Skip to content

Commit 26a5167

Browse files
committed
Fix FireFS events
Call the wright event and use the onAny callback.
1 parent 6741317 commit 26a5167

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/FireFS/FireFS.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,7 +1176,10 @@ public function getEntity(string $path)
11761176
private function _onCreate(string $path)
11771177
{
11781178
if ($this->listener instanceof IFileSystemListener) {
1179-
$this->listener->onCreated(new FileSystemEntityCreatedEvent($path));
1179+
$event = new FileSystemEntityCreatedEvent($path);
1180+
if ($this->listener->onAny($event)) {
1181+
$this->listener->onCreated($event);
1182+
}
11801183
}
11811184
}
11821185

@@ -1188,7 +1191,10 @@ private function _onCreate(string $path)
11881191
private function _onModify(string $path)
11891192
{
11901193
if ($this->listener instanceof IFileSystemListener) {
1191-
$this->listener->onCreated(new FileSystemEntityModifiedEvent($path));
1194+
$event = new FileSystemEntityModifiedEvent($path);
1195+
if ($this->listener->onAny($event)) {
1196+
$this->listener->onModified($event);
1197+
}
11921198
}
11931199
}
11941200

@@ -1200,7 +1206,10 @@ private function _onModify(string $path)
12001206
private function _onDelete(string $path)
12011207
{
12021208
if ($this->listener instanceof IFileSystemListener) {
1203-
$this->listener->onCreated(new FileSystemEntityDeletedEvent($path));
1209+
$event = new FileSystemEntityDeletedEvent($path);
1210+
if ($this->listener->onAny($event)) {
1211+
$this->listener->onDeleted($event);
1212+
}
12041213
}
12051214
}
12061215
}

0 commit comments

Comments
 (0)