public function getMimeType() { if (count($this->mimeTypes) > 1) { throw Exception::foundMultipleMimiTypes(array_keys($this->mimeTypes)); } return key($this->mimeTypes); }
/** * @inheritdoc */ public function unserialize($serialized) { if (!is_string($serialized)) { throw Exception::invalidUnserializeInput(); } $this->options = array_merge($this->options, json_decode($serialized, true)); }
private function process($group, CompilerHandler $compiler) { if (!$this->groups->offsetExists($group)) { throw Exception::groupNotFound($group); } $files = $this->groups->offsetGet($group); return $this->getBinder()->bind($files, $compiler->get()); }
private function getRealPath($path) { $realPath = realpath($path); if (!$realPath) { throw Exception::pathNotFound($path); } return $realPath . DIRECTORY_SEPARATOR; }
/** * @param $filePath * @return string * @throws \Exception */ protected function executeProcessing($filePath) { throw Exception::processorOverrideNecessary(get_class($this), $filePath); }
/** * @inheritdoc */ public function getModifiedTime($filePath) { $path = $this->getAbsolutePath($filePath); if (!file_exists($path)) { throw Exception::fileNotFound($path); } $time = new DateTime(); return $time->setTimestamp(filemtime($path)); }
private function validateLastModified($dateTime) { if (is_null($dateTime)) { throw Exception::emptyFileList(get_class($this)); } }
private function validateInstance($instance) { if (!is_subclass_of($instance, Processor::class)) { throw Exception::notSubclass($instance, Processor::class); } }