Skip to content

Commit

Permalink
Fixed PHPStan issues
Browse files Browse the repository at this point in the history
  • Loading branch information
actions-user authored and sebprt committed Jan 11, 2024
1 parent 96216d4 commit c42f88c
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 24 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"php-etl/packaging": "*",
"php-etl/configurator-contracts": "0.8.*",
"php-etl/satellite-toolbox": "*",
"php-etl/gyroscops-api-client": "*",
"php-etl/gyroscops-api-client": "^0.3.0",
"php-etl/dockerfile": "*",
"composer/composer": "*",
"symfony/deprecation-contracts": "*",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function __invoke(Cloud\Command\Pipeline\AddPipelineStepProbeCommand $com
/** @var \stdClass $result */
$result = $this->client->addPipelineStepProbePipelineItem(
$command->pipeline->asString(),
(new Api\Model\PipelineAddPipelineStepProbCommandInput())
(new Api\Model\PipelineAddPipelineStepProbeCommandInput())
->setProbe(
(new Api\Model\Probe())
->setCode($command->probe->code)
Expand Down
22 changes: 3 additions & 19 deletions src/Cloud/Handler/Pipeline/DeclarePipelineCommandHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use Gyroscops\Api;
use Kiboko\Component\Satellite\Cloud;
use Kiboko\Component\Satellite\Cloud\DTO\Probe;
use Kiboko\Component\Satellite\Cloud\DTO\PSR4AutoloadConfig;
use Kiboko\Component\Satellite\Cloud\DTO\Step;

final readonly class DeclarePipelineCommandHandler
Expand All @@ -26,31 +25,16 @@ public function __invoke(Cloud\Command\Pipeline\DeclarePipelineCommand $command)
->setLabel($command->label)
->setCode($command->code)
->setSteps($command->steps->map(
fn (Step $step) => (new Api\Model\StepInput())
fn (Step $step) => (new Api\Model\Step())
->setCode((string) $step->code)
->setLabel($step->label)
->setConfiguration($step->config)
->setProbes($step->probes->map(
fn (Probe $probe) => (new Api\Model\Probe())->setCode($probe->code)->setLabel($probe->label))
)
))
->setAutoloads($command->autoload->map(
fn (PSR4AutoloadConfig $autoloadConfig) => (new Api\Model\AutoloadInput())
->setNamespace($autoloadConfig->namespace)
->setPaths($autoloadConfig->paths)
))
->setPackages($command->packages->transform())
->setAuths($command->auths->map(
fn (Cloud\DTO\Auth $auth) => (new Api\Model\AddPipelineComposerAuthCommandInput())
->setUrl($auth->url)
->setToken($auth->token)
))
->setRepositories($command->repositories->map(
fn (Cloud\DTO\Repository $repository) => (new Api\Model\AddPipelineComposerRepositoryCommandInput())
->setName($repository->name)
->setType($repository->type)
->setUrl($repository->url)
)),
// TODO : implements the composer declaration
// ->setComposer(),
);
} catch (Api\Exception\DeclarePipelinePipelineCollectionBadRequestException $exception) {
throw new Cloud\DeclarePipelineFailedException('Something went wrong while declaring the pipeline. Maybe your client is not up to date, you may want to update your Gyroscops client.', previous: $exception);
Expand Down
3 changes: 1 addition & 2 deletions src/Plugin/Batching/Service.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

namespace Kiboko\Component\Satellite\Plugin\Batching;

// FIXME: hidden dependency to php-etl/fast-map
use Kiboko\Component\FastMap\Compiler\Builder\PropertyPathBuilder;
use Kiboko\Component\Satellite\ExpressionLanguage as Satellite;
use Kiboko\Component\Satellite\Plugin\Batching\Builder\Fork;
use Kiboko\Component\Satellite\Plugin\Batching\Builder\Merge;
use Kiboko\Component\SatelliteToolbox\Builder\PropertyPathBuilder;
use Kiboko\Contract\Configurator;
use PhpParser\Node\Expr\Variable;
use Symfony\Component\Config\Definition\Exception as Symfony;
Expand Down

0 comments on commit c42f88c

Please sign in to comment.