Skip to content

Commit e048b56

Browse files
author
ahmard
committed
Updated documentation
1 parent 06fda3f commit e048b56

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

README.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ Watcher::create()
2121
->addPath(__DIR__ . '/app')
2222
->addPath(__DIR__ . '/views')
2323
->onChange(function (EventInfo $eventInfo) {
24-
var_dump($eventInfo->getWatchedItem()->getFullPath());
24+
echo $eventInfo->getWatchedItem()->getFullPath() . PHP_EOL;
2525
});
2626
```
2727

2828
#### Filter
29+
2930
- Make sure that the file whose event is being fired should not end with provided characters.
3031
```php
3132
use RTC\Watcher\Watcher;
@@ -36,7 +37,7 @@ Watcher::create()
3637
->addPath(__DIR__ . '/app')
3738
->fileShouldNotEndWith(['.php'])
3839
->onChange(function (EventInfo $eventInfo) {
39-
var_dump($eventInfo->getWatchedItem()->getFullPath());
40+
echo $eventInfo->getWatchedItem()->getFullPath() . PHP_EOL;
4041
});
4142
```
4243

@@ -50,12 +51,12 @@ Watcher::create()
5051
->addPath(__DIR__ . '/app')
5152
->addExtension('php')
5253
->onChange(function (EventInfo $eventInfo) {
53-
var_dump($eventInfo->getWatchedItem()->getFullPath());
54+
echo $eventInfo->getWatchedItem()->getFullPath() . PHP_EOL;
5455
});
5556
```
5657

57-
5858
#### Any-event
59+
5960
Listens to any event on given path
6061

6162
Be careful using this method.
@@ -68,12 +69,10 @@ require 'vendor/autoload.php';
6869
Watcher::create()
6970
->addPath(__DIR__ . '/app')
7071
->onAny(function (EventInfo $eventInfo) {
71-
var_dump($eventInfo->getWatchedItem()->getFullPath());
72+
echo date('H:i:s') . " - {$eventInfo->getName()} {$eventInfo->getWatchedItem()->getFullPath()}\n";
7273
});
7374
```
7475

75-
76-
7776
#### Swoole Server Integration
7877

7978
```php

0 commit comments

Comments
 (0)