From 937651fd788833482e904f3fe628cc28a2afde2a Mon Sep 17 00:00:00 2001 From: chengyao <64066545+topyao@users.noreply.github.com> Date: Fri, 12 Aug 2022 20:30:01 +0800 Subject: [PATCH 1/3] =?UTF-8?q?Docs=EF=BC=9A=E6=B7=BB=E5=8A=A0=E8=87=B4?= =?UTF-8?q?=E8=B0=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 9a0a5720..4f10cf30 100644 --- a/README.md +++ b/README.md @@ -32,3 +32,7 @@ [![Contributor over time](https://contributor-overtime-api.apiseven.com/contributors-svg?chart=contributorOverTime&repo=marxphp/max)](https://contributor-overtime-api.apiseven.com/contributors-svg?chart=contributorOverTime&repo=marxphp/max) 欢迎有兴趣的朋友参与开发 + +## 致谢 + +感谢PHP最好用IDE: PHPStorm From 48687a6a467bc245548a8f078566ff58568b7798 Mon Sep 17 00:00:00 2001 From: chengyao <64066545+topyao@users.noreply.github.com> Date: Fri, 12 Aug 2022 20:30:54 +0800 Subject: [PATCH 2/3] =?UTF-8?q?Pref:=20=E7=A7=BB=E9=99=A4=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/jwt/src/Contract/Authenticatable.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jwt/src/Contract/Authenticatable.php b/src/jwt/src/Contract/Authenticatable.php index 2d578ad9..114ab6a1 100644 --- a/src/jwt/src/Contract/Authenticatable.php +++ b/src/jwt/src/Contract/Authenticatable.php @@ -13,7 +13,7 @@ interface Authenticatable { - public function getIdentifier(): mixed; + public function getIdentifier(); public function getClaims(): array; } From e08801a592917281672eeab62f2b6cda6be94854 Mon Sep 17 00:00:00 2001 From: chengyao <64066545+topyao@users.noreply.github.com> Date: Fri, 12 Aug 2022 20:32:03 +0800 Subject: [PATCH 3/3] =?UTF-8?q?Pref:=20=E7=A7=BB=E9=99=A4=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E5=BC=BA=E8=BD=AC=EF=BC=8C=E4=BF=AE=E5=A4=8D=E5=8F=82?= =?UTF-8?q?=E6=95=B0bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/di/src/Container.php | 24 +----------------------- 1 file changed, 1 insertion(+), 23 deletions(-) diff --git a/src/di/src/Container.php b/src/di/src/Container.php index c13207f3..69555a2e 100644 --- a/src/di/src/Container.php +++ b/src/di/src/Container.php @@ -225,13 +225,8 @@ public function getFuncArgs(ReflectionFunctionAbstract $reflectionFunction, arra foreach ($reflectionFunction->getParameters() as $parameter) { $name = $parameter->getName(); if (array_key_exists($name, $arguments)) { - $injectValue = $arguments[$name]; + $funcArgs[] = &$arguments[$name]; unset($arguments[$name]); - $type = $parameter->getType(); - if ($type instanceof ReflectionNamedType && $type->isBuiltin()) { - $injectValue = $this->castParameter($injectValue, $type->getName()); - } - $funcArgs[] = &$injectValue; } else { $type = $parameter->getType(); if (is_null($type) @@ -260,21 +255,4 @@ public function getFuncArgs(ReflectionFunctionAbstract $reflectionFunction, arra return $funcArgs; } - - /** - * 转换类型. - */ - protected function castParameter(mixed $value, string $type): mixed - { - return match ($type) { - 'int' => (int) $value, - 'string' => (string) $value, - 'bool' => (bool) $value, - 'array' => (array) $value, - 'float' => (float) $value, - 'double' => (float) $value, - 'object' => (object) $value, - default => $value, - }; - } }