Skip to content

Commit 9041841

Browse files
committed
cleanup some names
1 parent 8f8cfa3 commit 9041841

21 files changed

+122
-81
lines changed

rules/FinalClassRule.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
use PhpParser\Node;
1212
use PHPStan\Analyser\Scope;
13+
use PHPStan\Reflection\ReflectionProvider;
1314
use PHPStan\Rules\Rule;
1415
use PHPStan\Rules\RuleErrorBuilder;
15-
use PHPStan\Reflection\ReflectionProvider;
1616

1717
/**
1818
* @implements \PHPStan\Rules\Rule<\PhpParser\Node\Stmt\Class_>
@@ -71,7 +71,7 @@ public function processNode(Node $node, Scope $scope): array
7171
)
7272
->identifier('class.notFinal')
7373
->tip('Add "final" keyword to the class declaration.')
74-
->build()
74+
->build(),
7575
];
7676
}
7777
}

tests/rules/FinalClassRuleTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ public function testRule(): void
2626
{
2727
$this->analyse(
2828
[
29-
__DIR__ . '/Fixtures/FinalRule/NonFinalClass.php',
29+
__DIR__ . '/Fixtures/FinalClass/NonFinalClass.php',
3030
],
3131
[
3232
[
33-
'Class Ibexa\Tests\PHPStan\Rules\Fixtures\FinalRule\NonFinalClass is not final. All non-abstract classes should be final.',
33+
'Class Ibexa\Tests\PHPStan\Rules\Fixtures\FinalClass\NonFinalClass is not final. All non-abstract classes should be final.',
3434
11,
3535
'Add "final" keyword to the class declaration.',
3636
],
@@ -42,10 +42,10 @@ public function testNoErrorsOnFinalAndAbstractClassesAndInterfaces(): void
4242
{
4343
$this->analyse(
4444
[
45-
__DIR__ . '/Fixtures/FinalRule/FinalClass.php',
46-
__DIR__ . '/Fixtures/FinalRule/AbstractClass.php',
47-
__DIR__ . '/Fixtures/FinalRule/SomeInterface.php',
48-
__DIR__ . '/Fixtures/FinalRule/SomeTrait.php',
45+
__DIR__ . '/Fixtures/FinalClass/FinalClass.php',
46+
__DIR__ . '/Fixtures/FinalClass/AbstractClass.php',
47+
__DIR__ . '/Fixtures/FinalClass/SomeInterface.php',
48+
__DIR__ . '/Fixtures/FinalClass/SomeTrait.php',
4949
],
5050
[]
5151
);

tests/rules/Fixtures/FinalRule/AbstractClass.php renamed to tests/rules/Fixtures/FinalClass/AbstractClass.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77
declare(strict_types=1);
88

9-
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalRule;
9+
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalClass;
1010

11-
abstract class AbstractClass {}
11+
abstract class AbstractClass
12+
{
13+
}

tests/rules/Fixtures/FinalRule/FinalClass.php renamed to tests/rules/Fixtures/FinalClass/FinalClass.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77
declare(strict_types=1);
88

9-
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalRule;
9+
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalClass;
1010

11-
final class FinalClass {}
11+
final class FinalClass
12+
{
13+
}

tests/rules/Fixtures/FinalRule/NonFinalClass.php renamed to tests/rules/Fixtures/FinalClass/NonFinalClass.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77
declare(strict_types=1);
88

9-
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalRule;
9+
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalClass;
1010

11-
class NonFinalClass {}
11+
class NonFinalClass
12+
{
13+
}

tests/rules/Fixtures/FinalRule/SomeInterface.php renamed to tests/rules/Fixtures/FinalClass/SomeInterface.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77
declare(strict_types=1);
88

9-
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalRule;
9+
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalClass;
1010

11-
interface SomeInterface {}
11+
interface SomeInterface
12+
{
13+
}

tests/rules/Fixtures/FinalRule/SomeTrait.php renamed to tests/rules/Fixtures/FinalClass/SomeTrait.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77
declare(strict_types=1);
88

9-
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalRule;
9+
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\FinalClass;
1010

11-
trait SomeTrait {}
11+
trait SomeTrait
12+
{
13+
}

tests/rules/Fixtures/FinalClassFixture.php

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5+
* @license For full copyright and license information view LICENSE file distributed with this source code.
6+
*/
7+
declare(strict_types=1);
8+
9+
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\NamingConvention;
10+
11+
abstract class AbstractCorrectClass
12+
{
13+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
3+
/**
4+
* @copyright Copyright (C) Ibexa AS. All rights reserved.
5+
* @license For full copyright and license information view LICENSE file distributed with this source code.
6+
*/
7+
declare(strict_types=1);
8+
9+
namespace Ibexa\Tests\PHPStan\Rules\Fixtures\NamingConvention;
10+
11+
interface CorrectNameInterface
12+
{
13+
}

0 commit comments

Comments
 (0)