diff --git a/src/Common/UiElement.php b/src/Common/UiElement.php index e941c6d..5f6faa2 100644 --- a/src/Common/UiElement.php +++ b/src/Common/UiElement.php @@ -355,7 +355,8 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable { return count($this->childs); } - public function jsonSerialize() { + public function jsonSerialize() : mixed + { return [ 'tag' => $this->tag, 'attr' => $this->attributes, @@ -364,6 +365,7 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable { ]; } + #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { if ( is_numeric($offset) ) { return $this->selected[$offset] = $value; @@ -406,6 +408,7 @@ class UiElement implements \ArrayAccess, \Iterator, \JsonSerializable { return key($this->childs); } + #[\ReturnTypeWillChange] public function next() : self { return next($this->childs); diff --git a/src/Form/UiTextarea.php b/src/Form/UiTextarea.php index c7c8b42..ff2df2a 100644 --- a/src/Form/UiTextarea.php +++ b/src/Form/UiTextarea.php @@ -22,7 +22,9 @@ class UiTextarea extends UiInput { $this->echoRaw = true; } - return sprintf("echoRaw(%s)->buildHtml($arguments) ?>", $this->echoRaw ? 'true' : 'false'); + $raw = $this->echoRaw ? 'true' : 'false'; + + return "echoRaw($raw)->buildHtml($arguments) ?>"; }