mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
fix: rename shadowed variable in Request::getType()
The parameter \$type was being reassigned to the session value, which shadows the original parameter and causes confusion for static analysis tools and maintainers. Renamed the session value variable to \$value for clarity.
This commit is contained in:
@@ -56,14 +56,14 @@ final readonly class Request implements RequestInterface
|
|||||||
{
|
{
|
||||||
$session = $this->getSession();
|
$session = $this->getSession();
|
||||||
|
|
||||||
/** @var false|string|string[] $type */
|
/** @var false|string|string[] $value */
|
||||||
$type = $session?->get($type);
|
$value = $session?->get($type);
|
||||||
|
|
||||||
if (!\is_string($type) && !\is_array($type)) {
|
if (!\is_string($value) && !\is_array($value)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $type;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forgetType(string $type): void
|
public function forgetType(string $type): void
|
||||||
|
|||||||
Reference in New Issue
Block a user