Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 28, 2024
1 parent 79fd5be commit 1c247c0
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions src/DI/Config/Adapters/NeonAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand All @@ -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, '@@')) {
Expand All @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions src/DI/ContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [];
Expand Down
4 changes: 2 additions & 2 deletions src/DI/ContainerLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
) {
}

Expand Down
2 changes: 1 addition & 1 deletion src/DI/DependencyChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/DI/Extensions/DecoratorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/DI/Extensions/InjectExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
4 changes: 2 additions & 2 deletions src/DI/Resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 1c247c0

Please sign in to comment.