Skip to content

Commit 1978eda

Browse files
authored
static analysis plugin itself with lowest & highest deps (#94)
* static analysis plugin itself with lowest & highest deps * no message * no message * no message * no message * no message
1 parent 5cd3df1 commit 1978eda

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

.github/workflows/integrate.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ jobs:
1818
matrix:
1919
php-version:
2020
- 7.4
21+
- 7.3
2122

2223
dependencies:
2324
- highest
25+
- lowest
2426

2527
steps:
2628
- name: "Checkout"
@@ -43,6 +45,10 @@ jobs:
4345
key: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-${{ hashFiles('composer.json') }}
4446
restore-keys: php-${{ matrix.php-version }}-composer-${{ matrix.dependencies }}-
4547

48+
- name: "Install lowest dependencies from composer.json"
49+
if: matrix.dependencies == 'lowest'
50+
run: composer update --no-interaction --no-progress --no-suggest --prefer-lowest
51+
4652
- name: "Install highest dependencies from composer.json"
4753
if: matrix.dependencies == 'highest'
4854
run: composer install --no-interaction --no-progress --no-suggest

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"php": "^7.1",
1414
"ext-simplexml": "*",
1515
"symfony/framework-bundle": "^3.0 || ^4.0 || ^5.0",
16-
"vimeo/psalm": "^3.13"
16+
"vimeo/psalm": "^3.16 <3.17"
1717
},
1818
"require-dev": {
1919
"doctrine/orm": "^2.7",

src/Handler/DoctrineRepositoryHandler.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Doctrine\Common\Annotations\AnnotationReader;
66
use Doctrine\ORM\Mapping\Entity as EntityAnnotation;
7-
use function GuzzleHttp\Psr7\parse_query;
87
use PhpParser\Node\Expr;
98
use PhpParser\Node\Scalar\String_;
109
use PhpParser\Node\Stmt\ClassLike;
@@ -75,14 +74,9 @@ public static function afterClassLikeVisit(
7574
$docblock = $stmt->getDocComment();
7675
if ($docblock && false !== strpos((string) $docblock, 'repositoryClass')) {
7776
try {
78-
/** @psalm-suppress DeprecatedMethod */
79-
$parsedComment = DocComment::parse(
80-
(string) $docblock->getReformattedText()
81-
);
82-
if (isset($parsedComment['specials']['Entity'][0])) {
83-
$entitySpecial = trim($parsedComment['specials']['Entity'][0], '()');
84-
/** @psalm-suppress MixedArgument */
85-
$repositoryClassName = trim(parse_query($entitySpecial)['repositoryClass'], '"');
77+
$parsedComment = DocComment::parsePreservingLength($docblock);
78+
if (isset($parsedComment->tags['Entity'])) {
79+
$repositoryClassName = str_replace(['"', '(', ')', 'repositoryClass', '\'', '='], '', array_values($parsedComment->tags['Entity'])[0]);
8680

8781
$file_path = $statements_source->getFilePath();
8882
$file_storage = $codebase->file_storage_provider->get($file_path);

0 commit comments

Comments
 (0)