Skip to content

Commit a2e4d82

Browse files
committed
[ci] add compat test
1 parent 735b446 commit a2e4d82

2 files changed

Lines changed: 29 additions & 5 deletions

File tree

.github/workflows/compat_test.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# builds the content of https://github.com/rectorphp/rector
2+
# inspiration from https://github.com/phpstan/phpstan-src/blob/master/.github/workflows/phar.yml
3+
name: PHPUnit and PHPStan Compat Test
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request: null
10+
11+
jobs:
12+
build_scoped_rector:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
-
17+
uses: shivammathur/setup-php@v2
18+
with:
19+
php-version: 8.2
20+
coverage: none
21+
22+
- run: composer create-project "rector/rector-compat-tests:dev-main" .
23+
24+
- run: vendor/bin/phpunit tests/PHPStan
25+
26+
- run: vendor/bin/phpunit tests/Rector
27+
28+
- run: vendor/bin/phpunit tests

rules/CodingStyle/ClassNameImport/NamespaceBeforeClassNameResolver.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@ public function resolve(FullyQualifiedObjectType $fullyQualifiedObjectType): str
1515

1616
return $className === $shortName
1717
? ''
18-
: substr(
19-
$className,
20-
0,
21-
-strlen($shortName) - 1
22-
);
18+
: substr($className, 0, -strlen($shortName) - 1);
2319
}
2420
}

0 commit comments

Comments
 (0)