From b991edc8ca588c05590f36b9addf7c1b2b4d023c Mon Sep 17 00:00:00 2001 From: Franck DAKIA Date: Sat, 18 Jan 2025 13:59:29 +0000 Subject: [PATCH] fix: type data --- src/Container/Action.php | 4 ++-- src/Queue/Connection.php | 11 ++++++++--- src/Session/Session.php | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/Container/Action.php b/src/Container/Action.php index 58fdfe6f..01bfedde 100644 --- a/src/Container/Action.php +++ b/src/Container/Action.php @@ -475,11 +475,11 @@ private function getInjectParameters(array $parameters): array /** * Get injectable parameter * - * @param ReflectionClass $class + * @param mixed $class * @return ?object * @throws ReflectionException */ - private function getInjectParameter(ReflectionClass $class): ?object + private function getInjectParameter(mixed $class): ?object { $class_name = $class->getName(); diff --git a/src/Queue/Connection.php b/src/Queue/Connection.php index eab80b1f..c079a8f4 100644 --- a/src/Queue/Connection.php +++ b/src/Queue/Connection.php @@ -23,9 +23,9 @@ class Connection /** * The configuration array * - * @var string + * @var ?string */ - private string $connection = "beanstalkd"; + private ?string $connection = null; /** * The supported connection @@ -104,7 +104,8 @@ public function getAdapter(): QueueAdapter * * @param string $name * @param array $arguments - * @return mixed + * @return mixed|null + * @throws ErrorException */ public function __call(string $name, array $arguments) { @@ -113,5 +114,9 @@ public function __call(string $name, array $arguments) if (method_exists($adapter, $name)) { return call_user_func_array([$adapter, $name], $arguments); } + + $class = get_class($adapter); + + throw new ErrorException("Call to undefined method {$class}->{$name}()"); } } diff --git a/src/Session/Session.php b/src/Session/Session.php index 2b2a6264..ee080497 100644 --- a/src/Session/Session.php +++ b/src/Session/Session.php @@ -230,7 +230,7 @@ private function initializeInternalSessionStorage(): void private function setCookieParameters(): void { session_set_cookie_params( - $this->config["lifetime"], + (int) $this->config["lifetime"], $this->config["path"], $this->config['domain'], $this->config["secure"],