Skip to content

Commit d6c785b

Browse files
adaamzondrejmirtes
authored andcommitted
Added missing trailing dot in error messages
1 parent d3b9fec commit d6c785b

9 files changed

+19
-19
lines changed

src/Rules/Methods/MissingMethodParameterTypehintRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private function checkMethodParameter(MethodReflection $methodReflection, Parame
5757

5858
if ($parameterType instanceof MixedType && !$parameterType->isExplicitMixed()) {
5959
return sprintf(
60-
'Method %s::%s() has parameter $%s with no typehint specified',
60+
'Method %s::%s() has parameter $%s with no typehint specified.',
6161
$methodReflection->getDeclaringClass()->getDisplayName(),
6262
$methodReflection->getName(),
6363
$parameterReflection->getName()

src/Rules/Methods/MissingMethodReturnTypehintRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private function checkMethodReturnType(MethodReflection $methodReflection): ?str
4949

5050
if ($returnType instanceof MixedType && !$returnType->isExplicitMixed()) {
5151
return sprintf(
52-
'Method %s::%s() has no return typehint specified',
52+
'Method %s::%s() has no return typehint specified.',
5353
$methodReflection->getDeclaringClass()->getDisplayName(),
5454
$methodReflection->getName()
5555
);

src/Rules/Methods/WrongCaseOfInheritedMethodRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ private function findMethod(
7777
}
7878

7979
return sprintf(
80-
'Method %s::%s() does not match %s method name: %s::%s()',
80+
'Method %s::%s() does not match %s method name: %s::%s().',
8181
$declaringClass->getDisplayName(),
8282
$methodName,
8383
$classReflection->isInterface() ? 'interface' : 'parent',

src/Rules/Properties/MissingPropertyTypehintRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public function processNode(Node $node, Scope $scope): array
3434
if ($returnType instanceof MixedType && !$returnType->isExplicitMixed()) {
3535
return [
3636
sprintf(
37-
'Property %s::$%s has no typehint specified',
37+
'Property %s::$%s has no typehint specified.',
3838
$propertyReflection->getDeclaringClass()->getDisplayName(),
3939
$node->name->name
4040
),

tests/Levels/data/onlyBooleans-0.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[
22
{
3-
"message": "Method PHPStan\\Levels\\OnlyBooleans\\Foo::doFoo() has parameter $mixed with no typehint specified",
3+
"message": "Method PHPStan\\Levels\\OnlyBooleans\\Foo::doFoo() has parameter $mixed with no typehint specified.",
44
"line": 14,
55
"ignorable": true
66
},

tests/Rules/Methods/MissingMethodParameterTypehintRuleTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ public function testRule(): void
1414
{
1515
$this->analyse([__DIR__ . '/data/missing-method-parameter-typehint.php'], [
1616
[
17-
'Method MissingMethodParameterTypehint\FooInterface::getFoo() has parameter $p1 with no typehint specified',
17+
'Method MissingMethodParameterTypehint\FooInterface::getFoo() has parameter $p1 with no typehint specified.',
1818
8,
1919
],
2020
[
21-
'Method MissingMethodParameterTypehint\FooParent::getBar() has parameter $p2 with no typehint specified',
21+
'Method MissingMethodParameterTypehint\FooParent::getBar() has parameter $p2 with no typehint specified.',
2222
15,
2323
],
2424
[
25-
'Method MissingMethodParameterTypehint\Foo::getFoo() has parameter $p1 with no typehint specified',
25+
'Method MissingMethodParameterTypehint\Foo::getFoo() has parameter $p1 with no typehint specified.',
2626
25,
2727
],
2828
[
29-
'Method MissingMethodParameterTypehint\Foo::getBar() has parameter $p2 with no typehint specified',
29+
'Method MissingMethodParameterTypehint\Foo::getBar() has parameter $p2 with no typehint specified.',
3030
33,
3131
],
3232
[
33-
'Method MissingMethodParameterTypehint\Foo::getBaz() has parameter $p3 with no typehint specified',
33+
'Method MissingMethodParameterTypehint\Foo::getBaz() has parameter $p3 with no typehint specified.',
3434
42,
3535
],
3636
]);

tests/Rules/Methods/MissingMethodReturnTypehintRuleTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ public function testRule(): void
1414
{
1515
$this->analyse([__DIR__ . '/data/missing-method-return-typehint.php'], [
1616
[
17-
'Method MissingMethodReturnTypehint\FooInterface::getFoo() has no return typehint specified',
17+
'Method MissingMethodReturnTypehint\FooInterface::getFoo() has no return typehint specified.',
1818
8,
1919
],
2020
[
21-
'Method MissingMethodReturnTypehint\FooParent::getBar() has no return typehint specified',
21+
'Method MissingMethodReturnTypehint\FooParent::getBar() has no return typehint specified.',
2222
15,
2323
],
2424
[
25-
'Method MissingMethodReturnTypehint\Foo::getFoo() has no return typehint specified',
25+
'Method MissingMethodReturnTypehint\Foo::getFoo() has no return typehint specified.',
2626
25,
2727
],
2828
[
29-
'Method MissingMethodReturnTypehint\Foo::getBar() has no return typehint specified',
29+
'Method MissingMethodReturnTypehint\Foo::getBar() has no return typehint specified.',
3030
33,
3131
],
3232
]);

tests/Rules/Methods/WrongCaseOfInheritedMethodRuleTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public function testRule(): void
1414
{
1515
$this->analyse([__DIR__ . '/data/wrong-case.php'], [
1616
[
17-
'Method WrongCase\Foo::GETfoo() does not match interface method name: WrongCase\FooInterface::getFoo()',
17+
'Method WrongCase\Foo::GETfoo() does not match interface method name: WrongCase\FooInterface::getFoo().',
1818
25,
1919
],
2020
[
21-
'Method WrongCase\Foo::GETbar() does not match parent method name: WrongCase\FooParent::getBar()',
21+
'Method WrongCase\Foo::GETbar() does not match parent method name: WrongCase\FooParent::getBar().',
2222
30,
2323
],
2424
]);

tests/Rules/Properties/MissingPropertyTypehintRuleTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ public function testRule(): void
1414
{
1515
$this->analyse([__DIR__ . '/data/missing-property-typehint.php'], [
1616
[
17-
'Property MissingPropertyTypehint\MyClass::$prop1 has no typehint specified',
17+
'Property MissingPropertyTypehint\MyClass::$prop1 has no typehint specified.',
1818
7,
1919
],
2020
[
21-
'Property MissingPropertyTypehint\MyClass::$prop2 has no typehint specified',
21+
'Property MissingPropertyTypehint\MyClass::$prop2 has no typehint specified.',
2222
9,
2323
],
2424
[
25-
'Property MissingPropertyTypehint\MyClass::$prop3 has no typehint specified',
25+
'Property MissingPropertyTypehint\MyClass::$prop3 has no typehint specified.',
2626
14,
2727
],
2828
]);

0 commit comments

Comments
 (0)