Example #1
0
 public function getMimeType()
 {
     if (count($this->mimeTypes) > 1) {
         throw Exception::foundMultipleMimiTypes(array_keys($this->mimeTypes));
     }
     return key($this->mimeTypes);
 }
Example #2
0
 /**
  * @inheritdoc
  */
 public function unserialize($serialized)
 {
     if (!is_string($serialized)) {
         throw Exception::invalidUnserializeInput();
     }
     $this->options = array_merge($this->options, json_decode($serialized, true));
 }
Example #3
0
 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());
 }
Example #4
0
 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);
 }
Example #6
0
 /**
  * @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);
     }
 }