private function addModifiedTimes($path)
    {
        if (is_file($path)) {
            $stat = stat($path);
            $this->modifiedTimes[realpath($path)] = $stat['mtime'];

            return;
        }

        $directoryIterator = new \RecursiveDirectoryIterator(realpath($path));
        $files = new \RecursiveIteratorIterator($directoryIterator);

        // Iterate over instances of \SplFileObject
        foreach ($files as $file) {
            $modifiedTime = $file->getMTime();
            $this->modifiedTimes[$file->getRealPath()] = $modifiedTime;
        }
    }