Skip to content

Commit 08d66dd

Browse files
committed
Fix code styles
1 parent 4bfaba8 commit 08d66dd

17 files changed

+37
-37
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,5 @@
6060
'CodeIgniter 4 framework',
6161
'CodeIgniter Foundation',
6262
'admin@codeigniter.com',
63-
2023
63+
2023,
6464
);

src/ComposerScripts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private static function recursiveDelete(string $directory): void
4949
/** @var SplFileInfo $file */
5050
foreach (new RecursiveIteratorIterator(
5151
new RecursiveDirectoryIterator(rtrim($directory, '\\/'), FilesystemIterator::SKIP_DOTS),
52-
RecursiveIteratorIterator::CHILD_FIRST
52+
RecursiveIteratorIterator::CHILD_FIRST,
5353
) as $file) {
5454
$path = $file->getPathname();
5555

src/Rules/Classes/FrameworkExceptionInstantiationRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function processNode(Node $node, Scope $scope): array
5454

5555
return [RuleErrorBuilder::message(sprintf(
5656
'Instantiating %s using new is not allowed. Use one of its named constructors instead.',
57-
$objectType->getClassReflection()->getNativeReflection()->getShortName()
57+
$objectType->getClassReflection()->getNativeReflection()->getShortName(),
5858
))->identifier('codeigniter.frameworkExceptionInstance')->build()];
5959
}
6060
}

src/Rules/Functions/FactoriesFunctionArgumentTypeRule.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function __construct(
4747
private readonly ReflectionProvider $reflectionProvider,
4848
private readonly FactoriesReturnTypeHelper $factoriesReturnTypeHelper,
4949
bool $checkArgumentTypeOfConfig,
50-
bool $checkArgumentTypeOfModel
50+
bool $checkArgumentTypeOfModel,
5151
) {
5252
$this->argumentTypeCheck = [
5353
'config' => $checkArgumentTypeOfConfig,
@@ -93,7 +93,7 @@ public function processNode(Node $node, Scope $scope): array
9393
$firstParameter = ParametersAcceptorSelector::selectFromArgs(
9494
$scope,
9595
$node->getArgs(),
96-
$this->reflectionProvider->getFunction($nameNode, $scope)->getVariants()
96+
$this->reflectionProvider->getFunction($nameNode, $scope)->getVariants(),
9797
)->getParameters()[0];
9898

9999
if ($returnType->isNull()->yes()) {
@@ -102,7 +102,7 @@ public function processNode(Node $node, Scope $scope): array
102102
$ruleErrorBuilder->addTip(sprintf(
103103
'If %s is a valid class string, you can add its possible namespace(s) in <fg=cyan>codeigniter.additional%sNamespaces</> in your <fg=yellow>%%configurationFile%%</>.',
104104
$constantStringType->describe(VerbosityLevel::precise()),
105-
ucfirst($function)
105+
ucfirst($function),
106106
));
107107
}
108108

@@ -113,7 +113,7 @@ public function processNode(Node $node, Scope $scope): array
113113
'Parameter #1 $%s of function %s expects a valid class string, %s given.',
114114
$firstParameter->getName(),
115115
$function,
116-
$nameType->describe(VerbosityLevel::precise())
116+
$nameType->describe(VerbosityLevel::precise()),
117117
)))->identifier(sprintf('codeigniter.%sArgumentType', $function))->build()];
118118
}
119119

@@ -127,7 +127,7 @@ public function processNode(Node $node, Scope $scope): array
127127
$firstParameter->getName(),
128128
$nameType->describe(VerbosityLevel::precise()),
129129
$function,
130-
addcslashes($this->instanceofMap[$function], '\\')
130+
addcslashes($this->instanceofMap[$function], '\\'),
131131
))->identifier(sprintf('codeigniter.%sArgumentInstanceof', $function))->build()];
132132
}
133133

src/Rules/Functions/NoClassConstFetchOnFactoriesFunctions.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ final class NoClassConstFetchOnFactoriesFunctions implements Rule
3636

3737
public function __construct(
3838
private readonly ReflectionProvider $reflectionProvider,
39-
private readonly FactoriesReturnTypeHelper $factoriesReturnTypeHelper
39+
private readonly FactoriesReturnTypeHelper $factoriesReturnTypeHelper,
4040
) {}
4141

