Example #1
0
 public function __construct(PatternInterface $pattern, $variant, $dataFile)
 {
     $this->pattern = $pattern;
     $this->variant = $variant;
     $this->path = $pattern->getPath() . "~{$variant}";
     $this->id = $this->path;
     $this->name = $pattern->getName() . ' ' . str_replace('-', ' ', $variant);
     $this->dataFiles = [$dataFile];
 }
Example #2
0
 public function __construct(StyleguideInterface $styleguide, SourcePatternInterface $pattern)
 {
     $this->styleguide = $styleguide;
     $this->file = $pattern->getFile();
     $this->id = $pattern->getId();
     $this->partial = $pattern->getPartial();
     $this->state = $pattern->getState();
     $this->template = $pattern->getTemplate();
     $this->time = $pattern->getTime();
     $this->name = self::makeName($pattern->getName());
     $this->breadcrumb = self::makeBreadcrumb($pattern->getPath());
     $this->makePaths($pattern);
     $this->includes = $pattern->getIncludedPatterns();
 }