Commit Graph

139 Commits

Author SHA1 Message Date
Rostislav Wolny
df6a955f0c Fix deprecation warnings coming from pQuery library
[MAILPOET-3980]
2021-12-13 09:36:43 +01:00
Rostislav Wolny
54414b4174 Add WooCommercePackages stubs to PHPStan
I had to move loading those stubs to bootstrap files because it was not able to load the class
when placed in scanFiles.
Note this is also recommended in documentation https://github.com/php-stubs/woocommerce-stubs
[MAILPOET-3920]
2021-11-24 13:00:10 +01:00
Rostislav Wolny
c8ce0d96ac Update PHPStan packages
[MAILPOET-3889]
2021-10-28 15:44:18 +02:00
Jan Lysý
3ede4366b6 Update phpstan dependencies
[MAILPOET-3725]
2021-08-16 15:56:39 +02:00
Rodrigo Primo
8513a4d986 Fix checkMissingTypehint PHPStan errors
This commit removes the checkMissingTypehints flag
from PHPStan configuration files and fixes all associated errors in our
code base.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rodrigo Primo
e59992cc16 Fix checkGenericClassInNonGenericObjectType PHPStan errors
This commit removes the checkGenericClassInNonGenericObjectType flag
from PHPStan configuration files and fixes all associated errors in our
code base.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rodrigo Primo
f0dc0b3556 Stop excluding the PHPStan checkMissingTypehints error
This check doesn't produce any errors so we don't need to exclude it
from our checks. Note that this only removes the exclusion of this error
from phpstan.neon. The same error check is kept in phpstan-tests.neon as
there are some change that we need to make to two tests before being
able to update this file as well.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rodrigo Primo
30b4b3e073 Stop excluding the PHPStan checkMissingVarTagTypehint error
This check doesn't produce any errors so we don't need to exclude it
from our checks.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rostislav Wolny
7a3ffa388f Update PHPStan
[MAILPOET-3658]
2021-07-06 13:29:00 +02:00
Rostislav Wolny
120baeeb00 Add WooCommerceSubscriptions factory to tests
[MAILPOET-3471]
2021-04-20 15:51:09 +02:00
Rodrigo Primo
8c4805cd0a Update pattern to ignore PHPStan error
Since we updated to PHPStan 0.12.83 we started getting the error bellow.
It seems this happened because the message of an error that we were
already ignoring was changed. This commit simply updates the pattern we
use to ignore the error to reflect the change in the new PHPStan
version.

```
 ------ ---------------------------------------------------------------------
  Line   lib/Features/FeatureFlagsController.php
 ------ ---------------------------------------------------------------------
         Ignored error pattern #^Cannot access offset \(int\|string\) on
         array\|false# in path
         /home/circleci/mailpoet/lib/Features/FeatureFlagsController.php was
         not matched in reported errors.
  44     Cannot access offset (int|string) on array<string,
         MailPoet\Entities\FeatureFlagEntity>|false.
 ------ ---------------------------------------------------------------------
```

