diff --git a/config/help/MakeAuth.txt b/config/help/MakeAuth.txt index 579be4e1b..79ac70bd8 100644 --- a/config/help/MakeAuth.txt +++ b/config/help/MakeAuth.txt @@ -3,6 +3,6 @@ by asking questions. It can provide an empty authenticator, or a full login form authentication process. In both cases it also updates your security.yaml. -For the login form, it also generates a controller and the twig template. +For the login form, it also generates a controller and the Twig template. php %command.full_name% diff --git a/config/help/MakeTwigExtension.txt b/config/help/MakeTwigExtension.txt index 605515251..c26cab92d 100644 --- a/config/help/MakeTwigExtension.txt +++ b/config/help/MakeTwigExtension.txt @@ -1,4 +1,4 @@ -The %command.name% command generates a new twig extension with its runtime class. +The %command.name% command generates a new Twig extension with its runtime class. php %command.full_name% AppExtension diff --git a/config/help/security/MakeFormLogin.txt b/config/help/security/MakeFormLogin.txt index 08ce3592a..2cbcfde26 100644 --- a/config/help/security/MakeFormLogin.txt +++ b/config/help/security/MakeFormLogin.txt @@ -1,4 +1,4 @@ -The %command.name% command generates a controller and twig template +The %command.name% command generates a controller and Twig template to allow users to login using the form_login authenticator. The controller name, and logout ability can be customized by answering the diff --git a/src/Generator.php b/src/Generator.php index fbadc1bca..221899d07 100644 --- a/src/Generator.php +++ b/src/Generator.php @@ -85,7 +85,7 @@ public function generateClass(string $className, string $templateName, array $va * @param array $variables Array of variables to pass to the template * @param bool $isController Set to true if generating a Controller that needs * access to the TemplateComponentGenerator ("generator") in - * the twig template. e.g. to create route attributes for a route method + * the Twig template. e.g. to create route attributes for a route method * * @return string The path where the file will be created * diff --git a/src/Maker/MakeController.php b/src/Maker/MakeController.php index 58e049eb5..59a87ba94 100644 --- a/src/Maker/MakeController.php +++ b/src/Maker/MakeController.php @@ -100,7 +100,7 @@ class: $controllerClassName, ] ); - // Again if the class name is absolute, lets not make assumptions about where the twig template + // Again if the class name is absolute, lets not make assumptions about where the Twig template // should live. E.g. templates/custom/location/for/my_controller.html.twig instead of // templates/my/controller.html.twig. We do however remove the root_namespace prefix in either case // so we don't end up with templates/app/my/controller.html.twig @@ -109,7 +109,7 @@ class: $controllerClassName, $this->controllerClassData->getClassName(relative: true, withoutSuffix: true) ; - // Convert the twig template name into a file path where it will be generated. + // Convert the Twig template name into a file path where it will be generated. $this->twigTemplatePath = \sprintf('%s%s', Str::asFilePath($templateName), $this->isInvokable ? '.html.twig' : '/index.html.twig'); $this->interactSetGenerateTests($input, $io); diff --git a/src/Maker/MakeTwigComponent.php b/src/Maker/MakeTwigComponent.php index 4bf55ee8d..d4d637a80 100644 --- a/src/Maker/MakeTwigComponent.php +++ b/src/Maker/MakeTwigComponent.php @@ -43,15 +43,15 @@ public static function getCommandName(): string public static function getCommandDescription(): string { - return 'Create a twig (or live) component'; + return 'Create a Twig (or Live) component'; } public function configureCommand(Command $command, InputConfiguration $inputConfig): void { $command ->setDescription(self::getCommandDescription()) - ->addArgument('name', InputArgument::OPTIONAL, 'The name of your twig component (ie Notification)') - ->addOption('live', null, InputOption::VALUE_NONE, 'Whether to create a live twig component (requires symfony/ux-live-component)') + ->addArgument('name', InputArgument::OPTIONAL, 'The name of your Twig component (ie Notification)') + ->addOption('live', null, InputOption::VALUE_NONE, 'Whether to create a Live component (requires symfony/ux-live-component)') ; } @@ -66,7 +66,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen $live = $input->getOption('live'); if ($live && !class_exists(AsLiveComponent::class)) { - throw new \RuntimeException('You must install symfony/ux-live-component to create a live component (composer require symfony/ux-live-component)'); + throw new \RuntimeException('You must install symfony/ux-live-component to create a Live component (composer require symfony/ux-live-component)'); } $factory = $generator->createClassNameDetails( @@ -100,20 +100,20 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen public function interact(InputInterface $input, ConsoleStyle $io, Command $command): void { if (!$input->getOption('live')) { - $input->setOption('live', $io->confirm('Make this a live component?', false)); + $input->setOption('live', $io->confirm('Make this a Live component?', false)); } $path = 'config/packages/twig_component.yaml'; if (!$this->fileManager->fileExists($path)) { - throw new RuntimeCommandException(message: 'Unable to find twig_component.yaml'); + throw new RuntimeCommandException(message: 'Unable to find config/packages/twig_component.yaml'); } try { $value = Yaml::parse($this->fileManager->getFileContents($path)); $this->namespace = substr(array_key_first($value['twig_component']['defaults']), 4); } catch (\Throwable $throwable) { - throw new RuntimeCommandException(message: 'Unable to parse twig_component.yaml', previous: $throwable); + throw new RuntimeCommandException(message: 'Unable to parse config/packages/twig_component.yaml', previous: $throwable); } } } diff --git a/templates/twig/component_template.tpl.php b/templates/twig/component_template.tpl.php index 75ebedd3f..03a6f6565 100644 --- a/templates/twig/component_template.tpl.php +++ b/templates/twig/component_template.tpl.php @@ -1,3 +1,3 @@ - + diff --git a/tests/fixtures/make-twig-component/tests/it_generates_live_component.php b/tests/fixtures/make-twig-component/tests/it_generates_live_component.php index 2067884e7..f45c9818e 100644 --- a/tests/fixtures/make-twig-component/tests/it_generates_live_component.php +++ b/tests/fixtures/make-twig-component/tests/it_generates_live_component.php @@ -13,6 +13,6 @@ public function testController() $this->assertStringContainsString('
assertStringContainsString('data-live-name-value="', $output); $this->assertStringContainsString('data-live-url-value=', $output); - $this->assertStringContainsString('', $output); + $this->assertStringContainsString('', $output); } } diff --git a/tests/fixtures/make-twig-component/tests/it_generates_twig_component.php b/tests/fixtures/make-twig-component/tests/it_generates_twig_component.php index 25a94f80f..5263f374a 100644 --- a/tests/fixtures/make-twig-component/tests/it_generates_twig_component.php +++ b/tests/fixtures/make-twig-component/tests/it_generates_twig_component.php @@ -10,6 +10,6 @@ public function testController() { $output = self::getContainer()->get('twig')->createTemplate("")->render(); - $this->assertSame("
\n \n
\n", $output); + $this->assertSame("
\n \n
\n", $output); } }