diff --git a/src/Autocomplete/tests/Functional/AutocompleteFormRenderingTest.php b/src/Autocomplete/tests/Functional/AutocompleteFormRenderingTest.php index 92c7695c98c..126ac7280b4 100644 --- a/src/Autocomplete/tests/Functional/AutocompleteFormRenderingTest.php +++ b/src/Autocomplete/tests/Functional/AutocompleteFormRenderingTest.php @@ -157,7 +157,7 @@ public function testItUsesPassedExtraOptions() ; } - public function testItReturnsErrorWhenSendingMalformedExtraOptions(): void + public function testItReturnsErrorWhenSendingMalformedExtraOptions() { $extraOptionsWithoutChecksum = $this->encodeData(['foo' => 'bar']); $extraOptionsWithInvalidChecksum = $this->encodeData(['foo' => 'bar', '@checksum' => 'invalid']); diff --git a/src/Autocomplete/tests/Functional/CustomAutocompleterTest.php b/src/Autocomplete/tests/Functional/CustomAutocompleterTest.php index af7afe7115b..dcce575cc1b 100644 --- a/src/Autocomplete/tests/Functional/CustomAutocompleterTest.php +++ b/src/Autocomplete/tests/Functional/CustomAutocompleterTest.php @@ -25,7 +25,7 @@ class CustomAutocompleterTest extends KernelTestCase use HasBrowser; use ResetDatabase; - public function testItReturnsBasicResults(): void + public function testItReturnsBasicResults() { $product = ProductFactory::createOne(['name' => 'foo']); ProductFactory::createOne(['name' => 'bar']); @@ -43,7 +43,7 @@ public function testItReturnsBasicResults(): void ; } - public function testItUsesTheCustomQuery(): void + public function testItUsesTheCustomQuery() { ProductFactory::createOne(['name' => 'foo']); ProductFactory::new(['name' => 'foo and bar']) @@ -59,7 +59,7 @@ public function testItUsesTheCustomQuery(): void ; } - public function testItOnlySearchedOnSearchableFields(): void + public function testItOnlySearchedOnSearchableFields() { ProductFactory::createOne(['name' => 'foo', 'price' => 50]); ProductFactory::createOne(['name' => 'bar', 'description' => 'foo 50', 'price' => 55]); @@ -77,7 +77,7 @@ public function testItOnlySearchedOnSearchableFields(): void ; } - public function testItEnforcesSecurity(): void + public function testItEnforcesSecurity() { ProductFactory::createMany(3); @@ -97,7 +97,7 @@ public function testItEnforcesSecurity(): void ; } - public function testItReturns404OnBadAlias(): void + public function testItReturns404OnBadAlias() { $this->browser() ->get('/test/autocomplete/not_real') @@ -105,7 +105,7 @@ public function testItReturns404OnBadAlias(): void ; } - public function testItWorksWithCustomRoute(): void + public function testItWorksWithCustomRoute() { $product = ProductFactory::createOne(['name' => 'foo']); ProductFactory::createOne(['name' => 'bar']); diff --git a/src/Autocomplete/tests/Functional/FieldAutocompleterTest.php b/src/Autocomplete/tests/Functional/FieldAutocompleterTest.php index 305e75c20ae..d556f82f6e2 100644 --- a/src/Autocomplete/tests/Functional/FieldAutocompleterTest.php +++ b/src/Autocomplete/tests/Functional/FieldAutocompleterTest.php @@ -27,7 +27,7 @@ class FieldAutocompleterTest extends KernelTestCase use HasBrowser; use ResetDatabase; - public function testItReturnsBasicResults(): void + public function testItReturnsBasicResults() { $category = CategoryFactory::createOne(['name' => 'foo and baz']); CategoryFactory::createOne(['name' => 'foo and bar']); @@ -44,7 +44,7 @@ public function testItReturnsBasicResults(): void ; } - public function testItUsesTheCustomQuery(): void + public function testItUsesTheCustomQuery() { CategoryFactory::createOne(['name' => 'foo and bar']); CategoryFactory::createOne(['name' => 'baz and bar']); @@ -59,7 +59,7 @@ public function testItUsesTheCustomQuery(): void ; } - public function testItEnforcesSecurity(): void + public function testItEnforcesSecurity() { CategoryFactory::createMany(3, [ 'name' => 'foo so that it matches custom query', @@ -81,7 +81,7 @@ public function testItEnforcesSecurity(): void ; } - public function testItCheckMaxResultsOption(): void + public function testItCheckMaxResultsOption() { CategoryFactory::createMany(30, ['name' => 'foo']); @@ -93,7 +93,7 @@ public function testItCheckMaxResultsOption(): void ; } - public function testItWorksWithoutAChoiceLabel(): void + public function testItWorksWithoutAChoiceLabel() { CategoryFactory::createMany(5, ['name' => 'foo']); @@ -105,7 +105,7 @@ public function testItWorksWithoutAChoiceLabel(): void ; } - public function testItUsesTheCustomStringValue(): void + public function testItUsesTheCustomStringValue() { $category = CategoryFactory::createOne(['code' => 'foo']); @@ -118,7 +118,7 @@ public function testItUsesTheCustomStringValue(): void ; } - public function testItUsesTheCustomCallbackValue(): void + public function testItUsesTheCustomCallbackValue() { $category = CategoryFactory::createOne(['code' => 'foo']); @@ -131,7 +131,7 @@ public function testItUsesTheCustomCallbackValue(): void ; } - public function testItSearchesByTags(): void + public function testItSearchesByTags() { $productTag = ProductTagFactory::createOne(['name' => 'technology']); $categoryTag = CategoryTagFactory::createOne(['name' => 'home appliances']); diff --git a/src/Autocomplete/tests/Integration/AutocompleteResultsExecutorTest.php b/src/Autocomplete/tests/Integration/AutocompleteResultsExecutorTest.php index b804afd1123..58cb0ea65d0 100644 --- a/src/Autocomplete/tests/Integration/AutocompleteResultsExecutorTest.php +++ b/src/Autocomplete/tests/Integration/AutocompleteResultsExecutorTest.php @@ -26,7 +26,7 @@ class AutocompleteResultsExecutorTest extends KernelTestCase use Factories; use ResetDatabase; - public function testItReturnsExtraAttributes(): void + public function testItReturnsExtraAttributes() { $kernel = new Kernel('test', true); $kernel->disableForms(); diff --git a/src/Autocomplete/tests/Integration/Doctrine/EntityMetadataFactoryTest.php b/src/Autocomplete/tests/Integration/Doctrine/EntityMetadataFactoryTest.php index c9a912f23eb..cafe7462227 100644 --- a/src/Autocomplete/tests/Integration/Doctrine/EntityMetadataFactoryTest.php +++ b/src/Autocomplete/tests/Integration/Doctrine/EntityMetadataFactoryTest.php @@ -18,7 +18,7 @@ class EntityMetadataFactoryTest extends KernelTestCase { - public function testItSuccessfullyCreatesMetadata(): void + public function testItSuccessfullyCreatesMetadata() { /** @var EntityMetadataFactory $factory */ $factory = self::getContainer()->get('ux.autocomplete.entity_metadata_factory'); diff --git a/src/Autocomplete/tests/Integration/Doctrine/EntityMetadataTest.php b/src/Autocomplete/tests/Integration/Doctrine/EntityMetadataTest.php index 0d6a73df4ac..340aa0d9497 100644 --- a/src/Autocomplete/tests/Integration/Doctrine/EntityMetadataTest.php +++ b/src/Autocomplete/tests/Integration/Doctrine/EntityMetadataTest.php @@ -25,7 +25,7 @@ class EntityMetadataTest extends KernelTestCase use Factories; use ResetDatabase; - public function testGetAllPropertyNames(): void + public function testGetAllPropertyNames() { $this->assertSame( ['id', 'name', 'description', 'price', 'isEnabled'], @@ -33,20 +33,20 @@ public function testGetAllPropertyNames(): void ); } - public function testIsAssociation(): void + public function testIsAssociation() { $metadata = $this->getMetadata(); $this->assertFalse($metadata->isAssociation('name')); $this->assertTrue($metadata->isAssociation('category')); } - public function testGetIdValue(): void + public function testGetIdValue() { $product = ProductFactory::createOne(); $this->assertEquals($product->getId(), $this->getMetadata()->getIdValue($product)); } - public function testGetPropertyDataType(): void + public function testGetPropertyDataType() { $metadata = $this->getMetadata(); $this->assertSame(Types::STRING, $metadata->getPropertyDataType('name')); @@ -55,7 +55,7 @@ public function testGetPropertyDataType(): void $this->assertEquals(2, $metadata->getPropertyDataType('category')); } - public function testGetFieldMetadata(): void + public function testGetFieldMetadata() { $metadata = $this->getMetadata(); $nameMetadata = $metadata->getFieldMetadata('name'); @@ -75,7 +75,7 @@ public function testGetFieldMetadata(): void } } - public function testGetAssociationMetadata(): void + public function testGetAssociationMetadata() { $metadata = $this->getMetadata(); $expected = [ @@ -132,7 +132,7 @@ public function testGetAssociationMetadata(): void } } - public function testIsEmbeddedClassProperty(): void + public function testIsEmbeddedClassProperty() { // TODO $this->markTestIncomplete(); diff --git a/src/Autocomplete/tests/Integration/Doctrine/EntitySearchUtilTest.php b/src/Autocomplete/tests/Integration/Doctrine/EntitySearchUtilTest.php index 90dd33b354e..d06b032bfe2 100644 --- a/src/Autocomplete/tests/Integration/Doctrine/EntitySearchUtilTest.php +++ b/src/Autocomplete/tests/Integration/Doctrine/EntitySearchUtilTest.php @@ -26,7 +26,7 @@ class EntitySearchUtilTest extends KernelTestCase use Factories; use ResetDatabase; - public function testItCreatesBasicStringSearchQuery(): void + public function testItCreatesBasicStringSearchQuery() { $prod1 = ProductFactory::createOne(['name' => 'bar prod1']); $prod2 = ProductFactory::createOne(['name' => 'foo prod2']); @@ -37,7 +37,7 @@ public function testItCreatesBasicStringSearchQuery(): void $this->assertSame([$prod1, $prod2, $prod4], $results); } - public function testItSearchesOnCorrectFields(): void + public function testItSearchesOnCorrectFields() { $prod1 = ProductFactory::createOne(['name' => 'bar prod1']); ProductFactory::createOne(['description' => 'foo prod2']); @@ -46,7 +46,7 @@ public function testItSearchesOnCorrectFields(): void $this->assertSame([$prod1], $results); } - public function testItCanSearchOnRelationFields(): void + public function testItCanSearchOnRelationFields() { $category1 = CategoryFactory::createOne(['name' => 'foods']); $category2 = CategoryFactory::createOne(['name' => 'toys']); diff --git a/src/Autocomplete/tests/Integration/WiringTest.php b/src/Autocomplete/tests/Integration/WiringTest.php index fb7813e3a58..7d97ebfd033 100644 --- a/src/Autocomplete/tests/Integration/WiringTest.php +++ b/src/Autocomplete/tests/Integration/WiringTest.php @@ -35,7 +35,7 @@ protected static function createKernel(array $options = []): KernelInterface return $kernel; } - public function testWiringWithoutForm(): void + public function testWiringWithoutForm() { $kernel = new Kernel('test', true); $kernel->disableForms(); @@ -51,7 +51,7 @@ public function testWiringWithoutForm(): void $this->assertFalse($data->hasNextPage); } - public function testWiringWithManyResults(): void + public function testWiringWithManyResults() { $kernel = new Kernel('test', true); $kernel->disableForms(); @@ -76,7 +76,7 @@ public function testWiringWithManyResults(): void $this->assertFalse($data->hasNextPage); } - public function testWiringWithoutFormAndGroupByOption(): void + public function testWiringWithoutFormAndGroupByOption() { $kernel = new Kernel('test', true); $kernel->disableForms(); diff --git a/src/Autocomplete/tests/Unit/Calculator/ChecksumCalculatorTest.php b/src/Autocomplete/tests/Unit/Calculator/ChecksumCalculatorTest.php index 7c416c16120..3946023cc02 100644 --- a/src/Autocomplete/tests/Unit/Calculator/ChecksumCalculatorTest.php +++ b/src/Autocomplete/tests/Unit/Calculator/ChecksumCalculatorTest.php @@ -16,7 +16,7 @@ final class ChecksumCalculatorTest extends TestCase { - public function testCalculateChecksumForArray(): void + public function testCalculateChecksumForArray() { $this->assertSame( 'tZ34YQKgpttqybzPws0YJCOHV1QtMjQeuyy+rszdhXU=', @@ -24,7 +24,7 @@ public function testCalculateChecksumForArray(): void ); } - public function testCalculateTheSameChecksumForTheSameArrayButInDifferentOrder(): void + public function testCalculateTheSameChecksumForTheSameArrayButInDifferentOrder() { $this->assertSame( $this->createTestSubject()->calculateForArray(['test' => 'test', 'test2' => 'test2']), diff --git a/src/Autocomplete/tests/Unit/Form/AsEntityAutocompleteFieldTest.php b/src/Autocomplete/tests/Unit/Form/AsEntityAutocompleteFieldTest.php index c7fabeafd7d..bad45d32f27 100644 --- a/src/Autocomplete/tests/Unit/Form/AsEntityAutocompleteFieldTest.php +++ b/src/Autocomplete/tests/Unit/Form/AsEntityAutocompleteFieldTest.php @@ -20,7 +20,7 @@ class AsEntityAutocompleteFieldTest extends TestCase /** * @dataProvider provideClassNames */ - public function testShortName(string $shortName, string $className): void + public function testShortName(string $shortName, string $className) { $this->assertEquals($shortName, AsEntityAutocompleteField::shortName($className)); } diff --git a/src/Icons/tests/Integration/Command/ImportIconCommandTest.php b/src/Icons/tests/Integration/Command/ImportIconCommandTest.php index 0935fb4dd9a..1e007364724 100644 --- a/src/Icons/tests/Integration/Command/ImportIconCommandTest.php +++ b/src/Icons/tests/Integration/Command/ImportIconCommandTest.php @@ -39,7 +39,7 @@ public static function cleanup(): void } } - public function testCanImportIcon(): void + public function testCanImportIcon() { $this->assertFileDoesNotExist($expectedFile = self::ICON_DIR.'/uiw/dashboard.svg'); @@ -52,7 +52,7 @@ public function testCanImportIcon(): void $this->assertFileExists($expectedFile); } - public function testImportInvalidIconName(): void + public function testImportInvalidIconName() { $this->executeConsoleCommand('ux:icons:import something') ->assertStatusCode(1) @@ -60,7 +60,7 @@ public function testImportInvalidIconName(): void ; } - public function testImportNonExistentIconSet(): void + public function testImportNonExistentIconSet() { $this->executeConsoleCommand('ux:icons:import something:invalid') ->assertStatusCode(1) @@ -68,7 +68,7 @@ public function testImportNonExistentIconSet(): void ; } - public function testImportNonExistentIcon(): void + public function testImportNonExistentIcon() { $this->executeConsoleCommand('ux:icons:import lucide:not-existing-icon') ->assertStatusCode(1) @@ -79,7 +79,7 @@ public function testImportNonExistentIcon(): void $this->assertFileDoesNotExist(self::ICON_DIR.'/not-existing-icon.svg'); } - public function testImportNonExistentIconWithExistentOne(): void + public function testImportNonExistentIconWithExistentOne() { $this->executeConsoleCommand('ux:icons:import lucide:circle lucide:not-existing-icon') ->assertStatusCode(0) diff --git a/src/Icons/tests/Integration/Command/LockIconsCommandTest.php b/src/Icons/tests/Integration/Command/LockIconsCommandTest.php index abcfc45fdf6..b7e8a005052 100644 --- a/src/Icons/tests/Integration/Command/LockIconsCommandTest.php +++ b/src/Icons/tests/Integration/Command/LockIconsCommandTest.php @@ -43,7 +43,7 @@ public static function cleanup(): void } } - public function testImportFoundIcons(): void + public function testImportFoundIcons() { foreach (self::ICONS as $icon) { $this->assertFileDoesNotExist($icon); @@ -69,7 +69,7 @@ public function testImportFoundIcons(): void ; } - public function testForceImportFoundIcons(): void + public function testForceImportFoundIcons() { $this->executeConsoleCommand('ux:icons:lock') ->assertSuccessful() diff --git a/src/Icons/tests/Integration/Command/SearchIconCommandTest.php b/src/Icons/tests/Integration/Command/SearchIconCommandTest.php index 1e2de70476b..b6b17cf9be2 100644 --- a/src/Icons/tests/Integration/Command/SearchIconCommandTest.php +++ b/src/Icons/tests/Integration/Command/SearchIconCommandTest.php @@ -21,7 +21,7 @@ final class SearchIconCommandTest extends KernelTestCase { use InteractsWithConsole; - public function testSearchWithPrefix(): void + public function testSearchWithPrefix() { $this->consoleCommand('ux:icons:search iconoir') ->execute() @@ -39,7 +39,7 @@ public function testSearchWithPrefix(): void ->assertStatusCode(0); } - public function testSearchWithPrefixMatchingMultipleSet(): void + public function testSearchWithPrefixMatchingMultipleSet() { $this->consoleCommand('ux:icons:search box') ->execute() @@ -53,7 +53,7 @@ public function testSearchWithPrefixMatchingMultipleSet(): void ->assertStatusCode(0); } - public function testSearchWithPrefixName(): void + public function testSearchWithPrefixName() { $this->consoleCommand('ux:icons:search lucide arrow') ->execute() diff --git a/src/Icons/tests/Integration/Command/WarmCacheCommandTest.php b/src/Icons/tests/Integration/Command/WarmCacheCommandTest.php index 668bcbcdb9c..ae7285e66b5 100644 --- a/src/Icons/tests/Integration/Command/WarmCacheCommandTest.php +++ b/src/Icons/tests/Integration/Command/WarmCacheCommandTest.php @@ -21,7 +21,7 @@ final class WarmCacheCommandTest extends KernelTestCase { use InteractsWithConsole; - public function testCanWarmCache(): void + public function testCanWarmCache() { $this->executeConsoleCommand('ux:icons:warm-cache -v') ->assertSuccessful() diff --git a/src/Icons/tests/Integration/IconRendererTest.php b/src/Icons/tests/Integration/IconRendererTest.php index 9a6d8c5f4d6..825cbc093b7 100644 --- a/src/Icons/tests/Integration/IconRendererTest.php +++ b/src/Icons/tests/Integration/IconRendererTest.php @@ -20,18 +20,18 @@ */ final class IconRendererTest extends KernelTestCase { - public function testIconRenderService(): void + public function testIconRenderService() { $this->assertTrue(self::getContainer()->has(IconRendererInterface::class)); } - public function testIconRendererAlias(): void + public function testIconRendererAlias() { $renderer = self::getContainer()->get(IconRendererInterface::class); $this->assertInstanceOf(IconRenderer::class, $renderer); } - public function testIconRendererIsPrivate(): void + public function testIconRendererIsPrivate() { $this->assertFalse(self::getContainer()->has(IconRenderer::class)); } diff --git a/src/Icons/tests/Integration/RenderIconsInTwigTest.php b/src/Icons/tests/Integration/RenderIconsInTwigTest.php index feba3097dbe..c8555c3d647 100644 --- a/src/Icons/tests/Integration/RenderIconsInTwigTest.php +++ b/src/Icons/tests/Integration/RenderIconsInTwigTest.php @@ -19,7 +19,7 @@ */ final class RenderIconsInTwigTest extends KernelTestCase { - public function testRenderIcons(): void + public function testRenderIcons() { $output = self::getContainer()->get(Environment::class)->render('template1.html.twig'); @@ -41,7 +41,7 @@ public function testRenderIcons(): void ); } - public function testRenderAliasIcons(): void + public function testRenderAliasIcons() { $templateIcon = ''; $outputIcon = self::getContainer()->get(Environment::class)->createTemplate($templateIcon)->render(); diff --git a/src/Icons/tests/Unit/IconRendererTest.php b/src/Icons/tests/Unit/IconRendererTest.php index e6834b603dc..03193363175 100644 --- a/src/Icons/tests/Unit/IconRendererTest.php +++ b/src/Icons/tests/Unit/IconRendererTest.php @@ -23,7 +23,7 @@ */ class IconRendererTest extends TestCase { - public function testRenderIcon(): void + public function testRenderIcon() { $registry = $this->createRegistry([ 'user' => 'assertStringContainsString('createRegistry([]); $iconRenderer = new IconRenderer($registry); @@ -46,7 +46,7 @@ public function testRenderIconThrowsExceptionWhenIconNotFound(): void $iconRenderer->renderIcon('foo'); } - public function testRenderIconThrowsExceptionWhenAttributesAreInvalid(): void + public function testRenderIconThrowsExceptionWhenAttributesAreInvalid() { $registry = $this->createRegistry(['foo' => '']); $iconRenderer = new IconRenderer($registry); @@ -56,7 +56,7 @@ public function testRenderIconThrowsExceptionWhenAttributesAreInvalid(): void $iconRenderer->renderIcon('foo', [1, 2, null]); } - public function testRenderIconWithAttributes(): void + public function testRenderIconWithAttributes() { $registry = $this->createRegistry([ 'foo' => '', @@ -69,7 +69,7 @@ public function testRenderIconWithAttributes(): void $this->assertSame('', $svg); } - public function testRenderIconWithDefaultAttributes(): void + public function testRenderIconWithDefaultAttributes() { $registry = $this->createRegistry([ 'foo' => '', @@ -281,7 +281,7 @@ public static function provideRenderIconWithAttributeCascadeCases(): iterable * @param string|array{string, array} $icon * @param array $attributes */ - public function testRenderIconWithAutoAriaHidden(string|array $icon, array $attributes, string $expectedSvg): void + public function testRenderIconWithAutoAriaHidden(string|array $icon, array $attributes, string $expectedSvg) { $icon = (array) $icon; $registry = $this->createRegistry([ @@ -345,7 +345,7 @@ public static function provideAriaHiddenCases(): iterable ]; } - public function testRenderIconWithAliases(): void + public function testRenderIconWithAliases() { $registry = $this->createRegistry([ 'foo' => '', @@ -369,7 +369,7 @@ public function testRenderIconWithAliases(): void * * @dataProvider provideRenderIconWithIconSetAttributes */ - public function testRenderIconWithIconSetAttributes(string $name, array $attributes, string $expectedSvg): void + public function testRenderIconWithIconSetAttributes(string $name, array $attributes, string $expectedSvg) { $registry = $this->createRegistry([ 'a' => '', diff --git a/src/Icons/tests/Unit/IconTest.php b/src/Icons/tests/Unit/IconTest.php index 4cf1346c443..3c4c91dba7d 100644 --- a/src/Icons/tests/Unit/IconTest.php +++ b/src/Icons/tests/Unit/IconTest.php @@ -64,7 +64,7 @@ public function testNameToIdThrowsException(string $name) /** * @dataProvider provideValidIds */ - public function testIsValidIdWithValidIds(string $id): void + public function testIsValidIdWithValidIds(string $id) { $this->assertTrue(Icon::isValidId($id)); } @@ -72,7 +72,7 @@ public function testIsValidIdWithValidIds(string $id): void /** * @dataProvider provideInvalidIds */ - public function testIsValidIdWithInvalidIds(string $id): void + public function testIsValidIdWithInvalidIds(string $id) { $this->assertFalse(Icon::isValidId($id)); } @@ -80,7 +80,7 @@ public function testIsValidIdWithInvalidIds(string $id): void /** * @dataProvider provideValidNames */ - public function testIsValidNameWithValidNames(string $name): void + public function testIsValidNameWithValidNames(string $name) { $this->assertTrue(Icon::isValidName($name)); } @@ -88,7 +88,7 @@ public function testIsValidNameWithValidNames(string $name): void /** * @dataProvider provideInvalidNames */ - public function testIsValidNameWithInvalidNames(string $name): void + public function testIsValidNameWithInvalidNames(string $name) { $this->assertFalse(Icon::isValidName($name)); } @@ -108,7 +108,7 @@ public function testInvalidIdToName(string $id) /** * @dataProvider provideRenderAttributesTestCases */ - public function testRenderAttributes(array $attributes, string $expected): void + public function testRenderAttributes(array $attributes, string $expected) { $icon = new Icon('', $attributes); $this->assertStringStartsWith($expected, $icon->toHtml()); @@ -117,7 +117,7 @@ public function testRenderAttributes(array $attributes, string $expected): void /** * @dataProvider provideWithAttributesTestCases */ - public function testWithAttributes(array $attributes, array $withAttributes, array $expected): void + public function testWithAttributes(array $attributes, array $withAttributes, array $expected) { $icon = new Icon('foo', $attributes); $icon = $icon->withAttributes($withAttributes); @@ -284,7 +284,7 @@ public static function provideWithAttributesTestCases(): iterable ]; } - public function testSerialize(): void + public function testSerialize() { $icon = new Icon('foo', ['bar' => 'baz']); diff --git a/src/Icons/tests/Unit/IconifyTest.php b/src/Icons/tests/Unit/IconifyTest.php index 8516568b028..9b728e50769 100644 --- a/src/Icons/tests/Unit/IconifyTest.php +++ b/src/Icons/tests/Unit/IconifyTest.php @@ -24,7 +24,7 @@ */ class IconifyTest extends TestCase { - public function testFetchIcon(): void + public function testFetchIcon() { $iconify = new Iconify( cache: new NullAdapter(), @@ -50,7 +50,7 @@ public function testFetchIcon(): void $this->assertEquals($icon->getAttributes(), ['viewBox' => '0 0 24 24', 'xmlns' => 'https://www.w3.org/2000/svg']); } - public function testFetchIconByAlias(): void + public function testFetchIconByAlias() { $iconify = new Iconify( cache: new NullAdapter(), @@ -81,7 +81,7 @@ public function testFetchIconByAlias(): void $this->assertEquals($icon->getAttributes(), ['viewBox' => '0 0 24 24', 'xmlns' => 'https://www.w3.org/2000/svg']); } - public function testFetchIconThrowsWhenIconSetDoesNotExists(): void + public function testFetchIconThrowsWhenIconSetDoesNotExists() { $iconify = new Iconify(new NullAdapter(), 'https://example.com', new MockHttpClient(new JsonMockResponse([]))); @@ -91,7 +91,7 @@ public function testFetchIconThrowsWhenIconSetDoesNotExists(): void $iconify->fetchIcon('bi', 'heart'); } - public function testFetchIconUsesIconsetViewBoxHeight(): void + public function testFetchIconUsesIconsetViewBoxHeight() { $iconify = new Iconify( cache: new NullAdapter(), @@ -119,7 +119,7 @@ public function testFetchIconUsesIconsetViewBoxHeight(): void $this->assertEquals('0 0 17 17', $icon->getAttributes()['viewBox']); } - public function testFetchIconThrowsWhenViewBoxCannotBeComputed(): void + public function testFetchIconThrowsWhenViewBoxCannotBeComputed() { $iconify = new Iconify( cache: new NullAdapter(), @@ -144,7 +144,7 @@ public function testFetchIconThrowsWhenViewBoxCannotBeComputed(): void $iconify->fetchIcon('bi', 'heart'); } - public function testFetchIconThrowsWhenStatusCodeNot200(): void + public function testFetchIconThrowsWhenStatusCodeNot200() { $iconify = new Iconify( cache: new NullAdapter(), @@ -163,7 +163,7 @@ public function testFetchIconThrowsWhenStatusCodeNot200(): void $iconify->fetchIcon('bi', 'heart'); } - public function testFetchIcons(): void + public function testFetchIcons() { $iconify = new Iconify( cache: new NullAdapter(), @@ -194,7 +194,7 @@ public function testFetchIcons(): void $this->assertContainsOnlyInstancesOf(Icon::class, $icons); } - public function testFetchIconsByAliases(): void + public function testFetchIconsByAliases() { $iconify = new Iconify( cache: new NullAdapter(), @@ -234,7 +234,7 @@ public function testFetchIconsByAliases(): void $this->assertContainsOnlyInstancesOf(Icon::class, $icons); } - public function testFetchIconsThrowsWithInvalidIconNames(): void + public function testFetchIconsThrowsWithInvalidIconNames() { $iconify = new Iconify( cache: new NullAdapter(), @@ -251,7 +251,7 @@ public function testFetchIconsThrowsWithInvalidIconNames(): void $iconify->fetchIcons('bi', ['à', 'foo']); } - public function testFetchIconsThrowsWithTooManyIcons(): void + public function testFetchIconsThrowsWithTooManyIcons() { $iconify = new Iconify( cache: new NullAdapter(), @@ -268,7 +268,7 @@ public function testFetchIconsThrowsWithTooManyIcons(): void $iconify->fetchIcons('bi', array_fill(0, 50, '1234567890')); } - public function testGetMetadata(): void + public function testGetMetadata() { $responseFile = __DIR__.'/../Fixtures/Iconify/collections.json'; $client = $this->createHttpClient(json_decode(file_get_contents($responseFile))); @@ -281,7 +281,7 @@ public function testGetMetadata(): void /** * @dataProvider provideChunkCases */ - public function testChunk(int $maxQueryLength, string $prefix, array $names, array $chunks): void + public function testChunk(int $maxQueryLength, string $prefix, array $names, array $chunks) { $iconify = new Iconify( new NullAdapter(), @@ -331,7 +331,7 @@ public static function provideChunkCases(): iterable ]; } - public function testChunkThrowWithIconPrefixTooLong(): void + public function testChunkThrowWithIconPrefixTooLong() { $iconify = new Iconify(new NullAdapter(), 'https://example.com', new MockHttpClient([])); @@ -344,7 +344,7 @@ public function testChunkThrowWithIconPrefixTooLong(): void $result = iterator_to_array($iconify->chunk($prefix, [$name])); } - public function testChunkThrowWithIconNameTooLong(): void + public function testChunkThrowWithIconNameTooLong() { $iconify = new Iconify(new NullAdapter(), 'https://example.com', new MockHttpClient([])); diff --git a/src/Icons/tests/Unit/Registry/IconifyOnDemandRegistryTest.php b/src/Icons/tests/Unit/Registry/IconifyOnDemandRegistryTest.php index c3d1b1d6fcd..23e1428d0cb 100644 --- a/src/Icons/tests/Unit/Registry/IconifyOnDemandRegistryTest.php +++ b/src/Icons/tests/Unit/Registry/IconifyOnDemandRegistryTest.php @@ -24,7 +24,7 @@ */ final class IconifyOnDemandRegistryTest extends TestCase { - public function testWithIconSetAlias(): void + public function testWithIconSetAlias() { $client = new MockHttpClient([ new JsonMockResponse(['lucide' => []]), diff --git a/src/Icons/tests/Unit/Registry/InMemoryIconRegistryTest.php b/src/Icons/tests/Unit/Registry/InMemoryIconRegistryTest.php index 0d0e87b8c81..3b0cc6dc8dd 100644 --- a/src/Icons/tests/Unit/Registry/InMemoryIconRegistryTest.php +++ b/src/Icons/tests/Unit/Registry/InMemoryIconRegistryTest.php @@ -21,7 +21,7 @@ */ final class InMemoryIconRegistryTest extends TestCase { - public function testRegistryConstructor(): void + public function testRegistryConstructor() { $icon = new Icon('foo', ['bar' => 'foobar']); $registry = new InMemoryIconRegistry(['foo' => $icon]); @@ -29,7 +29,7 @@ public function testRegistryConstructor(): void $this->assertSame($icon, $registry->get('foo')); } - public function testRegistryReplaceIcon(): void + public function testRegistryReplaceIcon() { $registry = new InMemoryIconRegistry(); $foo = new Icon('foo', []); @@ -45,7 +45,7 @@ public function testRegistryReplaceIcon(): void $this->assertSame($foo, $registry->get('bar')); } - public function testRegistryThrowsExceptionOnUnknownIcon(): void + public function testRegistryThrowsExceptionOnUnknownIcon() { $this->expectException(IconNotFoundException::class); $this->expectExceptionMessage('Icon "foo" not found.'); diff --git a/src/Icons/tests/Unit/Registry/LocalSvgIconRegistryTest.php b/src/Icons/tests/Unit/Registry/LocalSvgIconRegistryTest.php index 9404b498f34..2c8e7502114 100644 --- a/src/Icons/tests/Unit/Registry/LocalSvgIconRegistryTest.php +++ b/src/Icons/tests/Unit/Registry/LocalSvgIconRegistryTest.php @@ -23,7 +23,7 @@ final class LocalSvgIconRegistryTest extends TestCase /** * @dataProvider validSvgProvider */ - public function testValidSvgs(string $name, array $expectedAttributes, string $expectedContent): void + public function testValidSvgs(string $name, array $expectedAttributes, string $expectedContent) { $icon = $this->registry()->get($name); $this->assertInstanceOf(Icon::class, $icon); @@ -67,7 +67,7 @@ public static function validSvgProvider(): iterable /** * @dataProvider invalidSvgProvider */ - public function testInvalidSvgs(string $name): void + public function testInvalidSvgs(string $name) { $this->expectException(\RuntimeException::class); @@ -85,7 +85,7 @@ public static function invalidSvgProvider(): iterable /** * @dataProvider provideIconSetPathsCases */ - public function testIconSetPaths(string $name, array $iconSetPaths, ?string $expectedContent): void + public function testIconSetPaths(string $name, array $iconSetPaths, ?string $expectedContent) { $registry = new LocalSvgIconRegistry( iconDir: __DIR__.'/../../Fixtures/icons', diff --git a/src/Icons/tests/Unit/Twig/UXIconRuntimeTest.php b/src/Icons/tests/Unit/Twig/UXIconRuntimeTest.php index 3c70bc7d667..dd82853d3a4 100644 --- a/src/Icons/tests/Unit/Twig/UXIconRuntimeTest.php +++ b/src/Icons/tests/Unit/Twig/UXIconRuntimeTest.php @@ -22,7 +22,7 @@ */ class UXIconRuntimeTest extends TestCase { - public function testRenderIconIgnoreNotFound(): void + public function testRenderIconIgnoreNotFound() { $renderer = $this->createMock(IconRendererInterface::class); $renderer->method('renderIcon') diff --git a/src/LazyImage/tests/BlurHash/BlurHashTest.php b/src/LazyImage/tests/BlurHash/BlurHashTest.php index 1304d1bbdca..a5b6fcfc500 100644 --- a/src/LazyImage/tests/BlurHash/BlurHashTest.php +++ b/src/LazyImage/tests/BlurHash/BlurHashTest.php @@ -44,7 +44,7 @@ public function testEncode() ); } - public function testWithCustomGetImageContent(): void + public function testWithCustomGetImageContent() { $kernel = new class('test', true) extends TwigAppKernel { public function registerContainerConfiguration(LoaderInterface $loader): void diff --git a/src/LiveComponent/CHANGELOG.md b/src/LiveComponent/CHANGELOG.md index 29a693f308a..06863ce27af 100644 --- a/src/LiveComponent/CHANGELOG.md +++ b/src/LiveComponent/CHANGELOG.md @@ -2,7 +2,7 @@ ## 2.28.0 -- Add new modifiers for input validations, useful to prevent uneccessary HTTP requests: +- Add new modifiers for input validations, useful to prevent unnecessary HTTP requests: - `min_length` and `max_length`: validate length from textual input elements - `min_value` and `max_value`: validate value from numeral input elements diff --git a/src/LiveComponent/doc/index.rst b/src/LiveComponent/doc/index.rst index 058e4cd5d67..9701f13fc82 100644 --- a/src/LiveComponent/doc/index.rst +++ b/src/LiveComponent/doc/index.rst @@ -2701,7 +2701,7 @@ This way you can also use the component multiple times in the same page and avoi The property name is passed into the modifier function since LiveComponents 2.26. The ``modifier`` function can also take the name of the property as a secondary parameter. -It can be used to perform more generic operations inside of the modifier that can be re-used for multiple props:: +It can be used to perform more generic operations inside of the modifier that can be reused for multiple props:: abstract class AbstractSearchModule { @@ -3344,7 +3344,7 @@ In the ``EditPost`` template, you render the Notice that ``MarkdownTextarea`` allows a dynamic ``name`` -attribute to be passed in. This makes that component re-usable in any +attribute to be passed in. This makes that component reusable in any form. .. _rendering-loop-of-elements: diff --git a/src/LiveComponent/src/Controller/BatchActionController.php b/src/LiveComponent/src/Controller/BatchActionController.php index 2b1bc7aa5b6..0036537e01d 100644 --- a/src/LiveComponent/src/Controller/BatchActionController.php +++ b/src/LiveComponent/src/Controller/BatchActionController.php @@ -31,7 +31,7 @@ public function __construct(private HttpKernelInterface $kernel) public function __invoke(Request $request, MountedComponent $_mounted_component, string $serviceId, array $actions): ?Response { foreach ($actions as $action) { - $name = $action['name'] ?? throw new BadRequestHttpException('Invalid JSON'); + $name = $action['name'] ?? throw new BadRequestHttpException('Invalid JSON.'); $subRequest = $request->duplicate(attributes: [ '_controller' => [$serviceId, $name], diff --git a/src/LiveComponent/src/LiveComponentHydrator.php b/src/LiveComponent/src/LiveComponentHydrator.php index 9f4af3c31fc..df7baa2cfde 100644 --- a/src/LiveComponent/src/LiveComponentHydrator.php +++ b/src/LiveComponent/src/LiveComponentHydrator.php @@ -115,7 +115,7 @@ public function dehydrate(object $component, ComponentAttributes $attributes, Li } catch (NoSuchPropertyException $e) { throw new \LogicException(\sprintf('The writable path "%s" does not exist on the "%s" property of the "%s" component.', $path, $propertyName, $component::class), 0, $e); } catch (PropertyAccessExceptionInterface $e) { - throw new \LogicException(\sprintf('The writable path "%s" on the "%s" property of the "%s" component could not be read: %s', $path, $propertyName, $component::class, $e->getMessage()), 0, $e); + throw new \LogicException(\sprintf('The writable path "%s" on the "%s" property of the "%s" component could not be read: ', $path, $propertyName, $component::class).$e->getMessage(), 0, $e); } // TODO: maybe we allow support the same types as LiveProps later @@ -198,7 +198,7 @@ public function hydrate(object $component, array $props, array $updatedProps, Li */ if ($dehydratedUpdatedProps->hasPropValue($frontendName)) { if (!$propMetadata->isIdentityWritable()) { - throw new HydrationException(\sprintf('The model "%s" was sent for update, but it is not writable. Try adding "writable: true" to the $%s property in %s.', $frontendName, $propMetadata->getName(), $component::class)); + throw new HydrationException(\sprintf('The model "%s" was sent for update, but it is not writable. Try adding "writable: true" to the $%s property in "%s".', $frontendName, $propMetadata->getName(), $component::class)); } try { $propertyValue = $this->hydrateValue( @@ -454,7 +454,7 @@ private function calculateChecksum(array $dehydratedPropsData): ?string private function verifyChecksum(array $identifierPops, string $error = 'Invalid checksum sent when updating the live component.'): void { if (!\array_key_exists(self::CHECKSUM_KEY, $identifierPops)) { - throw new HydrationException(\sprintf('Missing %s. key', self::CHECKSUM_KEY)); + throw new HydrationException(\sprintf('Missing "%s" key.', self::CHECKSUM_KEY)); } $sentChecksum = $identifierPops[self::CHECKSUM_KEY]; unset($identifierPops[self::CHECKSUM_KEY]); @@ -565,7 +565,7 @@ private function dehydrateValue(mixed $value, LivePropMetadata|LegacyLivePropMet $collectionClass = $propMetadata->collectionValueType()->getClassName(); foreach ($value as $key => $objectItem) { if (!$objectItem instanceof $collectionClass) { - throw new \LogicException(\sprintf('The LiveProp "%s" on component "%s" is an array. We determined the array is full of %s objects, but at least one key had a different value of %s', $propMetadata->getName(), $parentObject::class, $collectionClass, get_debug_type($objectItem))); + throw new \LogicException(\sprintf('The LiveProp "%s" on component "%s" is an array. We determined the array is full of "%s" objects, but at least one key had a different value of "%s".', $propMetadata->getName(), $parentObject::class, $collectionClass, get_debug_type($objectItem))); } $value[$key] = $this->dehydrateObjectValue($objectItem, $collectionClass, $propMetadata->getFormat(), $parentObject); @@ -586,7 +586,7 @@ private function dehydrateValue(mixed $value, LivePropMetadata|LegacyLivePropMet if ($t instanceof ObjectType) { foreach ($value as $key => $objectItem) { if (!TypeHelper::accepts($t, $objectItem)) { - throw new \LogicException(\sprintf('The LiveProp "%s" on component "%s" is an array. We determined the array is full of %s objects, but at least one key had a different value of %s', $propMetadata->getName(), $parentObject::class, $t->getClassName(), get_debug_type($objectItem))); + throw new \LogicException(\sprintf('The LiveProp "%s" on component "%s" is an array. We determined the array is full of "%s" objects, but at least one key had a different value of "%s".', $propMetadata->getName(), $parentObject::class, $t->getClassName(), get_debug_type($objectItem))); } $value[$key] = $this->dehydrateObjectValue($objectItem, $t->getClassName(), $propMetadata->getFormat(), $parentObject); @@ -762,7 +762,7 @@ private function calculateWritablePaths(LivePropMetadata|LegacyLivePropMetadata if (\count($extraSentWritablePaths) > 0) { // we could show multiple fields here in the message - throw new HydrationException(\sprintf('The model "%s.%s" was sent for update, but it is not writable. Try adding "writable: [\'%s\']" to the $%s property in %s.', $frontendPropName, $extraSentWritablePaths[0], $extraSentWritablePaths[0], $propMetadata->getName(), $componentClass)); + throw new HydrationException(\sprintf('The model "%s.%s" was sent for update, but it is not writable. Try adding "writable: [\'%s\']" to the $%s property in "%s".', $frontendPropName, $extraSentWritablePaths[0], $extraSentWritablePaths[0], $propMetadata->getName(), $componentClass)); } return $writablePaths; diff --git a/src/LiveComponent/src/Metadata/LiveComponentMetadataFactory.php b/src/LiveComponent/src/Metadata/LiveComponentMetadataFactory.php index 63109093377..1e76ca4c7cc 100644 --- a/src/LiveComponent/src/Metadata/LiveComponentMetadataFactory.php +++ b/src/LiveComponent/src/Metadata/LiveComponentMetadataFactory.php @@ -83,7 +83,7 @@ public function createLivePropMetadata(string $className, string $propertyName, { $reflectionType = $property->getType(); if ($reflectionType instanceof \ReflectionUnionType || $reflectionType instanceof \ReflectionIntersectionType) { - throw new \LogicException(\sprintf('Union or intersection types are not supported for LiveProps. You may want to change the type of property %s in %s.', $property->getName(), $property->getDeclaringClass()->getName())); + throw new \LogicException(\sprintf('Union or intersection types are not supported for LiveProps. You may want to change the type of property "%s" in "%s".', $property->getName(), $property->getDeclaringClass()->getName())); } // BC layer when "symfony/type-info" is not available diff --git a/src/LiveComponent/src/ValidatableComponentTrait.php b/src/LiveComponent/src/ValidatableComponentTrait.php index 16435be24b2..f7e1b56afd5 100644 --- a/src/LiveComponent/src/ValidatableComponentTrait.php +++ b/src/LiveComponent/src/ValidatableComponentTrait.php @@ -58,7 +58,7 @@ public function validate(bool $throw = true): void $this->getValidationErrors()->setAll($this->getValidator()->validate($this)); if ($throw && \count($this->getValidationErrors()) > 0) { - throw new UnprocessableEntityHttpException('Component validation failed'); + throw new UnprocessableEntityHttpException('Component validation failed.'); } } @@ -160,7 +160,7 @@ private function resetValidation(): void private function getValidator(): ComponentValidatorInterface { if (!$this->componentValidator) { - throw new \InvalidArgumentException(\sprintf('The ComponentValidator service was not injected into %s. Did you forget to autowire this service or configure the setComponentValidator() call?', static::class)); + throw new \InvalidArgumentException(\sprintf('The ComponentValidator service was not injected into "%s". Did you forget to autowire this service or configure the setComponentValidator() call?', static::class)); } return $this->componentValidator; diff --git a/src/LiveComponent/tests/Functional/Controller/BatchActionControllerTest.php b/src/LiveComponent/tests/Functional/Controller/BatchActionControllerTest.php index 6151cff63d3..0120d5f647b 100644 --- a/src/LiveComponent/tests/Functional/Controller/BatchActionControllerTest.php +++ b/src/LiveComponent/tests/Functional/Controller/BatchActionControllerTest.php @@ -26,7 +26,7 @@ final class BatchActionControllerTest extends KernelTestCase use HasBrowser; use LiveComponentTestHelper; - public function testCanBatchActions(): void + public function testCanBatchActions() { $dehydrated = $this->dehydrateComponent($this->mountComponent('with_actions')); @@ -81,7 +81,7 @@ public function testCanBatchActions(): void ; } - public function testCanBatchActionsWithAlternateRoute(): void + public function testCanBatchActionsWithAlternateRoute() { $dehydrated = $this->dehydrateComponent($this->mountComponent('alternate_route')); @@ -119,7 +119,7 @@ public function testCanBatchActionsWithAlternateRoute(): void ; } - public function testRedirect(): void + public function testRedirect() { $dehydrated = $this->dehydrateComponent($this->mountComponent('with_actions')); @@ -155,7 +155,7 @@ public function testRedirect(): void ; } - public function testRedirectWithAcceptHeader(): void + public function testRedirectWithAcceptHeader() { $dehydrated = $this->dehydrateComponent($this->mountComponent('with_actions')); @@ -194,7 +194,7 @@ public function testRedirectWithAcceptHeader(): void ; } - public function testException(): void + public function testException() { $dehydrated = $this->dehydrateComponent($this->mountComponent('with_actions')); @@ -228,7 +228,7 @@ public function testException(): void ; } - public function testCannotBatchWithNonLiveAction(): void + public function testCannotBatchWithNonLiveAction() { $dehydrated = $this->dehydrateComponent($this->mountComponent('with_actions')); diff --git a/src/LiveComponent/tests/Functional/EventListener/AddLiveAttributesSubscriberTest.php b/src/LiveComponent/tests/Functional/EventListener/AddLiveAttributesSubscriberTest.php index 93b310a91e7..8672af6a63b 100644 --- a/src/LiveComponent/tests/Functional/EventListener/AddLiveAttributesSubscriberTest.php +++ b/src/LiveComponent/tests/Functional/EventListener/AddLiveAttributesSubscriberTest.php @@ -31,7 +31,7 @@ final class AddLiveAttributesSubscriberTest extends KernelTestCase public const TODO_ITEM_DETERMINISTIC_PREFIX = 'live-1715058793-'; public const TODO_ITEM_DETERMINISTIC_PREFIX_EMBEDDED = 'live-2285361477-'; - public function testInitLiveComponent(): void + public function testInitLiveComponent() { $div = $this->browser() ->visit('/render-template/render_component_with_writable_props') @@ -52,7 +52,7 @@ public function testInitLiveComponent(): void $this->assertArrayHasKey('id', $props['@attributes']); } - public function testCanUseCustomAttributesVariableName(): void + public function testCanUseCustomAttributesVariableName() { $div = $this->browser() ->visit('/render-template/render_custom_attributes') @@ -68,7 +68,7 @@ public function testCanUseCustomAttributesVariableName(): void $this->assertArrayHasKey('@checksum', $props); } - public function testItAddsIdAndFingerprintToChildComponent(): void + public function testItAddsIdAndFingerprintToChildComponent() { $templateName = 'components/todo_list.html.twig'; $obscuredName = 'd9bcb8935cbb4282ac5d227fc82ae782'; @@ -100,7 +100,7 @@ public function testItAddsIdAndFingerprintToChildComponent(): void $this->assertSame('XSdvsiDR8VG0GFDQbOnj74XfSmfL6WrzMbSQcdIRhSs=', $lis->eq(1)->attr('data-live-fingerprint-value')); } - public function testItDoesNotOverrideDataLiveIdIfSpecified(): void + public function testItDoesNotOverrideDataLiveIdIfSpecified() { $templateName = 'components/todo_list.html.twig'; $obscuredName = 'a643d58357b14c9bb077f0c00a742059'; @@ -146,7 +146,7 @@ public function testQueryStringMappingAttribute() $this->assertEquals($expected, $queryMapping); } - public function testAbsoluteUrl(): void + public function testAbsoluteUrl() { $div = $this->browser() ->visit('/render-template/render_with_absolute_url') diff --git a/src/LiveComponent/tests/Functional/EventListener/DeferLiveComponentSubscriberTest.php b/src/LiveComponent/tests/Functional/EventListener/DeferLiveComponentSubscriberTest.php index 6a8c083aa82..a979283a761 100644 --- a/src/LiveComponent/tests/Functional/EventListener/DeferLiveComponentSubscriberTest.php +++ b/src/LiveComponent/tests/Functional/EventListener/DeferLiveComponentSubscriberTest.php @@ -20,7 +20,7 @@ final class DeferLiveComponentSubscriberTest extends KernelTestCase use HasBrowser; use LiveComponentTestHelper; - public function testItSetsDeferredTemplateIfLiveIdNotPassed(): void + public function testItSetsDeferredTemplateIfLiveIdNotPassed() { $div = $this->browser() ->visit('/render-template/render_deferred_component') @@ -48,7 +48,7 @@ public function testItSetsDeferredTemplateIfLiveIdNotPassed(): void $this->assertSame('Long awaited data', $div->html()); } - public function testItIncludesGivenTemplateWhileLoadingDeferredComponent(): void + public function testItIncludesGivenTemplateWhileLoadingDeferredComponent() { $div = $this->browser() ->visit('/render-template/render_deferred_component_with_template') @@ -75,7 +75,7 @@ public function testItIncludesGivenTemplateWhileLoadingDeferredComponent(): void $this->assertStringContainsString('Long awaited data', $div->html()); } - public function testItIncludesComponentTemplateBlockAsPlaceholder(): void + public function testItIncludesComponentTemplateBlockAsPlaceholder() { $div = $this->browser() ->visit('/render-template/render_deferred_component_with_placeholder') @@ -86,7 +86,7 @@ public function testItIncludesComponentTemplateBlockAsPlaceholder(): void $this->assertSame('', trim($div->html())); } - public function testItDoesNotIncludesPlaceholderWhenRendered(): void + public function testItDoesNotIncludesPlaceholderWhenRendered() { $div = $this->browser() ->visit('/render-template/render_component_with_placeholder') @@ -96,7 +96,7 @@ public function testItDoesNotIncludesPlaceholderWhenRendered(): void $this->assertStringNotContainsString('', $div->html()); } - public function testItAllowsToSetCustomLoadingHtmlTag(): void + public function testItAllowsToSetCustomLoadingHtmlTag() { $crawler = $this->browser() ->visit('/render-template/render_deferred_component_with_li_tag') @@ -108,7 +108,7 @@ public function testItAllowsToSetCustomLoadingHtmlTag(): void $this->assertSame(1, $crawler->filter('li')->count()); } - public function testLazyComponentIsNotRendered(): void + public function testLazyComponentIsNotRendered() { $crawler = $this->browser() ->visit('/render-template/render_lazy_component') @@ -125,7 +125,7 @@ public function testLazyComponentIsNotRendered(): void /** * @dataProvider provideLoadingValues */ - public function testLazyComponentRenderingDependsOnLazyValue(mixed $lazy, bool $isRendered): void + public function testLazyComponentRenderingDependsOnLazyValue(mixed $lazy, bool $isRendered) { $crawler = $this->browser() ->visit('/render-template/render_lazy_component_with_value?loading='.$lazy) @@ -144,7 +144,7 @@ public static function provideLoadingValues(): iterable ]; } - public function testLazyComponentIsRenderedLaterWithInitialData(): void + public function testLazyComponentIsRenderedLaterWithInitialData() { $crawler = $this->browser() ->visit('/render-template/render_lazy_component') @@ -171,7 +171,7 @@ public function testLazyComponentIsRenderedLaterWithInitialData(): void $browser->assertElementAttributeContains('#count', 'value', '7'); } - public function testSubscriberDoesNotHandleTwigComponent(): void + public function testSubscriberDoesNotHandleTwigComponent() { $browser = $this->browser() ->visit('/render-template/render_lazy_twig_component') diff --git a/src/LiveComponent/tests/Functional/EventListener/InterceptChildComponentRenderSubscriberTest.php b/src/LiveComponent/tests/Functional/EventListener/InterceptChildComponentRenderSubscriberTest.php index 62aa2f6dc54..f442b7903c4 100644 --- a/src/LiveComponent/tests/Functional/EventListener/InterceptChildComponentRenderSubscriberTest.php +++ b/src/LiveComponent/tests/Functional/EventListener/InterceptChildComponentRenderSubscriberTest.php @@ -30,7 +30,7 @@ final class InterceptChildComponentRenderSubscriberTest extends KernelTestCase AddLiveAttributesSubscriberTest::TODO_ITEM_DETERMINISTIC_PREFIX.'1' => '8AooEz36WYQyxj54BCaDm/jKbcdDdPDLaNO4/49bcQk=', ]; - public function testItAllowsFullChildRenderOnMissingFingerprints(): void + public function testItAllowsFullChildRenderOnMissingFingerprints() { $this->browser() ->visit($this->buildUrlForTodoListComponent([])) @@ -42,7 +42,7 @@ public function testItAllowsFullChildRenderOnMissingFingerprints(): void ; } - public function testItRendersEmptyElementOnMatchingFingerprintBasic(): void + public function testItRendersEmptyElementOnMatchingFingerprintBasic() { $this->browser() ->visit($this->buildUrlForTodoListComponent(self::$actualTodoItemFingerprints)) @@ -54,7 +54,7 @@ public function testItRendersEmptyElementOnMatchingFingerprintBasic(): void ; } - public function testItRendersEmptyElementOnMatchingFingerprintWithCustomDataLiveId(): void + public function testItRendersEmptyElementOnMatchingFingerprintWithCustomDataLiveId() { $fingerPrintsWithCustomLiveId = []; foreach (array_values(self::$actualTodoItemFingerprints) as $key => $fingerprintValue) { @@ -71,7 +71,7 @@ public function testItRendersEmptyElementOnMatchingFingerprintWithCustomDataLive ; } - public function testItRendersNewPropWhenFingerprintDoesNotMatch(): void + public function testItRendersNewPropWhenFingerprintDoesNotMatch() { $fingerprints = self::$actualTodoItemFingerprints; $fingerprints[AddLiveAttributesSubscriberTest::TODO_ITEM_DETERMINISTIC_PREFIX_EMBEDDED.'0'] = 'wrong fingerprint'; @@ -104,7 +104,7 @@ public function testItRendersNewPropWhenFingerprintDoesNotMatch(): void }); } - public function testItUsesKeysToRenderChildrenLiveIds(): void + public function testItUsesKeysToRenderChildrenLiveIds() { $fingerprintValues = array_values(self::$actualTodoItemFingerprints); $fingerprints = []; diff --git a/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php b/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php index c5141554923..cd82132aa7b 100644 --- a/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php +++ b/src/LiveComponent/tests/Functional/EventListener/LiveComponentSubscriberTest.php @@ -43,7 +43,7 @@ final class LiveComponentSubscriberTest extends KernelTestCase */ public const DETERMINISTIC_ID_MULTI_2 = 30904230242; - public function testCanRenderComponentAsHtml(): void + public function testCanRenderComponentAsHtml() { $component = $this->mountComponent('component1', [ 'prop1' => $entity = persist(Entity1::class), @@ -72,7 +72,7 @@ public function testCanRenderComponentAsHtml(): void ; } - public function testCanRenderComponentAsHtmlWithAlternateRoute(): void + public function testCanRenderComponentAsHtmlWithAlternateRoute() { $dehydrated = $this->dehydrateComponent($this->mountComponent('alternate_route')); @@ -91,7 +91,7 @@ public function testCanRenderComponentAsHtmlWithAlternateRoute(): void ; } - public function testCanExecuteComponentActionNormalRoute(): void + public function testCanExecuteComponentActionNormalRoute() { $templateName = 'render_embedded_with_blocks.html.twig'; $obscuredName = '4bd9245af4594aa28cb77583c29e188e'; @@ -129,7 +129,7 @@ public function testCanExecuteComponentActionNormalRoute(): void ; } - public function testCanExecuteComponentActionWithAlternateRoute(): void + public function testCanExecuteComponentActionWithAlternateRoute() { $dehydrated = $this->dehydrateComponent($this->mountComponent('alternate_route')); @@ -153,7 +153,7 @@ public function testCanExecuteComponentActionWithAlternateRoute(): void ; } - public function testCannotExecuteComponentActionForGetRequest(): void + public function testCannotExecuteComponentActionForGetRequest() { $this->browser() ->get('/_components/component2/increase') @@ -161,7 +161,7 @@ public function testCannotExecuteComponentActionForGetRequest(): void ; } - public function testCannotExecuteComponentDefaultActionForGetRequestWhenMethodIsPost(): void + public function testCannotExecuteComponentDefaultActionForGetRequestWhenMethodIsPost() { $this->browser() ->get('/_components/with_method_post/__invoke') @@ -169,7 +169,7 @@ public function testCannotExecuteComponentDefaultActionForGetRequestWhenMethodIs ; } - public function testPreReRenderHookOnlyExecutedDuringAjax(): void + public function testPreReRenderHookOnlyExecutedDuringAjax() { $dehydrated = $this->dehydrateComponent($this->mountComponent('component2')); @@ -189,7 +189,7 @@ public function testPreReRenderHookOnlyExecutedDuringAjax(): void ; } - public function testItAddsEmbeddedTemplateContextToEmbeddedComponents(): void + public function testItAddsEmbeddedTemplateContextToEmbeddedComponents() { $templateName = 'render_embedded_with_blocks.html.twig'; $obscuredName = '1918f197faab43278ba06c0a672a2b97'; @@ -226,7 +226,7 @@ public function testItAddsEmbeddedTemplateContextToEmbeddedComponents(): void ; } - public function testItWorksWithNamespacedTemplateNamesForEmbeddedComponents(): void + public function testItWorksWithNamespacedTemplateNamesForEmbeddedComponents() { $templateName = 'render_embedded_with_blocks.html.twig'; $obscuredName = 'fb7992f74bbb43c08e47b7cf5c880edb'; @@ -239,7 +239,7 @@ public function testItWorksWithNamespacedTemplateNamesForEmbeddedComponents(): v ; } - public function testItUseBlocksFromEmbeddedContextUsingMultipleComponents(): void + public function testItUseBlocksFromEmbeddedContextUsingMultipleComponents() { $templateName = 'render_multiple_embedded_with_blocks.html.twig'; $obscuredName = '5c474b02358c46cca3da7340cc79cc2e'; @@ -271,7 +271,7 @@ public function testItUseBlocksFromEmbeddedContextUsingMultipleComponents(): voi ; } - public function testItUseBlocksFromEmbeddedContextUsingMultipleComponentsWithNamespacedTemplate(): void + public function testItUseBlocksFromEmbeddedContextUsingMultipleComponentsWithNamespacedTemplate() { $templateName = 'render_multiple_embedded_with_blocks.html.twig'; $obscuredName = '5c474b02358c46cca3da7340cc79cc2e'; @@ -303,7 +303,7 @@ public function testItUseBlocksFromEmbeddedContextUsingMultipleComponentsWithNam ; } - public function testCanRedirectFromComponentAction(): void + public function testCanRedirectFromComponentAction() { $dehydrated = $this->dehydrateComponent($this->mountComponent('component2')); @@ -338,7 +338,7 @@ public function testCanRedirectFromComponentAction(): void ; } - public function testInjectsLiveArgs(): void + public function testInjectsLiveArgs() { $dehydrated = $this->dehydrateComponent($this->mountComponent('component6')); @@ -373,7 +373,7 @@ public function testInjectsLiveArgs(): void ; } - public function testWithNullableEntity(): void + public function testWithNullableEntity() { $dehydrated = $this->dehydrateComponent($this->mountComponent('with_nullable_entity')); @@ -391,7 +391,7 @@ public function testWithNullableEntity(): void ; } - public function testCanHaveControllerAttributes(): void + public function testCanHaveControllerAttributes() { if (!class_exists(IsGranted::class)) { $this->markTestSkipped('The security attributes are not available.'); @@ -409,7 +409,7 @@ public function testCanHaveControllerAttributes(): void ; } - public function testCanInjectSecurityUserIntoAction(): void + public function testCanInjectSecurityUserIntoAction() { $dehydrated = $this->dehydrateComponent($this->mountComponent('with_security')); diff --git a/src/LiveComponent/tests/Functional/Form/ComponentWithFormTest.php b/src/LiveComponent/tests/Functional/Form/ComponentWithFormTest.php index 9b527ab3523..8049372d62a 100644 --- a/src/LiveComponent/tests/Functional/Form/ComponentWithFormTest.php +++ b/src/LiveComponent/tests/Functional/Form/ComponentWithFormTest.php @@ -36,7 +36,7 @@ class ComponentWithFormTest extends KernelTestCase use LiveComponentTestHelper; use ResetDatabase; - public function testFormValuesRebuildAfterFormChanges(): void + public function testFormValuesRebuildAfterFormChanges() { $browser = $this->browser(); $crawler = $browser @@ -117,7 +117,7 @@ public function testFormValuesRebuildAfterFormChanges(): void ; } - public function testFormRemembersValidationFromInitialForm(): void + public function testFormRemembersValidationFromInitialForm() { /** @var FormFactoryInterface $formFactory */ $formFactory = self::getContainer()->get('form.factory'); @@ -160,7 +160,7 @@ public function testFormRemembersValidationFromInitialForm(): void ; } - public function testHandleCheckboxChanges(): void + public function testHandleCheckboxChanges() { $category = CategoryFixtureEntityFactory::createMany(5); $id = $category[0]->getId(); @@ -293,7 +293,7 @@ public function testHandleCheckboxChanges(): void ; } - public function testLiveCollectionTypeAddButtonsByDefault(): void + public function testLiveCollectionTypeAddButtonsByDefault() { $dehydrated = $this->dehydrateComponent($this->mountComponent('form_with_live_collection_type'))->getProps(); @@ -310,7 +310,7 @@ public function testLiveCollectionTypeAddButtonsByDefault(): void ; } - public function testResetForm(): void + public function testResetForm() { CategoryFixtureEntityFactory::createMany(5); $mounted = $this->mountComponent('form_with_many_different_fields_type'); @@ -363,7 +363,7 @@ public function testResetForm(): void ; } - public function testLiveCollectionTypeFieldsAddedAndRemoved(): void + public function testLiveCollectionTypeFieldsAddedAndRemoved() { $dehydratedProps = $this->dehydrateComponent($this->mountComponent('form_with_live_collection_type'))->getProps(); $updatedProps = []; @@ -439,7 +439,7 @@ public function testLiveCollectionTypeFieldsAddedAndRemoved(): void ; } - public function testDataModelAttributeAutomaticallyAdded(): void + public function testDataModelAttributeAutomaticallyAdded() { $dehydrated = $this->dehydrateComponent($this->mountComponent('form_with_collection_type'))->getProps(); @@ -455,7 +455,7 @@ public function testDataModelAttributeAutomaticallyAdded(): void ; } - public function testFormWithLivePropContainingAnEntityImplementingAnInterface(): void + public function testFormWithLivePropContainingAnEntityImplementingAnInterface() { $user = persist(User::class, ['username' => 'Fabien']); self::assertInstanceOf(User::class, $user); diff --git a/src/LiveComponent/tests/Functional/LiveResponderTest.php b/src/LiveComponent/tests/Functional/LiveResponderTest.php index 992a42ecef3..0ba92e5a9be 100644 --- a/src/LiveComponent/tests/Functional/LiveResponderTest.php +++ b/src/LiveComponent/tests/Functional/LiveResponderTest.php @@ -23,7 +23,7 @@ final class LiveResponderTest extends KernelTestCase use HasBrowser; use LiveComponentTestHelper; - public function testComponentCanEmitEvents(): void + public function testComponentCanEmitEvents() { $component = $this->mountComponent('component_with_emit'); $dehydrated = $this->dehydrateComponent($component); @@ -38,7 +38,7 @@ public function testComponentCanEmitEvents(): void ->assertSee('Data: {"foo":"bar","bar":"foo"}'); } - public function testComponentCanDispatchBrowserEvents(): void + public function testComponentCanDispatchBrowserEvents() { $component = $this->mountComponent('component_with_emit'); $dehydrated = $this->dehydrateComponent($component); diff --git a/src/LiveComponent/tests/Functional/Test/InteractsWithLiveComponentsTest.php b/src/LiveComponent/tests/Functional/Test/InteractsWithLiveComponentsTest.php index ff5461ae806..e1654f2adbd 100644 --- a/src/LiveComponent/tests/Functional/Test/InteractsWithLiveComponentsTest.php +++ b/src/LiveComponent/tests/Functional/Test/InteractsWithLiveComponentsTest.php @@ -31,7 +31,7 @@ final class InteractsWithLiveComponentsTest extends KernelTestCase use InteractsWithLiveComponents; use ResetDatabase; - public function testCanRenderInitialData(): void + public function testCanRenderInitialData() { $testComponent = $this->createLiveComponent('component2'); @@ -39,7 +39,7 @@ public function testCanRenderInitialData(): void $this->assertSame(1, $testComponent->component()->count); } - public function testCanCreateWithClassString(): void + public function testCanCreateWithClassString() { $testComponent = $this->createLiveComponent(Component2::class); @@ -47,7 +47,7 @@ public function testCanCreateWithClassString(): void $this->assertSame(1, $testComponent->component()->count); } - public function testCanCallLiveAction(): void + public function testCanCallLiveAction() { $testComponent = $this->createLiveComponent('component2'); @@ -60,7 +60,7 @@ public function testCanCallLiveAction(): void $this->assertSame(2, $testComponent->component()->count); } - public function testCanCallLiveActionWithArguments(): void + public function testCanCallLiveActionWithArguments() { $testComponent = $this->createLiveComponent('component6'); @@ -81,7 +81,7 @@ public function testCanCallLiveActionWithArguments(): void $this->assertSame(33.3, $testComponent->component()->arg3); } - public function testCanEmitEvent(): void + public function testCanEmitEvent() { $testComponent = $this->createLiveComponent('component2'); @@ -94,7 +94,7 @@ public function testCanEmitEvent(): void $this->assertSame(5, $testComponent->component()->count); } - public function testInvalidEventName(): void + public function testInvalidEventName() { $testComponent = $this->createLiveComponent('component2'); @@ -103,7 +103,7 @@ public function testInvalidEventName(): void $testComponent->emit('invalid'); } - public function testCanSetLiveProp(): void + public function testCanSetLiveProp() { $testComponent = $this->createLiveComponent('component_with_writable_props'); @@ -116,7 +116,7 @@ public function testCanSetLiveProp(): void $this->assertSame(100, $testComponent->component()->count); } - public function testCanRefreshComponent(): void + public function testCanRefreshComponent() { $testComponent = $this->createLiveComponent('track_renders'); @@ -131,7 +131,7 @@ public function testCanRefreshComponent(): void $this->assertStringContainsString('Re-Render Count: 3', $testComponent->render()); } - public function testCanAccessResponse(): void + public function testCanAccessResponse() { $testComponent = $this->createLiveComponent('component2'); @@ -141,7 +141,7 @@ public function testCanAccessResponse(): void $this->assertSame('1', $response->headers->get('X-Custom-Header')); } - public function testCannotUpdateComponentIfNoLongerInContext(): void + public function testCannotUpdateComponentIfNoLongerInContext() { $testComponent = $this->createLiveComponent('component2')->call('redirect'); @@ -150,7 +150,7 @@ public function testCannotUpdateComponentIfNoLongerInContext(): void $testComponent->call('increase'); } - public function testRenderingIsLazy(): void + public function testRenderingIsLazy() { if (!class_exists(IsGranted::class)) { $this->markTestSkipped('The security attributes are not available.'); @@ -163,7 +163,7 @@ public function testRenderingIsLazy(): void $testComponent->render(); } - public function testActingAs(): void + public function testActingAs() { $testComponent = $this->createLiveComponent('with_security') ->actingAs(new InMemoryUser('kevin', 'pass', ['ROLE_USER'])) @@ -176,7 +176,7 @@ public function testActingAs(): void $this->assertStringContainsString('Username: kevin', $testComponent->render()); } - public function testCanSubmitForm(): void + public function testCanSubmitForm() { CategoryFixtureEntityFactory::createMany(5); $testComponent = $this->createLiveComponent('form_with_many_different_fields_type'); @@ -187,7 +187,7 @@ public function testCanSubmitForm(): void $this->assertStringContainsString('foobar', $testComponent->render()); } - public function testAccessAllLivePropsInsideOnUpdatedHook(): void + public function testAccessAllLivePropsInsideOnUpdatedHook() { $testComponent = $this->createLiveComponent('with_on_updated', [ 'number1' => 1, @@ -202,7 +202,7 @@ public function testAccessAllLivePropsInsideOnUpdatedHook(): void $this->assertStringContainsString('Total: 9', $testComponent->render()); } - public function testSetLocaleRenderLocalizedComponent(): void + public function testSetLocaleRenderLocalizedComponent() { $testComponent = $this->createLiveComponent('localized_route'); $testComponent->setRouteLocale('fr'); @@ -219,7 +219,7 @@ public function testSetLocaleRenderLocalizedComponent(): void $this->assertStringContainsString('Locale: de', $testComponent->render()); } - public function testAssertComponentEmitEvent(): void + public function testAssertComponentEmitEvent() { $testComponent = $this->createLiveComponent('component_with_emit'); @@ -232,7 +232,7 @@ public function testAssertComponentEmitEvent(): void ]); } - public function testAssertComponentEmitEventFails(): void + public function testAssertComponentEmitEventFails() { $testComponent = $this->createLiveComponent('component_with_emit'); @@ -245,7 +245,7 @@ public function testAssertComponentEmitEventFails(): void ]); } - public function testComponentEmitsExpectedPartialEventData(): void + public function testComponentEmitsExpectedPartialEventData() { $testComponent = $this->createLiveComponent('component_with_emit'); @@ -257,7 +257,7 @@ public function testComponentEmitsExpectedPartialEventData(): void ; } - public function testComponentDoesNotEmitUnexpectedEvent(): void + public function testComponentDoesNotEmitUnexpectedEvent() { $testComponent = $this->createLiveComponent('component_with_emit'); @@ -266,7 +266,7 @@ public function testComponentDoesNotEmitUnexpectedEvent(): void $this->assertComponentNotEmitEvent($testComponent, 'event2'); } - public function testComponentDoesNotEmitUnexpectedEventFails(): void + public function testComponentDoesNotEmitUnexpectedEventFails() { $testComponent = $this->createLiveComponent('component_with_emit'); @@ -277,7 +277,7 @@ public function testComponentDoesNotEmitUnexpectedEventFails(): void $this->assertComponentNotEmitEvent($testComponent, 'event1'); } - public function testComponentEmitsEventWithIncorrectDataFails(): void + public function testComponentEmitsEventWithIncorrectDataFails() { $testComponent = $this->createLiveComponent('component_with_emit'); diff --git a/src/LiveComponent/tests/Functional/Util/RequestPropsExtractorTest.php b/src/LiveComponent/tests/Functional/Util/RequestPropsExtractorTest.php index 7301ad48168..80bbb738323 100644 --- a/src/LiveComponent/tests/Functional/Util/RequestPropsExtractorTest.php +++ b/src/LiveComponent/tests/Functional/Util/RequestPropsExtractorTest.php @@ -25,7 +25,7 @@ class RequestPropsExtractorTest extends KernelTestCase /** * @dataProvider getQueryStringTests */ - public function testExtractFromQueryString(string $queryString, array $expected, array $attributes = []): void + public function testExtractFromQueryString(string $queryString, array $expected, array $attributes = []) { $extractor = new RequestPropsExtractor($this->hydrator()); diff --git a/src/LiveComponent/tests/Functional/ValidatableComponentTraitTest.php b/src/LiveComponent/tests/Functional/ValidatableComponentTraitTest.php index ce8d02fc88f..5d4928886bf 100644 --- a/src/LiveComponent/tests/Functional/ValidatableComponentTraitTest.php +++ b/src/LiveComponent/tests/Functional/ValidatableComponentTraitTest.php @@ -24,7 +24,7 @@ class ValidatableComponentTraitTest extends KernelTestCase use LiveComponentTestHelper; use ResetDatabase; - public function testFormValuesRebuildAfterFormChanges(): void + public function testFormValuesRebuildAfterFormChanges() { $dehydratedProps = $this->dehydrateComponent($this->mountComponent('validating_component'))->getProps(); diff --git a/src/LiveComponent/tests/Integration/EventListener/DataModelPropsSubscriberTest.php b/src/LiveComponent/tests/Integration/EventListener/DataModelPropsSubscriberTest.php index 60d1f6e6b3f..7bdeb34d0ca 100644 --- a/src/LiveComponent/tests/Integration/EventListener/DataModelPropsSubscriberTest.php +++ b/src/LiveComponent/tests/Integration/EventListener/DataModelPropsSubscriberTest.php @@ -19,7 +19,7 @@ final class DataModelPropsSubscriberTest extends KernelTestCase { use LiveComponentTestHelper; - public function testDataModelPropsAreSharedToChild(): void + public function testDataModelPropsAreSharedToChild() { /** @var ComponentRenderer $renderer */ $renderer = self::getContainer()->get('ux.twig_component.component_renderer'); @@ -38,7 +38,7 @@ public function testDataModelPropsAreSharedToChild(): void $this->assertStringContainsString('', $html); } - public function testDataModelPropsAreAvailableInEmbeddedComponents(): void + public function testDataModelPropsAreAvailableInEmbeddedComponents() { $templateName = 'components/parent_component_data_model.html.twig'; $obscuredName = '684c45bf85d3461dbe587407892e59d8'; diff --git a/src/LiveComponent/tests/Integration/Hydration/DoctrineEntityHydrationExtensionTest.php b/src/LiveComponent/tests/Integration/Hydration/DoctrineEntityHydrationExtensionTest.php index 1b9de696f8b..47b9ccd8920 100644 --- a/src/LiveComponent/tests/Integration/Hydration/DoctrineEntityHydrationExtensionTest.php +++ b/src/LiveComponent/tests/Integration/Hydration/DoctrineEntityHydrationExtensionTest.php @@ -25,7 +25,7 @@ class DoctrineEntityHydrationExtensionTest extends KernelTestCase use Factories; use ResetDatabase; - public function testCompositeId(): void + public function testCompositeId() { $compositeIdEntity = CompositeIdEntityFactory::createOne()->_real(); @@ -38,7 +38,7 @@ public function testCompositeId(): void ); } - public function testForeignKeyId(): void + public function testForeignKeyId() { $foreignKeyIdEntity = ForeignKeyIdEntityFactory::createOne()->_real(); diff --git a/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php b/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php index 3dacba5d71c..442adacc7a7 100644 --- a/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php +++ b/src/LiveComponent/tests/Integration/LiveComponentHydratorTest.php @@ -153,7 +153,7 @@ private function executeHydrationTestCase(callable $testFactory, ?int $minPhpVer /** * @dataProvider provideDehydrationHydrationTests */ - public function testCanDehydrateAndHydrateComponentWithTestCases(callable $testFactory, ?int $minPhpVersion = null): void + public function testCanDehydrateAndHydrateComponentWithTestCases(callable $testFactory, ?int $minPhpVersion = null) { $this->executeHydrationTestCase($testFactory, $minPhpVersion); } @@ -1434,7 +1434,7 @@ public function modifyDateProp(LiveProp $prop): LiveProp }]; } - public function testHydrationWithInvalidDate(): void + public function testHydrationWithInvalidDate() { $this->expectException(BadRequestHttpException::class); $this->expectExceptionMessage('The model path "createdAt" was sent invalid date data "0" or in an invalid format. Make sure it\'s a valid date and it matches the expected format "Y. m. d.".'); @@ -1462,7 +1462,7 @@ public function __construct() }); } - public function testPassingArrayToWritablePropForHydrationIsNotAllowed(): void + public function testPassingArrayToWritablePropForHydrationIsNotAllowed() { $component = new class { #[LiveProp(writable: true)] @@ -1493,7 +1493,7 @@ public function __construct() ); } - public function testInterfaceTypedLivePropCannotBeHydrated(): void + public function testInterfaceTypedLivePropCannotBeHydrated() { $componentClass = new class { #[LiveProp(writable: true)] @@ -1512,7 +1512,7 @@ public function testInterfaceTypedLivePropCannotBeHydrated(): void ); } - public function testInterfaceTypedLivePropCannotBeDehydrated(): void + public function testInterfaceTypedLivePropCannotBeDehydrated() { $componentClass = new class { #[LiveProp(writable: true)] @@ -1531,7 +1531,7 @@ public function testInterfaceTypedLivePropCannotBeDehydrated(): void /** * @dataProvider provideInvalidHydrationTests */ - public function testInvalidTypeHydration(callable $testFactory, ?int $minPhpVersion = null): void + public function testInvalidTypeHydration(callable $testFactory, ?int $minPhpVersion = null) { $this->executeHydrationTestCase($testFactory, $minPhpVersion); } @@ -1628,7 +1628,7 @@ public static function provideInvalidHydrationTests(): iterable }]; } - public function testHydrationFailsIfChecksumMissing(): void + public function testHydrationFailsIfChecksumMissing() { $component = $this->getComponent('component1'); @@ -1637,7 +1637,7 @@ public function testHydrationFailsIfChecksumMissing(): void $this->hydrateComponent($component, 'component1', []); } - public function testHydrationFailsOnChecksumMismatch(): void + public function testHydrationFailsOnChecksumMismatch() { $component = $this->getComponent('component1'); @@ -1646,7 +1646,7 @@ public function testHydrationFailsOnChecksumMismatch(): void $this->hydrateComponent($component, 'component1', ['@checksum' => 'invalid']); } - public function testHydrationTakeUpdatedParentPropsIntoAccount(): void + public function testHydrationTakeUpdatedParentPropsIntoAccount() { $component = new class { #[LiveProp(writable: true)] @@ -1680,7 +1680,7 @@ public function testHydrationTakeUpdatedParentPropsIntoAccount(): void $this->assertTrue($freshComponent->shouldUppercase); } - public function testHydrationWithUpdatesParentPropsAndBadChecksumFails(): void + public function testHydrationWithUpdatesParentPropsAndBadChecksumFails() { $component = new class { #[LiveProp(updateFromParent: true)] @@ -1710,7 +1710,7 @@ public function testHydrationWithUpdatesParentPropsAndBadChecksumFails(): void ); } - public function testPreDehydrateAndPostHydrateHooksCalled(): void + public function testPreDehydrateAndPostHydrateHooksCalled() { $mounted = $this->mountComponent('component2'); @@ -1737,7 +1737,7 @@ public function testPreDehydrateAndPostHydrateHooksCalled(): void $this->assertTrue($component->postHydrateCalled); } - public function testCorrectlyUsesCustomFrontendNameInDehydrateAndHydrate(): void + public function testCorrectlyUsesCustomFrontendNameInDehydrateAndHydrate() { $mounted = $this->mountComponent('component3', ['prop1' => 'value1', 'prop2' => 'value2']); $dehydratedProps = $this->dehydrateComponent($mounted)->getProps(); @@ -1758,7 +1758,7 @@ public function testCorrectlyUsesCustomFrontendNameInDehydrateAndHydrate(): void $this->assertSame('value2', $component->prop2); } - public function testCanDehydrateAndHydrateComponentsWithAttributes(): void + public function testCanDehydrateAndHydrateComponentsWithAttributes() { $mounted = $this->mountComponent('with_attributes', $attributes = ['class' => 'foo', 'value' => null], false); @@ -1774,7 +1774,7 @@ public function testCanDehydrateAndHydrateComponentsWithAttributes(): void $this->assertSame($attributes, $actualAttributes->all()); } - public function testCanDehydrateAndHydrateComponentsWithEmptyAttributes(): void + public function testCanDehydrateAndHydrateComponentsWithEmptyAttributes() { $mounted = $this->mountComponent('with_attributes', [], false); @@ -1792,7 +1792,7 @@ public function testCanDehydrateAndHydrateComponentsWithEmptyAttributes(): void /** * @dataProvider truthyValueProvider */ - public function testCoerceTruthyValuesForScalarTypes($prop, $value, $expected): void + public function testCoerceTruthyValuesForScalarTypes($prop, $value, $expected) { $dehydratedProps = $this->dehydrateComponent($this->mountComponent('scalar_types'))->getProps(); @@ -1806,7 +1806,7 @@ public function testCoerceTruthyValuesForScalarTypes($prop, $value, $expected): /** * @dataProvider falseyValueProvider */ - public function testCoerceFalseyValuesForScalarTypes($prop, $value, $expected): void + public function testCoerceFalseyValuesForScalarTypes($prop, $value, $expected) { $dehydratedProps = $this->dehydrateComponent($this->mountComponent('scalar_types'))->getProps(); diff --git a/src/LiveComponent/tests/Integration/Twig/DeterministicTwigIdCalculatorTest.php b/src/LiveComponent/tests/Integration/Twig/DeterministicTwigIdCalculatorTest.php index c014e346089..423be5653ee 100644 --- a/src/LiveComponent/tests/Integration/Twig/DeterministicTwigIdCalculatorTest.php +++ b/src/LiveComponent/tests/Integration/Twig/DeterministicTwigIdCalculatorTest.php @@ -17,7 +17,7 @@ final class DeterministicTwigIdCalculatorTest extends KernelTestCase { - public function testReturnsDeterministicId(): void + public function testReturnsDeterministicId() { /** @var Environment $twig */ $twig = self::getContainer()->get('twig'); diff --git a/src/LiveComponent/tests/Integration/Twig/LiveComponentExtensionTest.php b/src/LiveComponent/tests/Integration/Twig/LiveComponentExtensionTest.php index abfd0a1c6cb..5dde447f28a 100644 --- a/src/LiveComponent/tests/Integration/Twig/LiveComponentExtensionTest.php +++ b/src/LiveComponent/tests/Integration/Twig/LiveComponentExtensionTest.php @@ -18,7 +18,7 @@ */ final class LiveComponentExtensionTest extends KernelTestCase { - public function testGetComponentUrl(): void + public function testGetComponentUrl() { $rendered = self::getContainer()->get('twig')->render('component_url.html.twig', [ 'date' => new \DateTime('2022-10-06-0'), diff --git a/src/LiveComponent/tests/Integration/Twig/LiveComponentRuntimeTest.php b/src/LiveComponent/tests/Integration/Twig/LiveComponentRuntimeTest.php index 1b6884ea40e..db8f9213a7d 100644 --- a/src/LiveComponent/tests/Integration/Twig/LiveComponentRuntimeTest.php +++ b/src/LiveComponent/tests/Integration/Twig/LiveComponentRuntimeTest.php @@ -22,7 +22,7 @@ final class LiveComponentRuntimeTest extends KernelTestCase { use HasBrowser; - public function testGetComponentUrl(): void + public function testGetComponentUrl() { $runtime = self::getContainer()->get('ux.live_component.twig.component_runtime'); \assert($runtime instanceof LiveComponentRuntime); diff --git a/src/LiveComponent/tests/Integration/Util/FingerprintCalculatorTest.php b/src/LiveComponent/tests/Integration/Util/FingerprintCalculatorTest.php index 8a5edd9b653..aa6b28a934a 100644 --- a/src/LiveComponent/tests/Integration/Util/FingerprintCalculatorTest.php +++ b/src/LiveComponent/tests/Integration/Util/FingerprintCalculatorTest.php @@ -85,7 +85,7 @@ public function testFingerprintNotEqual() ); } - public function testFingerprintOnlyUsesPropsThatAcceptUpdates(): void + public function testFingerprintOnlyUsesPropsThatAcceptUpdates() { $fingerprintCalculator = $this->getFingerprintCalculator(); diff --git a/src/LiveComponent/tests/Unit/Attribute/AsLiveComponentTest.php b/src/LiveComponent/tests/Unit/Attribute/AsLiveComponentTest.php index 6dcf8029e59..b265f05d048 100644 --- a/src/LiveComponent/tests/Unit/Attribute/AsLiveComponentTest.php +++ b/src/LiveComponent/tests/Unit/Attribute/AsLiveComponentTest.php @@ -26,7 +26,7 @@ */ final class AsLiveComponentTest extends TestCase { - public function testPreDehydrateMethodsAreOrderedByPriority(): void + public function testPreDehydrateMethodsAreOrderedByPriority() { $hooks = AsLiveComponent::preDehydrateMethods( new class { @@ -53,7 +53,7 @@ public function hook3() $this->assertSame('hook1', $hooks[2]->name); } - public function testPostHydrateMethodsAreOrderedByPriority(): void + public function testPostHydrateMethodsAreOrderedByPriority() { $hooks = AsLiveComponent::postHydrateMethods( new class { @@ -80,7 +80,7 @@ public function hook3() $this->assertSame('hook1', $hooks[2]->name); } - public function testPreMountHooksAreOrderedByPriority(): void + public function testPreMountHooksAreOrderedByPriority() { $hooks = AsLiveComponent::preReRenderMethods( new class { @@ -107,7 +107,7 @@ public function hook3() $this->assertSame('hook1', $hooks[2]->name); } - public function testCanGetPostHydrateMethodsFromClassString(): void + public function testCanGetPostHydrateMethodsFromClassString() { $methods = AsLiveComponent::postHydrateMethods(DummyLiveComponent::class); @@ -116,7 +116,7 @@ public function testCanGetPostHydrateMethodsFromClassString(): void $this->assertSame(DummyLiveComponent::class, $methods[0]->getDeclaringClass()?->getName()); } - public function testCanGetLiveListeners(): void + public function testCanGetLiveListeners() { $liveListeners = AsLiveComponent::liveListeners(new Component5()); @@ -127,7 +127,7 @@ public function testCanGetLiveListeners(): void ], $liveListeners[0]); } - public function testCanGetLiveListenersFromClassString(): void + public function testCanGetLiveListenersFromClassString() { $liveListeners = AsLiveComponent::liveListeners(DummyLiveComponent::class); @@ -138,7 +138,7 @@ public function testCanGetLiveListenersFromClassString(): void ], $liveListeners[0]); } - public function testCanGetRepeatedLiveListeners(): void + public function testCanGetRepeatedLiveListeners() { $liveListeners = AsLiveComponent::liveListeners(new ComponentWithRepeatedLiveListener()); @@ -163,14 +163,14 @@ public function testCanGetRepeatedLiveListeners(): void ], $liveListeners); } - public function testCanGetRepeatedLiveListenersFromClassString(): void + public function testCanGetRepeatedLiveListenersFromClassString() { $liveListeners = AsLiveComponent::liveListeners(ComponentWithRepeatedLiveListener::class); $this->assertCount(4, $liveListeners); } - public function testCanCheckIfMethodIsAllowed(): void + public function testCanCheckIfMethodIsAllowed() { $component = new Component5(); diff --git a/src/LiveComponent/tests/Unit/Attribute/LivePropTest.php b/src/LiveComponent/tests/Unit/Attribute/LivePropTest.php index be867516f4e..be766df1110 100644 --- a/src/LiveComponent/tests/Unit/Attribute/LivePropTest.php +++ b/src/LiveComponent/tests/Unit/Attribute/LivePropTest.php @@ -19,26 +19,26 @@ */ final class LivePropTest extends TestCase { - public function testHydrateWithMethod(): void + public function testHydrateWithMethod() { $this->assertSame('someMethod', (new LiveProp(false, 'someMethod'))->hydrateMethod()); $this->assertSame('someMethod', (new LiveProp(false, 'someMethod()'))->hydrateMethod()); } - public function testDehydrateWithMethod(): void + public function testDehydrateWithMethod() { $this->assertSame('someMethod', (new LiveProp(false, null, 'someMethod'))->dehydrateMethod()); $this->assertSame('someMethod', (new LiveProp(false, null, 'someMethod()'))->dehydrateMethod()); } - public function testCanCallCalculateFieldNameAsString(): void + public function testCanCallCalculateFieldNameAsString() { $component = new class {}; $this->assertSame('field', (new LiveProp(false, null, null, false, [], 'field'))->calculateFieldName($component, 'fallback')); } - public function testCanCallCalculateFieldNameAsMethod(): void + public function testCanCallCalculateFieldNameAsMethod() { $component = new class { public function fieldName(): string @@ -50,7 +50,7 @@ public function fieldName(): string $this->assertSame('foo', (new LiveProp(false, null, null, false, [], 'fieldName()'))->calculateFieldName($component, 'fallback')); } - public function testCanCallCalculateFieldNameWhenNotSet(): void + public function testCanCallCalculateFieldNameWhenNotSet() { $component = new class {}; @@ -73,7 +73,7 @@ public function testIsIdentityWritableAndWritablePaths() } // test updateFromParent property being set and accessed with acceptUpdatesFromParent() - public function testUpdateFromParent(): void + public function testUpdateFromParent() { $liveProp = new LiveProp(); $this->assertFalse($liveProp->acceptUpdatesFromParent()); diff --git a/src/LiveComponent/tests/Unit/DependencyInjection/LiveComponentExtensionTest.php b/src/LiveComponent/tests/Unit/DependencyInjection/LiveComponentExtensionTest.php index b70be7ed29c..401ca8ed006 100644 --- a/src/LiveComponent/tests/Unit/DependencyInjection/LiveComponentExtensionTest.php +++ b/src/LiveComponent/tests/Unit/DependencyInjection/LiveComponentExtensionTest.php @@ -18,7 +18,7 @@ class LiveComponentExtensionTest extends TestCase { - public function testKernelSecretIsUsedByDefault(): void + public function testKernelSecretIsUsedByDefault() { $container = $this->createContainer(); $container->registerExtension(new LiveComponentExtension()); @@ -29,7 +29,7 @@ public function testKernelSecretIsUsedByDefault(): void $this->assertSame('%kernel.secret%', $container->getDefinition('ux.live_component.fingerprint_calculator')->getArgument(0)); } - public function testCustomSecretIsUsedInDefinition(): void + public function testCustomSecretIsUsedInDefinition() { $container = $this->createContainer(); $container->registerExtension(new LiveComponentExtension()); diff --git a/src/LiveComponent/tests/Unit/Form/ComponentWithFormTest.php b/src/LiveComponent/tests/Unit/Form/ComponentWithFormTest.php index 93dcaa0e852..f96928c75b1 100644 --- a/src/LiveComponent/tests/Unit/Form/ComponentWithFormTest.php +++ b/src/LiveComponent/tests/Unit/Form/ComponentWithFormTest.php @@ -25,7 +25,7 @@ class ComponentWithFormTest extends KernelTestCase use Factories; use ResetDatabase; - public function testFormValues(): void + public function testFormValues() { $category = CategoryFixtureEntityFactory::createMany(5); $id = $category[0]->getId(); diff --git a/src/LiveComponent/tests/Unit/LiveCollectionTraitTest.php b/src/LiveComponent/tests/Unit/LiveCollectionTraitTest.php index 69eb6aad1cf..12e92730e77 100644 --- a/src/LiveComponent/tests/Unit/LiveCollectionTraitTest.php +++ b/src/LiveComponent/tests/Unit/LiveCollectionTraitTest.php @@ -22,7 +22,7 @@ final class LiveCollectionTraitTest extends TestCase { /** @dataProvider provideAddedItems */ - public function testAddCollectionItem(array $postedFormData, string $collectionFieldName, array $expectedFormData): void + public function testAddCollectionItem(array $postedFormData, string $collectionFieldName, array $expectedFormData) { $component = $this->createComponent($postedFormData); @@ -32,7 +32,7 @@ public function testAddCollectionItem(array $postedFormData, string $collectionF } /** @dataProvider provideRemovedItems */ - public function testRemoveCollectionItem(array $postedFormData, string $collectionFieldName, int $index, array $expectedFormData): void + public function testRemoveCollectionItem(array $postedFormData, string $collectionFieldName, int $index, array $expectedFormData) { $component = $this->createComponent($postedFormData); diff --git a/src/LiveComponent/tests/Unit/LiveComponentHydratorTest.php b/src/LiveComponent/tests/Unit/LiveComponentHydratorTest.php index 583f4245675..618f26d34b5 100644 --- a/src/LiveComponent/tests/Unit/LiveComponentHydratorTest.php +++ b/src/LiveComponent/tests/Unit/LiveComponentHydratorTest.php @@ -26,7 +26,7 @@ final class LiveComponentHydratorTest extends TestCase { - public function testConstructWithEmptySecret(): void + public function testConstructWithEmptySecret() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('A non-empty secret is required.'); diff --git a/src/LiveComponent/tests/Unit/LiveResponderTest.php b/src/LiveComponent/tests/Unit/LiveResponderTest.php index fac26ebdb9e..f0c748d8f11 100644 --- a/src/LiveComponent/tests/Unit/LiveResponderTest.php +++ b/src/LiveComponent/tests/Unit/LiveResponderTest.php @@ -16,7 +16,7 @@ class LiveResponderTest extends TestCase { - public function testEmit(): void + public function testEmit() { $responder = new LiveResponder(); $responder->emit('event_name1', ['data_key' => 'data_value']); @@ -38,7 +38,7 @@ public function testEmit(): void ], $responder->getEventsToEmit()); } - public function testEmitUp(): void + public function testEmitUp() { $responder = new LiveResponder(); $responder->emitUp('event_name1', ['data_key' => 'data_value']); @@ -60,7 +60,7 @@ public function testEmitUp(): void ], $responder->getEventsToEmit()); } - public function testEmitSelf(): void + public function testEmitSelf() { $responder = new LiveResponder(); $responder->emitSelf('event_name1', ['data_key' => 'data_value']); @@ -82,7 +82,7 @@ public function testEmitSelf(): void ], $responder->getEventsToEmit()); } - public function testDispatchBrowserEvent(): void + public function testDispatchBrowserEvent() { $responder = new LiveResponder(); $responder->dispatchBrowserEvent('event_name1', ['data_key' => 'data_value']); diff --git a/src/LiveComponent/tests/Unit/Metadata/LiveComponentMetadataTest.php b/src/LiveComponent/tests/Unit/Metadata/LiveComponentMetadataTest.php index 3c8ff8891d9..dd064e7a9be 100644 --- a/src/LiveComponent/tests/Unit/Metadata/LiveComponentMetadataTest.php +++ b/src/LiveComponent/tests/Unit/Metadata/LiveComponentMetadataTest.php @@ -39,7 +39,7 @@ public function testGetOnlyPropsThatAcceptUpdatesFromParent() $this->assertEquals($expected, $actual); } - public function testGetAllUrlMappings(): void + public function testGetAllUrlMappings() { $aliasUrlMapping = new UrlMapping('alias'); $propMetadas = [ diff --git a/src/LiveComponent/tests/Unit/Twig/LiveComponentRuntimeTest.php b/src/LiveComponent/tests/Unit/Twig/LiveComponentRuntimeTest.php index 01f067c08fa..c1a96e21de1 100644 --- a/src/LiveComponent/tests/Unit/Twig/LiveComponentRuntimeTest.php +++ b/src/LiveComponent/tests/Unit/Twig/LiveComponentRuntimeTest.php @@ -16,7 +16,7 @@ final class LiveComponentRuntimeTest extends KernelTestCase { - public function testGetLiveAction(): void + public function testGetLiveAction() { $runtime = self::getContainer()->get('ux.live_component.twig.component_runtime'); \assert($runtime instanceof LiveComponentRuntime); diff --git a/src/LiveComponent/tests/Unit/Twig/TemplateCacheWarmerTest.php b/src/LiveComponent/tests/Unit/Twig/TemplateCacheWarmerTest.php index 5e52311b60e..692e2f7e019 100644 --- a/src/LiveComponent/tests/Unit/Twig/TemplateCacheWarmerTest.php +++ b/src/LiveComponent/tests/Unit/Twig/TemplateCacheWarmerTest.php @@ -39,7 +39,7 @@ protected function setUp(): void ); } - public function testWarmUpCreatesCacheFile(): void + public function testWarmUpCreatesCacheFile() { $this->assertFileDoesNotExist($this->cacheFile); @@ -48,7 +48,7 @@ public function testWarmUpCreatesCacheFile(): void $this->assertFileExists($this->cacheFile); } - public function testWarmUpCreatesCorrectCacheContent(): void + public function testWarmUpCreatesCorrectCacheContent() { $this->templateCacheWarmer->warmUp($this->cacheDir); $adapter = new PhpArrayAdapter($this->cacheFile, new NullAdapter()); @@ -63,7 +63,7 @@ public function testWarmUpCreatesCorrectCacheContent(): void ); } - public function testWarmUpCreatesReproductibleTemplateMap(): void + public function testWarmUpCreatesReproductibleTemplateMap() { $this->templateCacheWarmer->warmUp($this->cacheDir); $adapter = new PhpArrayAdapter($this->cacheFile, new NullAdapter()); diff --git a/src/LiveComponent/tests/Unit/Util/DehydratedPropsTest.php b/src/LiveComponent/tests/Unit/Util/DehydratedPropsTest.php index f2fafe6c8d2..dd81a24c860 100644 --- a/src/LiveComponent/tests/Unit/Util/DehydratedPropsTest.php +++ b/src/LiveComponent/tests/Unit/Util/DehydratedPropsTest.php @@ -16,7 +16,7 @@ class DehydratedPropsTest extends TestCase { - public function testDataIsBuiltCorrectly(): void + public function testDataIsBuiltCorrectly() { $dehydratedProps = new DehydratedProps(); $dehydratedProps->addPropValue('firstName', 'Ryan'); @@ -43,7 +43,7 @@ public function testDataIsBuiltCorrectly(): void $this->assertEquals($dehydratedProps->getProps(), $propsFromArray->getProps()); } - public function testRemovePropValue(): void + public function testRemovePropValue() { $props = new DehydratedProps(); $props->addPropValue('firstName', 'Ryan'); @@ -52,7 +52,7 @@ public function testRemovePropValue(): void $this->assertSame(['lastName' => 'Weaver'], $props->getProps()); } - public function testGetAndHasPropValue(): void + public function testGetAndHasPropValue() { $props = new DehydratedProps(); $props->addPropValue('firstName', 'Ryan'); @@ -80,7 +80,7 @@ public function testGetAndHasNestedPathValue() $this->assertSame('Campfire Food', $props->getNestedPathValue('product', 'category.name')); } - public function testCreateFromUpdatedArray(): void + public function testCreateFromUpdatedArray() { $actual = DehydratedProps::createFromUpdatedArray([ 'isPublic' => true, @@ -102,7 +102,7 @@ public function testCreateFromUpdatedArray(): void $this->assertEquals($expected, $actual); } - public function testGetNestedPathsForProperty(): void + public function testGetNestedPathsForProperty() { $props = DehydratedProps::createFromUpdatedArray([ 'invoice.number' => '123', @@ -118,7 +118,7 @@ public function testGetNestedPathsForProperty(): void ); } - public function testCalculateUnexpectedWritablePaths(): void + public function testCalculateUnexpectedWritablePaths() { $props = DehydratedProps::createFromUpdatedArray([ 'product.tags' => ['pretzels', 'nonsense'], diff --git a/src/LiveComponent/tests/Unit/Util/FingerprintCalculatorTest.php b/src/LiveComponent/tests/Unit/Util/FingerprintCalculatorTest.php index 71f115d97e1..c295b938901 100644 --- a/src/LiveComponent/tests/Unit/Util/FingerprintCalculatorTest.php +++ b/src/LiveComponent/tests/Unit/Util/FingerprintCalculatorTest.php @@ -16,7 +16,7 @@ final class FingerprintCalculatorTest extends TestCase { - public function testConstructWithEmptySecret(): void + public function testConstructWithEmptySecret() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('A non-empty secret is required.'); diff --git a/src/LiveComponent/tests/Unit/Util/LiveAttributesCollectionTest.php b/src/LiveComponent/tests/Unit/Util/LiveAttributesCollectionTest.php index 0607daeb130..3b91472d250 100644 --- a/src/LiveComponent/tests/Unit/Util/LiveAttributesCollectionTest.php +++ b/src/LiveComponent/tests/Unit/Util/LiveAttributesCollectionTest.php @@ -16,7 +16,7 @@ class LiveAttributesCollectionTest extends KernelTestCase { - public function testToArray(): void + public function testToArray() { self::bootKernel(); $collection = new LiveAttributesCollection(self::getContainer()->get('twig')); diff --git a/src/LiveComponent/tests/Unit/Util/ModelBindingParserTest.php b/src/LiveComponent/tests/Unit/Util/ModelBindingParserTest.php index 2529cce69ca..e8220b59c85 100644 --- a/src/LiveComponent/tests/Unit/Util/ModelBindingParserTest.php +++ b/src/LiveComponent/tests/Unit/Util/ModelBindingParserTest.php @@ -19,7 +19,7 @@ final class ModelBindingParserTest extends TestCase /** * @dataProvider getModelStringTests */ - public function testParseAllValidStrings(string $input, array $expectedBindings): void + public function testParseAllValidStrings(string $input, array $expectedBindings) { $parser = new ModelBindingParser(); $this->assertEquals($expectedBindings, $parser->parse($input)); @@ -43,7 +43,7 @@ public static function getModelStringTests(): \Generator ]]; } - public function testParseThrowsExceptionWithMultipleColons(): void + public function testParseThrowsExceptionWithMultipleColons() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid value "foo:bar:baz" given for "data-model"'); diff --git a/src/LiveComponent/tests/Unit/Util/UrlFactoryTest.php b/src/LiveComponent/tests/Unit/Util/UrlFactoryTest.php index 7e993cffe41..653e2072dd5 100644 --- a/src/LiveComponent/tests/Unit/Util/UrlFactoryTest.php +++ b/src/LiveComponent/tests/Unit/Util/UrlFactoryTest.php @@ -127,7 +127,7 @@ public function testCreate( $this->assertEquals($expectedUrl, $newUrl); } - public function testResourceNotFoundException(): void + public function testResourceNotFoundException() { $previousUrl = '/foo/bar'; $router = $this->createMock(RouterInterface::class); @@ -140,7 +140,7 @@ public function testResourceNotFoundException(): void $this->assertNull($factory->createFromPreviousAndProps($previousUrl, [], [])); } - public function testMissingMandatoryParametersException(): void + public function testMissingMandatoryParametersException() { $previousUrl = '/foo/bar'; $matchedRouteName = 'foo_bar'; diff --git a/src/Map/doc/index.rst b/src/Map/doc/index.rst index b8bf0340e07..1fdfd499278 100644 --- a/src/Map/doc/index.rst +++ b/src/Map/doc/index.rst @@ -56,7 +56,7 @@ Renderer .. tip:: Read the `Symfony UX Map Leaflet bridge docs`_ and the - `Symfony UX Map Google Maps brige docs`_ to learn about the configuration + `Symfony UX Map Google Maps bridge docs`_ to learn about the configuration options available for each renderer. Create a map @@ -564,7 +564,7 @@ Then, you can use this controller in your template: .. tip:: Read the `Symfony UX Map Leaflet bridge docs`_ and the - `Symfony UX Map Google Maps brige docs`_ to learn about the exact code + `Symfony UX Map Google Maps bridge docs`_ to learn about the exact code needed to customize the markers. Advanced: Low-level options @@ -852,7 +852,7 @@ https://symfony.com/doc/current/contributing/code/bc.html .. _`the Symfony UX initiative`: https://ux.symfony.com/ .. _`Google Maps`: https://github.com/symfony/ux-google-map .. _`Leaflet`: https://github.com/symfony/ux-leaflet-map -.. _`Symfony UX Map Google Maps brige docs`: https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Google/README.md +.. _`Symfony UX Map Google Maps bridge docs`: https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Google/README.md .. _`Symfony UX Map Leaflet bridge docs`: https://github.com/symfony/ux/blob/2.x/src/Map/src/Bridge/Leaflet/README.md .. _`Twig Component`: https://symfony.com/bundles/ux-twig-component/current/index.html .. _`Live Actions`: https://symfony.com/bundles/ux-live-component/current/index.html#actions diff --git a/src/Map/src/Bridge/Google/tests/GoogleOptionsTest.php b/src/Map/src/Bridge/Google/tests/GoogleOptionsTest.php index b5ed565dae0..5c64a3b2a72 100644 --- a/src/Map/src/Bridge/Google/tests/GoogleOptionsTest.php +++ b/src/Map/src/Bridge/Google/tests/GoogleOptionsTest.php @@ -19,7 +19,7 @@ class GoogleOptionsTest extends TestCase { - public function testWithMinimalConfiguration(): void + public function testWithMinimalConfiguration() { $options = new GoogleOptions(); @@ -47,7 +47,7 @@ public function testWithMinimalConfiguration(): void self::assertEquals($options, GoogleOptions::fromArray($options->toArray())); } - public function testWithMinimalConfigurationAndWithoutControls(): void + public function testWithMinimalConfigurationAndWithoutControls() { $options = new GoogleOptions( mapId: 'abcdefgh12345678', diff --git a/src/Map/src/Bridge/Google/tests/Option/ControlPositionTest.php b/src/Map/src/Bridge/Google/tests/Option/ControlPositionTest.php index 71ef62e1167..ec462807069 100644 --- a/src/Map/src/Bridge/Google/tests/Option/ControlPositionTest.php +++ b/src/Map/src/Bridge/Google/tests/Option/ControlPositionTest.php @@ -16,7 +16,7 @@ class ControlPositionTest extends TestCase { - public function testEnumValues(): void + public function testEnumValues() { self::assertSame(24, ControlPosition::BLOCK_END_INLINE_CENTER->value); self::assertSame(25, ControlPosition::BLOCK_END_INLINE_END->value); diff --git a/src/Map/src/Bridge/Google/tests/Option/FullscreenControlOptionsTest.php b/src/Map/src/Bridge/Google/tests/Option/FullscreenControlOptionsTest.php index 3de7164df68..af60f0eb737 100644 --- a/src/Map/src/Bridge/Google/tests/Option/FullscreenControlOptionsTest.php +++ b/src/Map/src/Bridge/Google/tests/Option/FullscreenControlOptionsTest.php @@ -17,7 +17,7 @@ class FullscreenControlOptionsTest extends TestCase { - public function testToArray(): void + public function testToArray() { $options = new FullscreenControlOptions( position: ControlPosition::BLOCK_END_INLINE_CENTER diff --git a/src/Map/src/Bridge/Google/tests/Option/GestureHandlingTest.php b/src/Map/src/Bridge/Google/tests/Option/GestureHandlingTest.php index c6a1b6b9930..577fa10e9da 100644 --- a/src/Map/src/Bridge/Google/tests/Option/GestureHandlingTest.php +++ b/src/Map/src/Bridge/Google/tests/Option/GestureHandlingTest.php @@ -16,7 +16,7 @@ class GestureHandlingTest extends TestCase { - public function testEnumValues(): void + public function testEnumValues() { self::assertSame('cooperative', GestureHandling::COOPERATIVE->value); self::assertSame('greedy', GestureHandling::GREEDY->value); diff --git a/src/Map/src/Bridge/Google/tests/Option/MapTypeControlOptionsTest.php b/src/Map/src/Bridge/Google/tests/Option/MapTypeControlOptionsTest.php index fbc5ea19e81..9329f4677da 100644 --- a/src/Map/src/Bridge/Google/tests/Option/MapTypeControlOptionsTest.php +++ b/src/Map/src/Bridge/Google/tests/Option/MapTypeControlOptionsTest.php @@ -18,7 +18,7 @@ class MapTypeControlOptionsTest extends TestCase { - public function testToArray(): void + public function testToArray() { $options = new MapTypeControlOptions( mapTypeIds: ['satellite', 'hybrid'], diff --git a/src/Map/src/Bridge/Google/tests/Option/MapTypeControlStyleTest.php b/src/Map/src/Bridge/Google/tests/Option/MapTypeControlStyleTest.php index 43818e932ca..ae83c22ffc0 100644 --- a/src/Map/src/Bridge/Google/tests/Option/MapTypeControlStyleTest.php +++ b/src/Map/src/Bridge/Google/tests/Option/MapTypeControlStyleTest.php @@ -16,7 +16,7 @@ class MapTypeControlStyleTest extends TestCase { - public function testEnumValues(): void + public function testEnumValues() { self::assertSame(0, MapTypeControlStyle::DEFAULT->value); self::assertSame(2, MapTypeControlStyle::DROPDOWN_MENU->value); diff --git a/src/Map/src/Bridge/Google/tests/Option/StreetViewControlOptionsTest.php b/src/Map/src/Bridge/Google/tests/Option/StreetViewControlOptionsTest.php index 5cf0742b006..3f23a05664e 100644 --- a/src/Map/src/Bridge/Google/tests/Option/StreetViewControlOptionsTest.php +++ b/src/Map/src/Bridge/Google/tests/Option/StreetViewControlOptionsTest.php @@ -17,7 +17,7 @@ class StreetViewControlOptionsTest extends TestCase { - public function testToArray(): void + public function testToArray() { $options = new StreetViewControlOptions( position: ControlPosition::INLINE_END_BLOCK_CENTER diff --git a/src/Map/src/Bridge/Google/tests/Option/ZoomControlOptionsTest.php b/src/Map/src/Bridge/Google/tests/Option/ZoomControlOptionsTest.php index 929c960d432..33bc387f016 100644 --- a/src/Map/src/Bridge/Google/tests/Option/ZoomControlOptionsTest.php +++ b/src/Map/src/Bridge/Google/tests/Option/ZoomControlOptionsTest.php @@ -17,7 +17,7 @@ class ZoomControlOptionsTest extends TestCase { - public function testToArray(): void + public function testToArray() { $options = new ZoomControlOptions( position: ControlPosition::BLOCK_START_INLINE_END, diff --git a/src/Map/src/Bridge/Leaflet/tests/LeafletOptionsTest.php b/src/Map/src/Bridge/Leaflet/tests/LeafletOptionsTest.php index 14a5822ff1d..6cd34f44eda 100644 --- a/src/Map/src/Bridge/Leaflet/tests/LeafletOptionsTest.php +++ b/src/Map/src/Bridge/Leaflet/tests/LeafletOptionsTest.php @@ -17,7 +17,7 @@ class LeafletOptionsTest extends TestCase { - public function testWithMinimalConfiguration(): void + public function testWithMinimalConfiguration() { $leafletOptions = new LeafletOptions(); @@ -43,7 +43,7 @@ public function testWithMinimalConfiguration(): void self::assertEquals($leafletOptions, LeafletOptions::fromArray($leafletOptions->toArray())); } - public function testWithMaximumConfiguration(): void + public function testWithMaximumConfiguration() { $leafletOptions = new LeafletOptions( tileLayer: new TileLayer( @@ -85,7 +85,7 @@ public function testWithMaximumConfiguration(): void self::assertEquals($leafletOptions, LeafletOptions::fromArray($leafletOptions->toArray())); } - public function testWithTileLayerFalse(): void + public function testWithTileLayerFalse() { $leafletOptions = new LeafletOptions(tileLayer: false); @@ -107,7 +107,7 @@ public function testWithTileLayerFalse(): void self::assertEquals($leafletOptions, LeafletOptions::fromArray($leafletOptions->toArray())); } - public function testWithoutControls(): void + public function testWithoutControls() { $leafletOptions = new LeafletOptions( attributionControl: false, diff --git a/src/Map/src/Bridge/Leaflet/tests/Option/AttributionControlOptionsTest.php b/src/Map/src/Bridge/Leaflet/tests/Option/AttributionControlOptionsTest.php index 05b914deacc..63fa3045cd0 100644 --- a/src/Map/src/Bridge/Leaflet/tests/Option/AttributionControlOptionsTest.php +++ b/src/Map/src/Bridge/Leaflet/tests/Option/AttributionControlOptionsTest.php @@ -17,7 +17,7 @@ class AttributionControlOptionsTest extends TestCase { - public function testToArray(): void + public function testToArray() { $options = new AttributionControlOptions(); @@ -27,7 +27,7 @@ public function testToArray(): void ], $options->toArray()); } - public function testToArrayWithDifferentConfiguration(): void + public function testToArrayWithDifferentConfiguration() { $options = new AttributionControlOptions( position: ControlPosition::BOTTOM_LEFT, diff --git a/src/Map/src/Bridge/Leaflet/tests/Option/ZoomControlOptionsTest.php b/src/Map/src/Bridge/Leaflet/tests/Option/ZoomControlOptionsTest.php index e21ac360ffd..a551909e6d2 100644 --- a/src/Map/src/Bridge/Leaflet/tests/Option/ZoomControlOptionsTest.php +++ b/src/Map/src/Bridge/Leaflet/tests/Option/ZoomControlOptionsTest.php @@ -17,7 +17,7 @@ class ZoomControlOptionsTest extends TestCase { - public function testToArray(): void + public function testToArray() { $options = new ZoomControlOptions( position: ControlPosition::TOP_LEFT, diff --git a/src/Map/tests/Distance/DistanceCalculatorTest.php b/src/Map/tests/Distance/DistanceCalculatorTest.php index 3f6c982a165..5c7b9742d09 100644 --- a/src/Map/tests/Distance/DistanceCalculatorTest.php +++ b/src/Map/tests/Distance/DistanceCalculatorTest.php @@ -21,7 +21,7 @@ class DistanceCalculatorTest extends TestCase { - public function testCalculateDistanceUseCalculator(): void + public function testCalculateDistanceUseCalculator() { $calculator = new class implements DistanceCalculatorInterface { public function calculateDistance(Point $point1, Point $point2): float @@ -41,7 +41,7 @@ public function calculateDistance(Point $point1, Point $point2): float * * @dataProvider distanceAccuracyProvider */ - public function testAccuracyAgainstVincenty(Point $point1, Point $point2, float $tolerance): void + public function testAccuracyAgainstVincenty(Point $point1, Point $point2, float $tolerance) { $vincenty = new VincentyDistanceCalculator(); $referenceDistance = $vincenty->calculateDistance($point1, $point2); diff --git a/src/Map/tests/Distance/DistanceUnitTest.php b/src/Map/tests/Distance/DistanceUnitTest.php index f33b985de1a..c6d8b1a057b 100644 --- a/src/Map/tests/Distance/DistanceUnitTest.php +++ b/src/Map/tests/Distance/DistanceUnitTest.php @@ -33,7 +33,7 @@ public function testConversionFactorToMeterIsSameAsConversionFactor() /** * @dataProvider provideConvertedUnits */ - public function testConversionFactorFrom(DistanceUnit $unit, DistanceUnit $otherUnit, float $expected): void + public function testConversionFactorFrom(DistanceUnit $unit, DistanceUnit $otherUnit, float $expected) { $this->assertEqualsWithDelta($expected, $unit->getConversionFactorFrom($otherUnit), 0.001); } diff --git a/src/Map/tests/IconTest.php b/src/Map/tests/IconTest.php index 35ddeb943fb..68c42cf1b35 100644 --- a/src/Map/tests/IconTest.php +++ b/src/Map/tests/IconTest.php @@ -43,7 +43,7 @@ public static function provideIcons(): iterable * * @param class-string $expectedInstance */ - public function testIconConstruction(Icon $icon, string $expectedInstance, array $expectedToArray): void + public function testIconConstruction(Icon $icon, string $expectedInstance, array $expectedToArray) { self::assertInstanceOf($expectedInstance, $icon); } @@ -51,7 +51,7 @@ public function testIconConstruction(Icon $icon, string $expectedInstance, array /** * @dataProvider provideIcons */ - public function testToArray(Icon $icon, string $expectedInstance, array $expectedToArray): void + public function testToArray(Icon $icon, string $expectedInstance, array $expectedToArray) { self::assertSame($expectedToArray, $icon->toArray()); } @@ -59,7 +59,7 @@ public function testToArray(Icon $icon, string $expectedInstance, array $expecte /** * @dataProvider provideIcons */ - public function testFromArray(Icon $icon, string $expectedInstance, array $expectedToArray): void + public function testFromArray(Icon $icon, string $expectedInstance, array $expectedToArray) { self::assertEquals($icon, Icon::fromArray($expectedToArray)); } @@ -87,7 +87,7 @@ public static function dataProviderForTestSvgIconCustomizationMethodsCanNotBeCal /** * @dataProvider dataProviderForTestSvgIconCustomizationMethodsCanNotBeCalled */ - public function testSvgIconCustomizationMethodsCanNotBeCalled(string $method, mixed ...$args): void + public function testSvgIconCustomizationMethodsCanNotBeCalled(string $method, mixed ...$args) { $this->expectException(\LogicException::class); if (\in_array($method, ['width', 'height'], true)) { diff --git a/src/Map/tests/InfoWindowTest.php b/src/Map/tests/InfoWindowTest.php index 12c11f9b7af..0ef677ea64c 100644 --- a/src/Map/tests/InfoWindowTest.php +++ b/src/Map/tests/InfoWindowTest.php @@ -17,7 +17,7 @@ class InfoWindowTest extends TestCase { - public function testToArray(): void + public function testToArray() { $infoWindow = new InfoWindow( headerContent: 'Paris', diff --git a/src/Map/tests/MapFactoryTest.php b/src/Map/tests/MapFactoryTest.php index 25194376f96..834c4f506dc 100644 --- a/src/Map/tests/MapFactoryTest.php +++ b/src/Map/tests/MapFactoryTest.php @@ -30,7 +30,7 @@ protected function tearDown(): void DummyOptions::unregisterFromNormalizer(); } - public function testFromArray(): void + public function testFromArray() { $array = self::createMapArray(); $map = Map::fromArray($array); @@ -62,7 +62,7 @@ public function testFromArray(): void $this->assertSame($array['polylines'][0]['infoWindow']['content'], $polylines[0]['infoWindow']['content']); } - public function testToArrayFromArray(): void + public function testToArrayFromArray() { $map = (new Map()) ->center(new Point(48.8566, 2.3522)) @@ -95,7 +95,7 @@ public function testToArrayFromArray(): void $this->assertEquals($map->toArray(), $newMap->toArray()); } - public function testFromArrayWithInvalidCenter(): void + public function testFromArrayWithInvalidCenter() { $array = self::createMapArray(); $array['center'] = 'invalid'; @@ -104,7 +104,7 @@ public function testFromArrayWithInvalidCenter(): void Map::fromArray($array); } - public function testFromArrayWithInvalidZoom(): void + public function testFromArrayWithInvalidZoom() { $array = self::createMapArray(); $array['zoom'] = 'invalid'; @@ -113,7 +113,7 @@ public function testFromArrayWithInvalidZoom(): void Map::fromArray($array); } - public function testFromArrayWithInvalidMarkers(): void + public function testFromArrayWithInvalidMarkers() { $array = self::createMapArray(); $array['markers'] = 'invalid'; @@ -123,7 +123,7 @@ public function testFromArrayWithInvalidMarkers(): void Map::fromArray($array); } - public function testFromArrayWithInvalidMarker(): void + public function testFromArrayWithInvalidMarker() { $array = self::createMapArray(); $array['markers'] = [ @@ -137,7 +137,7 @@ public function testFromArrayWithInvalidMarker(): void Map::fromArray($array); } - public function testFromArrayWithInvalidPolygons(): void + public function testFromArrayWithInvalidPolygons() { $array = self::createMapArray(); $array['polygons'] = 'invalid'; @@ -147,7 +147,7 @@ public function testFromArrayWithInvalidPolygons(): void Map::fromArray($array); } - public function testFromArrayWithInvalidPolygon(): void + public function testFromArrayWithInvalidPolygon() { $array = self::createMapArray(); $array['polygons'] = [ @@ -161,7 +161,7 @@ public function testFromArrayWithInvalidPolygon(): void Map::fromArray($array); } - public function testFromArrayWithInvalidPolylines(): void + public function testFromArrayWithInvalidPolylines() { $array = self::createMapArray(); $array['polylines'] = 'invalid'; @@ -171,7 +171,7 @@ public function testFromArrayWithInvalidPolylines(): void Map::fromArray($array); } - public function testFromArrayWithInvalidPolyline(): void + public function testFromArrayWithInvalidPolyline() { $array = self::createMapArray(); $array['polylines'] = [ diff --git a/src/Map/tests/MapOptionsNormalizerTest.php b/src/Map/tests/MapOptionsNormalizerTest.php index 1348a4a464c..aa0bbd6e0b2 100644 --- a/src/Map/tests/MapOptionsNormalizerTest.php +++ b/src/Map/tests/MapOptionsNormalizerTest.php @@ -24,7 +24,7 @@ protected function tearDown(): void DummyOptions::unregisterFromNormalizer(); } - public function testDenormalizingWhenProviderKeyIsMissing(): void + public function testDenormalizingWhenProviderKeyIsMissing() { $this->expectException(UnableToDenormalizeOptionsException::class); $this->expectExceptionMessage(' the provider key "@provider" is missing in the normalized options.'); @@ -32,7 +32,7 @@ public function testDenormalizingWhenProviderKeyIsMissing(): void MapOptionsNormalizer::denormalize([]); } - public function testDenormalizingWhenProviderIsNotSupported(): void + public function testDenormalizingWhenProviderIsNotSupported() { $this->expectException(UnableToDenormalizeOptionsException::class); $this->expectExceptionMessage(' the provider "foo" is not supported. Supported providers are "google", "leaflet".'); @@ -40,7 +40,7 @@ public function testDenormalizingWhenProviderIsNotSupported(): void MapOptionsNormalizer::denormalize(['@provider' => 'foo']); } - public function testDenormalizingAndNormalizing(): void + public function testDenormalizingAndNormalizing() { DummyOptions::registerToNormalizer(); diff --git a/src/Map/tests/MapTest.php b/src/Map/tests/MapTest.php index c5018d45a4d..f88cec82630 100644 --- a/src/Map/tests/MapTest.php +++ b/src/Map/tests/MapTest.php @@ -34,7 +34,7 @@ protected function tearDown(): void DummyOptions::unregisterFromNormalizer(); } - public function testCenterValidation(): void + public function testCenterValidation() { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage('The map "center" must be explicitly set when not enabling "fitBoundsToMarkers" feature.'); @@ -43,7 +43,7 @@ public function testCenterValidation(): void $map->toArray(); } - public function testZoomValidation(): void + public function testZoomValidation() { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage('The map "zoom" must be explicitly set when not enabling "fitBoundsToMarkers" feature.'); @@ -54,7 +54,7 @@ public function testZoomValidation(): void $map->toArray(); } - public function testZoomAndCenterCanBeOmittedIfFitBoundsToMarkers(): void + public function testZoomAndCenterCanBeOmittedIfFitBoundsToMarkers() { $map = new Map( fitBoundsToMarkers: true @@ -78,7 +78,7 @@ public function testZoomAndCenterCanBeOmittedIfFitBoundsToMarkers(): void ], $array); } - public function testWithMinimumConfiguration(): void + public function testWithMinimumConfiguration() { $map = new Map(); $map @@ -103,7 +103,7 @@ public function testWithMinimumConfiguration(): void ], $array); } - public function testWithMaximumConfiguration(): void + public function testWithMaximumConfiguration() { $map = new Map(); $map @@ -432,7 +432,7 @@ public function testWithMaximumConfiguration(): void * [null, 5, 2, "The \"zoom\" must be less than or equal to \"maxZoom\"."] * [2.1, null, 2.0, "The \"minZoom\" must be less than or equal to \"maxZoom\"."] */ - public function testZoomsValidation(?float $minZoom, ?float $zoom, ?float $maxZoom, string $expectedExceptionMessage): void + public function testZoomsValidation(?float $minZoom, ?float $zoom, ?float $maxZoom, string $expectedExceptionMessage) { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage($expectedExceptionMessage); diff --git a/src/Map/tests/MarkerTest.php b/src/Map/tests/MarkerTest.php index db1ae73bd2b..c9c886bbd7e 100644 --- a/src/Map/tests/MarkerTest.php +++ b/src/Map/tests/MarkerTest.php @@ -19,7 +19,7 @@ class MarkerTest extends TestCase { - public function testToArray(): void + public function testToArray() { $marker = new Marker( position: new Point(48.8566, 2.3522), diff --git a/src/Map/tests/PointTest.php b/src/Map/tests/PointTest.php index 2032680694f..2d33e1d4a9d 100644 --- a/src/Map/tests/PointTest.php +++ b/src/Map/tests/PointTest.php @@ -28,7 +28,7 @@ public static function provideInvalidPoint(): iterable /** * @dataProvider provideInvalidPoint */ - public function testInvalidPoint(float $latitude, float $longitude, string $expectedExceptionMessage): void + public function testInvalidPoint(float $latitude, float $longitude, string $expectedExceptionMessage) { self::expectException(InvalidArgumentException::class); self::expectExceptionMessage($expectedExceptionMessage); @@ -36,21 +36,21 @@ public function testInvalidPoint(float $latitude, float $longitude, string $expe new Point($latitude, $longitude); } - public function testGetLatitude(): void + public function testGetLatitude() { $point = new Point(48.8566, 2.3533); self::assertSame(48.8566, $point->getLatitude()); } - public function testGetLongitude(): void + public function testGetLongitude() { $point = new Point(48.8566, 2.3533); self::assertSame(2.3533, $point->getLongitude()); } - public function testToArray(): void + public function testToArray() { $point = new Point(48.8566, 2.3533); diff --git a/src/Map/tests/Renderer/NullRendererTest.php b/src/Map/tests/Renderer/NullRendererTest.php index f026c3f11ae..f46d36efd4a 100644 --- a/src/Map/tests/Renderer/NullRendererTest.php +++ b/src/Map/tests/Renderer/NullRendererTest.php @@ -44,7 +44,7 @@ public function provideTestRenderMap(): iterable /** * @dataProvider provideTestRenderMap */ - public function testRenderMap(string $expectedExceptionMessage, RendererInterface $renderer): void + public function testRenderMap(string $expectedExceptionMessage, RendererInterface $renderer) { self::expectException(LogicException::class); self::expectExceptionMessage($expectedExceptionMessage); diff --git a/src/Map/tests/Renderer/RendererTest.php b/src/Map/tests/Renderer/RendererTest.php index 4c4a8595806..9990dc1da89 100644 --- a/src/Map/tests/Renderer/RendererTest.php +++ b/src/Map/tests/Renderer/RendererTest.php @@ -19,7 +19,7 @@ final class RendererTest extends TestCase { - public function testUnsupportedSchemeException(): void + public function testUnsupportedSchemeException() { self::expectException(UnsupportedSchemeException::class); self::expectExceptionMessage('The renderer "scheme" is not supported.'); @@ -28,7 +28,7 @@ public function testUnsupportedSchemeException(): void $renderer->fromString('scheme://default'); } - public function testSupportedFactory(): void + public function testSupportedFactory() { $renderer = new Renderer([ 'one' => $oneFactory = self::createMock(RendererFactoryInterface::class), diff --git a/src/Map/tests/Renderer/RenderersTest.php b/src/Map/tests/Renderer/RenderersTest.php index 845828761f9..a8e6fae6ab2 100644 --- a/src/Map/tests/Renderer/RenderersTest.php +++ b/src/Map/tests/Renderer/RenderersTest.php @@ -21,7 +21,7 @@ class RenderersTest extends TestCase { - public function testConstructWithoutRenderers(): void + public function testConstructWithoutRenderers() { self::expectException(LogicException::class); self::expectExceptionMessage('"Symfony\UX\Map\Renderer\Renderers" must have at least one renderer configured.'); @@ -29,7 +29,7 @@ public function testConstructWithoutRenderers(): void new Renderers([]); } - public function testRenderMapWithDefaultRenderer(): void + public function testRenderMapWithDefaultRenderer() { $defaultRenderer = $this->createMock(RendererInterface::class); $defaultRenderer->expects(self::once())->method('renderMap')->willReturn('
'); @@ -39,7 +39,7 @@ public function testRenderMapWithDefaultRenderer(): void self::assertSame('
', $renderers->renderMap(new Map())); } - public function testRenderMapWithCustomRenderer(): void + public function testRenderMapWithCustomRenderer() { $defaultRenderer = $this->createMock(RendererInterface::class); $defaultRenderer->expects(self::never())->method('renderMap'); @@ -54,7 +54,7 @@ public function testRenderMapWithCustomRenderer(): void self::assertSame('
', $renderers->renderMap($map)); } - public function testRenderMapWithUnknownRenderer(): void + public function testRenderMapWithUnknownRenderer() { self::expectException(LogicException::class); self::expectExceptionMessage('The "unknown" renderer does not exist (available renderers: "default").'); diff --git a/src/Map/tests/Twig/MapComponentTest.php b/src/Map/tests/Twig/MapComponentTest.php index 031fd9293a3..fa57a47e107 100644 --- a/src/Map/tests/Twig/MapComponentTest.php +++ b/src/Map/tests/Twig/MapComponentTest.php @@ -24,7 +24,7 @@ protected static function getKernelClass(): string return TwigComponentKernel::class; } - public function testRenderMapComponent(): void + public function testRenderMapComponent() { $map = (new Map()) ->center(new Point(latitude: 5, longitude: 10)) diff --git a/src/Map/tests/Twig/MapExtensionTest.php b/src/Map/tests/Twig/MapExtensionTest.php index 9e7c2b45b6e..e3a1bf63f3e 100644 --- a/src/Map/tests/Twig/MapExtensionTest.php +++ b/src/Map/tests/Twig/MapExtensionTest.php @@ -30,7 +30,7 @@ protected static function getKernelClass(): string return TwigAppKernel::class; } - public function testExtensionIsRegistered(): void + public function testExtensionIsRegistered() { /** @var Environment $twig */ $twig = self::getContainer()->get('twig'); @@ -39,7 +39,7 @@ public function testExtensionIsRegistered(): void $this->assertInstanceOf(MapExtension::class, $twig->getExtension(MapExtension::class)); } - public function testRuntimeIsRegistered(): void + public function testRuntimeIsRegistered() { /** @var Environment $twig */ $twig = self::getContainer()->get('twig'); @@ -47,7 +47,7 @@ public function testRuntimeIsRegistered(): void $this->assertInstanceOf(MapRuntime::class, $twig->getRuntime(MapRuntime::class)); } - public function testMapFunctionWithArray(): void + public function testMapFunctionWithArray() { $map = (new Map()) ->center(new Point(latitude: 5, longitude: 10)) diff --git a/src/Map/tests/TwigTest.php b/src/Map/tests/TwigTest.php index b69da03401b..c3e4a7f8530 100644 --- a/src/Map/tests/TwigTest.php +++ b/src/Map/tests/TwigTest.php @@ -25,7 +25,7 @@ protected static function getKernelClass(): string return TwigAppKernel::class; } - public function testRenderMap(): void + public function testRenderMap() { $map = new Map(); $attributes = ['data-foo' => 'bar']; diff --git a/src/Map/tests/UXMapBundleTest.php b/src/Map/tests/UXMapBundleTest.php index 169b890deed..dd385a2f6a3 100644 --- a/src/Map/tests/UXMapBundleTest.php +++ b/src/Map/tests/UXMapBundleTest.php @@ -35,7 +35,7 @@ public static function provideKernelClasses(): iterable * * @param class-string $kernelClass */ - public function testBootKernel(string $kernelClass): void + public function testBootKernel(string $kernelClass) { $kernel = new $kernelClass('test', true); $kernel->boot(); @@ -48,7 +48,7 @@ public function testBootKernel(string $kernelClass): void * * @param class-string $kernelClass */ - public function testNullRendererAsDefault(string $kernelClass): void + public function testNullRendererAsDefault(string $kernelClass) { $expectedRenderer = new NullRenderer(['symfony/ux-google-map', 'symfony/ux-leaflet-map']); diff --git a/src/Map/tests/Utils/CoordinateUtilsTest.php b/src/Map/tests/Utils/CoordinateUtilsTest.php index e7ac82dcf79..bb1e66e7633 100644 --- a/src/Map/tests/Utils/CoordinateUtilsTest.php +++ b/src/Map/tests/Utils/CoordinateUtilsTest.php @@ -15,31 +15,31 @@ class CoordinateUtilsTest extends TestCase { - public function testDecimalToDMSConvertsCorrectly(): void + public function testDecimalToDMSConvertsCorrectly() { $result = CoordinateUtils::decimalToDMS(48.8588443); $this->assertSame([48, 51, 31.83948], $result); } - public function testDecimalToDMSHandlesNegativeValues(): void + public function testDecimalToDMSHandlesNegativeValues() { $result = CoordinateUtils::decimalToDMS(-48.8588443); $this->assertSame([-48, 51, 31.83948], $result); } - public function testDMSToDecimalConvertsCorrectly(): void + public function testDMSToDecimalConvertsCorrectly() { $result = CoordinateUtils::DMSToDecimal(48, 51, 31.8388); $this->assertSame(48.858844, $result); } - public function testDMSToDecimalHandlesNegativeValues(): void + public function testDMSToDecimalHandlesNegativeValues() { $result = CoordinateUtils::DMSToDecimal(-48, 51, 31.8388); $this->assertSame(-48.858844, $result); } - public function testDMSToDecimalHandlesZeroValues(): void + public function testDMSToDecimalHandlesZeroValues() { $result = CoordinateUtils::DMSToDecimal(0, 0, 0.0); $this->assertSame(0.0, $result); diff --git a/src/StimulusBundle/tests/Dto/StimulusAttributesTest.php b/src/StimulusBundle/tests/Dto/StimulusAttributesTest.php index be252c2863f..9240146fa16 100644 --- a/src/StimulusBundle/tests/Dto/StimulusAttributesTest.php +++ b/src/StimulusBundle/tests/Dto/StimulusAttributesTest.php @@ -25,21 +25,21 @@ protected function setUp(): void $this->stimulusAttributes = new StimulusAttributes(new Environment(new ArrayLoader())); } - public function testAddAction(): void + public function testAddAction() { $this->stimulusAttributes->addAction('foo', 'bar', 'baz', ['qux' => '"']); $attributesHtml = (string) $this->stimulusAttributes; self::assertSame('data-action="baz->foo#bar" data-foo-qux-param="""', $attributesHtml); } - public function testAddActionToArrayNoEscapingAttributeValues(): void + public function testAddActionToArrayNoEscapingAttributeValues() { $this->stimulusAttributes->addAction('foo', 'bar', 'baz', ['qux' => '"']); $attributesArray = $this->stimulusAttributes->toArray(); self::assertSame(['data-action' => 'baz->foo#bar', 'data-foo-qux-param' => '"'], $attributesArray); } - public function testAddActionWithMultiple(): void + public function testAddActionWithMultiple() { $this->stimulusAttributes->addAction('my-controller', 'onClick'); $this->assertSame('data-action="my-controller#onClick"', (string) $this->stimulusAttributes); @@ -52,7 +52,7 @@ public function testAddActionWithMultiple(): void ); } - public function testAddControllerToStringEscapingAttributeValues(): void + public function testAddControllerToStringEscapingAttributeValues() { $this->stimulusAttributes->addController('foo', ['bar' => '"'], ['baz' => '"']); $attributesHtml = (string) $this->stimulusAttributes; @@ -64,7 +64,7 @@ public function testAddControllerToStringEscapingAttributeValues(): void ); } - public function testAddControllerToArrayNoEscapingAttributeValues(): void + public function testAddControllerToArrayNoEscapingAttributeValues() { $this->stimulusAttributes->addController('foo', ['bar' => '"'], ['baz' => '"']); $attributesArray = $this->stimulusAttributes->toArray(); @@ -101,21 +101,21 @@ public function testAddControllerNormalizesControllerName() ); } - public function testAddTargetToStringEscapingAttributeValues(): void + public function testAddTargetToStringEscapingAttributeValues() { $this->stimulusAttributes->addTarget('foo', '"'); $attributesHtml = (string) $this->stimulusAttributes; self::assertSame('data-foo-target="""', $attributesHtml); } - public function testAddTargetToArrayNoEscapingAttributeValues(): void + public function testAddTargetToArrayNoEscapingAttributeValues() { $this->stimulusAttributes->addTarget('foo', '"'); $attributesArray = $this->stimulusAttributes->toArray(); self::assertSame(['data-foo-target' => '"'], $attributesArray); } - public function testAddTargetWithMultiple(): void + public function testAddTargetWithMultiple() { $this->stimulusAttributes->addTarget('my-controller', 'myTarget'); $this->assertSame('data-my-controller-target="myTarget"', (string) $this->stimulusAttributes); @@ -152,7 +152,7 @@ public function testAddAttribute() /** * @dataProvider provideAddComplexActionData */ - public function testAddComplexAction(string $controllerName, string $actionName, ?string $eventName, string $expectedAction): void + public function testAddComplexAction(string $controllerName, string $actionName, ?string $eventName, string $expectedAction) { $this->stimulusAttributes->addAction($controllerName, $actionName, $eventName); $attributesHtml = (string) $this->stimulusAttributes; diff --git a/src/StimulusBundle/tests/Helper/StimulusHelperTest.php b/src/StimulusBundle/tests/Helper/StimulusHelperTest.php index 711ac2bfdcf..ba2f6f384e0 100644 --- a/src/StimulusBundle/tests/Helper/StimulusHelperTest.php +++ b/src/StimulusBundle/tests/Helper/StimulusHelperTest.php @@ -18,7 +18,7 @@ final class StimulusHelperTest extends TestCase { - public function testCreateStimulusAttributes(): void + public function testCreateStimulusAttributes() { $helper = new StimulusHelper($this->createMock(Environment::class)); $attributes = $helper->createStimulusAttributes(); diff --git a/src/StimulusBundle/tests/Twig/StimulusTwigExtensionTest.php b/src/StimulusBundle/tests/Twig/StimulusTwigExtensionTest.php index 0e8cdbf8893..c7a0b142d94 100644 --- a/src/StimulusBundle/tests/Twig/StimulusTwigExtensionTest.php +++ b/src/StimulusBundle/tests/Twig/StimulusTwigExtensionTest.php @@ -32,7 +32,7 @@ protected function setUp(): void /** * @dataProvider provideRenderStimulusController */ - public function testRenderStimulusController(string $controllerName, array $controllerValues, array $controllerClasses, array $controllerOutlets, string $expectedString, array $expectedArray): void + public function testRenderStimulusController(string $controllerName, array $controllerValues, array $controllerClasses, array $controllerOutlets, string $expectedString, array $expectedArray) { $extension = new StimulusTwigExtension(new StimulusHelper($this->twig)); $dto = $extension->renderStimulusController($controllerName, $controllerValues, $controllerClasses, $controllerOutlets); @@ -130,7 +130,7 @@ public static function provideRenderStimulusController(): iterable ]; } - public function testAppendStimulusController(): void + public function testAppendStimulusController() { $extension = new StimulusTwigExtension(new StimulusHelper($this->twig)); $dto = $extension->renderStimulusController('my-controller', ['myValue' => 'scalar-value']); @@ -143,7 +143,7 @@ public function testAppendStimulusController(): void /** * @dataProvider provideRenderStimulusAction */ - public function testRenderStimulusAction(string $controllerName, ?string $actionName, ?string $eventName, array $parameters, string $expectedString, array $expectedArray): void + public function testRenderStimulusAction(string $controllerName, ?string $actionName, ?string $eventName, array $parameters, string $expectedString, array $expectedArray) { $extension = new StimulusTwigExtension(new StimulusHelper($this->twig)); $dto = $extension->renderStimulusAction($controllerName, $actionName, $eventName, $parameters); @@ -208,7 +208,7 @@ public static function provideRenderStimulusAction(): iterable ]; } - public function testAppendStimulusAction(): void + public function testAppendStimulusAction() { $extension = new StimulusTwigExtension(new StimulusHelper($this->twig)); $dto = $extension->renderStimulusAction('my-controller', 'onClick', 'click'); @@ -246,7 +246,7 @@ public static function provideRenderStimulusTarget(): iterable ]; } - public function testAppendStimulusTarget(): void + public function testAppendStimulusTarget() { $extension = new StimulusTwigExtension(new StimulusHelper($this->twig)); $dto = $extension->renderStimulusTarget('my-controller', 'myTarget'); diff --git a/src/Swup/doc/index.rst b/src/Swup/doc/index.rst index 4a69ca79eac..b74cb242fa1 100644 --- a/src/Swup/doc/index.rst +++ b/src/Swup/doc/index.rst @@ -174,7 +174,7 @@ Stimulus controller: } _onConnect(event) { - // Swup has just been intialized and you can access details from the event + // Swup has just been initialized and you can access details from the event console.log(event.detail.swup); // Swup instance console.log(event.detail.options); // Options used to initialize Swup } diff --git a/src/TogglePassword/tests/Form/TogglePasswordTypeTest.php b/src/TogglePassword/tests/Form/TogglePasswordTypeTest.php index 5864a7baf3d..a691befb006 100644 --- a/src/TogglePassword/tests/Form/TogglePasswordTypeTest.php +++ b/src/TogglePassword/tests/Form/TogglePasswordTypeTest.php @@ -19,7 +19,7 @@ class TogglePasswordTypeTest extends TestCase { - public function testRenderFormWithToggle(): void + public function testRenderFormWithToggle() { $container = $this->givenServiceContainer(); $form = $container->get(FormFactoryInterface::class)->createBuilder() @@ -32,7 +32,7 @@ public function testRenderFormWithToggle(): void self::assertStringContainsString('
givenServiceContainer(); $form = $container->get(FormFactoryInterface::class)->createBuilder() diff --git a/src/TogglePassword/tests/TogglePasswordBundleTest.php b/src/TogglePassword/tests/TogglePasswordBundleTest.php index da042d6072f..f41eb5008e4 100644 --- a/src/TogglePassword/tests/TogglePasswordBundleTest.php +++ b/src/TogglePassword/tests/TogglePasswordBundleTest.php @@ -21,14 +21,14 @@ */ class TogglePasswordBundleTest extends TestCase { - public function testBootKernel(): void + public function testBootKernel() { $kernel = new TwigAppKernel('test', true); $kernel->boot(); $this->assertArrayHasKey('TogglePasswordBundle', $kernel->getBundles()); } - public function testFormThemeMerging(): void + public function testFormThemeMerging() { $kernel = new TwigAppKernel('test', true); $kernel->boot(); diff --git a/src/Toolkit/src/Installer/PoolResolver.php b/src/Toolkit/src/Installer/PoolResolver.php index 00edbf661f2..385663aa60b 100644 --- a/src/Toolkit/src/Installer/PoolResolver.php +++ b/src/Toolkit/src/Installer/PoolResolver.php @@ -57,7 +57,7 @@ public function resolveForComponent(Kit $kit, Component $component): Pool $pool->addFile($file); } } else { - throw new \RuntimeException(\sprintf('Unknown dependency type: %s', $dependency::class)); + throw new \RuntimeException(\sprintf('Unknown dependency type: "%s"', $dependency::class)); } } } diff --git a/src/Toolkit/tests/AssertTest.php b/src/Toolkit/tests/AssertTest.php index 5294e7dd83d..adafc226b28 100644 --- a/src/Toolkit/tests/AssertTest.php +++ b/src/Toolkit/tests/AssertTest.php @@ -19,7 +19,7 @@ class AssertTest extends TestCase /** * @dataProvider provideValidKitNames */ - public function testValidKitName(string $name): void + public function testValidKitName(string $name) { $this->expectNotToPerformAssertions(); @@ -53,7 +53,7 @@ public static function provideValidKitNames(): \Generator /** * @dataProvider provideInvalidKitNames */ - public function testInvalidKitName(string $name): void + public function testInvalidKitName(string $name) { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('Invalid kit name "%s".', $name)); @@ -85,7 +85,7 @@ public static function provideInvalidKitNames(): \Generator /** * @dataProvider provideValidComponentNames */ - public function testValidComponentName(string $name): void + public function testValidComponentName(string $name) { $this->expectNotToPerformAssertions(); @@ -109,7 +109,7 @@ public static function provideValidComponentNames(): iterable /** * @dataProvider provideInvalidComponentNames */ - public function testInvalidComponentName(string $name): void + public function testInvalidComponentName(string $name) { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('Invalid component name "%s".', $name)); @@ -146,7 +146,7 @@ public static function provideInvalidComponentNames(): iterable /** * @dataProvider provideValidPhpPackageNames */ - public function testValidPhpPackageName(string $name): void + public function testValidPhpPackageName(string $name) { $this->expectNotToPerformAssertions(); @@ -162,7 +162,7 @@ public static function provideValidPhpPackageNames(): iterable /** * @dataProvider provideInvalidPhpPackageNames */ - public function testInvalidPhpPackageName(string $name): void + public function testInvalidPhpPackageName(string $name) { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('Invalid PHP package name "%s".', $name)); @@ -181,7 +181,7 @@ public static function provideInvalidPhpPackageNames(): iterable /** * @dataProvider provideValidStimulusControllerNames */ - public function testValidStimulusControllerName(string $name): void + public function testValidStimulusControllerName(string $name) { $this->expectNotToPerformAssertions(); @@ -199,7 +199,7 @@ public static function provideValidStimulusControllerNames(): iterable /** * @dataProvider provideInvalidStimulusControllerNames */ - public function testInvalidStimulusControllerName(string $name): void + public function testInvalidStimulusControllerName(string $name) { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('Invalid Stimulus controller name "%s".', $name)); diff --git a/src/Toolkit/tests/Asset/ComponentTest.php b/src/Toolkit/tests/Asset/ComponentTest.php index 0b0c903126e..4ef9ebdabff 100644 --- a/src/Toolkit/tests/Asset/ComponentTest.php +++ b/src/Toolkit/tests/Asset/ComponentTest.php @@ -20,7 +20,7 @@ final class ComponentTest extends TestCase { - public function testCanBeInstantiated(): void + public function testCanBeInstantiated() { $component = new Component('Button', [ new File('templates/components/Button/Button.html.twig', 'Button.html.twig'), @@ -33,7 +33,7 @@ public function testCanBeInstantiated(): void $this->assertCount(0, $component->getDependencies()); } - public function testShouldFailIfComponentNameIsInvalid(): void + public function testShouldFailIfComponentNameIsInvalid() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid component name "foobar".'); @@ -43,7 +43,7 @@ public function testShouldFailIfComponentNameIsInvalid(): void ]); } - public function testShouldFailIfComponentHasNoFiles(): void + public function testShouldFailIfComponentHasNoFiles() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('The component "Button" must have at least one file.'); @@ -51,7 +51,7 @@ public function testShouldFailIfComponentHasNoFiles(): void new Component('Button', []); } - public function testCanAddAndGetDependencies(): void + public function testCanAddAndGetDependencies() { $component = new Component('Button', [ new File('templates/components/Button/Button.html.twig', 'Button.html.twig'), @@ -65,7 +65,7 @@ public function testCanAddAndGetDependencies(): void self::assertEquals([$dependency1, $dependency2, $dependency3], $component->getDependencies()); } - public function testShouldNotAddDuplicateComponentDependencies(): void + public function testShouldNotAddDuplicateComponentDependencies() { $component = new Component('Button', [ new File('templates/components/Button/Button.html.twig', 'Button.html.twig'), @@ -80,7 +80,7 @@ public function testShouldNotAddDuplicateComponentDependencies(): void self::assertEquals([$dependency1, $dependency2, $dependency4], $component->getDependencies()); } - public function testShouldReplacePhpPackageDependencyIfVersionIsHigher(): void + public function testShouldReplacePhpPackageDependencyIfVersionIsHigher() { $component = new Component('Button', [ new File('templates/components/Button/Button.html.twig', 'Button.html.twig'), @@ -99,7 +99,7 @@ public function testShouldReplacePhpPackageDependencyIfVersionIsHigher(): void self::assertEquals([$dependency1, $dependency2, $dependency4], $component->getDependencies()); } - public function testShouldNotReplacePhpPackageDependencyIfVersionIsLower(): void + public function testShouldNotReplacePhpPackageDependencyIfVersionIsLower() { $component = new Component('Button', [ new File('templates/components/Button/Button.html.twig', 'Button.html.twig'), diff --git a/src/Toolkit/tests/Asset/StimulusControllerTest.php b/src/Toolkit/tests/Asset/StimulusControllerTest.php index 7965f71212a..495336e111e 100644 --- a/src/Toolkit/tests/Asset/StimulusControllerTest.php +++ b/src/Toolkit/tests/Asset/StimulusControllerTest.php @@ -19,7 +19,7 @@ final class StimulusControllerTest extends TestCase { - public function testCanBeInstantiated(): void + public function testCanBeInstantiated() { $stimulusController = new StimulusController('clipboard', [ new File('assets/controllers/clipboard_controller.js', 'clipboard_controller.js'), @@ -28,7 +28,7 @@ public function testCanBeInstantiated(): void $this->assertSame('clipboard', $stimulusController->name); } - public function testShouldFailIfStimulusControllerNameIsInvalid(): void + public function testShouldFailIfStimulusControllerNameIsInvalid() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid Stimulus controller name "invalid_controller".'); @@ -36,7 +36,7 @@ public function testShouldFailIfStimulusControllerNameIsInvalid(): void new StimulusController('invalid_controller', [new File('assets/controllers/invalid_controller.js', 'invalid_controller.js')]); } - public function testShouldFailIfStimulusControllerHasNoFiles(): void + public function testShouldFailIfStimulusControllerHasNoFiles() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Stimulus controller "clipboard" has no files.'); diff --git a/src/Toolkit/tests/Command/DebugKitCommandTest.php b/src/Toolkit/tests/Command/DebugKitCommandTest.php index 7ce441cdad8..752a91fef84 100644 --- a/src/Toolkit/tests/Command/DebugKitCommandTest.php +++ b/src/Toolkit/tests/Command/DebugKitCommandTest.php @@ -19,7 +19,7 @@ class DebugKitCommandTest extends KernelTestCase { use InteractsWithConsole; - public function testShouldBeAbleToDebug(): void + public function testShouldBeAbleToDebug() { $this->bootKernel(); $this->consoleCommand(\sprintf('ux:toolkit:debug-kit %s', Path::join(__DIR__, '/../../kits/shadcn'))) diff --git a/src/Toolkit/tests/Command/InstallComponentCommandTest.php b/src/Toolkit/tests/Command/InstallComponentCommandTest.php index d2c3274e1ec..e53e9ec017f 100644 --- a/src/Toolkit/tests/Command/InstallComponentCommandTest.php +++ b/src/Toolkit/tests/Command/InstallComponentCommandTest.php @@ -33,7 +33,7 @@ protected function setUp(): void $this->filesystem->mkdir($this->tmpDir); } - public function testShouldAbleToInstallComponentTableAndItsDependencies(): void + public function testShouldAbleToInstallComponentTableAndItsDependencies() { $expectedFiles = [ 'Table.html.twig' => $this->tmpDir.'/Table.html.twig', @@ -65,7 +65,7 @@ public function testShouldAbleToInstallComponentTableAndItsDependencies(): void } } - public function testShouldFailAndSuggestAlternativeComponentsWhenKitIsExplicit(): void + public function testShouldFailAndSuggestAlternativeComponentsWhenKitIsExplicit() { $destination = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid(); mkdir($destination); @@ -86,7 +86,7 @@ public function testShouldFailAndSuggestAlternativeComponentsWhenKitIsExplicit() ; } - public function testShouldFailWhenComponentDoesNotExist(): void + public function testShouldFailWhenComponentDoesNotExist() { $destination = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid(); mkdir($destination); @@ -98,7 +98,7 @@ public function testShouldFailWhenComponentDoesNotExist(): void ->assertOutputContains('The component "Unknown" does not exist'); } - public function testShouldWarnWhenComponentFileAlreadyExistsInNonInteractiveMode(): void + public function testShouldWarnWhenComponentFileAlreadyExistsInNonInteractiveMode() { $destination = sys_get_temp_dir().\DIRECTORY_SEPARATOR.uniqid(); mkdir($destination); diff --git a/src/Toolkit/tests/Dependency/ComponentDependencyTest.php b/src/Toolkit/tests/Dependency/ComponentDependencyTest.php index 54dc3a42eb3..bd0a971ec1b 100644 --- a/src/Toolkit/tests/Dependency/ComponentDependencyTest.php +++ b/src/Toolkit/tests/Dependency/ComponentDependencyTest.php @@ -16,7 +16,7 @@ final class ComponentDependencyTest extends TestCase { - public function testShouldBeInstantiable(): void + public function testShouldBeInstantiable() { $dependency = new ComponentDependency('Table:Body'); @@ -24,7 +24,7 @@ public function testShouldBeInstantiable(): void $this->assertSame('Table:Body', (string) $dependency); } - public function testShouldFailIfComponentNameIsInvalid(): void + public function testShouldFailIfComponentNameIsInvalid() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid component name "foobar".'); diff --git a/src/Toolkit/tests/Dependency/PhpPackageDependencyTest.php b/src/Toolkit/tests/Dependency/PhpPackageDependencyTest.php index 8efb9f75501..a58d072944d 100644 --- a/src/Toolkit/tests/Dependency/PhpPackageDependencyTest.php +++ b/src/Toolkit/tests/Dependency/PhpPackageDependencyTest.php @@ -17,7 +17,7 @@ final class PhpPackageDependencyTest extends TestCase { - public function testShouldBeInstantiable(): void + public function testShouldBeInstantiable() { $dependency = new PhpPackageDependency('twig/html-extra'); $this->assertSame('twig/html-extra', $dependency->name); @@ -29,7 +29,7 @@ public function testShouldBeInstantiable(): void $this->assertSame('twig/html-extra:^3.2.1', (string) $dependency); } - public function testShouldFailIfPackageNameIsInvalid(): void + public function testShouldFailIfPackageNameIsInvalid() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid PHP package name "/foo".'); diff --git a/src/Toolkit/tests/Dependency/StimulusControllerDependencyTest.php b/src/Toolkit/tests/Dependency/StimulusControllerDependencyTest.php index 2e6b6feb80b..164a38dab4d 100644 --- a/src/Toolkit/tests/Dependency/StimulusControllerDependencyTest.php +++ b/src/Toolkit/tests/Dependency/StimulusControllerDependencyTest.php @@ -16,7 +16,7 @@ final class StimulusControllerDependencyTest extends TestCase { - public function testShouldBeInstantiable(): void + public function testShouldBeInstantiable() { $dependency = new StimulusControllerDependency('clipboard'); @@ -24,7 +24,7 @@ public function testShouldBeInstantiable(): void $this->assertSame('clipboard', (string) $dependency); } - public function testShouldFailIfComponentNameIsInvalid(): void + public function testShouldFailIfComponentNameIsInvalid() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid Stimulus controller name "my_Controller".'); diff --git a/src/Toolkit/tests/Dependency/VersionTest.php b/src/Toolkit/tests/Dependency/VersionTest.php index cc0c50f52ca..c6b73c0c328 100644 --- a/src/Toolkit/tests/Dependency/VersionTest.php +++ b/src/Toolkit/tests/Dependency/VersionTest.php @@ -16,14 +16,14 @@ final class VersionTest extends TestCase { - public function testCanBeInstantiated(): void + public function testCanBeInstantiated() { $version = new Version('1.2.3'); $this->assertSame('1.2.3', (string) $version); } - public function testCanBeCompared(): void + public function testCanBeCompared() { $this->assertTrue((new Version('1.2.3'))->isHigherThan(new Version('1.2.2'))); $this->assertFalse((new Version('1.2.3'))->isHigherThan(new Version('1.2.4'))); diff --git a/src/Toolkit/tests/File/DocTest.php b/src/Toolkit/tests/File/DocTest.php index 2cfb82df4b8..02a9e6e5a91 100644 --- a/src/Toolkit/tests/File/DocTest.php +++ b/src/Toolkit/tests/File/DocTest.php @@ -16,7 +16,7 @@ final class DocTest extends TestCase { - public function testCanBeInstantiated(): void + public function testCanBeInstantiated() { $doc = new Doc( '# Basic Button diff --git a/src/Toolkit/tests/File/FileTest.php b/src/Toolkit/tests/File/FileTest.php index d92958ed2f5..984c10a3ea0 100644 --- a/src/Toolkit/tests/File/FileTest.php +++ b/src/Toolkit/tests/File/FileTest.php @@ -16,7 +16,7 @@ final class FileTest extends TestCase { - public function testShouldFailIfPathIsNotRelative(): void + public function testShouldFailIfPathIsNotRelative() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('The path to the kit "%s" must be relative.', __FILE__.'/templates/components/Button.html.twig')); @@ -24,7 +24,7 @@ public function testShouldFailIfPathIsNotRelative(): void new File(__FILE__.'/templates/components/Button.html.twig', __FILE__.'Button.html.twig'); } - public function testShouldFailIfPathNameIsNotRelative(): void + public function testShouldFailIfPathNameIsNotRelative() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('The path name "%s" must be relative.', __FILE__.'Button.html.twig')); @@ -32,7 +32,7 @@ public function testShouldFailIfPathNameIsNotRelative(): void new File('templates/components/Button.html.twig', __FILE__.'Button.html.twig'); } - public function testShouldFailIfPathNameIsNotASubpathOfPathToKit(): void + public function testShouldFailIfPathNameIsNotASubpathOfPathToKit() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('The relative path name "%s" must be a subpath of the relative path to the kit "%s".', 'foo/bar/Button.html.twig', 'templates/components/Button.html.twig')); @@ -40,7 +40,7 @@ public function testShouldFailIfPathNameIsNotASubpathOfPathToKit(): void new File('templates/components/Button.html.twig', 'foo/bar/Button.html.twig'); } - public function testCanInstantiateFile(): void + public function testCanInstantiateFile() { $file = new File('templates/components/Button.html.twig', 'Button.html.twig'); @@ -49,7 +49,7 @@ public function testCanInstantiateFile(): void $this->assertSame('templates/components/Button.html.twig', (string) $file); } - public function testCanInstantiateFileWithSubComponent(): void + public function testCanInstantiateFileWithSubComponent() { $file = new File('templates/components/Table/Body.html.twig', 'Table/Body.html.twig'); diff --git a/src/Toolkit/tests/Functional/ComponentsRenderingTest.php b/src/Toolkit/tests/Functional/ComponentsRenderingTest.php index 39978c8a5cd..6fdcbfb6cc3 100644 --- a/src/Toolkit/tests/Functional/ComponentsRenderingTest.php +++ b/src/Toolkit/tests/Functional/ComponentsRenderingTest.php @@ -54,7 +54,7 @@ public static function provideTestComponentRendering(): iterable /** * @dataProvider provideTestComponentRendering */ - public function testComponentRendering(string $kitName, string $componentName, string $code): void + public function testComponentRendering(string $kitName, string $componentName, string $code) { $twig = self::getContainer()->get('twig'); $kitContextRunner = self::getContainer()->get('ux_toolkit.kit.kit_context_runner'); diff --git a/src/Toolkit/tests/Installer/InstallerTest.php b/src/Toolkit/tests/Installer/InstallerTest.php index 7386d581f63..d2c6e2d6421 100644 --- a/src/Toolkit/tests/Installer/InstallerTest.php +++ b/src/Toolkit/tests/Installer/InstallerTest.php @@ -33,7 +33,7 @@ protected function setUp(): void $this->filesystem->mkdir($this->tmpDir); } - public function testCanInstallComponent(): void + public function testCanInstallComponent() { $componentInstaller = new Installer(self::getContainer()->get('filesystem'), fn () => throw new \BadFunctionCallException('The installer should not ask for confirmation since the file does not exist.')); $kit = $this->createKit('shadcn'); @@ -49,7 +49,7 @@ public function testCanInstallComponent(): void $this->assertSame(file_get_contents($this->tmpDir.'/Button.html.twig'), file_get_contents(\sprintf('%s/templates/components/Button.html.twig', $kit->path))); } - public function testShouldAskIfFileAlreadyExists(): void + public function testShouldAskIfFileAlreadyExists() { $askedCount = 0; $componentInstaller = new Installer(self::getContainer()->get('filesystem'), function () use (&$askedCount) { @@ -72,7 +72,7 @@ public function testShouldAskIfFileAlreadyExists(): void $this->assertSame(1, $askedCount); } - public function testCanInstallComponentIfForced(): void + public function testCanInstallComponentIfForced() { $componentInstaller = new Installer(self::getContainer()->get('filesystem'), fn () => throw new \BadFunctionCallException('The installer should not ask for confirmation since the file does not exist.')); $kit = $this->createKit('shadcn'); @@ -91,7 +91,7 @@ public function testCanInstallComponentIfForced(): void $this->assertSame(file_get_contents($this->tmpDir.'/Button.html.twig'), file_get_contents(\sprintf('%s/templates/components/Button.html.twig', $kit->path))); } - public function testCanInstallComponentAndItsComponentDependencies(): void + public function testCanInstallComponentAndItsComponentDependencies() { $componentInstaller = new Installer(self::getContainer()->get('filesystem'), fn () => throw new \BadFunctionCallException('The installer should not ask for confirmation since the file does not exist.')); $kit = $this->createKit('shadcn'); diff --git a/src/Toolkit/tests/Installer/PoolResolverTest.php b/src/Toolkit/tests/Installer/PoolResolverTest.php index deded51aae0..13defca2ab5 100644 --- a/src/Toolkit/tests/Installer/PoolResolverTest.php +++ b/src/Toolkit/tests/Installer/PoolResolverTest.php @@ -23,7 +23,7 @@ final class PoolResolverTest extends TestCase { - public function testCanResolveDependencies(): void + public function testCanResolveDependencies() { $kitSynchronizer = new KitSynchronizer(new Filesystem()); $kit = new Kit(Path::join(__DIR__, '../../kits/shadcn'), 'shadcn'); @@ -51,7 +51,7 @@ public function testCanResolveDependencies(): void $this->assertCount(1, $pool->getPhpPackageDependencies()); } - public function testCanHandleCircularComponentDependencies(): void + public function testCanHandleCircularComponentDependencies() { $kitSynchronizer = new KitSynchronizer(new Filesystem()); $kit = new Kit(Path::join(__DIR__, '../Fixtures/kits/with-circular-components-dependencies'), 'with-circular-components-dependencies'); diff --git a/src/Toolkit/tests/Installer/PoolTest.php b/src/Toolkit/tests/Installer/PoolTest.php index a5dc227689e..66a9f0324a7 100644 --- a/src/Toolkit/tests/Installer/PoolTest.php +++ b/src/Toolkit/tests/Installer/PoolTest.php @@ -21,7 +21,7 @@ final class PoolTest extends TestCase { - public function testCanAddFiles(): void + public function testCanAddFiles() { $pool = new Pool(); @@ -33,7 +33,7 @@ public function testCanAddFiles(): void $this->assertCount(2, $pool->getFiles()); } - public function testCantAddSameFileTwice(): void + public function testCantAddSameFileTwice() { $pool = new Pool(); @@ -43,7 +43,7 @@ public function testCantAddSameFileTwice(): void $this->assertCount(1, $pool->getFiles()); } - public function testCanAddPhpPackageDependencies(): void + public function testCanAddPhpPackageDependencies() { $pool = new Pool(); @@ -52,7 +52,7 @@ public function testCanAddPhpPackageDependencies(): void $this->assertCount(1, $pool->getPhpPackageDependencies()); } - public function testCantAddSamePhpPackageDependencyTwice(): void + public function testCantAddSamePhpPackageDependencyTwice() { $pool = new Pool(); @@ -62,7 +62,7 @@ public function testCantAddSamePhpPackageDependencyTwice(): void $this->assertCount(1, $pool->getPhpPackageDependencies()); } - public function testCanAddPhpPackageDependencyWithHigherVersion(): void + public function testCanAddPhpPackageDependencyWithHigherVersion() { $pool = new Pool(); diff --git a/src/Toolkit/tests/Kit/KitContextRunnerTest.php b/src/Toolkit/tests/Kit/KitContextRunnerTest.php index 7cfe77c4094..1e6d8b36af1 100644 --- a/src/Toolkit/tests/Kit/KitContextRunnerTest.php +++ b/src/Toolkit/tests/Kit/KitContextRunnerTest.php @@ -19,7 +19,7 @@ class KitContextRunnerTest extends KernelTestCase { - public function testRunForKitShouldConfigureThenResetServices(): void + public function testRunForKitShouldConfigureThenResetServices() { $twig = self::getContainer()->get('twig'); $initialTwigLoader = $twig->getLoader(); diff --git a/src/Toolkit/tests/Kit/KitFactoryTest.php b/src/Toolkit/tests/Kit/KitFactoryTest.php index 07f4144ca37..a60ece854e0 100644 --- a/src/Toolkit/tests/Kit/KitFactoryTest.php +++ b/src/Toolkit/tests/Kit/KitFactoryTest.php @@ -21,7 +21,7 @@ final class KitFactoryTest extends KernelTestCase { - public function testShouldFailIfPathIsNotAbsolute(): void + public function testShouldFailIfPathIsNotAbsolute() { $kitFactory = $this->createKitFactory(); @@ -31,7 +31,7 @@ public function testShouldFailIfPathIsNotAbsolute(): void $kitFactory->createKitFromAbsolutePath('shadcn'); } - public function testShouldFailIfKitDoesNotExist(): void + public function testShouldFailIfKitDoesNotExist() { $kitFactory = $this->createKitFactory(); @@ -41,7 +41,7 @@ public function testShouldFailIfKitDoesNotExist(): void $kitFactory->createKitFromAbsolutePath(__DIR__.'/../../kits/does-not-exist'); } - public function testCanCreateShadKit(): void + public function testCanCreateShadKit() { $kitFactory = $this->createKitFactory(); @@ -73,7 +73,7 @@ public function testCanCreateShadKit(): void , $table->doc->markdownContent); } - public function testCanHandleStimulusControllers(): void + public function testCanHandleStimulusControllers() { $kitFactory = $this->createKitFactory(); diff --git a/src/Toolkit/tests/Kit/KitSynchronizerTest.php b/src/Toolkit/tests/Kit/KitSynchronizerTest.php index 05829ea1133..7c0174cd58b 100644 --- a/src/Toolkit/tests/Kit/KitSynchronizerTest.php +++ b/src/Toolkit/tests/Kit/KitSynchronizerTest.php @@ -33,7 +33,7 @@ protected function setUp(): void $this->filesystem = self::getContainer()->get('filesystem'); } - public function testCanResolveDependencies(): void + public function testCanResolveDependencies() { $kitSynchronizer = new KitSynchronizer($this->filesystem); $kit = new Kit(Path::join(__DIR__, '../../kits/shadcn'), 'shadcn'); @@ -58,7 +58,7 @@ public function testCanResolveDependencies(): void ], $kit->getComponent('Table')->getDependencies()); } - public function testCanResolveStimulusDependencies(): void + public function testCanResolveStimulusDependencies() { $kitSynchronizer = new KitSynchronizer($this->filesystem); $kit = new Kit(Path::join(__DIR__, '../Fixtures/kits/with-stimulus-controllers'), 'kit'); diff --git a/src/Toolkit/tests/Kit/KitTest.php b/src/Toolkit/tests/Kit/KitTest.php index 7f023a48474..862635d2b9e 100644 --- a/src/Toolkit/tests/Kit/KitTest.php +++ b/src/Toolkit/tests/Kit/KitTest.php @@ -18,7 +18,7 @@ final class KitTest extends TestCase { - public function testShouldFailIfKitNameIsInvalid(): void + public function testShouldFailIfKitNameIsInvalid() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Invalid kit name "-foobar".'); @@ -26,7 +26,7 @@ public function testShouldFailIfKitNameIsInvalid(): void new Kit(__DIR__, '-foobar', 'https://example.com', 'MIT'); } - public function testShouldFailIfKitPathIsNotAbsolute(): void + public function testShouldFailIfKitPathIsNotAbsolute() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage(\sprintf('Kit path "./%s" is not absolute.', __DIR__)); @@ -34,7 +34,7 @@ public function testShouldFailIfKitPathIsNotAbsolute(): void new Kit(\sprintf('./%s', __DIR__), 'foo', 'https://example.com', 'MIT'); } - public function testCanAddComponentsToTheKit(): void + public function testCanAddComponentsToTheKit() { $kit = new Kit(__DIR__, 'foo', 'https://example.com', 'MIT'); $kit->addComponent(new Component('Table', [new File('Table.html.twig', 'Table.html.twig')], null)); @@ -43,7 +43,7 @@ public function testCanAddComponentsToTheKit(): void $this->assertCount(2, $kit->getComponents()); } - public function testShouldFailIfComponentIsAlreadyRegisteredInTheKit(): void + public function testShouldFailIfComponentIsAlreadyRegisteredInTheKit() { $this->expectException(\InvalidArgumentException::class); $this->expectExceptionMessage('Component "Table" is already registered in the kit.'); @@ -53,7 +53,7 @@ public function testShouldFailIfComponentIsAlreadyRegisteredInTheKit(): void $kit->addComponent(new Component('Table', [new File('Table.html.twig', 'Table.html.twig')], null)); } - public function testCanGetComponentByName(): void + public function testCanGetComponentByName() { $kit = new Kit(__DIR__, 'foo', 'https://example.com', 'MIT'); $kit->addComponent(new Component('Table', [new File('Table.html.twig', 'Table.html.twig')], null)); @@ -63,7 +63,7 @@ public function testCanGetComponentByName(): void $this->assertSame('Table:Row', $kit->getComponent('Table:Row')->name); } - public function testShouldReturnNullIfComponentIsNotFound(): void + public function testShouldReturnNullIfComponentIsNotFound() { $kit = new Kit(__DIR__, 'foo', 'https://example.com', 'MIT'); diff --git a/src/Toolkit/tests/Registry/GitHubRegistryTest.php b/src/Toolkit/tests/Registry/GitHubRegistryTest.php index cffc454e602..0df210e42eb 100644 --- a/src/Toolkit/tests/Registry/GitHubRegistryTest.php +++ b/src/Toolkit/tests/Registry/GitHubRegistryTest.php @@ -34,7 +34,7 @@ protected function setUp(): void $this->filesystem->mkdir($this->tmpDir); } - public function testCanGetKitFromGithub(): void + public function testCanGetKitFromGithub() { $isHttpClientCalled = false; $zipShadcnMain = $this->createZip('repo', 'shadcn', 'main'); @@ -71,7 +71,7 @@ public function testCanGetKitFromGithub(): void $this->assertFileExists(Path::join($kit->path, 'docs/components/Button.md')); } - public function testShouldThrowExceptionIfKitNotFound(): void + public function testShouldThrowExceptionIfKitNotFound() { $githubRegistry = new GitHubRegistry( self::getContainer()->get('ux_toolkit.kit.kit_factory'), diff --git a/src/Toolkit/tests/Registry/LocalRegistryTest.php b/src/Toolkit/tests/Registry/LocalRegistryTest.php index b99cf8e8b70..578aa53ef5a 100644 --- a/src/Toolkit/tests/Registry/LocalRegistryTest.php +++ b/src/Toolkit/tests/Registry/LocalRegistryTest.php @@ -17,7 +17,7 @@ final class LocalRegistryTest extends KernelTestCase { - public function testCanGetKit(): void + public function testCanGetKit() { $localRegistry = new LocalRegistry( self::getContainer()->get('ux_toolkit.kit.kit_factory'), diff --git a/src/Toolkit/tests/Registry/RegistryFactoryTest.php b/src/Toolkit/tests/Registry/RegistryFactoryTest.php index 71ad4c4bf38..079a5abb810 100644 --- a/src/Toolkit/tests/Registry/RegistryFactoryTest.php +++ b/src/Toolkit/tests/Registry/RegistryFactoryTest.php @@ -34,7 +34,7 @@ public static function provideRegistryNames(): array /** * @dataProvider provideRegistryNames */ - public function testCanCreateRegistry(string $registryName, string $expectedRegistryClass): void + public function testCanCreateRegistry(string $registryName, string $expectedRegistryClass) { $registryFactory = self::getContainer()->get('ux_toolkit.registry.registry_factory'); @@ -56,7 +56,7 @@ public static function provideInvalidRegistryNames(): array /** * @dataProvider provideInvalidRegistryNames */ - public function testShouldFailIfRegistryIsNotFound(string $registryName): void + public function testShouldFailIfRegistryIsNotFound(string $registryName) { $registryFactory = self::getContainer()->get('ux_toolkit.registry.registry_factory'); diff --git a/src/Toolkit/tests/UXToolkitBundleTest.php b/src/Toolkit/tests/UXToolkitBundleTest.php index f7b19becb83..dad61afd120 100644 --- a/src/Toolkit/tests/UXToolkitBundleTest.php +++ b/src/Toolkit/tests/UXToolkitBundleTest.php @@ -16,7 +16,7 @@ class UXToolkitBundleTest extends KernelTestCase { - public function testBundleBuildsSuccessfully(): void + public function testBundleBuildsSuccessfully() { self::bootKernel(); $container = self::$kernel->getContainer(); diff --git a/src/Translator/assets/test/formatters/formatter.test.ts b/src/Translator/assets/test/formatters/formatter.test.ts index 5847a60a405..b6949dfd451 100644 --- a/src/Translator/assets/test/formatters/formatter.test.ts +++ b/src/Translator/assets/test/formatters/formatter.test.ts @@ -154,7 +154,7 @@ describe('Formatter', () => { new-line in it. Selector > 1.`, 5, ], - // with double-quotes and id split accros lines + // with double-quotes and id split across lines [ `This is a text with a new-line in it. Selector = 1.`, @@ -164,7 +164,7 @@ describe('Formatter', () => { new-line in it. Selector > 1.`, 1, ], - // with single-quotes and id split accros lines + // with single-quotes and id split across lines [ `This is a text with a new-line in it. Selector > 1.`, @@ -180,7 +180,7 @@ describe('Formatter', () => { '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', 0, ], - // with double-quotes and id split accros lines + // with double-quotes and id split across lines [ 'This is a text with a\nnew-line in it. Selector = 1.', '{0}This is a text with a\nnew-line in it. Selector = 0.|{1}This is a text with a\nnew-line in it. Selector = 1.|[1,Inf]This is a text with a\nnew-line in it. Selector > 1.', diff --git a/src/Translator/assets/test/formatters/intl-formatter.test.ts b/src/Translator/assets/test/formatters/intl-formatter.test.ts index f54583e2eda..918124e519c 100644 --- a/src/Translator/assets/test/formatters/intl-formatter.test.ts +++ b/src/Translator/assets/test/formatters/intl-formatter.test.ts @@ -60,7 +60,7 @@ describe('Intl Formatter', () => { expect(formatIntl('Hello {name}', { name: 'Fab' }, 'en')).toEqual('Hello Fab'); }); - test('format with locale containg underscore', () => { + test('format with locale containing underscore', () => { expect(formatIntl('Hello {name}', { name: 'Fab' }, 'en_US')).toEqual('Hello Fab'); expect(formatIntl('Bonjour {name}', { name: 'Fab' }, 'fr_FR')).toEqual('Bonjour Fab'); }); diff --git a/src/Translator/src/Intl/ErrorKind.php b/src/Translator/src/Intl/ErrorKind.php index 94066bba419..689db2c485c 100644 --- a/src/Translator/src/Intl/ErrorKind.php +++ b/src/Translator/src/Intl/ErrorKind.php @@ -34,9 +34,9 @@ final class ErrorKind public const INVALID_NUMBER_SKELETON = 'INVALID_NUMBER_SKELETON'; /** The date time skeleton is invalid. */ public const INVALID_DATE_TIME_SKELETON = 'INVALID_DATE_TIME_SKELETON'; - /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */ + /** Expect a number skeleton following the `::` (e.g. `{foo, number, ::}`) */ public const EXPECT_NUMBER_SKELETON = 'EXPECT_NUMBER_SKELETON'; - /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */ + /** Expect a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */ public const EXPECT_DATE_TIME_SKELETON = 'EXPECT_DATE_TIME_SKELETON'; /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */ diff --git a/src/Translator/tests/Functional/DumpEnabledLocalesTest.php b/src/Translator/tests/Functional/DumpEnabledLocalesTest.php index 35740bfe3f7..79d7f3b0edb 100644 --- a/src/Translator/tests/Functional/DumpEnabledLocalesTest.php +++ b/src/Translator/tests/Functional/DumpEnabledLocalesTest.php @@ -21,7 +21,7 @@ protected static function getKernelClass(): string return FrameworkAppKernel::class; } - public function testShouldDumpOnlyEnabledLocales(): void + public function testShouldDumpOnlyEnabledLocales() { self::assertFileExists(__DIR__.'/../Fixtures/translations/messages.en.yaml'); self::assertFileExists(__DIR__.'/../Fixtures/translations/messages.fr.yaml'); diff --git a/src/Translator/tests/Intl/IntlMessageParserTest.php b/src/Translator/tests/Intl/IntlMessageParserTest.php index 9538ba61e28..d445d6d659c 100644 --- a/src/Translator/tests/Intl/IntlMessageParserTest.php +++ b/src/Translator/tests/Intl/IntlMessageParserTest.php @@ -23,7 +23,7 @@ class IntlMessageParserTest extends TestCase /** * @dataProvider provideParse */ - public function testIntlMessageParser(string $message, array $expectedAst): void + public function testIntlMessageParser(string $message, array $expectedAst) { $intlMessageParser = new IntlMessageParser($message); diff --git a/src/Translator/tests/MessageParameters/Extractor/MessageParametersExtractorTest.php b/src/Translator/tests/MessageParameters/Extractor/MessageParametersExtractorTest.php index b92cf359b49..102e6b10334 100644 --- a/src/Translator/tests/MessageParameters/Extractor/MessageParametersExtractorTest.php +++ b/src/Translator/tests/MessageParameters/Extractor/MessageParametersExtractorTest.php @@ -19,7 +19,7 @@ class MessageParametersExtractorTest extends TestCase /** * @dataProvider provideExtract */ - public function testExtract(string $message, array $expectedParameters): void + public function testExtract(string $message, array $expectedParameters) { $messageParametersExtractor = new MessageParametersExtractor(); diff --git a/src/Translator/tests/TranslationsDumperTest.php b/src/Translator/tests/TranslationsDumperTest.php index 10b13d90a05..f298db46ba2 100644 --- a/src/Translator/tests/TranslationsDumperTest.php +++ b/src/Translator/tests/TranslationsDumperTest.php @@ -45,7 +45,7 @@ protected function setUp(): void ); } - public function testDump(): void + public function testDump() { $this->translationsDumper->dump(...self::getMessageCatalogues()); @@ -105,7 +105,7 @@ public function testDump(): void TYPESCRIPT); } - public function testDumpWithExcludedDomains(): void + public function testDumpWithExcludedDomains() { $this->translationsDumper->addExcludedDomain('foobar'); $this->translationsDumper->dump(...$this->getMessageCatalogues()); @@ -114,7 +114,7 @@ public function testDumpWithExcludedDomains(): void $this->assertStringNotContainsString('foobar', file_get_contents(self::$translationsDumpDir.'/index.js')); } - public function testDumpIncludedDomains(): void + public function testDumpIncludedDomains() { $this->translationsDumper->addIncludedDomain('messages'); $this->translationsDumper->dump(...$this->getMessageCatalogues()); @@ -123,7 +123,7 @@ public function testDumpIncludedDomains(): void $this->assertStringNotContainsString('foobar', file_get_contents(self::$translationsDumpDir.'/index.js')); } - public function testSetBothIncludedAndExcludedDomains(): void + public function testSetBothIncludedAndExcludedDomains() { $this->expectException(\LogicException::class); $this->expectExceptionMessage('You cannot set both "excluded_domains" and "included_domains" at the same time.'); @@ -131,7 +131,7 @@ public function testSetBothIncludedAndExcludedDomains(): void $this->translationsDumper->addExcludedDomain('messages'); } - public function testSetBothExcludedAndIncludedDomains(): void + public function testSetBothExcludedAndIncludedDomains() { $this->expectException(\LogicException::class); $this->expectExceptionMessage('You cannot set both "excluded_domains" and "included_domains" at the same time.'); diff --git a/src/Turbo/phpstan.dist.neon b/src/Turbo/phpstan.dist.neon index 5c5b5c17496..7db52b17d53 100644 --- a/src/Turbo/phpstan.dist.neon +++ b/src/Turbo/phpstan.dist.neon @@ -13,6 +13,9 @@ parameters: bootstrapFiles: - vendor/bin/.phpunit/phpunit/vendor/autoload.php ignoreErrors: + - + message: "#^Method .*::test.*\\(\\) has no return type specified\\.$#" + - message: "#^Call to method getClassAnnotations\\(\\) on an unknown class Doctrine\\\\Common\\\\Annotations\\\\Reader\\.$#" count: 1 diff --git a/src/Turbo/tests/Bridge/Mercure/TurboStreamListenRendererTest.php b/src/Turbo/tests/Bridge/Mercure/TurboStreamListenRendererTest.php index 108715b06f8..4ba54a0fc90 100644 --- a/src/Turbo/tests/Bridge/Mercure/TurboStreamListenRendererTest.php +++ b/src/Turbo/tests/Bridge/Mercure/TurboStreamListenRendererTest.php @@ -22,7 +22,7 @@ final class TurboStreamListenRendererTest extends KernelTestCase * * @param array $context */ - public function testRenderTurboStreamListen(string $template, array $context, string $expectedResult): void + public function testRenderTurboStreamListen(string $template, array $context, string $expectedResult) { $twig = self::getContainer()->get('twig'); self::assertInstanceOf(\Twig\Environment::class, $twig); diff --git a/src/Turbo/tests/BroadcastTest.php b/src/Turbo/tests/BroadcastTest.php index f95b00cde54..5ca80c122de 100644 --- a/src/Turbo/tests/BroadcastTest.php +++ b/src/Turbo/tests/BroadcastTest.php @@ -33,7 +33,7 @@ protected function setUp(): void parent::setUp(); } - public function testBroadcastBasic(): void + public function testBroadcastBasic() { ($client = self::createPantherClient())->request('GET', '/books'); @@ -52,7 +52,7 @@ public function testBroadcastBasic(): void $this->assertSelectorWillNotContain('#books', $matches[1]); } - public function testExpressionLanguageBroadcast(): void + public function testExpressionLanguageBroadcast() { ($client = self::createPantherClient())->request('GET', '/artists'); @@ -90,7 +90,7 @@ public function testExpressionLanguageBroadcast(): void ); } - public function testBroadcastWithProxy(): void + public function testBroadcastWithProxy() { // testing that Artist is updated, even though it's saved as Proxy ($client = self::createPantherClient())->request('GET', '/artistFromSong'); diff --git a/src/Turbo/tests/Compiler/RegisterMercureHubsPassTest.php b/src/Turbo/tests/Compiler/RegisterMercureHubsPassTest.php index 5d369ab886f..786251271df 100644 --- a/src/Turbo/tests/Compiler/RegisterMercureHubsPassTest.php +++ b/src/Turbo/tests/Compiler/RegisterMercureHubsPassTest.php @@ -17,7 +17,7 @@ final class RegisterMercureHubsPassTest extends TestCase { - public function testProcess(): void + public function testProcess() { $pass = new RegisterMercureHubsPass(); @@ -31,7 +31,7 @@ public function testProcess(): void $this->assertTrue($container->has('turbo.mercure.hub.broadcaster')); } - public function testProcessWithDefault(): void + public function testProcessWithDefault() { $pass = new RegisterMercureHubsPass(); diff --git a/src/Turbo/tests/Helper/TurboStreamTest.php b/src/Turbo/tests/Helper/TurboStreamTest.php index b404dca2ac8..1757487c347 100644 --- a/src/Turbo/tests/Helper/TurboStreamTest.php +++ b/src/Turbo/tests/Helper/TurboStreamTest.php @@ -24,7 +24,7 @@ class TurboStreamTest extends TestCase * ["before"] * ["after"] */ - public function testStream(string $action): void + public function testStream(string $action) { $this->assertSame(<< @@ -39,7 +39,7 @@ public function testStream(string $action): void * @testWith ["replace"] * ["update"] */ - public function testStreamMorph(string $action): void + public function testStreamMorph(string $action) { $this->assertSame(<< @@ -50,7 +50,7 @@ public function testStreamMorph(string $action): void ); } - public function testRemove(): void + public function testRemove() { $this->assertSame(<< @@ -59,7 +59,7 @@ public function testRemove(): void ); } - public function testRefreshWithoutId(): void + public function testRefreshWithoutId() { $this->assertSame(<< @@ -68,7 +68,7 @@ public function testRefreshWithoutId(): void ); } - public function testRefreshWithId(): void + public function testRefreshWithId() { $this->assertSame(<< @@ -77,7 +77,7 @@ public function testRefreshWithId(): void ); } - public function testCustom(): void + public function testCustom() { $this->assertSame(<< @@ -93,7 +93,7 @@ public function testCustom(): void * * @param array $attr */ - public function testCustomThrowsException(string $action, string $target, string $html, array $attr): void + public function testCustomThrowsException(string $action, string $target, string $html, array $attr) { $this->expectException(\InvalidArgumentException::class); TurboStream::action($action, $target, $html, $attr); diff --git a/src/Turbo/tests/Request/RequestListenerTest.php b/src/Turbo/tests/Request/RequestListenerTest.php index 27b1c73f462..57ae2ceac2c 100644 --- a/src/Turbo/tests/Request/RequestListenerTest.php +++ b/src/Turbo/tests/Request/RequestListenerTest.php @@ -22,7 +22,7 @@ */ class RequestListenerTest extends WebTestCase { - public function testAddsTurboRequestFormat(): void + public function testAddsTurboRequestFormat() { $client = static::createClient(server: [ 'HTTP_ACCEPT' => 'text/vnd.turbo-stream.html, text/html, application/xhtml+xml', diff --git a/src/Turbo/tests/TurboFrameTest.php b/src/Turbo/tests/TurboFrameTest.php index 6c43f468ae9..790c9e15006 100644 --- a/src/Turbo/tests/TurboFrameTest.php +++ b/src/Turbo/tests/TurboFrameTest.php @@ -18,7 +18,7 @@ */ class TurboFrameTest extends PantherTestCase { - public function testFrame(): void + public function testFrame() { ($client = self::createPantherClient())->request('GET', '/'); diff --git a/src/Turbo/tests/TurboStreamTest.php b/src/Turbo/tests/TurboStreamTest.php index 772b8d60feb..aaafc1ee685 100644 --- a/src/Turbo/tests/TurboStreamTest.php +++ b/src/Turbo/tests/TurboStreamTest.php @@ -18,7 +18,7 @@ */ final class TurboStreamTest extends PantherTestCase { - public function testStream(): void + public function testStream() { ($client = self::createPantherClient())->request('GET', '/'); diff --git a/src/TwigComponent/README.md b/src/TwigComponent/README.md index d089f461f05..0ee4e1dbbca 100644 --- a/src/TwigComponent/README.md +++ b/src/TwigComponent/README.md @@ -1,9 +1,9 @@ # Twig Components Twig components give you the power to bind an object to a template, making -it easier to render and re-use small template "units" - like an "alert", +it easier to render and reuse small template "units" - like an "alert", markup for a modal, or a category sidebar. A very simple example -would be a re-usable alert component: +would be a reusable alert component: ![Example of the AlertComponent](https://github.com/symfony/ux/blob/2.x/src/TwigComponent/alert-example.png?raw=true) diff --git a/src/TwigComponent/doc/index.rst b/src/TwigComponent/doc/index.rst index b7e187494fd..4b0d5fc1dc1 100644 --- a/src/TwigComponent/doc/index.rst +++ b/src/TwigComponent/doc/index.rst @@ -2,7 +2,7 @@ Twig Components =============== Twig components give you the power to bind an object to a template, -making it easier to render and re-use small template "units" - like an +making it easier to render and reuse small template "units" - like an "alert", markup for a modal, or a category sidebar: Every component consists of (1) a class:: @@ -921,7 +921,7 @@ For example, imagine we want to create a ``SuccessAlert`` component: We will successfully forward this block content! -We already have a generic ``Alert`` component, so let's re-use it: +We already have a generic ``Alert`` component, so let's reuse it: .. code-block:: html+twig diff --git a/src/TwigComponent/src/ComponentFactory.php b/src/TwigComponent/src/ComponentFactory.php index 22619fb7842..37a757ccb7b 100644 --- a/src/TwigComponent/src/ComponentFactory.php +++ b/src/TwigComponent/src/ComponentFactory.php @@ -167,7 +167,7 @@ private function mount(object $component, array &$data, ComponentMetadata $compo } elseif ($refParameter->isDefaultValueAvailable()) { $parameters[] = $refParameter->getDefaultValue(); } else { - throw new \LogicException(\sprintf('%s has a required $%s parameter. Make sure to pass it or give it a default value.', $component::class.'::mount()', $name)); + throw new \LogicException(\sprintf('"%s" has a required $%s parameter. Make sure to pass it or give it a default value.', $component::class.'::mount()', $name)); } } diff --git a/src/TwigComponent/tests/Integration/Command/TwigComponentDebugCommandTest.php b/src/TwigComponent/tests/Integration/Command/TwigComponentDebugCommandTest.php index 0e6ffa8d895..4ec60a851ed 100644 --- a/src/TwigComponent/tests/Integration/Command/TwigComponentDebugCommandTest.php +++ b/src/TwigComponent/tests/Integration/Command/TwigComponentDebugCommandTest.php @@ -17,7 +17,7 @@ class TwigComponentDebugCommandTest extends KernelTestCase { - public function testWithNoComponent(): void + public function testWithNoComponent() { $commandTester = $this->createCommandTester(); $commandTester->execute([]); @@ -32,7 +32,7 @@ public function testWithNoComponent(): void $this->assertStringContainsString('Type', $display); } - public function testWithNoMatchComponent(): void + public function testWithNoMatchComponent() { $commandTester = $this->createCommandTester(); $result = $commandTester->execute(['name' => 'NoMatchComponent']); @@ -41,7 +41,7 @@ public function testWithNoMatchComponent(): void $this->assertStringContainsString('Unknown component "NoMatchComponent".', $commandTester->getDisplay()); } - public function testNotComponentsIsNotListed(): void + public function testNotComponentsIsNotListed() { $commandTester = $this->createCommandTester(); $result = $commandTester->execute(['name' => 'NotAComponent']); @@ -50,7 +50,7 @@ public function testNotComponentsIsNotListed(): void $this->assertStringContainsString('Unknown component "NotAComponent".', $commandTester->getDisplay()); } - public function testWithOnePartialMatchComponent(): void + public function testWithOnePartialMatchComponent() { $commandTester = $this->createCommandTester(); $commandTester->setInputs([]); @@ -64,7 +64,7 @@ public function testWithOnePartialMatchComponent(): void $this->assertStringContainsString('Component\\DivComponentNoPass', $commandTester->getDisplay()); } - public function testWithMultiplePartialMatchComponent(): void + public function testWithMultiplePartialMatchComponent() { $commandTester = $this->createCommandTester(); $commandTester->setInputs(['DivComponent5']); @@ -82,7 +82,7 @@ public function testWithMultiplePartialMatchComponent(): void $this->assertStringNotContainsString('Component\\DivComponent6', $commandTester->getDisplay()); } - public function testComponentWithClass(): void + public function testComponentWithClass() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'BasicComponent']); @@ -97,7 +97,7 @@ public function testComponentWithClass(): void $this->assertStringContainsString('components/BasicComponent.html.twig', $display); } - public function testComponentWithClassPropertiesAndCustomName(): void + public function testComponentWithClassPropertiesAndCustomName() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'component_c']); @@ -116,7 +116,7 @@ public function testComponentWithClassPropertiesAndCustomName(): void $this->assertStringContainsString('Mount', $display); } - public function testComponentWithClassPropertiesCustomNameAndCustomTemplate(): void + public function testComponentWithClassPropertiesCustomNameAndCustomTemplate() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'component_b']); @@ -133,7 +133,7 @@ public function testComponentWithClassPropertiesCustomNameAndCustomTemplate(): v $this->assertStringContainsString('string $postValue', $display); } - public function testWithAnonymousComponent(): void + public function testWithAnonymousComponent() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'Button']); @@ -150,7 +150,7 @@ public function testWithAnonymousComponent(): void $this->assertStringContainsString('primary = true', $display); } - public function testWithBundleAnonymousComponent(): void + public function testWithBundleAnonymousComponent() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'Acme:Button']); @@ -165,7 +165,7 @@ public function testWithBundleAnonymousComponent(): void $this->assertStringContainsString('Anonymous', $display); } - public function testWithBundleAnonymousComponentSubDir(): void + public function testWithBundleAnonymousComponentSubDir() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'Acme:Table:Header']); @@ -180,7 +180,7 @@ public function testWithBundleAnonymousComponentSubDir(): void $this->assertStringContainsString('Anonymous', $display); } - public function testWithoutPublicProps(): void + public function testWithoutPublicProps() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'no_public_props']); @@ -194,7 +194,7 @@ public function testWithoutPublicProps(): void $this->assertStringNotContainsString('prop1', $display); } - public function testWithExposedVariables(): void + public function testWithExposedVariables() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'with_exposed_variables']); @@ -212,7 +212,7 @@ public function testWithExposedVariables(): void $this->assertStringNotContainsString('prop3', $display); } - public function testWithUnionTypeProps(): void + public function testWithUnionTypeProps() { $commandTester = $this->createCommandTester(); $commandTester->execute(['name' => 'union_type_props']); diff --git a/src/TwigComponent/tests/Integration/ComponentEventTest.php b/src/TwigComponent/tests/Integration/ComponentEventTest.php index fac7458447d..4c9c13189d7 100644 --- a/src/TwigComponent/tests/Integration/ComponentEventTest.php +++ b/src/TwigComponent/tests/Integration/ComponentEventTest.php @@ -25,7 +25,7 @@ final class ComponentEventTest extends KernelTestCase /** * @dataProvider provideFooBarSyntaxes */ - public function testTemplateIsUpdatedByEventListener(string $syntax): void + public function testTemplateIsUpdatedByEventListener(string $syntax) { /** @var Environment $environment */ $environment = self::getContainer()->get(Environment::class); diff --git a/src/TwigComponent/tests/Integration/ComponentExtensionTest.php b/src/TwigComponent/tests/Integration/ComponentExtensionTest.php index 2f4c3ce3d0b..4c055dbe827 100644 --- a/src/TwigComponent/tests/Integration/ComponentExtensionTest.php +++ b/src/TwigComponent/tests/Integration/ComponentExtensionTest.php @@ -24,7 +24,7 @@ final class ComponentExtensionTest extends KernelTestCase { use ExpectDeprecationTrait; - public function testCanRenderComponent(): void + public function testCanRenderComponent() { $output = $this->renderComponent('component_a', [ 'propA' => 'prop a value', @@ -36,7 +36,7 @@ public function testCanRenderComponent(): void $this->assertStringContainsString('service: service a value', $output); } - public function testCanRenderTheSameComponentMultipleTimes(): void + public function testCanRenderTheSameComponentMultipleTimes() { $output = self::getContainer()->get(Environment::class)->render('multi_render.html.twig'); @@ -49,7 +49,7 @@ public function testCanRenderTheSameComponentMultipleTimes(): void $this->assertStringContainsString('service: service a value', $output); } - public function testCanRenderComponentWithMoreAdvancedTwigExpressions(): void + public function testCanRenderComponentWithMoreAdvancedTwigExpressions() { $output = self::getContainer()->get(Environment::class)->render('flexible_component_attributes.html.twig'); @@ -64,28 +64,28 @@ public function testCanRenderComponentWithMoreAdvancedTwigExpressions(): void $this->assertStringContainsString('service: service a value', $output); } - public function testCanNotRenderComponentWithInvalidExpressions(): void + public function testCanNotRenderComponentWithInvalidExpressions() { $this->expectException(\Throwable::class); self::getContainer()->get(Environment::class)->render('invalid_flexible_component.html.twig'); } - public function testCanCustomizeTemplateWithAttribute(): void + public function testCanCustomizeTemplateWithAttribute() { $output = $this->renderComponent('component_b', ['value' => 'b value 1']); $this->assertStringContainsString('Custom template 1', $output); } - public function testCanCustomizeTemplateWithServiceTag(): void + public function testCanCustomizeTemplateWithServiceTag() { $output = $this->renderComponent('component_d', ['value' => 'b value 1']); $this->assertStringContainsString('Custom template 2', $output); } - public function testCanRenderComponentWithAttributes(): void + public function testCanRenderComponentWithAttributes() { $output = $this->renderComponent('with_attributes', [ 'prop' => 'prop value 1', @@ -109,14 +109,14 @@ public function testCanRenderComponentWithAttributes(): void $this->assertStringContainsString('