Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet authored and github-actions[bot] committed Sep 28, 2023
1 parent cfa6fb1 commit 99777c8
Show file tree
Hide file tree
Showing 21 changed files with 65 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/Datagrid/Datagrid.php
Expand Up @@ -154,7 +154,7 @@ public function getValues(): array
return $this->values;
}

public function setValue(string $name, ?string $operator, $value): void
public function setValue(string $name, ?string $operator, mixed $value): void
{
$this->values[$name] = [
'type' => $operator,
Expand Down
32 changes: 30 additions & 2 deletions tests/Admin/AdminTest.php
Expand Up @@ -330,7 +330,7 @@ public function testConfigureWithValidParentAssociationMapping(): void
/**
* @phpstan-return iterable<array-key, array{class-string, string}>
*
* @psalm-suppress InvalidReturnType, InvalidReturnStatement
* @psalm-suppress MoreSpecificReturnType
*/
public function provideGetBaseRoutePattern(): iterable
{
Expand All @@ -339,58 +339,72 @@ public function provideGetBaseRoutePattern(): iterable
'Application\Sonata\NewsBundle\Entity\Post',
'/sonata/news/post',
];
// @phpstan-ignore-next-line
yield [
'Application\Sonata\NewsBundle\Document\Post',
'/sonata/news/post',
];
// @phpstan-ignore-next-line
yield [
'MyApplication\MyBundle\Entity\Post',
'/myapplication/my/post',
];
// @phpstan-ignore-next-line
yield [
'MyApplication\MyBundle\Entity\Post\Category',
'/myapplication/my/post-category',
];
// @phpstan-ignore-next-line
yield [
'MyApplication\MyBundle\Entity\Product\Category',
'/myapplication/my/product-category',
];
// @phpstan-ignore-next-line
yield [
'MyApplication\MyBundle\Entity\Other\Product\Category',
'/myapplication/my/other-product-category',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Document\Menu',
'/cmf/foo/menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Doctrine\Phpcr\Menu',
'/cmf/foo/menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Bundle\BarBarBundle\Doctrine\Phpcr\Menu',
'/symfony/barbar/menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Bundle\BarBarBundle\Doctrine\Phpcr\Menu\Item',
'/symfony/barbar/menu-item',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Doctrine\Orm\Menu',
'/cmf/foo/menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Doctrine\MongoDB\Menu',
'/cmf/foo/menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Doctrine\CouchDB\Menu',
'/cmf/foo/menu',
];
// @phpstan-ignore-next-line
yield [
'AppBundle\Entity\User',
'/app/user',
];
// @phpstan-ignore-next-line
yield [
'App\Entity\User',
'/app/user',
Expand Down Expand Up @@ -483,7 +497,7 @@ public function testGetBaseRoutePatternWithUnrecognizedClassname(): void
/**
* @phpstan-return iterable<array-key, array{class-string, string}>
*
* @psalm-suppress InvalidReturnType, InvalidReturnStatement
* @psalm-suppress MoreSpecificReturnType
*/
public function provideGetBaseRouteName(): iterable
{
Expand All @@ -492,58 +506,72 @@ public function provideGetBaseRouteName(): iterable
'Application\Sonata\NewsBundle\Entity\Post',
'admin_sonata_news_post',
];
// @phpstan-ignore-next-line
yield [
'Application\Sonata\NewsBundle\Document\Post',
'admin_sonata_news_post',
];
// @phpstan-ignore-next-line
yield [
'MyApplication\MyBundle\Entity\Post',
'admin_myapplication_my_post',
];
// @phpstan-ignore-next-line
yield [
'MyApplication\MyBundle\Entity\Post\Category',
'admin_myapplication_my_post_category',
];
// @phpstan-ignore-next-line
yield [
'MyApplication\MyBundle\Entity\Product\Category',
'admin_myapplication_my_product_category',
];
// @phpstan-ignore-next-line
yield [
'MyApplication\MyBundle\Entity\Other\Product\Category',
'admin_myapplication_my_other_product_category',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Document\Menu',
'admin_cmf_foo_menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Doctrine\Phpcr\Menu',
'admin_cmf_foo_menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Bundle\BarBarBundle\Doctrine\Phpcr\Menu',
'admin_symfony_barbar_menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Bundle\BarBarBundle\Doctrine\Phpcr\Menu\Item',
'admin_symfony_barbar_menu_item',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Doctrine\Orm\Menu',
'admin_cmf_foo_menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Doctrine\MongoDB\Menu',
'admin_cmf_foo_menu',
];
// @phpstan-ignore-next-line
yield [
'Symfony\Cmf\Bundle\FooBundle\Doctrine\CouchDB\Menu',
'admin_cmf_foo_menu',
];
// @phpstan-ignore-next-line
yield [
'AppBundle\Entity\User',
'admin_app_user',
];
// @phpstan-ignore-next-line
yield [
'App\Entity\User',
'admin_app_user',
Expand Down
2 changes: 1 addition & 1 deletion tests/Admin/BreadcrumbsBuilderTest.php
Expand Up @@ -134,7 +134,7 @@ public function testChildGetBreadCrumbs(): void
}

/**
* @phpstan-return array<array{string}>
* @phpstan-return iterable<array{string}>
*/
public function provideBuildBreadcrumbsCases(): iterable
{
Expand Down
Expand Up @@ -160,7 +160,7 @@ public function testReverseTransformMultipleInvalidTypeTests(mixed $params, stri
}

/**
* @phpstan-return array<array{mixed, string}>
* @phpstan-return iterable<array{mixed, string}>
*/
public function provideReverseTransformMultipleInvalidTypeTestsCases(): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/DataTransformer/ModelToIdTransformerTest.php
Expand Up @@ -48,7 +48,7 @@ public function testReverseTransform(int|string $value): void
}

/**
* @return array<array{int|string}>
* @return iterable<array{int|string}>
*/
public function provideReverseTransformCases(): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/DataTransformerResolverTest.php
Expand Up @@ -55,7 +55,7 @@ public function testFailedResolve(): void
}

/**
* @phpstan-return array<array{string}>
* @phpstan-return iterable<array{string}>
*/
public function provideFieldTypes(): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/Type/ChoiceFieldMaskTypeTest.php
Expand Up @@ -43,7 +43,7 @@ public function testGetDefaultOptions2(): void
}

/**
* @phpstan-return array<array{mixed}>
* @phpstan-return iterable<array{mixed}>
*/
public function provideSetAllowedTypesCases(): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/Type/ModelTypeTest.php
Expand Up @@ -110,7 +110,7 @@ public function testCompoundOption(bool $expectedCompound, bool $multiple, bool
}

/**
* @phpstan-return array<array{bool, bool, bool}>
* @phpstan-return iterable<array{bool, bool, bool}>
*/
public function provideCompoundOptionCases(): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Form/Widget/FormSonataNativeCollectionWidgetTest.php
Expand Up @@ -30,7 +30,7 @@ protected function setUp(): void
}

