Skip to content

Commit be493a8

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

2 files changed

Lines changed: 35 additions & 5 deletions

File tree

.github/workflows/compat_test.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
timeout-minutes: 3
15+
16+
steps:
17+
-
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
-
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: 8.2
26+
coverage: none
27+
28+
- run: composer create-project "rector/rector-compat-tests:dev-main" .
29+
30+
- run: vendor/bin/phpunit tests/PHPStan
31+
32+
- run: vendor/bin/phpunit tests/PHPUnit
33+
34+
- 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)