mirror of
https://github.com/archtechx/laravel-seo.git
synced 2025-12-12 18:04:03 +00:00
Fix some PHPStan errors
This commit is contained in:
parent
1b2bfb2945
commit
1970b01773
4 changed files with 22 additions and 12 deletions
|
|
@ -82,11 +82,14 @@ class SEOManager
|
|||
: value($this->values[$key]);
|
||||
}
|
||||
|
||||
/** Set one or more values. */
|
||||
/**
|
||||
* Set one or more values.
|
||||
*
|
||||
* @param string|array<string, string> $key
|
||||
*/
|
||||
public function set(string|array $key, string|Closure|null $value = null): string|array|null
|
||||
{
|
||||
if (is_array($key)) {
|
||||
/** @var array<string, string> $key */
|
||||
foreach ($key as $k => $v) {
|
||||
$this->set($k, $v);
|
||||
}
|
||||
|
|
@ -166,7 +169,7 @@ class SEOManager
|
|||
];
|
||||
}
|
||||
|
||||
$query = base64_encode(json_encode($data));
|
||||
$query = base64_encode((string)json_encode($data));
|
||||
|
||||
/** @var string $template */
|
||||
$template = $this->meta("flipp.templates.$alias");
|
||||
|
|
@ -273,7 +276,11 @@ class SEOManager
|
|||
return $this->get(Str::snake($key, '.'));
|
||||
}
|
||||
|
||||
/** Handle magic set. */
|
||||
/**
|
||||
* Handle magic set.
|
||||
*
|
||||
* @phpstan-return string|array|null
|
||||
*/
|
||||
public function __set(string $key, string $value)
|
||||
{
|
||||
return $this->set(Str::snake($key, '.'), $value);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue