diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 0afc9c950..0acb49a4f 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -225,6 +225,9 @@ + + $item + offsetSet @@ -237,7 +240,6 @@ $href $index $item - $item autoEscape ? $this->escapeAttribute($attributes[$itemKey]) : $attributes[$itemKey]]]> autoEscape ? $this->escapeAttribute($value) : $value]]> $value @@ -258,7 +260,6 @@ $href $index $item - $item $media $title $type @@ -277,6 +278,7 @@ + $item $value $value @@ -349,10 +351,6 @@ $content $index $index - attributes['conditional']]]> - type]]> - type]]> - $key autoEscape ? $this->escapeAttribute($value) : $value]]> $value @@ -364,8 +362,6 @@ $content $index - $key - $type $value @@ -374,16 +370,6 @@ isHtml5 - - attributes['conditional']]]> - source]]> - $type - - - attributes]]> - source]]> - type]]> - parent::__call($method, $args) parent::__call($method, $args) @@ -411,6 +397,9 @@ offsetSet + + ObjectShape + $content $index diff --git a/src/Helper/HeadLink.php b/src/Helper/HeadLink.php index 3baea603e..8f34f209a 100644 --- a/src/Helper/HeadLink.php +++ b/src/Helper/HeadLink.php @@ -7,6 +7,7 @@ use Laminas\View\Exception; use Laminas\View\Helper\Placeholder\Container\AbstractContainer; use Laminas\View\Helper\Placeholder\Container\AbstractStandalone; +use stdClass; use function array_intersect; use function array_keys; @@ -36,6 +37,7 @@ * @method HeadLink offsetSetAlternate($index, $href, $type, $title, $extras = []) * @method HeadLink prependAlternate($href, $type, $title, $extras = []) * @method HeadLink setAlternate($href, $type, $title, $extras = []) + * @final */ class HeadLink extends AbstractStandalone { @@ -300,7 +302,7 @@ public function set($value) * * @return string */ - public function itemToString(object $item) + public function itemToString(stdClass $item) { $attributes = (array) $item; $link = ' + * @final */ class HeadMeta extends AbstractStandalone { @@ -254,7 +256,7 @@ public function createData($type, $typeValue, $content, array $modifiers) * @throws Exception\InvalidArgumentException * @return string */ - public function itemToString(object $item) + public function itemToString(stdClass $item) { if (! in_array($item->type, $this->typeKeys)) { throw new Exception\InvalidArgumentException(sprintf( diff --git a/src/Helper/HeadScript.php b/src/Helper/HeadScript.php index 085f01481..78f5c5e19 100644 --- a/src/Helper/HeadScript.php +++ b/src/Helper/HeadScript.php @@ -422,10 +422,10 @@ protected function isValid($value) * * @internal This method will become private in version 3.0 * - * @param mixed $item Item to convert - * @param string $indent String to add before the item - * @param string $escapeStart Starting sequence - * @param string $escapeEnd Ending sequence + * @param ObjectShape $item Item to convert + * @param string $indent String to add before the item + * @param string $escapeStart Starting sequence + * @param string $escapeEnd Ending sequence * @return string */ public function itemToString($item, $indent, $escapeStart, $escapeEnd) diff --git a/src/Helper/HeadStyle.php b/src/Helper/HeadStyle.php index 9bc3df0a0..f8ebe24e5 100644 --- a/src/Helper/HeadStyle.php +++ b/src/Helper/HeadStyle.php @@ -44,6 +44,7 @@ * @method HeadStyle prependStyle(string $content, array $attributes = []) * @method HeadStyle setStyle(string $content, array $attributes = []) * @method HeadStyle setIndent(int|string $indent) + * @final */ class HeadStyle extends AbstractStandalone { @@ -369,7 +370,7 @@ private function styleTagAttributesString(object $item): string * @param string $indent Indentation to use * @return string */ - public function itemToString(object $item, $indent) + public function itemToString(stdClass $item, $indent) { if (! isset($item->content) || ! is_string($item->content) || $item->content === '') { return ''; diff --git a/src/Helper/HeadTitle.php b/src/Helper/HeadTitle.php index 2547ddc12..7718760bb 100644 --- a/src/Helper/HeadTitle.php +++ b/src/Helper/HeadTitle.php @@ -21,6 +21,7 @@ * @method HeadTitle set(string $string) * @method HeadTitle prepend(string $string) * @method HeadTitle append(string $string) + * @final */ class HeadTitle extends AbstractStandalone { diff --git a/src/Helper/InlineScript.php b/src/Helper/InlineScript.php index b8299e50c..465bc4e3b 100644 --- a/src/Helper/InlineScript.php +++ b/src/Helper/InlineScript.php @@ -7,6 +7,8 @@ /** * Helper for setting and retrieving script elements for inclusion in HTML body * section + * + * @final */ class InlineScript extends HeadScript {