1 | <?php |
||
12 | class FileWatcher |
||
13 | { |
||
14 | use \PHPDaemon\Traits\ClassWatchdog; |
||
15 | use \PHPDaemon\Traits\StaticObjectWatchdog; |
||
16 | |||
17 | /** |
||
18 | * @var array Associative array of the files being observed |
||
19 | */ |
||
20 | public $files = []; |
||
21 | |||
22 | /** |
||
23 | * @var resource Resource returned by inotify_init() |
||
24 | */ |
||
25 | public $inotify; |
||
26 | |||
27 | /** |
||
28 | * @var Array of inotify descriptors |
||
29 | */ |
||
30 | public $descriptors = []; |
||
31 | |||
32 | /** |
||
33 | * Constructor |
||
34 | */ |
||
35 | public function __construct() |
||
53 | |||
54 | /** |
||
55 | * Check the file system, triggered by timer |
||
56 | * @return void |
||
57 | */ |
||
58 | public function watch() |
||
92 | |||
93 | /** |
||
94 | * Called when file $path is changed |
||
95 | * @param string $path Path |
||
96 | * @return void |
||
97 | */ |
||
98 | public function onFileChanged($path) |
||
112 | |||
113 | /** |
||
114 | * Cancels your subscription on object in FS |
||
115 | * @param string $path Path |
||
116 | * @param mixed $cb Callback |
||
117 | * @return boolean |
||
118 | */ |
||
119 | public function rmWatch($path, $cb) |
||
139 | |||
140 | /** |
||
141 | * Adds your subscription on object in FS |
||
142 | * @param string $path Path |
||
143 | * @param mixed $cb Callback |
||
144 | * @param integer $flags Look inotify_add_watch() |
||
|
|||
145 | * @return true |
||
146 | */ |
||
147 | public function addWatch($path, $cb, $flags = null) |
||
160 | } |
||
161 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.