Skip to content

Commit

Permalink
Merge pull request #4 from symplify/tv-update
Browse files Browse the repository at this point in the history
Refresh
  • Loading branch information
TomasVotruba authored Dec 16, 2023
2 parents e4b9ba4 + 23fb193 commit 34205e9
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 46 deletions.
9 changes: 3 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"require": {
"php": ">=8.1",
"nette/utils": "^3.2",
"nikic/php-parser": "^4.16",
"symfony/yaml": "^6.2"
"nikic/php-parser": "^4.18",
"symfony/yaml": "^6.4"
},
"require-dev": {
"myclabs/php-enum": "^1.8",
Expand All @@ -18,10 +18,7 @@
"symplify/easy-coding-standard": "^12.0",
"symplify/easy-testing": "^11.1",
"symplify/phpstan-extensions": "^11.2",
"symplify/phpstan-rules": "^12.0",
"symplify/symplify-kernel": "^11.0",
"tomasvotruba/class-leak": "0.1.1.72",
"tomasvotruba/unused-public": "^0.2.0"
"tomasvotruba/class-leak": "^0.2"
},
"autoload": {
"psr-4": {
Expand Down
21 changes: 21 additions & 0 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
use PhpParser\NodeVisitor\ParentConnectingVisitor;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\Yaml\Parser;
use Symplify\PhpConfigPrinter\Contract\CaseConverterInterface;
use Symplify\PhpConfigPrinter\Contract\RoutingCaseConverterInterface;
use Symplify\PhpConfigPrinter\NodeFactory\ContainerConfiguratorReturnClosureFactory;
use Symplify\PhpConfigPrinter\NodeFactory\RoutingConfiguratorReturnClosureFactory;
use function Symfony\Component\DependencyInjection\Loader\Configurator\tagged_iterator;

return static function (ContainerConfigurator $containerConfigurator): void {
$services = $containerConfigurator->services();
Expand All @@ -18,6 +23,22 @@
$services->load('Symplify\PhpConfigPrinter\\', __DIR__ . '/../src')
->exclude([__DIR__ . '/../src/ValueObject']);

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

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

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

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

$services->set(NodeFinder::class);
$services->set(Parser::class);
$services->set(BuilderFactory::class);
Expand Down
31 changes: 0 additions & 31 deletions phpstan-baseline.neon

This file was deleted.

6 changes: 2 additions & 4 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
includes:
- phpstan-baseline.neon

parameters:
level: 8
level: 6

paths:
- src
Expand All @@ -14,3 +11,4 @@ parameters:
- '*/tests/**/data/*'

ignoreErrors:
- '#Parameter \#1 \$items of class PhpParser\\Node\\Expr\\Array_ constructor expects array<PhpParser\\Node\\Expr\\ArrayItem\|null>, array<PhpParser\\Node\\Arg> given#'
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class ContainerConfiguratorReturnClosureFactory
*/
public function __construct(
private readonly ConfiguratorClosureNodeFactory $configuratorClosureNodeFactory,
private readonly array $caseConverters,
private readonly iterable $caseConverters,
private readonly ContainerNestedNodesFactory $containerNestedNodesFactory
) {
}
Expand Down
5 changes: 1 addition & 4 deletions src/NodeFactory/RoutingConfiguratorReturnClosureFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,14 @@
use Symplify\PhpConfigPrinter\Contract\RoutingCaseConverterInterface;
use Symplify\PhpConfigPrinter\PhpParser\NodeFactory\ConfiguratorClosureNodeFactory;

/**
* @api
*/
final class RoutingConfiguratorReturnClosureFactory
{
/**
* @param RoutingCaseConverterInterface[] $routingCaseConverters
*/
public function __construct(
private readonly ConfiguratorClosureNodeFactory $containerConfiguratorClosureNodeFactory,
private readonly array $routingCaseConverters
private readonly iterable $routingCaseConverters
) {
}

Expand Down

0 comments on commit 34205e9

Please sign in to comment.