Browse Source

Add annoations to avoid ignoring phpstan reported errors

ADmad 8 years ago
parent
commit
b3876082cd
4 changed files with 6 additions and 3 deletions
  1. 0 3
      phpstan.neon
  2. 2 0
      src/Console/Shell.php
  3. 2 0
      src/Http/Client/Message.php
  4. 2 0
      src/View/ViewVarsTrait.php

+ 0 - 3
phpstan.neon

@@ -6,13 +6,10 @@ parameters:
         - '#Function xcache_[a-zA-Z0-9_]+ not found#'
         - '#Cake\\Database\\Type\\[a-zA-Z0-9_]+Type::__construct\(\) does not call parent constructor from Cake\\Database\\Type#'
         - '#Constructor of class Cake\\[a-zA-Z0-9_\\]+ has an unused parameter#'
-        - '#Call to an undefined method Cake\\Console\\Shell::main\(\)#'
         - '#Access to undefined constant Memcached::OPT_CLIENT_MODE#'
         - '#Access to undefined constant Memcached::DYNAMIC_CLIENT_MODE#'
         - '#Access to undefined constant PDO::SQLSRV_ATTR_ENCODING#'
         - '#Access to undefined constant PDO::SQLSRV_ENCODING_BINARY#'
-        - '#Access to an undefined property Cake\\Http\\Client\\Message::\$headers#'
-        - '#Access to an undefined property Cake\\[a-zA-Z0-9_\\]+::\$_validViewOptions#'
         - '#Access to an undefined property Cake\\Database\\Driver::\$_connection#'
         - '#Constant XC_TYPE_VAR not found#'
         - '#Class PHPUnit_Runner_Version not found and could not be autoloaded#'

+ 2 - 0
src/Console/Shell.php

@@ -32,6 +32,8 @@ use ReflectionMethod;
  * Base class for command-line utilities for automating programmer chores.
  *
  * Is the equivalent of Cake\Controller\Controller on the command line.
+ *
+ * @method int main()
  */
 class Shell
 {

+ 2 - 0
src/Http/Client/Message.php

@@ -18,6 +18,8 @@ namespace Cake\Http\Client;
  *
  * Defines some common helper methods, constants
  * and properties.
+ *
+ * @property array $headers
  */
 class Message
 {

+ 2 - 0
src/View/ViewVarsTrait.php

@@ -20,6 +20,8 @@ use Cake\Event\EventDispatcherInterface;
  *
  * Once collected context data can be passed to another object.
  * This is done in Controller, TemplateTask and View for example.
+ *
+ * @property array $_validViewOptions
  */
 trait ViewVarsTrait
 {