2021-09-24 11:26:05 +02:00
|
|
|
#phpVersion: 70300
|
2019-03-13 07:15:22 +01:00
|
|
|
includes:
|
2019-03-19 12:37:02 +01:00
|
|
|
#- '../../vendor/phpstan/phpstan-strict-rules/rules.neon'
|
|
|
|
|
- '../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'
|
2021-12-09 13:06:58 +01:00
|
|
|
- 'extension.neon'
|
2019-03-13 07:15:22 +01:00
|
|
|
parameters:
|
|
|
|
|
fileExtensions:
|
|
|
|
|
- php
|
|
|
|
|
- dist
|
2020-12-10 20:46:57 +01:00
|
|
|
bootstrapFiles:
|
|
|
|
|
- phpstan-bootstrap.php
|
2021-11-04 07:55:53 +01:00
|
|
|
excludePaths:
|
2020-12-10 20:46:57 +01:00
|
|
|
- */system/src/Grav/Common/Errors/Resources/layout.html.php
|
2021-12-03 13:52:52 +01:00
|
|
|
- */system/src/Twig/DeferredExtension/DeferredNodeVisitorCompat.php # Twig 1
|
|
|
|
|
- */system/src/Twig/DeferredExtension/DeferredNodeVisitor.php # Twig 2+3
|
2021-12-02 12:52:51 +01:00
|
|
|
# Ignore vendor dev dependencies and tests
|
|
|
|
|
- */vendor/*/*/tests
|
|
|
|
|
- */vendor/behat
|
|
|
|
|
- */vendor/codeception
|
|
|
|
|
- */vendor/phpstan
|
|
|
|
|
- */vendor/phpunit
|
|
|
|
|
- */vendor/phpspec
|
|
|
|
|
- */vendor/phpdocumentor
|
|
|
|
|
- */vendor/sebastian
|
|
|
|
|
- */vendor/theseer
|
|
|
|
|
- */vendor/webmozart
|
2021-09-24 11:26:05 +02:00
|
|
|
|
2019-11-15 13:03:52 +01:00
|
|
|
inferPrivatePropertyTypeFromConstructor: true
|
2019-03-13 08:49:08 +01:00
|
|
|
reportUnmatchedIgnoredErrors: false
|
2021-09-24 11:26:05 +02:00
|
|
|
treatPhpDocTypesAsCertain: false
|
2020-12-10 20:46:57 +01:00
|
|
|
|
2021-12-01 16:03:41 +01:00
|
|
|
# These checks are new in phpstan 1, ignore them for now.
|
2020-12-10 20:46:57 +01:00
|
|
|
checkMissingIterableValueType: false
|
2021-12-07 12:10:19 +01:00
|
|
|
#checkGenericClassInNonGenericObjectType: false
|
2020-12-10 20:46:57 +01:00
|
|
|
|
2019-03-13 18:46:06 +01:00
|
|
|
universalObjectCratesClasses:
|
|
|
|
|
- Grav\Common\Config\Config
|
|
|
|
|
- Grav\Common\Config\Languages
|
|
|
|
|
- Grav\Common\Config\Setup
|
|
|
|
|
- Grav\Common\Data\Data
|
|
|
|
|
- Grav\Common\GPM\Common\Package
|
|
|
|
|
- Grav\Common\GPM\Local\Package
|
|
|
|
|
- Grav\Common\GPM\Remote\Package
|
2019-10-16 08:48:22 +02:00
|
|
|
- Grav\Common\Page\Header
|
2019-03-13 18:46:06 +01:00
|
|
|
- Grav\Common\Session
|
2019-12-09 11:53:17 +01:00
|
|
|
dynamicConstantNames:
|
|
|
|
|
- GRAV_CLI
|
2019-03-13 07:15:22 +01:00
|
|
|
ignoreErrors:
|
2021-11-30 20:20:17 +01:00
|
|
|
# New in phpstan 1, ignore them for now.
|
2020-12-10 20:46:57 +01:00
|
|
|
- '#Unsafe usage of new static\(\)#'
|
2019-03-14 08:01:16 +01:00
|
|
|
|
|
|
|
|
# TODO: Errors that needs some more thinking (bad design?)
|
|
|
|
|
- '#Access to an undefined property RocketTheme\\Toolbox\\Event\\Event::#'
|
2020-02-03 10:19:22 +01:00
|
|
|
- '#Instantiation of deprecated class RocketTheme\\Toolbox\\Event\\Event#'
|
|
|
|
|
- '#extends deprecated class RocketTheme\\Toolbox\\Event\\Event#'
|
2019-03-14 08:01:16 +01:00
|
|
|
- '#Access to an undefined property Grav\\Common\\Data\\Blueprint::#'
|
|
|
|
|
-
|
|
|
|
|
message: '#Cannot call method path\(\) on string#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Page/Media.php'
|
2019-03-13 07:15:22 +01:00
|
|
|
|
2019-03-19 12:37:02 +01:00
|
|
|
# TODO: system.twig.umask_fix will not work with Twig 2 anymore
|
|
|
|
|
-
|
|
|
|
|
message: '#Call to deprecated method writeCacheFile\(\) of class Twig\\Environment#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Twig/WriteCacheFileTrait.php'
|
2019-03-19 12:37:02 +01:00
|
|
|
|
2019-05-20 09:52:32 +02:00
|
|
|
# PSR-16 Exception interfaces do not extend \Throwable
|
|
|
|
|
- '#PHPDoc tag \@throws with type Psr\\SimpleCache\\(CacheException|InvalidArgumentException) is not subtype of Throwable#'
|
|
|
|
|
|
2019-03-13 21:22:03 +01:00
|
|
|
# Medium __call() methods
|
|
|
|
|
- '#Call to an undefined method Grav\\Common\\Page\\Medium\\(\w*)Medium::#'
|
|
|
|
|
|
2019-03-14 08:01:16 +01:00
|
|
|
# These errors are about plugins (need to find a better solution)
|
2019-03-13 07:15:22 +01:00
|
|
|
-
|
2019-03-13 21:22:03 +01:00
|
|
|
message: '#Call to static method sendEmail\(\) on an unknown class Grav\\Plugin\\Email\\Utils#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Scheduler/Job.php'
|
2019-03-13 21:22:03 +01:00
|
|
|
-
|
2020-12-10 20:46:57 +01:00
|
|
|
message: '#unknown class Grav\\Plugin\\Admin#'
|
|
|
|
|
path: '*/system/src/Grav/Common/Page/Pages.php'
|
2019-10-24 10:26:04 +02:00
|
|
|
-
|
2020-12-10 20:46:57 +01:00
|
|
|
message: '#unknown class Grav\\Plugin\\Admin#'
|
|
|
|
|
path: '*/system/src/Grav/Common/Flex/Pages/PageObject.php'
|
2020-02-17 13:04:31 +01:00
|
|
|
-
|
|
|
|
|
message: '#unknown class Grav\\Plugin\\Admin\\Admin#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Flex/Types/Pages/PageObject.php'
|
2021-11-30 20:20:17 +01:00
|
|
|
-
|
|
|
|
|
message: '#unknown class Grav\\Plugin\\Form\\Forms#'
|
|
|
|
|
path: '*/system/src/Grav/Common/Processors/PagesProcessor.php'
|
2019-03-13 07:15:22 +01:00
|
|
|
|
2020-12-10 20:46:57 +01:00
|
|
|
# Clockwork does not define functions for __call() call
|
|
|
|
|
-
|
|
|
|
|
message: '#Call to an undefined method Clockwork\\Clockwork::(info|userData|addEvent|alert)\(\)#'
|
|
|
|
|
path: '*/system/src/Grav/Common/Debugger.php'
|
2019-03-13 07:15:22 +01:00
|
|
|
|
2019-03-14 08:01:16 +01:00
|
|
|
# These errors can be ignored (they depend on installed extensions)
|
2019-03-13 07:15:22 +01:00
|
|
|
-
|
2019-03-13 08:49:08 +01:00
|
|
|
message: '#Instantiated class (Memcache|Memcached|Redis|RedisException) not found#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Cache.php'
|
2019-03-13 14:21:09 +01:00
|
|
|
-
|
2019-10-24 11:36:14 +02:00
|
|
|
message: '#unknown class (Memcache|Memcached|Redis|RedisException)#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Cache.php'
|
2019-03-13 07:15:22 +01:00
|
|
|
-
|
2020-05-05 18:35:09 +02:00
|
|
|
message: '#unknown class Collator#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Page/Pages.php'
|
2020-05-05 18:35:09 +02:00
|
|
|
-
|
|
|
|
|
message: '#unknown class Collator#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php'
|
2019-11-18 11:05:31 +01:00
|
|
|
-
|
|
|
|
|
message: '#Ternary operator condition is always true#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Framework/Cache/AbstractCache.php'
|
2019-11-18 11:05:31 +01:00
|
|
|
-
|
|
|
|
|
message: '#Call to function is_object\(\) with int will always evaluate to false#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Framework/Cache/AbstractCache.php'
|
2019-03-19 12:37:02 +01:00
|
|
|
|
2019-10-24 11:36:14 +02:00
|
|
|
# XHprof
|
|
|
|
|
- '#tideways_xhprof_enable#'
|
|
|
|
|
|
2019-03-19 12:37:02 +01:00
|
|
|
# Support for deprecated features
|
|
|
|
|
-
|
2021-04-26 09:54:39 +02:00
|
|
|
message: '#Instantiation of deprecated class Doctrine\\Common\\Cache\\(\w+)Cache#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Cache.php'
|
2021-04-26 09:54:39 +02:00
|
|
|
-
|
|
|
|
|
message: '#Instantiation of deprecated class Doctrine\\Common\\Cache\\(\w+)Cache#'
|
|
|
|
|
path: '*/system/src/Grav/Common/GPM/Remote/*.php'
|
2019-03-19 12:37:02 +01:00
|
|
|
-
|
|
|
|
|
message: '#Call to deprecated method order#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Page/Pages.php'
|
2019-03-19 12:37:02 +01:00
|
|
|
-
|
|
|
|
|
message: '#Fetching class constant class of deprecated class Grav\\Common\\User\\User#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Service/AccountsServiceProvider.php'
|
2019-03-19 12:37:02 +01:00
|
|
|
-
|
|
|
|
|
message: '#Call to deprecated method getLegacyFiles\(\)#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Session.php'
|
2022-01-17 08:37:59 +01:00
|
|
|
-
|
|
|
|
|
message: '#Call to deprecated method \w+\(\) of class Grav\\Common\\Flex\\Types\\Users\\UserObject#'
|
|
|
|
|
path: '*/system/src/Grav/Common/Flex/Types/Users/UserObject.php'
|
2020-02-17 13:04:31 +01:00
|
|
|
-
|
|
|
|
|
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexObject#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Framework/Flex/FlexObject.php'
|
2020-05-05 18:35:09 +02:00
|
|
|
-
|
|
|
|
|
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexIndex#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Framework/Flex/FlexIndex.php'
|
2020-05-05 18:35:09 +02:00
|
|
|
-
|
|
|
|
|
message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexCollection#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Framework/Flex/FlexCollection.php'
|
2020-05-05 18:35:09 +02:00
|
|
|
-
|
|
|
|
|
message: '#Call to deprecated method (getAuthorizeScope|getActiveUser)\(\) of class Grav\\Framework\\Flex\\FlexObject#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php'
|
2019-03-19 12:37:02 +01:00
|
|
|
-
|
|
|
|
|
message: '#deprecated class#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Framework/Uri/Uri.php'
|
2019-11-15 08:00:48 +01:00
|
|
|
-
|
|
|
|
|
message: '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch#'
|
2020-12-10 20:46:57 +01:00
|
|
|
path: '*/system/src/Grav/Common/Grav.php'
|
|
|
|
|
|
|
|
|
|
- '#has typehint with deprecated class RocketTheme\\Toolbox\\Event\\Event#'
|
2019-11-15 08:00:48 +01:00
|
|
|
- '#Call to deprecated method stopPropagation\(\) of class Symfony\\Component\\EventDispatcher\\Event#'
|
|
|
|
|
- '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::addListener\(\)#'
|
|
|
|
|
- '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::removeListener\(\)#'
|
2022-06-13 18:29:42 +02:00
|
|
|
- '#Class Grav\\Common\\GPM\\Response not found#'
|
2021-03-31 21:11:55 +02:00
|
|
|
|
|
|
|
|
# Installer updates
|
|
|
|
|
-
|
|
|
|
|
message: '#Variable \$this in PHPDoc tag @var does not exist#'
|
|
|
|
|
path: '*/system/src/Grav/Installer/updates/*'
|
2022-06-13 18:29:42 +02:00
|
|
|
-
|
|
|
|
|
message: '#YamlUpdater::isInlineComment\(\) is unused#'
|
|
|
|
|
path: '*/system/src/Grav/Installer/YamlUpdater.php'
|
2021-09-24 11:26:05 +02:00
|
|
|
|
|
|
|
|
# Twig Deferred extension compatibility
|
|
|
|
|
-
|
|
|
|
|
message: '#typehint with deprecated interface#'
|
|
|
|
|
path: '*/system/src/Twig/DeferredExtension/DeferredNodeVisitorCompat.php'
|
2022-06-14 19:08:04 +02:00
|
|
|
-
|
|
|
|
|
message: '#Function twig_array_filter not found#'
|
|
|
|
|
path: '*/system/src/Grav/Common/Twig/Extension/GravExtension.php'
|