Skip to content

Commit

Permalink
Fix phpstan baseline (#311)
Browse files Browse the repository at this point in the history
* Fix phpstan baseline

* Add PHP 8.1 tests

* Add baseline

* Fix code style
  • Loading branch information
alexander-schranz authored Jan 24, 2022
1 parent 3e68c0f commit b6838a8
Show file tree
Hide file tree
Showing 7 changed files with 103 additions and 15 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/test-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
database: mysql
dependency-versions: 'highest'
tools: 'composer:v2'
lint: true
lint: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:root@127.0.0.1/sulu_form_test?serverVersion=5.7
Expand All @@ -45,7 +45,18 @@ jobs:
lint: true
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:root@127.0.0.1/sulu_form_test?serverVersion=8.0
DATABASE_URL: mysql://root:root@127.0.0.1/sulu_form_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci

- php-version: '8.1'
database: mysql
dependency-versions: 'highest'
tools: 'composer:v2'
lint: false
env:
SYMFONY_DEPRECATIONS_HELPER: weak
DATABASE_URL: mysql://root:root@127.0.0.1/sulu_form_test?serverVersion=5.7
DATABASE_CHARSET: utf8mb4
DATABASE_COLLATE: utf8mb4_unicode_ci

Expand Down
1 change: 1 addition & 0 deletions Dynamic/Helper/SendinblueListSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

/**
* @final
*
* @internal
*/
class SendinblueListSelect
Expand Down
1 change: 1 addition & 0 deletions Dynamic/Helper/SendinblueMailTemplateSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

/**
* @final
*
* @internal
*/
class SendinblueMailTemplateSelect
Expand Down
1 change: 1 addition & 0 deletions Event/SendinblueListSubscriber.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

/**
* @final
*
* @internal
*/
class SendinblueListSubscriber implements EventSubscriberInterface
Expand Down
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@
"preferred-install": {
"*": "dist"
},
"sort-packages": true
"sort-packages": true,
"allow-plugins": {
"composer/package-versions-deprecated": true
}
}
}
94 changes: 82 additions & 12 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,46 @@ parameters:
count: 1
path: Dynamic/Helper/MailchimpListSelect.php

-
message: "#^Cannot access offset 'id' on object\\.$#"
count: 1
path: Dynamic/Helper/SendinblueListSelect.php

-
message: "#^Cannot access offset 'name' on object\\.$#"
count: 1
path: Dynamic/Helper/SendinblueListSelect.php

-
message: "#^Parameter \\#2 \\$key of method SendinBlue\\\\Client\\\\Configuration\\:\\:setApiKey\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: Dynamic/Helper/SendinblueListSelect.php

-
message: "#^Cannot assign offset 'tag' to SendinBlue\\\\Client\\\\Model\\\\GetSmtpTemplateOverview\\.$#"
count: 1
path: Dynamic/Helper/SendinblueMailTemplateSelect.php

-
message: "#^Offset 'tag' on SendinBlue\\\\Client\\\\Model\\\\GetSmtpTemplateOverview on left side of \\?\\? does not exist\\.$#"
count: 1
path: Dynamic/Helper/SendinblueMailTemplateSelect.php

-
message: "#^Parameter \\#1 \\$templateStatus of method SendinBlue\\\\Client\\\\Api\\\\TransactionalEmailsApi\\:\\:getSmtpTemplates\\(\\) expects bool\\|null, string given\\.$#"
count: 1
path: Dynamic/Helper/SendinblueMailTemplateSelect.php

-
message: "#^Parameter \\#2 \\$key of method SendinBlue\\\\Client\\\\Configuration\\:\\:setApiKey\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: Dynamic/Helper/SendinblueMailTemplateSelect.php

-
message: "#^Unreachable statement \\- code above always terminates\\.$#"
count: 1
path: Dynamic/Helper/SendinblueMailTemplateSelect.php

-
message: "#^Cannot access an offset on mixed\\.$#"
count: 2
Expand Down Expand Up @@ -710,6 +750,11 @@ parameters:
count: 1
path: Dynamic/Types/SalutationType.php

