Skip to content

Commit

Permalink
Merge pull request #5 from symplify/tv-more-autowire
Browse files Browse the repository at this point in the history
autowire optoin factory
  • Loading branch information
TomasVotruba authored Dec 16, 2023
2 parents 34205e9 + 82f195d commit c74f121
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
12 changes: 0 additions & 12 deletions .github/workflows/code_analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,10 @@ jobs:
name: 'Rector'
run: composer rector --ansi

-
name: 'Coding Standard'
run: composer fix-cs --ansi

-
name: 'Tests'
run: vendor/bin/phpunit

-
name: 'PHP Linter'
run: vendor/bin/parallel-lint src tests

-
name: 'Check Commented Code'
run: vendor/bin/easy-ci check-commented-code src tests --ansi

-
name: 'Check Active Classes'
run: vendor/bin/class-leak check src --ansi --skip-type="\Symplify\PhpConfigPrinter\Contract\Converter\ServiceOptionsKeyYamlToPhpFactoryInterface" --skip-type="\Symplify\PhpConfigPrinter\Contract\RoutingCaseConverterInterface" --skip-type="\Symplify\PhpConfigPrinter\Contract\CaseConverterInterface"
Expand Down
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
},
"require-dev": {
"myclabs/php-enum": "^1.8",
"php-parallel-lint/php-parallel-lint": "^1.3",
"phpstan/extension-installer": "^1.2",
"phpunit/phpunit": "^10.0",
"rector/rector": "^0.17",
"symplify/easy-ci": "^11.0",
"phpstan/extension-installer": "^1.3",
"phpunit/phpunit": "^10.5",
"rector/rector": "^0.18.12",
"symplify/easy-coding-standard": "^12.0",
"symplify/easy-testing": "^11.1",
"symplify/phpstan-extensions": "^11.2",
Expand Down
10 changes: 10 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\Yaml\Parser;
use Symplify\PhpConfigPrinter\Contract\CaseConverterInterface;
use Symplify\PhpConfigPrinter\Contract\Converter\ServiceOptionsKeyYamlToPhpFactoryInterface;
use Symplify\PhpConfigPrinter\Contract\RoutingCaseConverterInterface;
use Symplify\PhpConfigPrinter\NodeFactory\ContainerConfiguratorReturnClosureFactory;
use Symplify\PhpConfigPrinter\NodeFactory\RoutingConfiguratorReturnClosureFactory;
Expand All @@ -33,12 +34,21 @@
__DIR__ . '/../src/RoutingCaseConverter'
)->tag(RoutingCaseConverterInterface::class);


$services->load(
'Symplify\\PhpConfigPrinter\\ServiceOptionConverter\\',
__DIR__ . '/../src/ServiceOptionConverter'
)->tag(ServiceOptionsKeyYamlToPhpFactoryInterface::class);

$services->set(ContainerConfiguratorReturnClosureFactory::class)
->arg('$caseConverters', tagged_iterator(CaseConverterInterface::class));

$services->set(RoutingConfiguratorReturnClosureFactory::class)
->arg('$routingCaseConverters', tagged_iterator(RoutingCaseConverterInterface::class));

$services->set(\Symplify\PhpConfigPrinter\NodeFactory\Service\ServiceOptionNodeFactory::class)
->arg('$serviceOptionKeyYamlToPhpFactories', tagged_iterator(ServiceOptionsKeyYamlToPhpFactoryInterface::class));

$services->set(NodeFinder::class);
$services->set(Parser::class);
$services->set(BuilderFactory::class);
Expand Down
3 changes: 3 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@
// keep the container class string, to avoid prefixing
__DIR__ . '/src/NodeFactory/ContainerConfiguratorReturnClosureFactory.php',
],

// preference
\Rector\CodingStyle\Rector\FuncCall\ArraySpreadInsteadOfArrayMergeRector::class,
]);
};
2 changes: 1 addition & 1 deletion src/NodeFactory/Service/ServiceOptionNodeFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class ServiceOptionNodeFactory
*/
public function __construct(
private readonly ServiceOptionAnalyzer $serviceOptionAnalyzer,
private readonly array $serviceOptionKeyYamlToPhpFactories
private readonly iterable $serviceOptionKeyYamlToPhpFactories
) {
}

Expand Down

0 comments on commit c74f121

Please sign in to comment.