Skip to content

Commit

Permalink
Fixed custom root namespace #1641
Browse files Browse the repository at this point in the history
  • Loading branch information
marcriemer committed Jan 5, 2025
1 parent 0624f13 commit cd2415f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Maker/MakeTwigComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen

$factory = $generator->createClassNameDetails(
$name,
$this->namespace,
str_replace($generator->getRootNamespace() . "\\", "", $this->namespace),
);

$templatePath = str_replace('\\', '/', $factory->getRelativeNameWithoutSuffix());
Expand Down Expand Up @@ -111,7 +111,7 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma

try {
$value = Yaml::parse($this->fileManager->getFileContents($path));
$this->namespace = substr(array_key_first($value['twig_component']['defaults']), 4);
$this->namespace = array_key_first($value['twig_component']['defaults']);
} catch (\Throwable $throwable) {
throw new RuntimeCommandException(message: 'Unable to parse twig_component.yaml', previous: $throwable);
}
Expand Down

0 comments on commit cd2415f

Please sign in to comment.