diff --git a/README.md b/README.md index ca9794a..aa7e9bc 100755 --- a/README.md +++ b/README.md @@ -78,28 +78,30 @@ $compiled = $macdom->compile($content); ```PHP use Macdom\Engine; - use Macdom\Bridges\MacdomLatte\MacdomLoader; - + use Macdom\Bridges\MacdomLatte\FileLoader; + /** * @var Engine */ private $macdom; /** - * @var MacdomLoader + * @var FileLoader */ - private $macdom; + private $fileLoader; - public function __construct(Engine $macdom, MacdomLoader $macdomLoader) { + + public function __construct(Engine $macdom, FileLoader $fileLoader) { $this->macdom = $macdom; - $this->macdomLoader = $macdom; + $this->fileLoader = $fileLoader; } + protected function createTemplate() { $template = parent::createTemplate(); - $this->macdomLoader->setMacdom($this->macdom); - $template->getLatte()->setLoader($this->macdomLoader); + $this->fileLoader->setMacdom($this->macdom); + $template->getLatte()->setLoader($this->fileLoader); return $template; } ``` diff --git a/src/Bridges/MacdomLatte/MacdomLoader.php b/src/Bridges/MacdomLatte/FileLoader.php similarity index 88% rename from src/Bridges/MacdomLatte/MacdomLoader.php rename to src/Bridges/MacdomLatte/FileLoader.php index 6276b4a..67e6b32 100644 --- a/src/Bridges/MacdomLatte/MacdomLoader.php +++ b/src/Bridges/MacdomLatte/FileLoader.php @@ -15,11 +15,11 @@ namespace Macdom\Bridges\MacdomLatte; -use Latte\Loaders\FileLoader; +use Latte\Loaders\FileLoader as LatteFileLoader; use Macdom\Engine; -final class MacdomLoader extends FileLoader +final class FileLoader extends LatteFileLoader { /** diff --git a/src/Bridges/MacdomNette/MacdomExtension.php b/src/Bridges/MacdomNette/MacdomExtension.php index c42de3b..497b305 100644 --- a/src/Bridges/MacdomNette/MacdomExtension.php +++ b/src/Bridges/MacdomNette/MacdomExtension.php @@ -35,7 +35,7 @@ public function loadConfiguration() $config = $this->getConfig($this->config); $builder->addDefinition($this->prefix('loader')) - ->setClass('Macdom\Bridges\MacdomLatte\MacdomLoader'); + ->setClass('Macdom\Bridges\MacdomLatte\FileLoader'); $compiler = $builder->addDefinition($this->prefix('engine')) ->setClass('Macdom\Engine'); diff --git a/src/Macdom/Compiler/Register.php b/src/Macdom/Compiler/Register.php index 637f842..1e73acd 100644 --- a/src/Macdom/Compiler/Register.php +++ b/src/Macdom/Compiler/Register.php @@ -281,12 +281,16 @@ public function removeBooleanAttribute($booleanAttribute, string $contentType = if ($isXhtmlContentType) { if ($this->findBooleanAttribute($booleanAttributeToRemove, Engine::CONTENT_HTML)) { - $booleanAttributeKey = array_search($booleanAttributeToRemove, $this->booleanAttributes[Engine::CONTENT_HTML]); + $booleanAttributeKey = array_search( + $booleanAttributeToRemove, $this->booleanAttributes[Engine::CONTENT_HTML] + ); unset($this->booleanAttributes[Engine::CONTENT_HTML][$booleanAttributeKey]); } if ($this->findBooleanAttribute($booleanAttributeToRemove, Engine::CONTENT_XML)) { - $booleanAttributeKey = array_search($booleanAttributeToRemove, $this->booleanAttributes[Engine::CONTENT_XML]); + $booleanAttributeKey = array_search( + $booleanAttributeToRemove, $this->booleanAttributes[Engine::CONTENT_XML] + ); unset($this->booleanAttributes[Engine::CONTENT_HTML][$booleanAttributeKey]); }