Skip to content

Commit 4eb5f70

Browse files
committed
Use code-generator 0.4.0
1 parent ed8c227 commit 4eb5f70

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": "^8.4",
14-
"ruudk/code-generator": "^0.3.0",
14+
"ruudk/code-generator": "^0.4.0",
1515
"symfony/dependency-injection": "^7.3"
1616
},
1717
"require-dev": {

composer.lock

Lines changed: 15 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/SymfonyConfigCodeGenerator.php

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Generator;
99
use InvalidArgumentException;
1010
use Ruudk\CodeGenerator\CodeGenerator;
11+
use Ruudk\CodeGenerator\FunctionName;
1112
use Ruudk\CodeGenerator\Group;
1213
use Symfony\Component\DependencyInjection\Argument\ArgumentInterface;
1314
use Symfony\Component\DependencyInjection\Argument\IteratorArgument;
@@ -316,7 +317,7 @@ private function dumpReference(Reference $value) : Generator
316317
$id = $value instanceof TypedReference ? sprintf('%s $%s', $value, $value->getName()) : (string) $value;
317318

318319
$call = $this->generator->dumpFunctionCall(
319-
$this->generator->import('function Symfony\Component\DependencyInjection\Loader\Configurator\service'),
320+
$this->generator->import(new FunctionName('Symfony\Component\DependencyInjection\Loader\Configurator\service')),
320321
[
321322
$this->export($id),
322323
],
@@ -382,7 +383,7 @@ private function dumpTaggedIterator(TaggedIteratorArgument $value, string $funct
382383
}
383384

384385
yield from $this->generator->dumpFunctionCall(
385-
$this->generator->import(sprintf('function Symfony\Component\DependencyInjection\Loader\Configurator\%s', $function)),
386+
$this->generator->import(new FunctionName(sprintf('Symfony\Component\DependencyInjection\Loader\Configurator\%s', $function))),
386387
$args,
387388
);
388389
}
@@ -393,7 +394,7 @@ private function dumpTaggedIterator(TaggedIteratorArgument $value, string $funct
393394
private function dumpIterator(IteratorArgument $value) : Generator
394395
{
395396
yield from $this->generator->dumpFunctionCall(
396-
$this->generator->import('function Symfony\Component\DependencyInjection\Loader\Configurator\iterator'),
397+
$this->generator->import(new FunctionName('Symfony\Component\DependencyInjection\Loader\Configurator\iterator')),
397398
[
398399
$this->export($value->getValues()),
399400
],
@@ -406,7 +407,7 @@ private function dumpIterator(IteratorArgument $value) : Generator
406407
private function dumpEnv(string $name) : Generator
407408
{
408409
yield from $this->generator->dumpFunctionCall(
409-
$this->generator->import('function Symfony\Component\DependencyInjection\Loader\Configurator\env'),
410+
$this->generator->import(new FunctionName('Symfony\Component\DependencyInjection\Loader\Configurator\env')),
410411
$this->export($name),
411412
);
412413
}
@@ -417,7 +418,7 @@ private function dumpEnv(string $name) : Generator
417418
private function dumpParam(string $name) : Generator
418419
{
419420
yield from $this->generator->dumpFunctionCall(
420-
$this->generator->import('function Symfony\Component\DependencyInjection\Loader\Configurator\param'),
421+
$this->generator->import(new FunctionName('Symfony\Component\DependencyInjection\Loader\Configurator\param')),
421422
$this->export($name),
422423
);
423424
}
@@ -428,7 +429,7 @@ private function dumpParam(string $name) : Generator
428429
private function dumpServiceClosure(string $value) : Generator
429430
{
430431
yield from $this->generator->dumpFunctionCall(
431-
$this->generator->import('function Symfony\Component\DependencyInjection\Loader\Configurator\service_closure'),
432+
$this->generator->import(new FunctionName('Symfony\Component\DependencyInjection\Loader\Configurator\service_closure')),
432433
$this->export($value),
433434
);
434435
}
@@ -445,7 +446,7 @@ private function dumpServiceLocator(ServiceLocatorArgument $input) : Generator
445446
}
446447

447448
yield from $this->generator->dumpFunctionCall(
448-
$this->generator->import('function Symfony\Component\DependencyInjection\Loader\Configurator\service_locator'),
449+
$this->generator->import(new FunctionName('Symfony\Component\DependencyInjection\Loader\Configurator\service_locator')),
449450
$this->export($input->getValues()),
450451
);
451452
}
@@ -456,7 +457,7 @@ private function dumpServiceLocator(ServiceLocatorArgument $input) : Generator
456457
private function dumpInlineService(Definition $service) : Generator
457458
{
458459
$call = $this->generator->dumpFunctionCall(
459-
$this->generator->import('function Symfony\Component\DependencyInjection\Loader\Configurator\inline_service'),
460+
$this->generator->import(new FunctionName('Symfony\Component\DependencyInjection\Loader\Configurator\inline_service')),
460461
$this->export($service->getClass()),
461462
);
462463

@@ -510,7 +511,7 @@ private function dumpInlineService(Definition $service) : Generator
510511
private function dumpExpression(Expression $expression) : Generator
511512
{
512513
yield from $this->generator->dumpFunctionCall(
513-
$this->generator->import('function Symfony\Component\DependencyInjection\Loader\Configurator\expr'),
514+
$this->generator->import(new FunctionName('Symfony\Component\DependencyInjection\Loader\Configurator\expr')),
514515
$this->export((string) $expression),
515516
);
516517
}

0 commit comments

Comments
 (0)