Skip to content

Commit

Permalink
Мелкие правки кода
Browse files Browse the repository at this point in the history
  • Loading branch information
Elnadrion committed May 8, 2024
1 parent 97d6830 commit 174b74b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Maximaster/Tools/Twig/BitrixLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ class BitrixLoader extends TwigFilesystemLoader implements TwigLoaderInterface
* <b>vendor:componentname[:template[:specifictemplatefile]]</b><br>
* Например bitrix:news.list:.default, или bitrix:sale.order:show:step1
*/

public function getSource(string $name): string
{
return file_get_contents($this->getSourcePath($name));
Expand Down Expand Up @@ -102,7 +101,7 @@ private function getComponentTemplatePath(string $name): string
{
$name = $this->normalizeName($name);

list($siteTemplate, $namespace, $component, $template, $page) = explode(':', $name);
[$siteTemplate, $namespace, $component, $template, $page] = explode(':', $name);

// Относительный путь, например: vendor:component:template:inc/area.twig
$isRelative = $page !== basename($page);
Expand Down Expand Up @@ -173,7 +172,7 @@ public function normalizeName(string $name): string
}

if ($isComponentPath) {
list($siteTemplate, $namespace, $component, $template, $file) = explode(':', $name);
[$siteTemplate, $namespace, $component, $template, $file] = explode(':', (string) $name);

if (strlen($template) === 0) {
$template = '.default';
Expand Down

0 comments on commit 174b74b

Please sign in to comment.