From 1c247c0ad3a71a9df2d9e7866334afe8dec7619b Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sun, 28 Apr 2024 18:20:58 +0200 Subject: [PATCH] typos --- composer.json | 1 + src/DI/Config/Adapters/NeonAdapter.php | 8 ++++---- src/DI/ContainerBuilder.php | 3 +-- src/DI/ContainerLoader.php | 4 ++-- src/DI/DependencyChecker.php | 2 +- src/DI/Extensions/DecoratorExtension.php | 2 +- src/DI/Extensions/InjectExtension.php | 2 +- src/DI/Resolver.php | 4 ++-- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index f4782e7b2..28498797b 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "require": { "php": "8.1 - 8.3", "ext-tokenizer": "*", + "ext-ctype": "*", "nette/neon": "^3.3 || ^4.0", "nette/php-generator": "^4.1.3", "nette/robot-loader": "^4.0", diff --git a/src/DI/Config/Adapters/NeonAdapter.php b/src/DI/Config/Adapters/NeonAdapter.php index b71823b6f..d78a5e191 100644 --- a/src/DI/Config/Adapters/NeonAdapter.php +++ b/src/DI/Config/Adapters/NeonAdapter.php @@ -149,7 +149,7 @@ function (&$val): void { } - private function firstClassCallableVisitor(Neon\Node $node) + private function firstClassCallableVisitor(Neon\Node $node): void { if ($node instanceof Neon\Node\EntityNode && count($node->attributes) === 1 @@ -162,7 +162,7 @@ private function firstClassCallableVisitor(Neon\Node $node) } - private function removeUnderscoreVisitor(Neon\Node $node) + private function removeUnderscoreVisitor(Neon\Node $node): void { if (!$node instanceof Neon\Node\EntityNode) { return; @@ -189,7 +189,7 @@ private function removeUnderscoreVisitor(Neon\Node $node) } - private function convertAtSignVisitor(Neon\Node $node) + private function convertAtSignVisitor(Neon\Node $node): void { if ($node instanceof Neon\Node\StringNode) { if (str_starts_with($node->value, '@@')) { @@ -208,7 +208,7 @@ private function convertAtSignVisitor(Neon\Node $node) } - private function deprecatedParametersVisitor(Neon\Node $node) + private function deprecatedParametersVisitor(Neon\Node $node): void { if (($node instanceof Neon\Node\StringNode || $node instanceof Neon\Node\LiteralNode) && is_string($node->value) diff --git a/src/DI/ContainerBuilder.php b/src/DI/ContainerBuilder.php index b70a2028e..f2844d508 100644 --- a/src/DI/ContainerBuilder.php +++ b/src/DI/ContainerBuilder.php @@ -28,8 +28,7 @@ class ContainerBuilder /** @deprecated use ContainerBuilder::ThisContainer */ public const THIS_CONTAINER = self::ThisContainer; - /** @var array */ - public $parameters = []; + public array $parameters = []; /** @var Definition[] */ private array $definitions = []; diff --git a/src/DI/ContainerLoader.php b/src/DI/ContainerLoader.php index b1a2015a7..e6241a75b 100644 --- a/src/DI/ContainerLoader.php +++ b/src/DI/ContainerLoader.php @@ -18,8 +18,8 @@ class ContainerLoader { public function __construct( - private string $tempDirectory, - private bool $autoRebuild = false, + private readonly string $tempDirectory, + private readonly bool $autoRebuild = false, ) { } diff --git a/src/DI/DependencyChecker.php b/src/DI/DependencyChecker.php index 4b143af19..b9bcb305b 100644 --- a/src/DI/DependencyChecker.php +++ b/src/DI/DependencyChecker.php @@ -179,7 +179,7 @@ private static function hashParameters(\ReflectionFunctionAbstract $method): arr (string) $param->getType(), $param->isVariadic(), $param->isDefaultValueAvailable() - ? is_object($tmp = Reflection::getParameterDefaultValue($param)) ? ['object' => $tmp::class] : ['value' => $tmp] + ? is_object($tmp = $param->getDefaultValue()) ? ['object' => $tmp::class] : ['value' => $tmp] : null, ]; } diff --git a/src/DI/Extensions/DecoratorExtension.php b/src/DI/Extensions/DecoratorExtension.php index 7afa70339..e5a4cc129 100644 --- a/src/DI/Extensions/DecoratorExtension.php +++ b/src/DI/Extensions/DecoratorExtension.php @@ -30,7 +30,7 @@ public function getConfigSchema(): Nette\Schema\Schema } - public function beforeCompile() + public function beforeCompile(): void { $this->getContainerBuilder()->resolve(); foreach ($this->config as $type => $info) { diff --git a/src/DI/Extensions/InjectExtension.php b/src/DI/Extensions/InjectExtension.php index 91948615f..4c40b30c0 100644 --- a/src/DI/Extensions/InjectExtension.php +++ b/src/DI/Extensions/InjectExtension.php @@ -32,7 +32,7 @@ public function getConfigSchema(): Nette\Schema\Schema } - public function beforeCompile() + public function beforeCompile(): void { foreach ($this->getContainerBuilder()->getDefinitions() as $def) { if ($def->getTag(self::TagInject)) { diff --git a/src/DI/Resolver.php b/src/DI/Resolver.php index 5848d73fe..dd51c490c 100644 --- a/src/DI/Resolver.php +++ b/src/DI/Resolver.php @@ -518,7 +518,7 @@ private function convertReferences(array $arguments): array /** * Add missing arguments using autowiring. - * @param (callable(string $type, bool $single): (object|object[]|null)) $getter + * @param (callable(string, bool): (object|object[]|null)) $getter * @throws ServiceCreationException */ public static function autowireArguments( @@ -592,7 +592,7 @@ public static function autowireArguments( /** * Resolves missing argument using autowiring. - * @param (callable(string $type, bool $single): (object|object[]|null)) $getter + * @param (callable(string, bool): (object|object[]|null)) $getter * @throws ServiceCreationException */ private static function autowireArgument(\ReflectionParameter $parameter, callable $getter): mixed