phpstan.neon 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. #phpVersion: 70100
  2. includes:
  3. #- '../../vendor/phpstan/phpstan-strict-rules/rules.neon'
  4. - '../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'
  5. parameters:
  6. fileExtensions:
  7. - php
  8. - dist
  9. bootstrapFiles:
  10. - phpstan-bootstrap.php
  11. excludes_analyse:
  12. - */system/src/Grav/Common/Errors/Resources/layout.html.php
  13. inferPrivatePropertyTypeFromConstructor: true
  14. reportUnmatchedIgnoredErrors: false
  15. # These checks are new in phpstan 0.12, ignore them for now.
  16. checkMissingIterableValueType: false
  17. checkGenericClassInNonGenericObjectType: false
  18. universalObjectCratesClasses:
  19. - Grav\Common\Config\Config
  20. - Grav\Common\Config\Languages
  21. - Grav\Common\Config\Setup
  22. - Grav\Common\Data\Data
  23. - Grav\Common\GPM\Common\Package
  24. - Grav\Common\GPM\Local\Package
  25. - Grav\Common\GPM\Remote\Package
  26. - Grav\Common\Page\Header
  27. - Grav\Common\Session
  28. dynamicConstantNames:
  29. - GRAV_CLI
  30. ignoreErrors:
  31. # New in phpstan 0.12, ignore them for now.
  32. - '#Unsafe usage of new static\(\)#'
  33. - '#Cannot instantiate interface Grav\\Framework\\#'
  34. # TODO: phpstan bug #3875 (fixed, test if can be removed)
  35. -
  36. message: '#Unreachable statement - code above always terminates#'
  37. path: '*/system/src/Grav/Common/Flex/Types/Pages/Storage/PageStorage.php'
  38. # FIXME: Bugs that need to be fixed
  39. # FIXME: PHP 7.3 bug workaround
  40. -
  41. message: '#If condition is always false.#'
  42. path: '*/system/src/Grav/Framework/Session/Session.php'
  43. # TODO: Errors that needs some more thinking (bad design?)
  44. - '#Access to an undefined property RocketTheme\\Toolbox\\Event\\Event::#'
  45. - '#Instantiation of deprecated class RocketTheme\\Toolbox\\Event\\Event#'
  46. - '#extends deprecated class RocketTheme\\Toolbox\\Event\\Event#'
  47. - '#implements deprecated interface RocketTheme\\Toolbox\\Event\\EventSubscriberInterface#'
  48. - '#Access to an undefined property Grav\\Common\\Data\\Blueprint::#'
  49. - '#Access to an undefined property Grav\\Common\\Media\\Interfaces\\MediaObjectInterface::#'
  50. -
  51. message: '#Cannot call method path\(\) on string#'
  52. path: '*/system/src/Grav/Common/Page/Media.php'
  53. - '"FlexCollectionInterface::filterBy\(\) invoked with 2 parameters"'
  54. # TODO: system.twig.umask_fix will not work with Twig 2 anymore
  55. -
  56. message: '#Call to deprecated method writeCacheFile\(\) of class Twig\\Environment#'
  57. path: '*/system/src/Grav/Common/Twig/WriteCacheFileTrait.php'
  58. # Needed: full coverage (probably with admin plugin...) then redesign constructor
  59. -
  60. message: '#Grav\\Common\\GPM\\Remote\\GravCore::__construct\(\) does not call parent constructor from Grav\\Common\\GPM\\Remote\\AbstractPackageCollection#'
  61. path: '*/system/src/Grav/Common/GPM/Remote/GravCore.php'
  62. # PSR-16 Exception interfaces do not extend \Throwable
  63. - '#PHPDoc tag \@throws with type Psr\\SimpleCache\\(CacheException|InvalidArgumentException) is not subtype of Throwable#'
  64. # Medium __call() methods
  65. - '#Call to an undefined method Grav\\Common\\Page\\Medium\\(\w*)Medium::#'
  66. # These errors are about plugins (need to find a better solution)
  67. -
  68. message: '#Call to static method sendEmail\(\) on an unknown class Grav\\Plugin\\Email\\Utils#'
  69. path: '*/system/src/Grav/Common/Scheduler/Job.php'
  70. -
  71. message: '#unknown class Grav\\Plugin\\Admin#'
  72. path: '*/system/src/Grav/Common/Page/Pages.php'
  73. -
  74. message: '#unknown class Grav\\Plugin\\Admin#'
  75. path: '*/system/src/Grav/Common/Flex/Pages/PageObject.php'
  76. -
  77. message: '#unknown class Grav\\Common\\Grav\\Plugin\\Form\\Forms#'
  78. path: '*/system/src/Grav/Common/Session.php'
  79. -
  80. message: '#unknown class Grav\\Plugin\\Admin\\Admin#'
  81. path: '*/system/src/Grav/Common/Flex/Types/Pages/PageObject.php'
  82. # Can be ignored, after fopen there's always an $http_response_header locally available
  83. -
  84. message: '#Variable \$http_response_header in isset\(\) always exists and is not nullable#'
  85. path: '*/system/src/Grav/Common/GPM/Response.php'
  86. # Clockwork does not define functions for __call() call
  87. -
  88. message: '#Call to an undefined method Clockwork\\Clockwork::(info|userData|addEvent|alert)\(\)#'
  89. path: '*/system/src/Grav/Common/Debugger.php'
  90. # These errors can be ignored (they depend on installed extensions)
  91. -
  92. message: '#Instantiated class (Memcache|Memcached|Redis|RedisException) not found#'
  93. path: '*/system/src/Grav/Common/Cache.php'
  94. -
  95. message: '#unknown class (Memcache|Memcached|Redis|RedisException)#'
  96. path: '*/system/src/Grav/Common/Cache.php'
  97. -
  98. message: '#unknown class Collator#'
  99. path: '*/system/src/Grav/Common/Page/Pages.php'
  100. -
  101. message: '#unknown class Collator#'
  102. path: '*/system/src/Grav/Common/Flex/Types/Pages/PageCollection.php'
  103. -
  104. message: '#Ternary operator condition is always true#'
  105. path: '*/system/src/Grav/Framework/Cache/AbstractCache.php'
  106. -
  107. message: '#Call to function is_object\(\) with int will always evaluate to false#'
  108. path: '*/system/src/Grav/Framework/Cache/AbstractCache.php'
  109. # XHprof
  110. - '#tideways_xhprof_enable#'
  111. # Support for deprecated features
  112. -
  113. message: '#Instantiation of deprecated class Doctrine\\Common\\Cache\\MemcacheCache#'
  114. path: '*/system/src/Grav/Common/Cache.php'
  115. -
  116. message: '#Call to deprecated method order#'
  117. path: '*/system/src/Grav/Common/Page/Pages.php'
  118. -
  119. message: '#Fetching class constant class of deprecated class Grav\\Common\\User\\User#'
  120. path: '*/system/src/Grav/Common/Service/AccountsServiceProvider.php'
  121. -
  122. message: '#Call to deprecated method getLegacyFiles\(\)#'
  123. path: '*/system/src/Grav/Common/Session.php'
  124. -
  125. message: '#Call to deprecated method getType\(\) of class#'
  126. path: '*/system/src/Grav/Framework/Object/Base/ObjectTrait.php'
  127. -
  128. message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexObject#'
  129. path: '*/system/src/Grav/Framework/Flex/FlexObject.php'
  130. -
  131. message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexIndex#'
  132. path: '*/system/src/Grav/Framework/Flex/FlexIndex.php'
  133. -
  134. message: '#Call to deprecated method \w+\(\) of class Grav\\Framework\\Flex\\FlexCollection#'
  135. path: '*/system/src/Grav/Framework/Flex/FlexCollection.php'
  136. -
  137. message: '#Call to deprecated method (getAuthorizeScope|getActiveUser)\(\) of class Grav\\Framework\\Flex\\FlexObject#'
  138. path: '*/system/src/Grav/Framework/Flex/Pages/Traits/PageAuthorsTrait.php'
  139. -
  140. message: '#deprecated class#'
  141. path: '*/system/src/Grav/Framework/Uri/Uri.php'
  142. -
  143. message: '#Method Symfony\\Contracts\\EventDispatcher\\EventDispatcherInterface::dispatch#'
  144. path: '*/system/src/Grav/Common/Grav.php'
  145. - '#has typehint with deprecated class RocketTheme\\Toolbox\\Event\\Event#'
  146. - '#Call to deprecated method stopPropagation\(\) of class Symfony\\Component\\EventDispatcher\\Event#'
  147. - '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::addListener\(\)#'
  148. - '#Parameter \#2 \$listener of method Symfony\\Component\\EventDispatcher\\EventDispatcher::removeListener\(\)#'