[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Rodrigo Primo
0f6d7a5627 Update PHPStan to 0.12.83
[MAILPOET-3491]
2021-04-12 08:55:14 +02:00
Jan Lysý
88c884b2c9 Delete phpstan-baseline files for tests and remove them from config
[MAILPOET-3235]
2021-01-18 14:39:42 +01:00
Jan Lysý
b0e53b38a1 Delete phpstan-baseline.neon and remove them from config
[MAILPOET-3235]
2021-01-18 14:39:42 +01:00
Rostislav Wolny
27af1f6f4e Use WooCommerce stubs in static analysis instead custom file
[MAILPOET-2837]
2021-01-04 12:28:53 +01:00
Rostislav Wolny
32c3d08b36 Limit number of PHPStan processes to prevent crashes on CI
[MAILPOET-2837]
2021-01-04 12:28:53 +01:00
Rostislav Wolny
35a25e119f Remove unnecessary type checks
These were added during initial testing of php8 compatibility using PHPStan and were false positive due PHPStan issues.
[MAILPOET-2837]
2021-01-04 12:28:53 +01:00
Rostislav Wolny
8b58167ed9 Remove phpstan configuration for loading WordPress
[MAILPOET-2837]
2021-01-04 12:28:53 +01:00
Rostislav Wolny
0bc0dd1808 Adjust PHP stan configs to use wordpress extension
[MAILPOET-2837]
2021-01-04 12:28:53 +01:00
Rostislav Wolny
332dd6ea58 Install phpstan-wordpress extention
[MAILPOET-2837]
2021-01-04 12:28:53 +01:00
Rostislav Wolny
f0133c8f74 Update phpstan and extensions
[MAILPOET-2837]
2021-01-04 12:28:53 +01:00
Rostislav Wolny
15d010c448 Fix static analysis issues in FormTest
[MAILPOET-3297]
2021-01-04 11:32:28 +01:00
Jan Lysý
37cef4fb34 Remove usage of Idiorm from Segments test
[MAILPOET-3167]
2020-12-07 14:48:58 +01:00
Rostislav Wolny
3845f400b1 Add parameter for php version to static analysis command
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Rostislav Wolny
0ee843723e Enable unused ignoredErrors reporting for PHPStan
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Rostislav Wolny
90eb894b72 Refactor acceptance tests splitting to respect coding style
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Rostislav Wolny
9473579766 Fix type issues in tests
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Rostislav Wolny
9e9063414f Ignore some PHPStan errors in libs only for PHP7
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Rostislav Wolny
ec19b565f5 Update PHP Stan
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Rostislav Wolny
c0c9b11c54 Add workaround for removed codeception/robo-paracept
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Rostislav Wolny
a62ad4f70a Update robo and codeception and remove outdated deps
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Rostislav Wolny
12cc818f8b Fix required after optional parameter in doctrine config factory
[MAILPOET-3296]
2020-12-07 11:36:01 +01:00
Pavel Dohnal
06dca19738 Add magic getters for backward compatibility
[MAILPOET-3333]
2020-12-03 14:11:53 +01:00
Rostislav Wolny
688755a9bf Handle WP source path config for different environments
[MAILPOET-3029]
2020-11-09 11:04:32 +01:00
Rostislav Wolny
24fa5bd6ca Adjust integration tests analysis configuration
[MAILPOET-3029]
2020-11-09 11:04:32 +01:00
Rostislav Wolny
8f73eb785b Load stuff that is needed in runtime during PHPStan analysis
[MAILPOET-3029]
2020-11-09 11:04:32 +01:00
Rostislav Wolny
36b5a279b9 Add constants needed during analysis
[MAILPOET-3029]
2020-11-09 11:04:32 +01:00
Rostislav Wolny
90d7e1804e Clean PHPStan bootstrap file - get rid of WP loading
[MAILPOET-3029]
2020-11-09 11:04:32 +01:00
Rostislav Wolny
4202faa40c Configure phpstan scan files and directories for libs analysis
[MAILPOET-3029]
2020-11-09 11:04:32 +01:00
Jan Lysý
ac1044eebb Remove mose of uses Idiorm from NewslettersTest
[MAILPOET-2946]
2020-10-27 15:00:14 +01:00
Jan Lysý
a15a74d94f Use doctrine instead of Idiom in test for PostNotification
[MAILPOET-2946]
2020-10-27 15:00:14 +01:00
Pavel Dohnal
f8bd946dc0 Check sent emails for products when schedulig an email
[MAILPOET-2335] [MAILPOET-2334]
2020-10-22 11:54:41 +02:00
Rostislav Wolny
e43819920d Update PHPStan
[MAILPOET-3203]
2020-10-20 13:18:43 +02:00
Rostislav Wolny
f16601e239 Update phpstan/phpunit extension
[MAILPOET-3203]
2020-10-20 13:18:43 +02:00
Rostislav Wolny
ba26e91f82 Update phpstan config for tests and fix errors in tests
[MAILPOET-3146]
2020-10-08 15:59:05 +02:00
Rostislav Wolny
1f58e63306 Update phpstan config for lib
[MAILPOET-3146]
2020-10-08 15:59:05 +02:00
Rostislav Wolny
8f7463b20d Update PHPStan Doctrine extension and PHPStan
[MAILPOET-3146]
2020-10-08 15:59:05 +02:00
Rostislav Wolny
0437236cf1 Refactor subscriber finder to use new repository
[MAILPOET-3077]
2020-09-28 14:26:53 +02:00
Rostislav Wolny
7c979c9b56 Move manage subscription page filter to proper class
[MAILPOET-1635]
2020-08-03 10:23:17 +02:00
wxa
a181afe646 Load PHPMailer conditionally to avoid deprecation notices in WP 5.5 [MAILPOET-3040] 2020-07-16 10:11:09 +02:00