Skip to content

Commit

Permalink
Apply PER2.0 phpcs (part 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
SerafimArts committed Aug 1, 2024
1 parent 50778dc commit 2f9d7e4
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 20 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
},
"require-dev": {
"phpunit/phpunit": "^9.6|^10.0",
"vimeo/psalm": "^5.22"
"phpstan/extension-installer": "^1.4",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan-strict-rules": "^1.6"
},
"autoload-dev": {
"psr-4": {
Expand Down
12 changes: 12 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
includes:
- phar://phpstan.phar/conf/bleedingEdge.neon
parameters:
level: 1
strictRules:
allRules: true
fileExtensions:
- php
paths:
- src
tmpDir: vendor/.cache.phpstan
reportUnmatchedIgnoredErrors: false
16 changes: 0 additions & 16 deletions psalm.xml

This file was deleted.

1 change: 1 addition & 0 deletions src/Executor.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ protected function traverseNode(NodeInterface $node): NodeInterface
private function updateNodeValue(NodeInterface $node, $key, $value): void
{
try {
// @phpstan-ignore-next-line
$node->$key = $value;
} catch (\Error $e) {
if (\strpos($e->getMessage(), 'Cannot access') !== 0) {
Expand Down
6 changes: 3 additions & 3 deletions tests/Unit/Stub/Counter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
class Counter implements VisitorInterface
{
public $before = 0;
public $after = 0;
public $enter = 0;
public $leave = 0;
public $after = 0;
public $enter = 0;
public $leave = 0;

public function before(iterable $nodes): ?iterable
{
Expand Down

0 comments on commit 2f9d7e4

Please sign in to comment.