/** * Normalize the file info. * * @param SplFileInfo $file * * @return array */ protected function normalizeFileInfo(SplFileInfo $file) { if ($file->isLink()) { throw NotSupportedException::forLink($file); } $normalized = ['type' => $file->getType(), 'path' => $this->getFilePath($file)]; $normalized['timestamp'] = $file->getMTime(); if ($normalized['type'] === 'file') { $normalized['size'] = $file->getSize(); } return $normalized; }
/** * Normalize the file info. * * @param SplFileInfo $file * * @return array */ protected function normalizeFileInfo(SplFileInfo $file) { if (!$file->isLink()) { return $this->mapFileInfo($file); } if ($this->linkHandling & self::DISALLOW_LINKS) { throw NotSupportedException::forLink($file); } }