Skip to content

Commit

Permalink
Fix php 8
Browse files Browse the repository at this point in the history
  • Loading branch information
Prokyonn committed Sep 21, 2023
1 parent fbc26ee commit 3d55451
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 44 deletions.
3 changes: 0 additions & 3 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
*/
class Configuration implements ConfigurationInterface
{
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder('sulu_comment');
Expand Down
10 changes: 2 additions & 8 deletions DependencyInjection/SuluCommentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ class SuluCommentExtension extends Extension implements PrependExtensionInterfac
{
use PersistenceExtensionTrait;

/**
* {@inheritdoc}
*/
public function prepend(ContainerBuilder $container)
public function prepend(ContainerBuilder $container): void
{
if ($container->hasExtension('jms_serializer')) {
$container->prependExtensionConfig(
Expand Down Expand Up @@ -79,10 +76,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);
Expand Down
2 changes: 1 addition & 1 deletion Entity/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public function getParent(): ?CommentInterface
return $this->parent;
}

public function setParent(?CommentInterface $parent = null): CommentInterface
public function setParent(CommentInterface $parent = null): CommentInterface
{
$this->parent = $parent;

Expand Down
2 changes: 1 addition & 1 deletion Form/Type/CommentType.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Manager/CommentManagerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function addComment(
string $type,
string $entityId,
CommentInterface $comment,
?string $threadTitle = null
string $threadTitle = null
): ThreadInterface;

public function update(CommentInterface $comment): CommentInterface;
Expand Down
5 changes: 1 addition & 4 deletions SuluCommentBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ class SuluCommentBundle extends Bundle
{
use PersistenceBundleTrait;

/**
* {@inheritdoc}
*/
public function build(ContainerBuilder $container)
public function build(ContainerBuilder $container): void
{
$this->buildPersistence(
[
Expand Down
4 changes: 2 additions & 2 deletions Tests/Application/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class Kernel extends SuluTestKernel
{
public function registerBundles()
public function registerBundles(): iterable
{
$bundles = parent::registerBundles();
$bundles[] = new SuluCommentBundle();
Expand All @@ -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();

Expand Down
3 changes: 1 addition & 2 deletions Tests/Application/config/config_website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ security:
access_decision_manager:
strategy: affirmative

encoders:
password_hashers:
Sulu\Bundle\SecurityBundle\Entity\User: plaintext

providers:
Expand All @@ -22,7 +22,6 @@ security:
firewalls:
test:
http_basic: ~
anonymous: ~

sulu_test:
enable_test_user_provider: true
Expand Down
2 changes: 1 addition & 1 deletion Twig/CommentFormFactoryTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function getFunctions()
];
}

public function createCommentForm(string $threadId, ?string $referrer = null, ?int $parent = null): FormView
public function createCommentForm(string $threadId, string $referrer = null, int $parent = null): FormView
{
$form = $this->formFactory->create(
CommentType::class,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"phpstan/phpstan-doctrine": "^1.0",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-symfony": "^1.0",
"phpunit/phpunit": "^8.0",
"phpunit/phpunit": "^8.0 || ^9.0",
"symfony/browser-kit": "^4.3 || ^5.0 || ^6.0",
"symfony/dotenv": "^4.3 || ^5.0 || ^6.0",
"symfony/form": "^4.3 || ^5.0 || ^6.0",
Expand Down
20 changes: 0 additions & 20 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 3d55451

Please sign in to comment.