Example #1
0
 public function getNormalizedPath()
 {
     if (!isset($this->normalizedPath)) {
         $this->normalizedPath = PatternLab::normalizePath($this->getPath());
     }
     return $this->normalizedPath;
 }
Example #2
0
 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;
     }
 }
Example #3
0
 /**
  * @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];
 }