| 1 | <?php |
||
| 12 | class View { |
||
| 13 | /** |
||
| 14 | * Global variables |
||
| 15 | * |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $globals = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * View composers |
||
| 22 | * |
||
| 23 | * @var array |
||
| 24 | */ |
||
| 25 | protected $composers = []; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * Get global variables |
||
| 29 | * |
||
| 30 | * @return array |
||
| 31 | */ |
||
| 32 | 2 | public function getGlobals() { |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Set a global variable |
||
| 38 | * |
||
| 39 | * @param string $key |
||
| 40 | * @param mixed $value |
||
| 41 | * @return void |
||
| 42 | */ |
||
| 43 | 1 | public function setGlobal( $key, $value ) { |
|
| 46 | |||
| 47 | /** |
||
| 48 | * Set an array of global variables |
||
| 49 | * |
||
| 50 | * @param array $globals |
||
| 51 | * @return void |
||
| 52 | */ |
||
| 53 | 1 | public function setGlobals( $globals ) { |
|
| 58 | |||
| 59 | /** |
||
| 60 | * Get view composer |
||
| 61 | * |
||
| 62 | * @param string $view |
||
| 63 | * @return Handler|null |
||
| 64 | */ |
||
| 65 | 1 | public function getComposer( $view ) { |
|
| 68 | |||
| 69 | /** |
||
| 70 | * Set view composer |
||
| 71 | * |
||
| 72 | * @param string $view |
||
| 73 | * @param string|Closure $composer |
||
| 74 | * @return void |
||
| 75 | */ |
||
| 76 | 1 | public function setComposer( $view, $composer ) { |
|
| 80 | |||
| 81 | /** |
||
| 82 | * Get the composed context for a view. |
||
| 83 | * Passes all arguments to the composer. |
||
| 84 | * |
||
| 85 | * @param string $view |
||
| 86 | * @param mixed $arguments,... |
||
|
|
|||
| 87 | * @return array |
||
| 88 | */ |
||
| 89 | 2 | public function compose( $view ) { |
|
| 96 | } |
||
| 97 |
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italyis not defined by the methodfinale(...).The most likely cause is that the parameter was removed, but the annotation was not.