Exemplo n.º 1
0
 public function build(array $files)
 {
     $db = new SubclassesDatabase();
     foreach ($files as $path) {
         $lines = file($path, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
         if (!$lines) {
             continue;
         }
         foreach ($lines as $line) {
             list($subclass, $parent) = explode(' ', $line, 2);
             $db->add(MimeType::create($subclass), MimeType::create($parent));
         }
     }
     return $db;
 }
Exemplo n.º 2
0
 /**
  * @param MimeType|string $type
  *
  * @return MimeType[]
  */
 public function getParentTypes($type)
 {
     return $this->subclassesDb->getParents(MimeType::create($type));
 }