Skip to content

Commit

Permalink
Merge pull request #144 from php-etl/fix/code-issues
Browse files Browse the repository at this point in the history
Added the ability to add code to a job in a workflow
  • Loading branch information
gplanchat authored Jan 11, 2024
2 parents d8f8820 + 4713d2c commit 48c50cf
Show file tree
Hide file tree
Showing 201 changed files with 802 additions and 453 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
211 changes: 186 additions & 25 deletions composer.lock

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

5 changes: 5 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Rector\CodeQuality\Rector\Class_\InlineConstructorDefaultToPropertyRector;
use Rector\Config\RectorConfig;
use Rector\Php55\Rector\String_\StringClassNameToClassConstantRector;
use Rector\Set\ValueObject\LevelSetList;
use Rector\PHPUnit\Set\PHPUnitLevelSetList;
use Rector\Symfony\Set\SymfonyLevelSetList;
Expand All @@ -20,4 +21,8 @@
PHPUnitLevelSetList::UP_TO_PHPUNIT_100,
SymfonyLevelSetList::UP_TO_SYMFONY_60,
]);

$rectorConfig->skip([
StringClassNameToClassConstantRector::class
]);
};
6 changes: 4 additions & 2 deletions src/Action/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@

final readonly class Action
{
public function __construct(private ?string $plugin, private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage()) {}
public function __construct(private ?string $plugin, private ExpressionLanguage $interpreter = new Satellite\ExpressionLanguage())
{
}

public function __invoke(array $config, ActionBuilder $action, RepositoryInterface $repository): void

Check failure on line 22 in src/Action/Action.php

View workflow job for this annotation

GitHub Actions / phpstan6

Method Kiboko\Component\Satellite\Action\Action::__invoke() has parameter $config with no value type specified in iterable type array.

Check failure on line 22 in src/Action/Action.php

View workflow job for this annotation

GitHub Actions / phpstan8

Method Kiboko\Component\Satellite\Action\Action::__invoke() has parameter $config with no value type specified in iterable type array.

Check failure on line 22 in src/Action/Action.php

View workflow job for this annotation

GitHub Actions / phpstan7

Method Kiboko\Component\Satellite\Action\Action::__invoke() has parameter $config with no value type specified in iterable type array.

Check failure on line 22 in src/Action/Action.php

View workflow job for this annotation

GitHub Actions / phpstan8

Method Kiboko\Component\Satellite\Action\Action::__invoke() has parameter $config with no value type specified in iterable type array.

Check failure on line 22 in src/Action/Action.php

View workflow job for this annotation

GitHub Actions / phpstan7

Method Kiboko\Component\Satellite\Action\Action::__invoke() has parameter $config with no value type specified in iterable type array.

Check failure on line 22 in src/Action/Action.php

View workflow job for this annotation

GitHub Actions / phpstan6

Method Kiboko\Component\Satellite\Action\Action::__invoke() has parameter $config with no value type specified in iterable type array.
{
Expand Down Expand Up @@ -43,7 +45,7 @@ public function __invoke(array $config, ActionBuilder $action, RepositoryInterfa
$state = $compiled->getBuilder()->getNode();
} else {
$state = new Node\Expr\New_(
new Node\Name\FullyQualified(\Kiboko\Contract\Action\NullState::class),
new Node\Name\FullyQualified('Kiboko\\Contract\\Action\\NullState'),
);
}

Expand Down
3 changes: 2 additions & 1 deletion src/Action/ConfigurationApplier.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ public function __construct(
private readonly string $plugin,
private readonly FactoryInterface $service,
private readonly ExpressionLanguage $interpreter,
) {}
) {
}

public function withAction(): self
{
Expand Down
4 changes: 3 additions & 1 deletion src/Action/Custom/Builder/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ final class Action implements ActionBuilderInterface
private ?Node\Expr $logger = null;

Check failure on line 12 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan5

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$logger is never read, only written.

Check failure on line 12 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan6

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$logger is never read, only written.

Check failure on line 12 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan8

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$logger is never read, only written.

Check failure on line 12 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan7

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$logger is never read, only written.

Check failure on line 12 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan8

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$logger is never read, only written.

Check failure on line 12 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan7

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$logger is never read, only written.

Check failure on line 12 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan6

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$logger is never read, only written.

Check failure on line 12 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan5

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$logger is never read, only written.
private ?Node\Expr $state = null;

Check failure on line 13 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan5

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$state is never read, only written.

Check failure on line 13 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan6

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$state is never read, only written.

Check failure on line 13 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan8

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$state is never read, only written.

Check failure on line 13 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan7

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$state is never read, only written.

Check failure on line 13 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan8

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$state is never read, only written.

Check failure on line 13 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan7

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$state is never read, only written.

Check failure on line 13 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan6

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$state is never read, only written.

Check failure on line 13 in src/Action/Custom/Builder/Action.php

View workflow job for this annotation

GitHub Actions / phpstan5

Property Kiboko\Component\Satellite\Action\Custom\Builder\Action::$state is never read, only written.

public function __construct(private readonly Node\Expr $service, private readonly string $containerNamespace) {}
public function __construct(private readonly Node\Expr $service, private readonly string $containerNamespace)
{
}

public function withLogger(Node\Expr $logger): self
{
Expand Down
4 changes: 2 additions & 2 deletions src/Action/Custom/Factory/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function normalize(array $config): array
{
try {
return $this->processor->processConfiguration($this->configuration, $config);
} catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException $exception) {
} catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException $exception) {
throw new Configurator\InvalidConfigurationException($exception->getMessage(), 0, $exception);
}
}
Expand All @@ -55,7 +55,7 @@ public function validate(array $config): bool
$this->processor->processConfiguration($this->configuration, $config);

return true;
} catch (Symfony\InvalidTypeException|Symfony\InvalidConfigurationException) {
} catch (Symfony\InvalidConfigurationException|Symfony\InvalidTypeException) {
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Action/Custom/Factory/Repository/RepositoryTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ trait RepositoryTrait
/** @var string[] */
private array $packages;

public function addFiles(Packaging\FileInterface|Packaging\DirectoryInterface ...$files): Configurator\RepositoryInterface
public function addFiles(Packaging\DirectoryInterface|Packaging\FileInterface ...$files): Configurator\RepositoryInterface
{
array_push($this->files, ...$files);

Expand Down
Loading

0 comments on commit 48c50cf

Please sign in to comment.