Style fixes.

This commit is contained in:
Buster Neece 2022-11-15 18:59:13 -06:00
parent 2bc1073a42
commit 316eb03a4c
No known key found for this signature in database
GPG Key ID: F1D2E64A0005E80E
2 changed files with 6 additions and 6 deletions

View File

@ -37,6 +37,6 @@ parameters:
-
message: "#^Parameter \\#2 \\$callback of method League\\\\Plates\\\\Engine\\:\\:registerFunction\\(\\) expects League\\\\Plates\\\\callback, Closure given\\.$#"
count: 7
count: 4
path: src/View.php

View File

@ -34,9 +34,9 @@ final class GlobalSections
$initialValue = $this->sections[$section] ?? '';
$this->sections[$section] = match ($mode) {
Template::SECTION_MODE_REWRITE => $value,
Template::SECTION_MODE_PREPEND => $value . $initialValue,
Template::SECTION_MODE_APPEND => $initialValue . $value
Template::SECTION_MODE_APPEND => $initialValue . $value,
default => $value
};
}
@ -61,13 +61,13 @@ final class GlobalSections
ob_start();
}
public function appendStart($name): void
public function appendStart(string $name): void
{
$this->sectionMode = Template::SECTION_MODE_APPEND;
$this->start($name);
}
public function prependStart($name)
public function prependStart(string $name): void
{
$this->sectionMode = Template::SECTION_MODE_PREPEND;
$this->start($name);
@ -81,7 +81,7 @@ final class GlobalSections
);
}
$this->set($this->sectionName, ob_get_clean(), $this->sectionMode);
$this->set($this->sectionName, ob_get_clean() ?: null, $this->sectionMode);
$this->sectionName = null;
$this->sectionMode = Template::SECTION_MODE_REWRITE;