/**
* @phpstan-return array<array{array<string, mixed>}>
* @phpstan-return iterable<array{array<string, mixed>}>
*/
public function providePrototypeIsDeletableNoMatterTheShrinkabilityCases(): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Mapper/BaseGroupedMapperTest.php
Expand Up @@ -204,7 +204,7 @@ public function testIfEndException(): void
}

/**
* @phpstan-return array<array{string, string, string|null, string}>
* @phpstan-return iterable<array{string, string, string|null, string}>
*/
public function provideLabelCases(): iterable
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Menu/Provider/GroupMenuProviderTest.php
Expand Up @@ -383,7 +383,7 @@ public function testRootMenuItemUrl(string $expectedUrl, array $item): void
}

/**
* @phpstan-return array<array{Group}>
* @phpstan-return iterable<array{Group}>
*/
public function getAdminGroups(): iterable
{
Expand Down Expand Up @@ -426,7 +426,7 @@ public function getAdminGroups(): iterable
}

/**
* @phpstan-return array<array{Group}>
* @phpstan-return iterable<array{Group}>
*/
public function getAdminGroupsMultipleRoles(): iterable
{
Expand Down Expand Up @@ -523,7 +523,7 @@ public function getAdminGroupsMultipleRoles(): iterable
}

/**
* @phpstan-return array<array{Group}>
* @phpstan-return iterable<array{Group}>
*/
public function provideGetMenuProviderWithCheckerGrantedMultipleGroupRolesOnTopCases(): iterable
{
Expand Down Expand Up @@ -590,7 +590,7 @@ public function provideGetMenuProviderWithCheckerGrantedMultipleGroupRolesOnTopC
}

