protected static function monitorDirectoryIfItExists(FileMonitor $fileMonitor, string $path, string $filenamePattern = null)
    {
        if (is_dir($path)) {
            $fileMonitor->monitorDirectory($path, $filenamePattern);
        }
    }
protected static function monitorDirectoryIfItExists(FileMonitor $fileMonitor, string $path, string $filenamePattern = null)
    {
        if (is_dir($path)) {
            $fileMonitor->monitorDirectory($path, $filenamePattern);
        }
    }
protected static function monitorDirectoryIfItExists ( FileMonitor $ fileMonitor , string $ path , string $ filenamePattern = null ) { if ( is_dir ( $ path ) ) { $ fileMonitor -> monitorDirectory ( $ path , $ filenamePattern ) ; } }
Let the given file monitor track changes of the specified directory if it exists.

@param FileMonitor $fileMonitor
@param string $path
@param string $filenamePattern Optional pattern for filenames to consider for file monitoring (regular expression). @see FileMonitor::monitorDirectory()
@return void
Let the given file monitor track changes of the specified directory if it exists .