for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace CSSPrites\Generator;
class HTMLGenerator extends AbstractGenerator
{
protected $cssGenerator;
protected $tag = '';
protected $template = '';
protected $cssgenerator;
public function setTag($value)
$this->tag = $value;
return $this;
}
public function setTemplate($value)
$this->template = $value;
public function setCSSGenerator(CSSGenerator $cssGenerator)
$this->cssgenerator = $cssGenerator;
public function addLine($filename)
$this->content .= "\t".'<'.$this->tag.' class="{{selector}} {{prefix}}-'.$this->slugifier->slugify($filename).'"></'.$this->tag.'>'."\n";
public function process()
if (!($this->cssgenerator instanceof CSSGenerator)) {
throw new \Exception('CSSGenerator not set');
$this->content = str_replace(
['{{selector}}', '{{prefix}}'],
[$this->cssgenerator->getSelector(), $this->cssgenerator->getPrefix()],
$this->content
);
['{{stylesheet}}', '{{content}}'],
[pathinfo($this->cssgenerator->getFilePath(), PATHINFO_BASENAME), rtrim($this->content)],
$this->template
return $this->content;
public function save()
return parent::save();