예제 #1
0
파일: Item.php 프로젝트: daspete/labcoat
 public function getNormalizedPath()
 {
     if (!isset($this->normalizedPath)) {
         $this->normalizedPath = PatternLab::normalizePath($this->getPath());
     }
     return $this->normalizedPath;
 }
예제 #2
0
파일: Loader.php 프로젝트: daspete/labcoat
 protected function makeIndex(PatternLabInterface $patternlab)
 {
     $this->index = [];
     foreach ($patternlab->getPatterns() as $pattern) {
         $file = $pattern->getFile();
         $partial = $pattern->getPartial();
         $path = PatternLab::normalizePath($pattern->getPath());
         $this->index[$partial] = $file;
         $this->index[$path] = $file;
     }
 }
예제 #3
0
파일: Type.php 프로젝트: daspete/labcoat
 /**
  * @param $path
  * @return SubtypeInterface
  */
 protected function getOrCreateSubtype($path)
 {
     list(, $key) = explode('/', PatternLab::normalizePath($path));
     if (!isset($this->items[$key])) {
         $this->items[$key] = new Subtype($path);
     }
     return $this->items[$key];
 }