Skip to content

Commit e1ccc85

Browse files
Danackondrejmirtes
authored andcommitted
Change message 'typehint' to 'type' and 'typehint type' to 'type'.
1 parent 27a5d0f commit e1ccc85

File tree

56 files changed

+228
-226
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+228
-226
lines changed

src/Rules/Functions/ExistingClassesInArrowFunctionTypehintsRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public function processNode(Node $node, Scope $scope): array
3030
$scope,
3131
$node->getParams(),
3232
$node->getReturnType(),
33-
'Parameter $%s of anonymous function has invalid typehint type %s.',
34-
'Return typehint of anonymous function has invalid type %s.',
33+
'Parameter $%s of anonymous function has invalid type %s.',
34+
'Anonymous function has invalid return type %s.',
3535
'Anonymous function uses native union types but they\'re supported only on PHP 8.0 and later.'
3636
);
3737
}

src/Rules/Functions/ExistingClassesInClosureTypehintsRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ public function processNode(Node $node, Scope $scope): array
3131
$scope,
3232
$node->getParams(),
3333
$node->getReturnType(),
34-
'Parameter $%s of anonymous function has invalid typehint type %s.',
35-
'Return typehint of anonymous function has invalid type %s.',
34+
'Parameter $%s of anonymous function has invalid type %s.',
35+
'Anonymous function has invalid return type %s.',
3636
'Anonymous function uses native union types but they\'re supported only on PHP 8.0 and later.'
3737
);
3838
}

src/Rules/Functions/ExistingClassesInTypehintsRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ public function processNode(Node $node, Scope $scope): array
3838
$node->getOriginalNode(),
3939
$scope->getFunction(),
4040
sprintf(
41-
'Parameter $%%s of function %s() has invalid typehint type %%s.',
41+
'Parameter $%%s of function %s() has invalid type %%s.',
4242
$functionName
4343
),
4444
sprintf(
45-
'Return typehint of function %s() has invalid type %%s.',
45+
'Function %s() has invalid return type %%s.',
4646
$functionName
4747
),
4848
sprintf('Function %s() uses native union types but they\'re supported only on PHP 8.0 and later.', $functionName),

src/Rules/Functions/MissingFunctionParameterTypehintRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ private function checkFunctionParameter(FunctionReflection $functionReflection,
6464
if ($parameterType instanceof MixedType && !$parameterType->isExplicitMixed()) {
6565
return [
6666
RuleErrorBuilder::message(sprintf(
67-
'Function %s() has parameter $%s with no typehint specified.',
67+
'Function %s() has parameter $%s with no type specified.',
6868
$functionReflection->getName(),
6969
$parameterReflection->getName()
7070
))->build(),

src/Rules/Functions/MissingFunctionReturnTypehintRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function processNode(Node $node, Scope $scope): array
4444
if ($returnType instanceof MixedType && !$returnType->isExplicitMixed()) {
4545
return [
4646
RuleErrorBuilder::message(sprintf(
47-
'Function %s() has no return typehint specified.',
47+
'Function %s() has no return type specified.',
4848
$functionReflection->getName()
4949
))->build(),
5050
];

src/Rules/Methods/ExistingClassesInTypehintsRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ public function processNode(Node $node, Scope $scope): array
4040
$methodReflection,
4141
$node->getOriginalNode(),
4242
sprintf(
43-
'Parameter $%%s of method %s::%s() has invalid typehint type %%s.',
43+
'Parameter $%%s of method %s::%s() has invalid type %%s.',
4444
$scope->getClassReflection()->getDisplayName(),
4545
$methodReflection->getName()
4646
),
4747
sprintf(
48-
'Return typehint of method %s::%s() has invalid type %%s.',
48+
'Method %s::%s() has invalid return type %%s.',
4949
$scope->getClassReflection()->getDisplayName(),
5050
$methodReflection->getName()
5151
),

src/Rules/Methods/MissingMethodParameterTypehintRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private function checkMethodParameter(MethodReflection $methodReflection, Parame
6161
if ($parameterType instanceof MixedType && !$parameterType->isExplicitMixed()) {
6262
return [
6363
RuleErrorBuilder::message(sprintf(
64-
'Method %s::%s() has parameter $%s with no typehint specified.',
64+
'Method %s::%s() has parameter $%s with no type specified.',
6565
$methodReflection->getDeclaringClass()->getDisplayName(),
6666
$methodReflection->getName(),
6767
$parameterReflection->getName()

src/Rules/Methods/MissingMethodReturnTypehintRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function processNode(Node $node, Scope $scope): array
4242
if ($returnType instanceof MixedType && !$returnType->isExplicitMixed()) {
4343
return [
4444
RuleErrorBuilder::message(sprintf(
45-
'Method %s::%s() has no return typehint specified.',
45+
'Method %s::%s() has no return type specified.',
4646
$methodReflection->getDeclaringClass()->getDisplayName(),
4747
$methodReflection->getName()
4848
))->build(),

src/Rules/Properties/MissingPropertyTypehintRule.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function processNode(Node $node, Scope $scope): array
3939
if ($propertyType instanceof MixedType && !$propertyType->isExplicitMixed()) {
4040
return [
4141
RuleErrorBuilder::message(sprintf(
42-
'Property %s::$%s has no typehint specified.',
42+
'Property %s::$%s has no type specified.',
4343
$propertyReflection->getDeclaringClass()->getDisplayName(),
4444
$node->getName()
4545
))->build(),

src/Rules/TooWideTypehints/TooWideArrowFunctionReturnTypehintRule.php

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

5151
$messages[] = RuleErrorBuilder::message(sprintf(
52-
'Anonymous function never returns %s so it can be removed from the return typehint.',
52+
'Anonymous function never returns %s so it can be removed from the return type.',
5353
$type->describe(VerbosityLevel::getRecommendedLevelByType($type))
5454
))->build();
5555
}

0 commit comments

Comments
 (0)