/**
* @phpstan-return array<array{Group}>
* @phpstan-return iterable<array{Group}>
*/
public function provideGetMenuProviderOnTopOptionsCases(): iterable
{
Expand Down
8 changes: 4 additions & 4 deletions tests/Route/DefaultRouteGeneratorTest.php
Expand Up @@ -104,7 +104,7 @@ public function testGenerateUrl(
}

/**
* @phpstan-return array<array{0: string, 1: string, 2: array<string, mixed>, 3?: int}>
* @phpstan-return iterable<array{0: string, 1: string, 2: array<string, mixed>, 3?: int}>
*/
public function provideGenerateUrlCases(): iterable
{
Expand Down Expand Up @@ -223,7 +223,7 @@ public function testGenerateUrlChild(string $type, string $expected, string $nam
}

/**
* @phpstan-return array<array{string, string, string, array<string, mixed>}>
* @phpstan-return iterable<array{string, string, string, array<string, mixed>}>
*/
public function provideGenerateUrlChildCases(): iterable
{
Expand Down Expand Up @@ -296,7 +296,7 @@ public function testGenerateUrlParentFieldDescription(string $expected, string $
}

/**
* @phpstan-return array<array{string, string, array<string, mixed>}>
* @phpstan-return iterable<array{string, string, array<string, mixed>}>
*/
public function provideGenerateUrlParentFieldDescriptionCases(): iterable
{
Expand Down Expand Up @@ -396,7 +396,7 @@ public function testGenerateUrlLoadCache(string $expected, string $name, array $
}

/**
* @phpstan-return array<array{string, string, array<string, mixed>}>
* @phpstan-return iterable<array{string, string, array<string, mixed>}>
*/
public function provideGenerateUrlLoadCacheCases(): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Security/Acl/Permission/AdminPermissionMapTest.php
Expand Up @@ -54,7 +54,7 @@ public function testGetMaskReturnsNullIfPermissionIsNotSupported(): void
}

/**
* @phpstan-return array<array{bool, string}>
* @phpstan-return iterable<array{bool, string}>
*/
public function provideContainsReturnsABooleanCases(): iterable
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Security/Handler/RoleSecurityHandlerTest.php
Expand Up @@ -57,7 +57,7 @@ public function testGetBaseRole(string $expected, string $code): void
}

/**
* @phpstan-return array<array{string, string}>
* @phpstan-return iterable<array{string, string}>
*/
public function provideGetBaseRoleCases(): iterable
{
Expand Down Expand Up @@ -117,7 +117,7 @@ public function testIsGranted(
}

/**
* @phpstan-return array<array{0: bool, 1: string|array<string>, 2: string, 3: string|Expression|array<string|Expression>, 4?: object|null}>
* @phpstan-return iterable<array{0: bool, 1: string|array<string>, 2: string, 3: string|Expression|array<string|Expression>, 4?: object|null}>
*/
public function provideIsGrantedCases(): iterable
{
Expand Down
2 changes: 1 addition & 1 deletion tests/Translator/NativeLabelTranslatorStrategyTest.php
Expand Up @@ -29,7 +29,7 @@ public function testLabel(string $expectedLabel, string $label): void
}

/**
* @phpstan-return array<array{string, string}>
* @phpstan-return iterable<array{string, string}>
*/
public function provideLabelCases(): iterable
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Twig/CanonicalizeRuntimeTest.php
Expand Up @@ -64,7 +64,7 @@ public function testCanonicalizedLocaleForSelect2(?string $expected, string $ori
/**
* NEXT_MAJOR: Remove this function.
*
* @return array<array{?string, string}>
* @return iterable<array{?string, string}>
*/
public function provideCanonicalizedLocaleForMomentCases(): iterable
{
Expand Down Expand Up @@ -186,7 +186,7 @@ public function provideCanonicalizedLocaleForMomentCases(): iterable
}

/**
* @return array<array{?string, string}>
* @return iterable<array{?string, string}>
*/
public function provideCanonicalizedLocaleForSelect2Cases(): iterable
{
Expand Down
4 changes: 2 additions & 2 deletions tests/Twig/Extension/CanonicalizeExtensionTest.php
Expand Up @@ -70,7 +70,7 @@ public function testCanonicalizedLocaleForSelect2(?string $expected, string $ori
}

/**
* @return array<array{?string, string}>
* @return iterable<array{?string, string}>
*/
public function provideCanonicalizedLocaleForMomentCases(): iterable
{
Expand Down Expand Up @@ -192,7 +192,7 @@ public function provideCanonicalizedLocaleForMomentCases(): iterable
}

/**
* @return array<array{?string, string}>
* @return iterable<array{?string, string}>
*/
public function provideCanonicalizedLocaleForSelect2Cases(): iterable
{
Expand Down

0 comments on commit 99777c8

Please sign in to comment.