phpstan.neon 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. includes:
  2. #- '../../vendor/phpstan/phpstan-strict-rules/rules.neon'
  3. - '../../vendor/phpstan/phpstan-deprecation-rules/rules.neon'
  4. parameters:
  5. fileExtensions:
  6. - php
  7. - dist
  8. bootstrap: tests/phpstan/phpstan-bootstrap.php
  9. excludes_analyse:
  10. - system/src/Grav/Common/Errors/Resources/layout.html.php
  11. reportUnmatchedIgnoredErrors: false
  12. universalObjectCratesClasses:
  13. - Grav\Common\Config\Config
  14. - Grav\Common\Config\Languages
  15. - Grav\Common\Config\Setup
  16. - Grav\Common\Data\Data
  17. - Grav\Common\GPM\Common\Package
  18. - Grav\Common\GPM\Local\Package
  19. - Grav\Common\GPM\Remote\Package
  20. - Grav\Common\Session
  21. ignoreErrors:
  22. # FIXME: Bugs that need to be fixed
  23. # TODO: Errors that needs some more thinking (bad design?)
  24. - '#Access to an undefined property RocketTheme\\Toolbox\\Event\\Event::#'
  25. - '#Access to an undefined property Grav\\Common\\Data\\Blueprint::#'
  26. - '#Access to an undefined property Grav\\Common\\Media\\Interfaces\\MediaObjectInterface::#'
  27. - '#Access to an undefined property Grav\\Common\\Page\\Interfaces\\PageInterface::#'
  28. -
  29. message: '#Cannot call method path\(\) on string#'
  30. path: 'system/src/Grav/Common/Page/Media.php'
  31. # TODO: system.twig.umask_fix will not work with Twig 2 anymore
  32. -
  33. message: '#Call to deprecated method writeCacheFile\(\) of class Twig\\Environment#'
  34. path: 'system/src/Grav/Common/Twig/WriteCacheFileTrait.php'
  35. # Needed: full coverage (probably with admin plugin...) then redesign constructor
  36. -
  37. message: '#Grav\\Common\\GPM\\Remote\\GravCore::__construct\(\) does not call parent constructor from Grav\\Common\\GPM\\Remote\\AbstractPackageCollection#'
  38. path: 'system/src/Grav/Common/GPM/Remote/GravCore.php'
  39. # PSR-16 Exception interfaces do not extend \Throwable
  40. - '#PHPDoc tag \@throws with type Psr\\SimpleCache\\(CacheException|InvalidArgumentException) is not subtype of Throwable#'
  41. - '#expects Exception, Psr\\SimpleCache\\InvalidArgumentException&Throwable given#'
  42. # Needed: psr-17 (http-factories) support (through decorator or further investigations)
  43. -
  44. message: '#Call to an undefined static method Grav\\Framework\\Psr7\\Stream::create\(\)#'
  45. path: 'system/src/Grav/Framework/Form/FormFlashFile.php'
  46. # Medium __call() methods
  47. - '#Call to an undefined method Grav\\Common\\Page\\Medium\\(\w*)Medium::#'
  48. # Filesystem::getInstance()
  49. -
  50. message: '#Strict comparison using === between null and static#'
  51. path: 'system/src/Grav/Framework/Filesystem/Filesystem.php'
  52. # These errors are about plugins (need to find a better solution)
  53. -
  54. message: '#Call to static method sendEmail\(\) on an unknown class Grav\\Plugin\\Email\\Utils#'
  55. path: 'system/src/Grav/Common/Scheduler/Job.php'
  56. -
  57. message: '#on an unknown class Grav\\Plugin\\Admin#'
  58. path: 'system/src/Grav/Common/Page/Pages.php'
  59. -
  60. message: '#Call to method getFlash\(\) on an unknown class Grav\\Common\\Grav\\Plugin\\Form\\Forms#'
  61. path: 'system/src/Grav/Common/Session.php'
  62. # Can be ignored, after fopen there's always an $http_response_header locally available
  63. -
  64. message: '#Variable \$http_response_header in isset\(\) always exists and is not nullable#'
  65. path: 'system/src/Grav/Common/GPM/Response.php'
  66. # These errors can be ignored (they depend on installed extensions)
  67. -
  68. message: '#Instantiated class (Memcache|Memcached|Redis|RedisException) not found#'
  69. path: 'system/src/Grav/Common/Cache.php'
  70. -
  71. message: '#on an unknown class (Memcache|Memcached|Redis|RedisException)#'
  72. path: 'system/src/Grav/Common/Cache.php'
  73. -
  74. message: '#on an unknown class Collator#'
  75. path: 'system/src/Grav/Common/Page/Pages.php'
  76. # Support for deprecated features
  77. -
  78. message: '#Instantiation of deprecated class Doctrine\\Common\\Cache\\MemcacheCache#'
  79. path: 'system/src/Grav/Common/Cache.php'
  80. -
  81. message: '#Call to deprecated method order#'
  82. path: 'system/src/Grav/Common/Page/Pages.php'
  83. -
  84. message: '#Fetching class constant class of deprecated class Grav\\Common\\User\\User#'
  85. path: 'system/src/Grav/Common/Service/AccountsServiceProvider.php'
  86. -
  87. message: '#Call to deprecated method getLegacyFiles\(\)#'
  88. path: 'system/src/Grav/Common/Session.php'
  89. -
  90. message: '#Call to deprecated method getType\(\) of class#'
  91. path: 'system/src/Grav/Framework/Object/Base/ObjectTrait.php'
  92. -
  93. message: '#deprecated class#'
  94. path: 'system/src/Grav/Framework/Uri/Uri.php'