From 8a55ae896f1769d54b14cfa2186053cc2015f027 Mon Sep 17 00:00:00 2001 From: Prokyonn Date: Fri, 22 Sep 2023 01:23:57 +0200 Subject: [PATCH] Fix php 8 --- DependencyInjection/SuluCommentExtension.php | 4 ++-- Form/Type/CommentType.php | 2 +- SuluCommentBundle.php | 2 +- Tests/Application/Kernel.php | 4 ++-- Tests/Application/config/config_website.yml | 3 +-- phpstan-baseline.neon | 20 -------------------- 6 files changed, 7 insertions(+), 28 deletions(-) diff --git a/DependencyInjection/SuluCommentExtension.php b/DependencyInjection/SuluCommentExtension.php index 9135ab9c..0661b752 100644 --- a/DependencyInjection/SuluCommentExtension.php +++ b/DependencyInjection/SuluCommentExtension.php @@ -28,7 +28,7 @@ class SuluCommentExtension extends Extension implements PrependExtensionInterfac /** * {@inheritdoc} */ - public function prepend(ContainerBuilder $container) + public function prepend(ContainerBuilder $container): void { if ($container->hasExtension('jms_serializer')) { $container->prependExtensionConfig( @@ -82,7 +82,7 @@ public function prepend(ContainerBuilder $container) /** * {@inheritdoc} */ - public function load(array $configs, ContainerBuilder $container) + public function load(array $configs, ContainerBuilder $container): void { $configuration = new Configuration(); $config = $this->processConfiguration($configuration, $configs); diff --git a/Form/Type/CommentType.php b/Form/Type/CommentType.php index a493496a..b8e5fecb 100644 --- a/Form/Type/CommentType.php +++ b/Form/Type/CommentType.php @@ -47,7 +47,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) $builder->add('submit', SubmitType::class); } - public function configureOptions(OptionsResolver $resolver) + public function configureOptions(OptionsResolver $resolver): void { $resolver->setRequired('threadId'); $resolver->setDefault('referrer', null); diff --git a/SuluCommentBundle.php b/SuluCommentBundle.php index 86c0a14d..8099f705 100644 --- a/SuluCommentBundle.php +++ b/SuluCommentBundle.php @@ -27,7 +27,7 @@ class SuluCommentBundle extends Bundle /** * {@inheritdoc} */ - public function build(ContainerBuilder $container) + public function build(ContainerBuilder $container): void { $this->buildPersistence( [ diff --git a/Tests/Application/Kernel.php b/Tests/Application/Kernel.php index 40f9b673..02741ca9 100644 --- a/Tests/Application/Kernel.php +++ b/Tests/Application/Kernel.php @@ -20,7 +20,7 @@ class Kernel extends SuluTestKernel { - public function registerBundles() + public function registerBundles(): iterable { $bundles = parent::registerBundles(); $bundles[] = new SuluCommentBundle(); @@ -40,7 +40,7 @@ public function registerContainerConfiguration(LoaderInterface $loader) $loader->load(__DIR__ . '/config/config_' . $context . '.yml'); } - protected function getKernelParameters() + protected function getKernelParameters(): array { $parameters = parent::getKernelParameters(); diff --git a/Tests/Application/config/config_website.yml b/Tests/Application/config/config_website.yml index d6b7d7b7..e0e03051 100644 --- a/Tests/Application/config/config_website.yml +++ b/Tests/Application/config/config_website.yml @@ -9,7 +9,7 @@ security: access_decision_manager: strategy: affirmative - encoders: + password_hashers: Sulu\Bundle\SecurityBundle\Entity\User: plaintext providers: @@ -22,7 +22,6 @@ security: firewalls: test: http_basic: ~ - anonymous: ~ sulu_test: enable_test_user_provider: true diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index bab48829..34a593f4 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -95,16 +95,6 @@ parameters: count: 1 path: Controller/WebsiteCommentController.php - - - message: "#^Method Sulu\\\\Bundle\\\\CommentBundle\\\\DependencyInjection\\\\SuluCommentExtension\\:\\:load\\(\\) has no return type specified\\.$#" - count: 1 - path: DependencyInjection/SuluCommentExtension.php - - - - message: "#^Method Sulu\\\\Bundle\\\\CommentBundle\\\\DependencyInjection\\\\SuluCommentExtension\\:\\:prepend\\(\\) has no return type specified\\.$#" - count: 1 - path: DependencyInjection/SuluCommentExtension.php - - message: "#^Method Sulu\\\\Bundle\\\\CommentBundle\\\\Entity\\\\Comment\\:\\:getChildren\\(\\) return type with generic interface Doctrine\\\\Common\\\\Collections\\\\Collection does not specify its types\\: TKey, T$#" count: 1 @@ -270,13 +260,3 @@ parameters: count: 1 path: Form/Type/CommentType.php - - - message: "#^Method Sulu\\\\Bundle\\\\CommentBundle\\\\Form\\\\Type\\\\CommentType\\:\\:configureOptions\\(\\) has no return type specified\\.$#" - count: 1 - path: Form/Type/CommentType.php - - - - message: "#^Method Sulu\\\\Bundle\\\\CommentBundle\\\\SuluCommentBundle\\:\\:build\\(\\) has no return type specified\\.$#" - count: 1 - path: SuluCommentBundle.php -