This repository has been archived by the owner on Dec 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 187
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PHPStanRules] Fix commented print node (#2704)
* simplify getName * [PHPStanRules] Fix commented print node
- Loading branch information
1 parent
dcc78c0
commit 181da5e
Showing
6 changed files
with
55 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/phpstan-rules/src/ValueObject/PhpParserAttributeKey.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Symplify\PHPStanRules\ValueObject; | ||
|
||
final class PhpParserAttributeKey | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public const COMMENTS = 'comments'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
...s/Rules/CheckTypehintCallerTypeRule/Fixture/SkipDuplicatedCallOfSameMethodWithComment.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Symplify\PHPStanRules\Tests\Rules\CheckTypehintCallerTypeRule\Fixture; | ||
|
||
use PHPStan\Node\FileNode; | ||
use Rector\Core\PhpParser\Node\CustomNode\FileWithoutNamespace; | ||
|
||
final class SkipDuplicatedCallOfSameMethodWithComment | ||
{ | ||
public function firstMethod() | ||
{ | ||
$this->printFile(new FileWithoutNamespace([])); | ||
} | ||
|
||
/** | ||
* @param FileWithoutNamespace|FileNode $node | ||
*/ | ||
private function printFile(\PhpParser\Node $node) | ||
{ | ||
} | ||
|
||
public function secondMethod() | ||
{ | ||
// some comment | ||
$this->printFile(new FileNode([])); | ||
} | ||
} |