1 | <?php |
||
16 | class Module extends \samson\core\ExternalModule implements \samsonframework\core\CompressInterface |
||
17 | { |
||
18 | /** View handling event */ |
||
19 | const EVENT_VIEW_HANDLER = 'samsonphp.view.handler'; |
||
20 | /** @var string Module identifier */ |
||
21 | protected $id = STATIC_RESOURCE_HANDLER; |
||
22 | /** @var Generator */ |
||
23 | protected $generator; |
||
24 | |||
25 | /** |
||
26 | * Module constructor. |
||
27 | * |
||
28 | * @param string $path |
||
29 | * @param ResourcesInterface $resources |
||
30 | * @param SystemInterface $system |
||
31 | * @param Generator $generator |
||
32 | */ |
||
33 | public function __construct($path, ResourcesInterface $resources, SystemInterface $system, Generator $generator = null) |
||
50 | |||
51 | /** |
||
52 | * This method should be used to override generic compression logic. |
||
53 | * |
||
54 | * @param mixed $obj Pointer to compressor instance |
||
55 | * @param array|null $code Collection of already compressed code |
||
56 | * |
||
57 | *@return bool False if generic compression needs to be avoided |
||
58 | */ |
||
59 | public function beforeCompress(&$obj = null, array &$code = null) |
||
63 | |||
64 | /** |
||
65 | * This method is called after generic compression logic has finished. |
||
66 | * |
||
67 | * @param mixed $obj Pointer to compressor instance |
||
68 | * @param array|null $code Collection of already compressed code |
||
69 | * |
||
70 | * @return bool False if generic compression needs to be avoided |
||
71 | */ |
||
72 | public function afterCompress(&$obj = null, array &$code = null) |
||
81 | |||
82 | /** |
||
83 | * Generator view code handler. |
||
84 | * |
||
85 | * @param string $viewCode Source view code |
||
86 | * |
||
87 | * @return string Modified view code |
||
88 | */ |
||
89 | public function viewHandler($viewCode) |
||
97 | |||
98 | /** |
||
99 | * Help autoloading view classes as we know where we store them. |
||
100 | * |
||
101 | * @param string $class View class name for searching |
||
102 | */ |
||
103 | public function autoload($class) |
||
110 | |||
111 | /** |
||
112 | * Module preparation stage. |
||
113 | * This function called after module instance creation but before |
||
114 | * initialization stage. |
||
115 | * |
||
116 | * @param array $params Preparation stage parameters |
||
117 | * |
||
118 | * @return bool|void Preparation stage result |
||
119 | */ |
||
120 | public function prepare(array $params = array()) |
||
138 | } |
||
139 |
This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.
If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.
In this case you can add the
@ignore
PhpDoc annotation to the duplicate definition and it will be ignored.