8000 Custom root namespace make:twig-component by marcriemer · Pull Request #1642 · symfony/maker-bundle · GitHub
[go: up one dir, main page]

Skip to content

Custom root namespace make:twig-component #1642

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 {
584C $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
Loading
0