8000 [minor] Fix "twig" case (-> "Twig") in make:twig-component & various … · symfony/maker-bundle@88221cf · GitHub
[go: up one dir, main page]

Skip to content

Commit 88221cf

Browse files
smnandrekbond
authored andcommitted
[minor] Fix "twig" case (-> "Twig") in make:twig-component & various places
1 parent a12d5e0 commit 88221cf

File tree

9 files changed

+15
-15
lines changed

9 files changed

+15
-15
lines changed

config/help/MakeAuth.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ by asking questions.
33

44
It can provide an empty authenticator, or a full login form authentication process.
55
In both cases it also updates your <info>security.yaml</info>.
6-
For the login form, it also generates a controller and the twig template.
6+
For the login form, it also generates a controller and the Twig template.
77

88
<info>php %command.full_name%</info>

config/help/MakeTwigExtension.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The <info>%command.name%</info> command generates a new twig extension with its runtime class.
1+
The <info>%command.name%</info> command generates a new Twig extension with its runtime class.
22

33
<info>php %command.full_name% AppExtension</info>
44

config/help/security/MakeFormLogin.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
The <info>%command.name%</info> command generates a controller and twig template
1+
The <info>%command.name%</info> command generates a controller and Twig template
22
to allow users to login using the form_login authenticator.
33

44
The controller name, and logout ability can be customized by answering the

src/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function generateClass(string $className, string $templateName, array $va
8585
* @param array $variables Array of variables to pass to the template
8686
* @param bool $isController Set to true if generating a Controller that needs
8787
* access to the TemplateComponentGenerator ("generator") in
88-
* the twig template. e.g. to create route attributes for a route method
88+
* the Twig template. e.g. to create route attributes for a route method
8989
*
9090
* @return string The path where the file will be created
9191
*

src/Maker/MakeController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ class: $controllerClassName,
100100
]
101101
);
102102

103-
// Again if the class name is absolute, lets not make assumptions about where the twig template
103+
// Again if the class name is absolute, lets not make assumptions about where the Twig template
104104
// should live. E.g. templates/custom/location/for/my_controller.html.twig instead of
105105
// templates/my/controller.html.twig. We do however remove the root_namespace prefix in either case
106106
// so we don't end up with templates/app/my/controller.html.twig
@@ -109,7 +109,7 @@ class: $controllerClassName,
109109
$this->controllerClassData->getClassName(relative: true, withoutSuffix: true)
110110
;
111111

112-
// Convert the twig template name into a file path where it will be generated.
112+
// Convert the Twig template name into a file path where it will be generated.
113113
$this->twigTemplatePath = \sprintf('%s%s', Str::asFilePath($templateName), $this->isInvokable ? '.html.twig' : '/index.html.twig');
114114

115115
$this->interactSetGenerateTests($input, $io);

src/Maker/MakeTwigComponent.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@ public static function getCommandName(): string
4343

4444
public static function getCommandDescription(): string
4545
{
46-
return 'Create a twig (or live) component';
46+
return 'Create a Twig (or Live) component';
4747
}
4848

4949
public function configureCommand(Command $command, InputConfiguration $inputConfig): void
5050
{
5151
$command
5252
->setDescription(self::getCommandDescription())
53-
->addArgument('name', InputArgument::OPTIONAL, 'The name of your twig component (ie <fg=yellow>Notification</>)')
54-
->addOption('live', null, InputOption::VALUE_NONE, 'Whether to create a live twig component (requires <fg=yellow>symfony/ux-live-component</>)')
53+
->addArgument('name', InputArgument::OPTIONAL, 'The name of your Twig component (ie <fg=yellow>Notification</>)')
54+
->addOption('live', null, InputOption::VALUE_NONE, 'Whether to create a Live component (requires <fg=yellow>symfony/ux-live-component</>)')
5555
;
5656
}
5757

@@ -66,7 +66,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
6666
$live = $input->getOption('live');
6767

6868
if ($live && !class_exists(AsLiveComponent::class)) {
69-
throw new \RuntimeException('You must install symfony/ux-live-component to create a live component (composer require symfony/ux-live-component)');
69+
throw new \RuntimeException('You must install symfony/ux-live-component to create a Live component (composer require symfony/ux-live-component)');
7070
}
7171

7272
$factory = $generator->createClassNameDetails(
@@ -100,7 +100,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen
100100
public function interact(InputInterface $input, ConsoleStyle $io, Command $command): void
101101
{
102102
if (!$input->getOption('live')) {
103-
$input->setOption('live', $io->confirm('Make this a live component?', false));
103+
$input->setOption('live', $io->confirm('Make this a Live component?', false));
104104
}
105105

106106
$path = 'config/packages/twig_component.yaml';
@@ -113,7 +113,7 @@ public function interact(InputInterface $input, ConsoleStyle $io, Command $comma
113113
$value = Yaml::parse($this->fileManager->getFileContents($path));
114114
$this->namespace = array_key_first($value['twig_component']['defaults']);
115115
} catch (\Throwable $throwable) {
116-
throw new RuntimeCommandException(message: 'Unable to parse twig_component.yaml', previous: $throwable);
116+
throw new RuntimeCommandException(message: 'Unable to parse config/packages/twig_component.yaml', previous: $throwable);
117117
}
118118
}
119119
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<div{{ attributes }}>
2-
<!-- component html -->
2+
<!-- component HTML -->
33
</div>

tests/fixtures/make-twig-component/tests/it_generates_live_component.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ public function testController()
1313
$this->assertStringContainsString('<div data-controller="live"', $output);
1414
$this->assertStringContainsString('data-live-name-value="', $output);
1515
$this->assertStringContainsString('data-live-url-value=', $output);
16-
$this->assertStringContainsString('<!-- component html -->', $output);
16+
$this->assertStringContainsString('<!-- component HTML -->', $output);
1717
}
1818
}

tests/fixtures/make-twig-component/tests/it_generates_twig_component.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ public function testController()
1010
{
1111
$output = self::getContainer()->get('twig')->createTemplate("<twig:{name} />")->render();
1212

13-
$this->assertSame("<div>\n <!-- component html -->\n</div>\n", $output);
13+
$this->assertSame("<div>\n <!-- component HTML -->\n</div>\n", $output);
1414
}
1515
}

0 commit comments

Comments
 (0)
0