@@ -136,7 +136,7 @@ protected function inotifyWatchPath(string $path): void
136
136
protected function inotifyRemovePathWatch (EventInfo $ eventInfo ): void
137
137
{
138
138
$ descriptor = $ eventInfo ->getWatchDescriptor ();
139
- if ($ eventInfo ->getWatchedItem ()->getFullPath () != $ this ->watchedItems [$ descriptor ]){
139
+ if ($ eventInfo ->getWatchedItem ()->getFullPath () != $ this ->watchedItems [$ descriptor ]) {
140
140
return ;
141
141
}
142
142
@@ -234,7 +234,7 @@ public function watch(): void
234
234
235
235
// INDIVIDUAL LISTENERS
236
236
foreach ($ inotifyEvents as $ inotifyEvent ) {
237
- // var_export($inotifyEvent);
237
+ // var_export($inotifyEvent);
238
238
// Make sure that we support this event
239
239
if (in_array ($ inotifyEvent ['mask ' ], $ this ->watchedMasks )) {
240
240
$ this ->fireEvent ($ inotifyEvent );
@@ -257,23 +257,33 @@ public function watch(): void
257
257
/**
258
258
* Add file extension filter
259
259
*
260
- * @param string $extension
260
+ * @param string|array $extension
261
261
* @return $this
262
262
*/
263
- public function addExtension (string $ extension ): Watcher
263
+ public function addExtension (string | array $ extension ): Watcher
264
264
{
265
+ if (is_array ($ extension )) {
266
+ $ this ->extensions = array_merge ($ this ->extensions , $ extension );
267
+ return $ this ;
268
+ }
269
+
265
270
$ this ->extensions [] = $ extension ;
266
271
return $ this ;
267
272
}
268
273
269
274
/**
270
275
* Add path to watch
271
276
*
272
- * @param string $path
277
+ * @param string|array $path
273
278
* @return $this
274
279
*/
275
- public function addPath (string $ path ): Watcher
280
+ public function addPath (string | array $ path ): Watcher
276
281
{
282
+ if (is_array ($ path )) {
283
+ $ this ->paths = array_merge ($ this ->paths , $ path );
284
+ return $ this ;
285
+ }
286
+
277
287
$ this ->paths [] = $ path ;
278
288
return $ this ;
279
289
}
0 commit comments