Skip to content

Commit

Permalink
php 8.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
scorninpc committed Jun 5, 2022
1 parent 2270c4f commit 715ca96
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/Smarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,7 @@ public function registerPlugin(string $type, string $tag, callable $callback, $c
*/
public function fetch(string $template, $data = []): string
{
if($data === NULL) {
$data = [];
}
$data = array_merge($this->defaultVariables, $data);
$data = array_merge($this->defaultVariables, $data??[]);

$this->smarty->assign($data);

Expand Down Expand Up @@ -154,7 +151,7 @@ public function offsetExists($key): bool
*
* @return mixed The key's value, or the default value
*/
public function offsetGet($key): mixed
public function offsetGet(mixed $key):mixed
{
return $this->defaultVariables[$key];
}
Expand All @@ -165,7 +162,7 @@ public function offsetGet($key): mixed
* @param string $key The data key
* @param mixed $value The data value
*/
public function offsetSet($key, $value): void
public function offsetSet(mixed $offset, mixed $value): void
{
$this->defaultVariables[$key] = $value;
}
Expand All @@ -175,7 +172,7 @@ public function offsetSet($key, $value): void
*
* @param string $key The data key
*/
public function offsetUnset($key): void
public function offsetUnset(mixed $offset): void
{
unset($this->defaultVariables[$key]);
}
Expand Down

0 comments on commit 715ca96

Please sign in to comment.