PHPDaemon\FS\FileWatcher::onFileChanged PHP Method

onFileChanged() public method

Called when file $path is changed
public onFileChanged ( string $path ) : void
$path string Path
return void
    public function onFileChanged($path)
    {
        if (!Daemon::lintFile($path)) {
            Daemon::log(__METHOD__ . ': Detected parse error in ' . $path);
            return;
        }
        foreach ($this->files[$path] as $cb) {
            if (is_callable($cb) || is_array($cb)) {
                $cb($path);
            } elseif (!Daemon::$process->IPCManager->importFile($cb, $path)) {
                $this->rmWatch($path, $cb);
            }
        }
    }