diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 1a98413..aab4991 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,1471 +1,2 @@ parameters: - ignoreErrors: - - - rawMessage: 'Argument of an invalid type array|bool|float|int|string|null supplied for foreach, only iterables are supported.' - identifier: foreach.nonIterable - count: 1 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php - - - - rawMessage: 'Binary operation "+" between mixed and array{remember_me_parameter: null, always_remember_me: false} results in an error.' - identifier: binaryOp.invalid - count: 1 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php - - - - rawMessage: Binary operation "." between 'security…' and mixed results in an error. - identifier: binaryOp.invalid - count: 4 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php - - - - rawMessage: Cannot access offset 'always_remember_me' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php - - - - rawMessage: Cannot access offset 'remember_me_parameter' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php - - - - rawMessage: Possibly invalid array key type mixed. - identifier: offsetAccess.invalidOffset - count: 3 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php - - - - rawMessage: Cannot access offset 'alias' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/MenuCompilerPass.php - - - - rawMessage: Cannot access offset 'method' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/MenuCompilerPass.php - - - - rawMessage: Cannot access offset 'priority' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/MenuCompilerPass.php - - - - rawMessage: Cannot access offset 'role' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/DependencyInjection/CompilerPass/MenuCompilerPass.php - - - - rawMessage: 'Default value of the parameter #2 $config (array{}) of method SolidWorx\Platform\PlatformBundle\DependencyInjection\Extension\TwoFactorExtension::enable() is incompatible with type array{name: string, base_template: string}.' - identifier: parameter.defaultValue - count: 1 - path: src/Bundle/Platform/DependencyInjection/Extension/TwoFactorExtension.php - - - - rawMessage: 'Parameter #2 $configurator of method Symfony\Component\DependencyInjection\ContainerBuilder::registerAttributeForAutoconfiguration() expects callable(Symfony\Component\DependencyInjection\ChildDefinition, SolidWorx\Platform\PlatformBundle\Attributes\Menu\MenuBuilder, Reflector): void, Closure(Symfony\Component\DependencyInjection\ChildDefinition, SolidWorx\Platform\PlatformBundle\Attributes\Menu\MenuBuilder, ReflectionMethod): void given.' - identifier: argument.type - count: 1 - path: src/Bundle/Platform/DependencyInjection/SolidWorxPlatformExtension.php - - - - rawMessage: 'Parameter #2 $array of function implode expects array, array given.' - identifier: argument.type - count: 1 - path: src/Bundle/Platform/Feature/FeatureValue.php - - - - rawMessage: 'Parameter #1 $child of method Symfony\Component\Form\FormBuilderInterface|null>::add() expects string|Symfony\Component\Form\FormBuilderInterface, mixed given.' - identifier: argument.type - count: 2 - path: src/Bundle/Platform/Form/Type/Security/LoginType.php - - - - rawMessage: Cannot cast mixed to string. - identifier: cast.string - count: 1 - path: src/Bundle/Platform/Form/Type/Security/TwoFactorVerifyType.php - - - - rawMessage: 'Class SolidWorx\Platform\PlatformBundle\Form\Type\TextEditorType extends generic class Symfony\Component\Form\AbstractType but does not specify its types: TData' - identifier: missingType.generics - count: 1 - path: src/Bundle/Platform/Form/Type/TextEditorType.php - - - - rawMessage: Cannot access offset 'enabled' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: Cannot access offset 'security' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: Cannot access offset 'two_factor' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: Cannot cast mixed to string. - identifier: cast.string - count: 2 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: 'Generator expects value type Symfony\Component\HttpKernel\Bundle\BundleInterface, mixed given.' - identifier: generator.valueType - count: 1 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: 'Parameter #1 $rawConfig of method SolidWorx\Platform\PlatformBundle\Config\PlatformConfigSectionInterface::setPlatformRawConfig() expects array, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: 'Property SolidWorx\Platform\PlatformBundle\Kernel::$rawConfig (array|null) does not accept mixed.' - identifier: assign.propertyType - count: 1 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: ''' - Return type of method SolidWorx\Platform\PlatformBundle\Kernel::registerBundles() has typehint with deprecated interface Symfony\Component\HttpKernel\Bundle\BundleInterface: - since Symfony 8.1, use Symfony\Component\DependencyInjection\Kernel\BundleInterface instead - ''' - identifier: return.deprecatedInterface - count: 1 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: Short ternary operator is not allowed. Use null coalesce operator if applicable or consider using long ternary. - identifier: ternary.shortNotAllowed - count: 1 - path: src/Bundle/Platform/Kernel.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Menu\Options::route() has parameter $parameters with no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Platform/Menu/Options.php - - - - rawMessage: 'Property SolidWorx\Platform\PlatformBundle\Menu\Options::$options (array{route?: string, routeParameters?: array, routeAbsolute?: bool}) does not accept array{route?: string, routeParameters: array, routeAbsolute?: bool}.' - identifier: assign.propertyType - count: 1 - path: src/Bundle/Platform/Menu/Options.php - - - - rawMessage: 'Property SolidWorx\Platform\PlatformBundle\Menu\Options::$options (array{route?: string, routeParameters?: array, routeAbsolute?: bool}) does not accept array{route?: string, routeParameters?: array, routeAbsolute?: bool, extras: array{icon: string}}.' - identifier: assign.propertyType - count: 1 - path: src/Bundle/Platform/Menu/Options.php - - - - rawMessage: 'Property SolidWorx\Platform\PlatformBundle\Menu\Options::$options (array{route?: string, routeParameters?: array, routeAbsolute?: bool}) does not accept array{route?: string, routeParameters?: array, routeAbsolute?: bool, extras: array{role: string}}.' - identifier: assign.propertyType - count: 1 - path: src/Bundle/Platform/Menu/Options.php - - - - rawMessage: 'Property SolidWorx\Platform\PlatformBundle\Menu\Options::$options (array{route?: string, routeParameters?: array, routeAbsolute?: bool}) does not accept array{route?: string, routeParameters?: array, routeAbsolute?: bool, extras: array{}}.' - identifier: assign.propertyType - count: 2 - path: src/Bundle/Platform/Menu/Options.php - - - - rawMessage: 'Only booleans are allowed in &&, mixed given on the left side.' - identifier: booleanAnd.leftNotBoolean - count: 1 - path: src/Bundle/Platform/Menu/Provider.php - - - - rawMessage: 'Parameter #2 $priority of method SplPriorityQueue::insert() expects int, array given.' - identifier: argument.type - count: 1 - path: src/Bundle/Platform/Menu/Provider.php - - - - rawMessage: Casting to bool something that's already bool. - identifier: cast.useless - count: 1 - path: src/Bundle/Platform/Model/User.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Model\User::getBackUpCodes() does not match interface method name: SolidWorx\Platform\PlatformBundle\Contracts\Security\TwoFactor\UserTwoFactorInterface::getBackupCodes().' - identifier: method.nameCase - count: 1 - path: src/Bundle/Platform/Model/User.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Model\User::getBackUpCodes() should return list but returns array.' - identifier: return.type - count: 1 - path: src/Bundle/Platform/Model/User.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Model\User::getEmailAuthRecipient() should return string but returns string|null.' - identifier: return.type - count: 1 - path: src/Bundle/Platform/Model/User.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Model\User::getTotpAuthenticationUsername() should return string but returns string|null.' - identifier: return.type - count: 1 - path: src/Bundle/Platform/Model/User.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Model\User::getUserIdentifier() should return non-empty-string but returns string|null.' - identifier: return.type - count: 1 - path: src/Bundle/Platform/Model/User.php - - - - rawMessage: Property SolidWorx\Platform\PlatformBundle\Model\User::$backupCodes type has no value type specified in iterable type array. - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Platform/Model/User.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Repository\UserRepository::loadUserByIdentifier() should return Symfony\Component\Security\Core\User\UserInterface but returns mixed.' - identifier: return.type - count: 1 - path: src/Bundle/Platform/Repository/UserRepository.php - - - - rawMessage: 'Parameter #1 $identifier of method SolidWorx\Platform\PlatformBundle\Repository\UserRepository::loadUserByIdentifier() expects string, string|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Platform/Repository/UserRepository.php - - - - rawMessage: 'Parameter #2 $entityClass of method Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository::__construct() expects class-string, string|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Platform/Repository/UserRepository.php - - - - rawMessage: Type mixed in generic type SolidWorx\Platform\PlatformBundle\Repository\EntityRepository in PHPDoc tag @extends is not subtype of template type T of object of class SolidWorx\Platform\PlatformBundle\Repository\EntityRepository. - identifier: generics.notSubtype - count: 1 - path: src/Bundle/Platform/Repository/UserRepository.php - - - - rawMessage: Binary operation "." between '/' and mixed results in an error. - identifier: binaryOp.invalid - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Binary operation "." between 'The "check_path"…' and mixed results in an error. - identifier: binaryOp.invalid - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Binary operation "." between '_login_' and mixed results in an error. - identifier: binaryOp.invalid - count: 3 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'always_remember_me' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'check_path' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 5 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'csrf_parameter' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'csrf_token_id' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'enable_csrf' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'login_path' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'password_parameter' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'remember_me_parameter' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot access offset 'username_parameter' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: Cannot cast mixed to string. - identifier: cast.string - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Routing\LoginPageRouteLoader::__construct() has parameter $authenticators with no value type specified in iterable type iterable.' - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: 'Parameter #1 $name of method Symfony\Component\Routing\RouteCollection::add() expects string, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: 'Parameter $path of class Symfony\Component\Routing\Route constructor expects string, mixed given.' - identifier: argument.type - count: 2 - path: src/Bundle/Platform/Routing/LoginPageRouteLoader.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\SolidWorxPlatformBundle::createContainerExtension() never returns null so it can be removed from the return type.' - identifier: return.unusedType - count: 1 - path: src/Bundle/Platform/SolidWorxPlatformBundle.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\SolidWorxPlatformBundle::createContainerExtension() should return Symfony\Component\DependencyInjection\Extension\ExtensionInterface|null but returns object.' - identifier: return.type - count: 1 - path: src/Bundle/Platform/SolidWorxPlatformBundle.php - - - - rawMessage: Cannot access offset 'secret' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Platform/Twig/Components/Security/TwoFactor.php - - - - rawMessage: 'Method SolidWorx\Platform\PlatformBundle\Twig\Components\Security\TwoFactor::instantiateForm() return type with generic interface Symfony\Component\Form\FormInterface does not specify its types: TData' - identifier: missingType.generics - count: 1 - path: src/Bundle/Platform/Twig/Components/Security/TwoFactor.php - - - - rawMessage: 'Parameter #1 $totpSecret of method SolidWorx\Platform\PlatformBundle\Contracts\Security\TwoFactor\UserTwoFactorInterface::setTotpSecret() expects string, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Platform/Twig/Components/Security/TwoFactor.php - - - - rawMessage: Cannot access offset 'entity' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Config/Builder/SaasConfigBuilder.php - - - - rawMessage: Cannot access offset 'lemon_squeezy' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Config/Builder/SaasConfigBuilder.php - - - - rawMessage: Cannot access offset 'subscriptions' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Config/Builder/SaasConfigBuilder.php - - - - rawMessage: Cannot access offset 'table_names' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Config/Builder/SaasConfigBuilder.php - - - - rawMessage: Cannot access offset 'user_entity' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Config/Builder/SaasConfigBuilder.php - - - - rawMessage: Cannot cast mixed to string. - identifier: cast.string - count: 5 - path: src/Bundle/Saas/Config/SaasConfiguration.php - - - - rawMessage: 'Parameter #1 $object_or_class of function is_subclass_of expects object|string, mixed given.' - identifier: argument.type - count: 2 - path: src/Bundle/Saas/Config/SaasConfiguration.php - - - - rawMessage: Binary operation "." between mixed and '@' results in an error. - identifier: binaryOp.invalid - count: 1 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: Binary operation "." between non-falsy-string and mixed results in an error. - identifier: binaryOp.invalid - count: 2 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: 'Call to static method getClass() on an unknown class Doctrine\Common\Util\ClassUtils.' - identifier: class.notFound - count: 2 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Console\Command\SubscriptionListCommand::getSubscriberString() never returns Symfony\Component\Uid\Ulid so it can be removed from the return type.' - identifier: return.unusedType - count: 1 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Console\Command\SubscriptionListCommand::getSubscriberString() never returns int so it can be removed from the return type.' - identifier: return.unusedType - count: 1 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: 'Only booleans are allowed in &&, mixed given on the left side.' - identifier: booleanAnd.leftNotBoolean - count: 1 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: 'Only booleans are allowed in &&, mixed given on the right side.' - identifier: booleanAnd.rightNotBoolean - count: 1 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: 'Only booleans are allowed in an if condition, mixed given.' - identifier: if.condNotBoolean - count: 3 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: 'Parameter #1 $value of static method SolidWorx\Platform\SaasBundle\Enum\SubscriptionStatus::from() expects int|string, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Console/Command/SubscriptionListCommand.php - - - - rawMessage: 'Parameter #1 $string of function strtolower expects string, Symfony\Component\String\AbstractUnicodeString given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Doctrine/EventSubscriber/PlanIdSubscriber.php - - - - rawMessage: Property SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Meta::$customData type has no value type specified in iterable type array. - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Saas/Dto/LemonSqueezy/Meta.php - - - - rawMessage: 'Property SolidWorx\Platform\SaasBundle\Entity\Plan::$subscriptions type mapping mismatch: property can contain Doctrine\Common\Collections\Collection but database expects Doctrine\Common\Collections\Collection&iterable.' - identifier: doctrine.associationType - count: 1 - path: src/Bundle/Saas/Entity/Plan.php - - - - rawMessage: 'Property SolidWorx\Platform\SaasBundle\Entity\Plan::$subscriptions with generic interface Doctrine\Common\Collections\Collection does not specify its types: TKey, T' - identifier: missingType.generics - count: 1 - path: src/Bundle/Saas/Entity/Plan.php - - - - rawMessage: Cannot access property $attributes on SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|null. - identifier: property.nonObject - count: 1 - path: src/Bundle/Saas/Event/TrialStartedEvent.php - - - - rawMessage: 'Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/EventSubscriber/SubscriptionEventSubscriber.php - - - - rawMessage: 'Parameter #1 $plans of class SolidWorx\Platform\PlatformBundle\Feature\UpgradeOptions constructor expects list, array given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Feature/PlanFeatureGate.php - - - - rawMessage: 'Call to an undefined method SolidWorx\Platform\SaasBundle\Repository\PlanFeatureRepositoryInterface::remove().' - identifier: method.notFound - count: 1 - path: src/Bundle/Saas/Feature/PlanFeatureManager.php - - - - rawMessage: 'Call to an undefined method SolidWorx\Platform\SaasBundle\Repository\PlanFeatureRepositoryInterface::save().' - identifier: method.notFound - count: 1 - path: src/Bundle/Saas/Feature/PlanFeatureManager.php - - - - rawMessage: 'Call to an undefined method Symfony\Contracts\Cache\CacheInterface::clear().' - identifier: method.notFound - count: 1 - path: src/Bundle/Saas/Feature/PlanFeatureManager.php - - - - rawMessage: 'Argument of an invalid type mixed supplied for foreach, only iterables are supported.' - identifier: foreach.nonIterable - count: 2 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'attributes' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 8 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'customer_portal' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'description' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'ends_at' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'id' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'links' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'name' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'price-model' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'related' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'relationships' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'renewal_interval_quantity' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'renewal_interval_unit' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'renews_at' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'unit_price' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'url' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'urls' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: Cannot access offset 'variants' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Integration\LemonSqueezy::checkout() should return string but returns mixed.' - identifier: return.type - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Integration\LemonSqueezy::getCustomerPortalUrl() should return string but returns mixed.' - identifier: return.type - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Parameter #1 $payload of method SolidWorx\Platform\SaasBundle\Integration\LemonSqueezy::extractRenewDate() expects array, array given.' - identifier: argument.type - count: 2 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Parameter #2 $url of method Symfony\Contracts\HttpClient\HttpClientInterface::request() expects string, mixed given.' - identifier: argument.type - count: 2 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Parameter #3 ...$values of function sprintf expects bool|float|int|string|null, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Parameter $description of class SolidWorx\Platform\SaasBundle\Dto\IntegrationProduct constructor expects string, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Parameter $id of class SolidWorx\Platform\SaasBundle\Dto\IntegrationProduct constructor expects string, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Parameter $name of class SolidWorx\Platform\SaasBundle\Dto\IntegrationProduct constructor expects string, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Parameter $price of class SolidWorx\Platform\SaasBundle\Dto\IntegrationProduct constructor expects int, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Integration/LemonSqueezy.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Integration\Options::toArray() return type has no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Saas/Integration/Options.php - - - - rawMessage: Property SolidWorx\Platform\SaasBundle\Integration\Options::$options type has no value type specified in iterable type array. - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Saas/Integration/Options.php - - - - rawMessage: Access to an undefined property SolidWorx\Platform\SaasBundle\RemoteEvent\SubscriptionPaymentRemoteEvent|SolidWorx\Platform\SaasBundle\RemoteEvent\SubscriptionRemoteEvent::$subscription. - identifier: property.notFound - count: 8 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: Access to an undefined property SolidWorx\Platform\SaasBundle\RemoteEvent\SubscriptionPaymentRemoteEvent|SolidWorx\Platform\SaasBundle\RemoteEvent\SubscriptionRemoteEvent::$subscriptionInvoice. - identifier: property.notFound - count: 5 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Call to function is_a() with arguments ''SolidWorx\\Platform\\SaasBundle\\Event\\SubscriptionPaymentFailedEvent''|''SolidWorx\\Platform\\SaasBundle\\Event\\SubscriptionPaymentPaidEvent''|''SolidWorx\\Platform\\SaasBundle\\Event\\SubscriptionPaymentRecoveredEvent''|''SolidWorx\\Platform\\SaasBundle\\Event\\SubscriptionPaymentRefundedEvent'', ''SolidWorx\\Platform\\SaasBundle\\Event\\PaymentEvent'' and true will always evaluate to true.' - identifier: function.alreadyNarrowedType - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: Cannot access offset 'id' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: Match arm comparison between SolidWorx\Platform\SaasBundle\Enum\LemonSqueezy\Event::SUBSCRIPTION_PAYMENT_REFUNDED and SolidWorx\Platform\SaasBundle\Enum\LemonSqueezy\Event::SUBSCRIPTION_PAYMENT_REFUNDED is always true. - identifier: match.alwaysTrue - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #1 $gatewayEventId of method SolidWorx\Platform\SaasBundle\Entity\WebhookEventLog::setGatewayEventId() expects string|null, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #2 ...$values of function sprintf expects bool|float|int|string|null, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscription of class SolidWorx\Platform\SaasBundle\Event\SubscriptionCancelledEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscription of class SolidWorx\Platform\SaasBundle\Event\SubscriptionCreatedEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscription of class SolidWorx\Platform\SaasBundle\Event\SubscriptionExpiredEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscription of class SolidWorx\Platform\SaasBundle\Event\SubscriptionPausedEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscription of class SolidWorx\Platform\SaasBundle\Event\SubscriptionResumedEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscription of class SolidWorx\Platform\SaasBundle\Event\SubscriptionUnpausedEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscription of class SolidWorx\Platform\SaasBundle\Event\SubscriptionUpdatedEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscriptionInvoice of class SolidWorx\Platform\SaasBundle\Event\SubscriptionPaymentFailedEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscriptionInvoice of class SolidWorx\Platform\SaasBundle\Event\SubscriptionPaymentPaidEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscriptionInvoice of class SolidWorx\Platform\SaasBundle\Event\SubscriptionPaymentRecoveredEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Parameter #3 $subscriptionInvoice of class SolidWorx\Platform\SaasBundle\Event\SubscriptionPaymentRefundedEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null, SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription|SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice|null given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumer.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\RemoteEvent\SubscriptionPaymentRemoteEvent::__construct() has parameter $payload with no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Saas/RemoteEvent/SubscriptionPaymentRemoteEvent.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\RemoteEvent\SubscriptionRemoteEvent::__construct() has parameter $payload with no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Saas/RemoteEvent/SubscriptionRemoteEvent.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Repository\PlanRepository::findAllOrdered() should return list but returns mixed.' - identifier: return.type - count: 1 - path: src/Bundle/Saas/Repository/PlanRepository.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Repository\PlanRepository::findDefault() should return SolidWorx\Platform\SaasBundle\Entity\Plan|null but returns mixed.' - identifier: return.type - count: 1 - path: src/Bundle/Saas/Repository/PlanRepository.php - - - - rawMessage: 'Parameter #1 $id (SolidWorx\Platform\SaasBundle\Entity\Plan|string|Symfony\Component\Uid\Ulid) of method SolidWorx\Platform\SaasBundle\Repository\PlanRepository::find() should be contravariant with parameter $id (mixed) of method Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository::find()' - identifier: method.childParameterType - count: 1 - path: src/Bundle/Saas/Repository/PlanRepository.php - - - - rawMessage: 'Parameter #1 $id (SolidWorx\Platform\SaasBundle\Entity\Plan|string|Symfony\Component\Uid\Ulid) of method SolidWorx\Platform\SaasBundle\Repository\PlanRepository::find() should be contravariant with parameter $id (mixed) of method Doctrine\Persistence\ObjectRepository::find()' - identifier: method.childParameterType - count: 1 - path: src/Bundle/Saas/Repository/PlanRepository.php - - - - rawMessage: 'Parameter #2 $lockMode (int|null) of method SolidWorx\Platform\SaasBundle\Repository\PlanRepository::find() should be contravariant with parameter $lockMode (Doctrine\DBAL\LockMode|int|null) of method Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository::find()' - identifier: method.childParameterType - count: 1 - path: src/Bundle/Saas/Repository/PlanRepository.php - - - - rawMessage: 'Parameter #2 $lockMode (int|null) of method SolidWorx\Platform\SaasBundle\Repository\PlanRepository::find() should be contravariant with parameter $lockMode (Doctrine\DBAL\LockMode|int|null) of method SolidWorx\Platform\SaasBundle\Repository\PlanRepositoryInterface::find()' - identifier: method.childParameterType - count: 1 - path: src/Bundle/Saas/Repository/PlanRepository.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\SolidWorxPlatformSaasBundle::createContainerExtension() never returns null so it can be removed from the return type.' - identifier: return.unusedType - count: 1 - path: src/Bundle/Saas/SolidWorxPlatformSaasBundle.php - - - - rawMessage: 'Parameter #1 $plan of class SolidWorx\Platform\SaasBundle\Exception\InvalidPlanException constructor expects string, SolidWorx\Platform\SaasBundle\Entity\Plan|string|Symfony\Component\Uid\Ulid given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Subscription/SubscriptionManager.php - - - - rawMessage: Cannot access offset 'custom_data' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: Cannot access offset 'event_name' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 3 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: Cannot access offset 'id' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: Cannot access offset 'subscription_id' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: Cannot access offset 'type' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: Cannot cast mixed to string. - identifier: cast.string - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Webhook\Converter\LemonSqueezyPayloadConverter::convert() has parameter $payload with no value type specified in iterable type array.' - identifier: missingType.iterableValue - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Parameter #1 $name of class Symfony\Component\RemoteEvent\RemoteEvent constructor expects string, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Parameter #1 $ulid of static method Symfony\Component\Uid\Ulid::fromString() expects string, mixed given.' - identifier: argument.type - count: 2 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Parameter #1 $value of static method SolidWorx\Platform\SaasBundle\Enum\LemonSqueezy\Event::from() expects int|string, mixed given.' - identifier: argument.type - count: 2 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Parameter #2 $id of class Symfony\Component\RemoteEvent\RemoteEvent constructor expects string, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Parameter #2 $subscription of class SolidWorx\Platform\SaasBundle\RemoteEvent\SubscriptionRemoteEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\Subscription, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Parameter #2 $subscriptionInvoice of class SolidWorx\Platform\SaasBundle\RemoteEvent\SubscriptionPaymentRemoteEvent constructor expects SolidWorx\Platform\SaasBundle\Dto\LemonSqueezy\SubscriptionInvoice, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Parameter #3 $payload of class Symfony\Component\RemoteEvent\RemoteEvent constructor expects array, mixed given.' - identifier: argument.type - count: 1 - path: src/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverter.php - - - - rawMessage: 'Method SolidWorx\Platform\UiBundle\SolidWorxPlatformUiBundle::createContainerExtension() never returns null so it can be removed from the return type.' - identifier: return.unusedType - count: 1 - path: src/Bundle/Ui/SolidWorxPlatformUiBundle.php - - - - rawMessage: ''' - Access to deprecated property $file of class Rector\Rector\AbstractRector: - Use getFile() instead. - ''' - identifier: property.deprecated - count: 1 - path: src/Tools/Rector/Rules/AddGenericMethodPhpDocRector.php - - - - rawMessage: 'Only booleans are allowed in an if condition, int|false given.' - identifier: if.condNotBoolean - count: 2 - path: src/Tools/Rector/Rules/AddGenericMethodPhpDocRector.php - - - - rawMessage: 'Parameter #1 $node (PhpParser\Node\Stmt\ClassMethod) of method SolidWorx\Platform\Tools\Rector\Rules\AddGenericMethodPhpDocRector::refactor() should be contravariant with parameter $node (PhpParser\Node) of method Rector\Contract\Rector\RectorInterface::refactor()' - identifier: method.childParameterType - count: 2 - path: src/Tools/Rector/Rules/AddGenericMethodPhpDocRector.php - - - - rawMessage: 'Method SolidWorx\Platform\Tools\Rector\Rules\AddGenericTemplateExtendsRector::countOwnTemplateTags() has parameter $reflection with generic class ReflectionClass but does not specify its types: T' - identifier: missingType.generics - count: 1 - path: src/Tools/Rector/Rules/AddGenericTemplateExtendsRector.php - - - - rawMessage: 'Method SolidWorx\Platform\Tools\Rector\Rules\AddGenericTemplateExtendsRector::countOwnTemplateTags() should return int but returns int<0, max>|false.' - identifier: return.type - count: 1 - path: src/Tools/Rector/Rules/AddGenericTemplateExtendsRector.php - - - - rawMessage: 'Parameter #1 $node (PhpParser\Node\Stmt\Class_) of method SolidWorx\Platform\Tools\Rector\Rules\AddGenericTemplateExtendsRector::refactor() should be contravariant with parameter $node (PhpParser\Node) of method Rector\Contract\Rector\RectorInterface::refactor()' - identifier: method.childParameterType - count: 2 - path: src/Tools/Rector/Rules/AddGenericTemplateExtendsRector.php - - - - rawMessage: 'Parameter #1 $objectOrClass of class ReflectionClass constructor expects class-string|T of object, string given.' - identifier: argument.type - count: 2 - path: src/Tools/Rector/Rules/AddGenericTemplateExtendsRector.php - - - - rawMessage: 'Parameter #1 $optionsArg of method SolidWorx\Platform\Tools\Rector\Rules\AddGenericTemplateExtendsRector::isFieldUnmapped() expects PhpParser\Node\Arg|null, PhpParser\Node\Arg|PhpParser\Node\VariadicPlaceholder|null given.' - identifier: argument.type - count: 1 - path: src/Tools/Rector/Rules/AddGenericTemplateExtendsRector.php - - - - rawMessage: 'Parameter #1 $typeArg of method SolidWorx\Platform\Tools\Rector\Rules\AddGenericTemplateExtendsRector::resolveFormFieldPhpType() expects PhpParser\Node\Arg|null, PhpParser\Node\Arg|PhpParser\Node\VariadicPlaceholder|null given.' - identifier: argument.type - count: 1 - path: src/Tools/Rector/Rules/AddGenericTemplateExtendsRector.php - - - - rawMessage: 'Parameter #2 $optionsArg of method SolidWorx\Platform\Tools\Rector\Rules\AddGenericTemplateExtendsRector::resolveFormFieldPhpType() expects PhpParser\Node\Arg|null, PhpParser\Node\Arg|PhpParser\Node\VariadicPlaceholder|null given.' - identifier: argument.type - count: 1 - path: src/Tools/Rector/Rules/AddGenericTemplateExtendsRector.php - - - - rawMessage: Instanceof between PHPStan\PhpDocParser\Ast\Type\GenericTypeNode and PHPStan\PhpDocParser\Ast\Type\GenericTypeNode will always evaluate to true. - identifier: instanceof.alwaysTrue - count: 1 - path: src/Tools/Rector/Rules/EnforcePlatformEntityRepositoryRector.php - - - - rawMessage: 'Only booleans are allowed in a while condition, ReflectionClass|false given.' - identifier: while.condNotBoolean - count: 1 - path: src/Tools/Rector/Rules/EnforcePlatformEntityRepositoryRector.php - - - - rawMessage: 'Parameter #1 $node (PhpParser\Node\Stmt\Class_) of method SolidWorx\Platform\Tools\Rector\Rules\EnforcePlatformEntityRepositoryRector::refactor() should be contravariant with parameter $node (PhpParser\Node) of method Rector\Contract\Rector\RectorInterface::refactor()' - identifier: method.childParameterType - count: 2 - path: src/Tools/Rector/Rules/EnforcePlatformEntityRepositoryRector.php - - - - rawMessage: 'Parameter #1 $objectOrClass of class ReflectionClass constructor expects class-string|T of object, string given.' - identifier: argument.type - count: 1 - path: src/Tools/Rector/Rules/EnforcePlatformEntityRepositoryRector.php - - - - rawMessage: 'Call to static method PHPUnit\Framework\Assert::assertInstanceOf() with ''SolidWorx\\Platform\\PlatformBundle\\Config\\Builder\\SecurityConfigBuilder'' and SolidWorx\Platform\PlatformBundle\Config\Builder\SecurityConfigBuilder will always evaluate to true.' - identifier: staticMethod.alreadyNarrowedType - count: 1 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'doctrine' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'enable_utc_date' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'models' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'name' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'saas' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'types' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'ui' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'user' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'version' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: 'Parameter #2 $array of static method PHPUnit\Framework\Assert::assertArrayNotHasKey() expects array|ArrayAccess<(int|string), mixed>, mixed given.' - identifier: argument.type - count: 4 - path: tests/Bundle/PlatformBundle/Config/Builder/PlatformConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'active' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'additionalProperties' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'anything' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'color' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'count' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'db' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'default' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'description' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'driver' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'enabled' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'enum' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'items' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'name' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'nested' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'options' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'platform' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 23 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'properties' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 28 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'ratio' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'required_field' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'tags' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'template' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'title' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'two_factor' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'type' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 14 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'ui' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: Cannot access offset 'user' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: 'Parameter #2 $array of static method PHPUnit\Framework\Assert::assertArrayHasKey() expects array|ArrayAccess<(int|string), mixed>, mixed given.' - identifier: argument.type - count: 15 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: 'Parameter #2 $array of static method PHPUnit\Framework\Assert::assertArrayNotHasKey() expects array|ArrayAccess<(int|string), mixed>, mixed given.' - identifier: argument.type - count: 5 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: 'Parameter #2 $haystack of static method PHPUnit\Framework\Assert::assertContains() expects iterable, mixed given.' - identifier: argument.type - count: 1 - path: tests/Bundle/PlatformBundle/Config/SchemaGeneratorTest.php - - - - rawMessage: 'Call to function is_a() with arguments ''SolidWorx\\Platform\\PlatformBundle\\Response\\RedirectResponse'', ''Symfony\\Component\\HttpFoundation\\RedirectResponse'' and true will always evaluate to true.' - identifier: function.alreadyNarrowedType - count: 1 - path: tests/Bundle/PlatformBundle/Response/RedirectResponseTest.php - - - - rawMessage: 'Call to static method PHPUnit\Framework\Assert::assertInstanceOf() with ''SolidWorx\\Platform\\SaasBundle\\Config\\Builder\\SaasPaymentConfigBuilder'' and SolidWorx\Platform\SaasBundle\Config\Builder\SaasPaymentConfigBuilder will always evaluate to true.' - identifier: staticMethod.alreadyNarrowedType - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'api_key' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'db_schema' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'enabled' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'entity' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'lemon_squeezy' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 4 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'plan' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'return_route' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'store_id' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'subscriptions' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'table_names' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'trial' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'user_entity' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'webhook_secret' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: 'Parameter #2 $array of static method PHPUnit\Framework\Assert::assertArrayHasKey() expects array|ArrayAccess<(int|string), mixed>, mixed given.' - identifier: argument.type - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: 'Parameter #2 $array of static method PHPUnit\Framework\Assert::assertArrayNotHasKey() expects array|ArrayAccess<(int|string), mixed>, mixed given.' - identifier: argument.type - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: 'Parameter #2 $haystack of static method PHPUnit\Framework\Assert::assertCount() expects Countable|iterable, mixed given.' - identifier: argument.type - count: 1 - path: tests/Bundle/Saas/Config/Builder/SaasConfigBuilderTest.php - - - - rawMessage: 'Method SolidWorx\Platform\SaasBundle\Repository\PlanFeatureRepositoryInterface@anonymous/tests/Bundle/Saas/Feature/PlanFeatureManagerTest.php:219::findByPlans() should return array but returns array.' - identifier: return.type - count: 1 - path: tests/Bundle/Saas/Feature/PlanFeatureManagerTest.php - - - - rawMessage: Instanceof between *NEVER* and SolidWorx\Platform\SaasBundle\Event\PaymentEvent will always evaluate to false. - identifier: instanceof.alwaysFalse - count: 1 - path: tests/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumerTest.php - - - - rawMessage: Instanceof between *NEVER* and SolidWorx\Platform\SaasBundle\Event\SubscriptionEvent will always evaluate to false. - identifier: instanceof.alwaysFalse - count: 1 - path: tests/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumerTest.php - - - - rawMessage: 'Parameter #2 $expectedEventClass of method Bundle\Saas\RemoteEvent\LemonSqueezyWebhookConsumerTest::testConsume() expects class-string, string given.' - identifier: argument.type - count: 12 - path: tests/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumerTest.php - - - - rawMessage: Result of && is always false. - identifier: booleanAnd.alwaysFalse - count: 2 - path: tests/Bundle/Saas/RemoteEvent/LemonSqueezyWebhookConsumerTest.php - - - - rawMessage: 'Method Bundle\Saas\Webhook\Converter\LemonSqueezyPayloadConverterTest::loadFixture() should return array but returns array.' - identifier: return.type - count: 1 - path: tests/Bundle/Saas/Webhook/Converter/LemonSqueezyPayloadConverterTest.php - - - - rawMessage: Cannot access offset 'base' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/Ui/Config/Builder/UiConfigBuilderTest.php - - - - rawMessage: Cannot access offset 'login' on mixed. - identifier: offsetAccess.nonOffsetAccessible - count: 2 - path: tests/Bundle/Ui/Config/Builder/UiConfigBuilderTest.php - - - - rawMessage: 'Parameter #2 $array of static method PHPUnit\Framework\Assert::assertArrayHasKey() expects array|ArrayAccess<(int|string), mixed>, mixed given.' - identifier: argument.type - count: 1 - path: tests/Bundle/Ui/Config/Builder/UiConfigBuilderTest.php + ignoreErrors: [] diff --git a/src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php b/src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php index 5f0ffc9..5e45263 100644 --- a/src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php +++ b/src/Bundle/Platform/DependencyInjection/CompilerPass/AuthenticationCompilerPass.php @@ -18,6 +18,9 @@ use Symfony\Component\DependencyInjection\Argument\IteratorArgument; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; +use function is_array; +use function is_iterable; +use function is_string; final class AuthenticationCompilerPass implements CompilerPassInterface { @@ -39,15 +42,28 @@ private function registerLoginRouteLoader(ContainerBuilder $container): void $routeLoader = $container->getDefinition(LoginPageRouteLoader::class); $firewalls = $container->getParameter('security.firewalls'); + if (! is_iterable($firewalls)) { + return; + } + $authenticators = []; foreach ($firewalls as $firewall) { + if (! is_string($firewall)) { + continue; + } + if (! $container->hasDefinition('security.authenticator.form_login.' . $firewall)) { continue; } $authenticator = $container->getDefinition('security.authenticator.form_login.' . $firewall); - $authenticators[$firewall] = $authenticator->getArgument(4) + [ + $options = $authenticator->getArgument(4); + if (! is_array($options)) { + continue; + } + + $authenticators[$firewall] = $options + [ 'remember_me_parameter' => null, 'always_remember_me' => false, ]; @@ -55,8 +71,10 @@ private function registerLoginRouteLoader(ContainerBuilder $container): void if ($container->hasDefinition('security.authenticator.remember_me_handler.' . $firewall)) { $rememberMeArguments = $container->getDefinition('security.authenticator.remember_me_handler.' . $firewall)->getArgument(3); - $authenticators[$firewall]['remember_me_parameter'] = $rememberMeArguments['remember_me_parameter']; - $authenticators[$firewall]['always_remember_me'] = $rememberMeArguments['always_remember_me']; + if (is_array($rememberMeArguments)) { + $authenticators[$firewall]['remember_me_parameter'] = $rememberMeArguments['remember_me_parameter'] ?? null; + $authenticators[$firewall]['always_remember_me'] = $rememberMeArguments['always_remember_me'] ?? false; + } } } diff --git a/src/Bundle/Platform/DependencyInjection/CompilerPass/MenuCompilerPass.php b/src/Bundle/Platform/DependencyInjection/CompilerPass/MenuCompilerPass.php index f199d22..28b7847 100644 --- a/src/Bundle/Platform/DependencyInjection/CompilerPass/MenuCompilerPass.php +++ b/src/Bundle/Platform/DependencyInjection/CompilerPass/MenuCompilerPass.php @@ -21,6 +21,7 @@ use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; +use function is_array; final class MenuCompilerPass implements CompilerPassInterface { @@ -37,6 +38,9 @@ public function process(ContainerBuilder $container): void foreach ($taggedServices as $id => $tagAttributes) { foreach ($tagAttributes as $attributes) { + if (! is_array($attributes)) { + continue; + } $wrapperDefinition = (new Definition(Closure::class)) ->addArgument([new Reference($id), $attributes['method']]) diff --git a/src/Bundle/Platform/DependencyInjection/Extension/TwoFactorExtension.php b/src/Bundle/Platform/DependencyInjection/Extension/TwoFactorExtension.php index c5f80ab..f9e19cb 100644 --- a/src/Bundle/Platform/DependencyInjection/Extension/TwoFactorExtension.php +++ b/src/Bundle/Platform/DependencyInjection/Extension/TwoFactorExtension.php @@ -28,7 +28,7 @@ final class TwoFactorExtension /** * @param array{name: string, base_template: string} $config */ - public static function enable(ContainerBuilder $container, array $config = []): void + public static function enable(ContainerBuilder $container, array $config): void { $container ->setDefinition( diff --git a/src/Bundle/Platform/DependencyInjection/SolidWorxPlatformExtension.php b/src/Bundle/Platform/DependencyInjection/SolidWorxPlatformExtension.php index d5ffa3f..231c5db 100644 --- a/src/Bundle/Platform/DependencyInjection/SolidWorxPlatformExtension.php +++ b/src/Bundle/Platform/DependencyInjection/SolidWorxPlatformExtension.php @@ -16,6 +16,7 @@ use Knp\Menu\Provider\MenuProviderInterface; use Override; use ReflectionMethod; +use Reflector; use SolidWorx\Platform\PlatformBundle\Attributes\Menu\MenuBuilder; use SolidWorx\Platform\PlatformBundle\Config\PlatformConfiguration; use SolidWorx\Platform\PlatformBundle\Controller\Security\ResendTwoFactorCode; @@ -68,10 +69,14 @@ public function load(array $configs, ContainerBuilder $container): void $container->registerForAutoconfiguration(MenuProviderInterface::class) ->addTag('knp_menu.provider'); - $container->registerAttributeForAutoconfiguration(MenuBuilder::class, static function (ChildDefinition $definition, MenuBuilder $attribute, ReflectionMethod $reflectionMethod): void { + $container->registerAttributeForAutoconfiguration(MenuBuilder::class, static function (ChildDefinition $definition, MenuBuilder $attribute, Reflector $reflector): void { + if (! $reflector instanceof ReflectionMethod) { + return; + } + $definition->addTag(Util::tag('menu.builder'), [ 'alias' => $attribute->name, - 'method' => $reflectionMethod->getName(), + 'method' => $reflector->getName(), 'priority' => $attribute->priority, 'role' => $attribute->role, ]); diff --git a/src/Bundle/Platform/Feature/FeatureValue.php b/src/Bundle/Platform/Feature/FeatureValue.php index f04390d..40ac057 100644 --- a/src/Bundle/Platform/Feature/FeatureValue.php +++ b/src/Bundle/Platform/Feature/FeatureValue.php @@ -13,9 +13,11 @@ namespace SolidWorx\Platform\PlatformBundle\Feature; +use Stringable; use function is_array; use function is_bool; use function is_int; +use function is_scalar; final readonly class FeatureValue { @@ -75,7 +77,16 @@ public function asBool(): bool public function asString(): string { if (is_array($this->value)) { - return implode(',', $this->value); + $parts = []; + foreach ($this->value as $item) { + if (is_scalar($item)) { + $parts[] = (string) $item; + } elseif ($item instanceof Stringable) { + $parts[] = (string) $item; + } + } + + return implode(',', $parts); } if (is_bool($this->value)) { diff --git a/src/Bundle/Platform/Form/Type/Security/LoginType.php b/src/Bundle/Platform/Form/Type/Security/LoginType.php index bb9f9b8..e4226f4 100644 --- a/src/Bundle/Platform/Form/Type/Security/LoginType.php +++ b/src/Bundle/Platform/Form/Type/Security/LoginType.php @@ -13,6 +13,7 @@ namespace SolidWorx\Platform\PlatformBundle\Form\Type\Security; +use InvalidArgumentException; use Override; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\Extension\Core\Type\EmailType; @@ -21,17 +22,25 @@ use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints\Email; use Symfony\Component\Validator\Constraints\NotBlank; +use function is_string; /** - * @extends AbstractType + * @extends AbstractType */ final class LoginType extends AbstractType { #[Override] public function buildForm(FormBuilderInterface $builder, array $options): void { + $usernameParameter = $options['username_parameter']; + $passwordParameter = $options['password_parameter']; + + if (! is_string($usernameParameter) || ! is_string($passwordParameter)) { + throw new InvalidArgumentException('The "username_parameter" and "password_parameter" options must be strings.'); + } + $builder - ->add($options['username_parameter'], EmailType::class, [ + ->add($usernameParameter, EmailType::class, [ 'label' => 'Email address', 'placeholder' => 'your@email.com', 'required' => true, @@ -47,7 +56,7 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ], ]); - $builder->add($options['password_parameter'], PasswordType::class, [ + $builder->add($passwordParameter, PasswordType::class, [ 'label' => 'Password', 'required' => true, 'attr' => [ diff --git a/src/Bundle/Platform/Form/Type/Security/TwoFactorVerifyType.php b/src/Bundle/Platform/Form/Type/Security/TwoFactorVerifyType.php index 2ad4100..44e12a2 100644 --- a/src/Bundle/Platform/Form/Type/Security/TwoFactorVerifyType.php +++ b/src/Bundle/Platform/Form/Type/Security/TwoFactorVerifyType.php @@ -13,6 +13,7 @@ namespace SolidWorx\Platform\PlatformBundle\Form\Type\Security; +use InvalidArgumentException; use Override; use SolidWorx\Platform\PlatformBundle\Validator\Constraint\TwoFactorCode; use Symfony\Component\Form\AbstractType; @@ -21,15 +22,22 @@ use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\OptionsResolver\OptionsResolver; use Symfony\Component\Validator\Constraints\NotBlank; +use function is_string; /** - * @extends AbstractType + * @extends AbstractType */ final class TwoFactorVerifyType extends AbstractType { #[Override] public function buildForm(FormBuilderInterface $builder, array $options): void { + $secret = $options['secret']; + + if (! is_string($secret)) { + throw new InvalidArgumentException('The "secret" option must be a string.'); + } + $builder ->add('code', NumberType::class, [ 'label' => 'Enter the verification code generated by your mobile application.', @@ -44,11 +52,11 @@ public function buildForm(FormBuilderInterface $builder, array $options): void ], 'constraints' => [ new NotBlank(), - new TwoFactorCode(secret: (string) $options['secret']), + new TwoFactorCode(secret: $secret), ], ]) ->add('secret', HiddenType::class, [ - 'data' => $options['secret'], + 'data' => $secret, ]); } diff --git a/src/Bundle/Platform/Form/Type/TextEditorType.php b/src/Bundle/Platform/Form/Type/TextEditorType.php index eba2ce9..6f3df2e 100644 --- a/src/Bundle/Platform/Form/Type/TextEditorType.php +++ b/src/Bundle/Platform/Form/Type/TextEditorType.php @@ -34,6 +34,8 @@ * The field always renders a real `