4242
public function getNodeType(): string
@@ -120,11 +120,11 @@ public function processNode(Node $node, Scope $scope): array
120120
RuleErrorBuilder::message(sprintf(
121121
'Call to function %s with %s::class is discouraged.',
122122
$function,
123-
$reflection->getDisplayName()
123+
$reflection->getDisplayName(),
124124
))->tip(sprintf(
125125
'Use %s(\'%s\') instead to allow overriding.',
126126
$function,
127-
$reflection->getNativeReflection()->getShortName()
127+
$reflection->getNativeReflection()->getShortName(),
128128
))->identifier('codeigniter.factoriesClassConstFetch')->build(),
129129
];
130130
}

src/Rules/Functions/ServicesFunctionArgumentTypeRule.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ final class ServicesFunctionArgumentTypeRule implements Rule
3030
{
3131
public function __construct(
3232
private readonly ReflectionProvider $reflectionProvider,
33-
private readonly ServicesReturnTypeHelper $servicesReturnTypeHelper
33+
private readonly ServicesReturnTypeHelper $servicesReturnTypeHelper,
3434
) {}
3535

3636
public function getNodeType(): string
@@ -96,14 +96,14 @@ public function processNode(Node $node, Scope $scope): array
9696
$hasMethod = array_reduce(
9797
$this->servicesReturnTypeHelper->getServicesReflection(),
9898
static fn (bool $carry, ClassReflection $service): bool => $carry || $service->hasMethod($trimmedName),
99-
false
99+
false,
100100
);
101101

102102
if (! $returnType->isNull()->yes() || $hasMethod) {
103103
return [RuleErrorBuilder::message(sprintf(
104104
'Service method %s expected to return a service instance, got %s instead.',
105105
$name,
106-
$returnType->describe(VerbosityLevel::precise())
106+
$returnType->describe(VerbosityLevel::precise()),
107107
))->identifier('codeigniter.serviceNonObjectReturn')->build()];
108108
}
109109

@@ -121,7 +121,7 @@ public function processNode(Node $node, Scope $scope): array
121121

122122
return [$addTip(RuleErrorBuilder::message(sprintf(
123123
'Call to unknown service method %s.',
124-
$nameType->describe(VerbosityLevel::precise())
124+
$nameType->describe(VerbosityLevel::precise()),
125125
)))->identifier('codeigniter.unknownServiceMethod')->build()];
126126
}
127127
}

src/Rules/Superglobals/SuperglobalAccessRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
final class SuperglobalAccessRule implements Rule
2727
{
2828
public function __construct(
29-
private readonly SuperglobalRuleHelper $superglobalRuleHelper
29+
private readonly SuperglobalRuleHelper $superglobalRuleHelper,
3030
) {}
3131

3232
public function getNodeType(): string

src/Rules/Superglobals/SuperglobalAssignRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
final class SuperglobalAssignRule implements Rule
2828
{
2929
public function __construct(
30-
private readonly SuperglobalRuleHelper $superglobalRuleHelper
30+
private readonly SuperglobalRuleHelper $superglobalRuleHelper,
3131
) {}
3232

3333
public function getNodeType(): string
@@ -108,7 +108,7 @@ private function processArrayDimFetch(Node $node, Scope $scope): array
108108
'Use \\Config\\Services::superglobals()->%s(%s, %s) instead.',
109109
$method,
110110
$dimString->describe(VerbosityLevel::precise()),
111-
$exprString->describe(VerbosityLevel::precise())
111+
$exprString->describe(VerbosityLevel::precise()),
112112
));
113113
}
114114
}

src/Type/FactoriesFunctionReturnTypeExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
final class FactoriesFunctionReturnTypeExtension implements DynamicFunctionReturnTypeExtension
2323
{
2424
public function __construct(
25-
private readonly FactoriesReturnTypeHelper $factoriesReturnTypeHelper
25+
private readonly FactoriesReturnTypeHelper $factoriesReturnTypeHelper,
2626
) {}
2727

2828
public function isFunctionSupported(FunctionReflection $functionReflection): bool
@@ -40,7 +40,7 @@ public function getTypeFromFunctionCall(FunctionReflection $functionReflection,
4040

4141
return $this->factoriesReturnTypeHelper->check(
4242
$scope->getType($arguments[0]->value),
43-
$functionReflection->getName()
43+
$functionReflection->getName(),
4444
);
4545
}
4646
}

src/Type/FactoriesReturnTypeHelper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ final class FactoriesReturnTypeHelper
4646
public function __construct(
4747
private readonly ReflectionProvider $reflectionProvider,
4848
array $additionalConfigNamespaces,
49-
array $additionalModelNamespaces
49+
array $additionalModelNamespaces,
5050
) {
5151
$cb = static fn (string $item): string => rtrim($item, '\\') . '\\';
5252

0 commit comments

Comments
 (0)