public function __construct(\SplFileInfo $file) { if (!$file->isFile()) { throw new \InvalidArgumentException(sprintf('%s is not a file.', $file)); } $this->file = $file; }