Skip to content

Commit bc48c8f

Browse files
committed
iterate
1 parent 73038ec commit bc48c8f

File tree

6 files changed

+20
-9
lines changed

6 files changed

+20
-9
lines changed

src/Toolkit/src/Command/CreateKitCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
8686
], \JSON_PRETTY_PRINT | \JSON_UNESCAPED_SLASHES));
8787

8888
// Create a component
89-
$this->filesystem->dumpFile('Button/templates/components/Button.html.twig', <<<TWIG
89+
$this->filesystem->dumpFile(
90+
'Button/templates/components/Button.html.twig',
91+
<<<TWIG
9092
{% props type = 'button', variant = 'default' %}
9193
{%- set style = html_cva(
9294
base: 'inline-flex items-center',

src/Toolkit/src/Command/DebugKitCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ protected function configure(): void
4545
{
4646
$this
4747
->addArgument('kit-path', InputArgument::OPTIONAL, 'The path to the kit to debug', '.')
48-
->setHelp(<<<'EOF'
48+
->setHelp(
49+
<<<'EOF'
4950
To debug a Kit in the current directory:
5051
<info>php %command.full_name%</info>
5152

src/Toolkit/src/Command/InstallCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
118118
} elseif (1 === $availableKitsCount) {
119119
$kit = $availableKits[0];
120120
} else {
121-
$io->error(null === $recipeName
121+
$io->error(
122+
null === $recipeName
122123
? 'It seems that no local kits are available and it should not happens. Please open an issue on https://github.com/symfony/ux to report this.'
123124
: \sprintf("The recipe \"%s\" does not exist in any official kits.\n\nYou can try to run one of the following commands to interactively install recipes:\n%s\n\nOr you can try one of the community kits https://github.com/search?q=topic:ux-toolkit&type=repositories", $recipeName, implode("\n", array_map(fn (string $availableKitName) => \sprintf('$ bin/console %s --kit %s', $this->getName(), $availableKitName), $availableKitNames)))
124125
);

src/Toolkit/src/Kit/KitContextRunner.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ private function createComponentTemplateFinder(Kit $kit): ComponentTemplateFinde
8383
{
8484
static $instances = [];
8585

86-
return $instances[$kit->manifest->name] ?? new class($kit) implements ComponentTemplateFinderInterface {
86+
return $instances[$kit->manifest->name] ?? new class ($kit) implements ComponentTemplateFinderInterface {
8787
public function __construct(private readonly Kit $kit)
8888
{
8989
}

src/Toolkit/tests/Command/CreateKitCommandTest.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,9 @@ public function testShouldBeAbleToCreateAKit()
5353
->assertOutputContains('Your kit has been created successfully, happy coding!')
5454
;
5555

56-
$this->assertStringEqualsFile($this->tmpDir.'/manifest.json', <<<'JSON'
56+
$this->assertStringEqualsFile(
57+
$this->tmpDir.'/manifest.json',
58+
<<<'JSON'
5759
{
5860
"$schema": "../vendor/symfony/ux-toolkit/schema-kit-v1.json",
5961
"name": "MyKit",
@@ -63,7 +65,9 @@ public function testShouldBeAbleToCreateAKit()
6365
}
6466
JSON
6567
);
66-
$this->assertStringEqualsFile($this->tmpDir.'/Button/manifest.json', <<<'JSON'
68+
$this->assertStringEqualsFile(
69+
$this->tmpDir.'/Button/manifest.json',
70+
<<<'JSON'
6771
{
6872
"$schema": "../vendor/symfony/ux-toolkit/schema-kit-recipe-v1.json",
6973
"name": "Button",
@@ -88,7 +92,9 @@ public function testShouldBeAbleToCreateAKit()
8892
}
8993
JSON
9094
);
91-
$this->assertStringEqualsFile($this->tmpDir.'/Button/templates/components/Button.html.twig', <<<'TWIG'
95+
$this->assertStringEqualsFile(
96+
$this->tmpDir.'/Button/templates/components/Button.html.twig',
97+
<<<'TWIG'
9298
{% props type = 'button', variant = 'default' %}
9399
{%- set style = html_cva(
94100
base: 'inline-flex items-center',

src/Toolkit/tests/Functional/ComponentsRenderingTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ private function instantiateKit(string $kitName): Kit
7979

8080
private function assertCodeRenderedMatchesHtmlSnapshot(Kit $kit, Recipe $recipe, string $code, string $renderedCode): void
8181
{
82-
$info = \sprintf(<<<HTML
82+
$info = \sprintf(
83+
<<<HTML
8384
<!--
8485
- Kit: %s
8586
- Component: %s
@@ -94,7 +95,7 @@ private function assertCodeRenderedMatchesHtmlSnapshot(Kit $kit, Recipe $recipe,
9495
trim($code)
9596
);
9697

97-
$this->assertMatchesSnapshot($renderedCode, new class($info) extends HtmlDriver {
98+
$this->assertMatchesSnapshot($renderedCode, new class ($info) extends HtmlDriver {
9899
public function __construct(private string $info)
99100
{
100101
}

0 commit comments

Comments
 (0)