-
message: "#^Cannot call method getDefaultValue\\(\\) on Sulu\\\\Bundle\\\\FormBundle\\\\Entity\\\\FormFieldTranslation\\|null\\.$#"
count: 1
path: Dynamic/Types/SendinblueType.php

-
message: "#^Cannot access offset 'type' on mixed\\.$#"
count: 1
Expand Down Expand Up @@ -1021,9 +1066,39 @@ parameters:
path: Event/RequestListener.php

-
message: "#^Array \\(array\\<Symfony\\\\Component\\\\Form\\\\FormInterface\\>\\) does not accept Symfony\\\\Component\\\\Form\\\\FormInterface\\|null\\.$#"
message: "#^Argument of an invalid type mixed supplied for foreach, only iterables are supported\\.$#"
count: 1
path: Form/Builder.php
path: Event/SendinblueListSubscriber.php

-
message: "#^Cannot access offset 'listId' on mixed\\.$#"
count: 1
path: Event/SendinblueListSubscriber.php

-
message: "#^Cannot access offset 'mailTemplateId' on mixed\\.$#"
count: 1
path: Event/SendinblueListSubscriber.php

-
message: "#^Cannot access offset 'options' on mixed\\.$#"
count: 2
path: Event/SendinblueListSubscriber.php

-
message: "#^Cannot access offset 'type' on mixed\\.$#"
count: 4
path: Event/SendinblueListSubscriber.php

-
message: "#^Cannot access offset 'value' on mixed\\.$#"
count: 4
path: Event/SendinblueListSubscriber.php

-
message: "#^Parameter \\#2 \\$key of method SendinBlue\\\\Client\\\\Configuration\\:\\:setApiKey\\(\\) expects string, string\\|null given\\.$#"
count: 1
path: Event/SendinblueListSubscriber.php

-
message: "#^Cannot access offset 'checksum' on array\\|bool\\|float\\|int\\|string\\.$#"
Expand Down Expand Up @@ -1120,6 +1195,11 @@ parameters:
count: 1
path: Form/Builder.php

-
message: "#^Property Sulu\\\\Bundle\\\\FormBundle\\\\Form\\\\Builder\\:\\:\\$cache \\(array\\<Symfony\\\\Component\\\\Form\\\\FormInterface\\>\\) does not accept array\\<Symfony\\\\Component\\\\Form\\\\FormInterface\\|null\\>\\.$#"
count: 1
path: Form/Builder.php

-
message: "#^Parameter \\#1 \\$object of method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:persist\\(\\) expects object, mixed given\\.$#"
count: 1
Expand Down Expand Up @@ -1635,11 +1715,6 @@ parameters:
count: 1
path: Repository/DynamicRepository.php

-
message: "#^Method Sulu\\\\Bundle\\\\FormBundle\\\\Repository\\\\DynamicRepository\\:\\:findByFilters\\(\\) should return array but returns mixed\\.$#"
count: 1
path: Repository/DynamicRepository.php

-
message: "#^Parameter \\#2 \\$fromDate of method Sulu\\\\Bundle\\\\FormBundle\\\\Repository\\\\DynamicRepository\\:\\:addDateRangeFilter\\(\\) expects string\\|null, mixed given\\.$#"
count: 1
Expand Down Expand Up @@ -1670,11 +1745,6 @@ parameters:
count: 2
path: Repository/FormRepository.php

-
message: "#^Method Sulu\\\\Bundle\\\\FormBundle\\\\Repository\\\\FormRepository\\:\\:loadAll\\(\\) should return array\\<Sulu\\\\Bundle\\\\FormBundle\\\\Entity\\\\Form\\> but returns mixed\\.$#"
count: 1
path: Repository/FormRepository.php

-
message: "#^Method Sulu\\\\Bundle\\\\FormBundle\\\\Repository\\\\FormRepository\\:\\:loadById\\(\\) should return Sulu\\\\Bundle\\\\FormBundle\\\\Entity\\\\Form\\|null but returns mixed\\.$#"
count: 1
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
includes:
- phpstan-baseline.neon
- vendor/jangregor/phpstan-prophecy/extension.neon
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-doctrine/rules.neon
Expand Down

0 comments on commit b6838a8

Please sign in to comment.