Skip to content

Commit

Permalink
static analysis plugin itself with lowest & highest deps (#94)
Browse files Browse the repository at this point in the history
* static analysis plugin itself with lowest & highest deps

* no message

* no message

* no message

* no message

* no message
  • Loading branch information
seferov authored Oct 13, 2020
1 parent 5cd3df1 commit 1978eda
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/integrate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ jobs:
matrix:
php-version:
- 7.4
- 7.3

dependencies:
- highest
- lowest

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

- name: "Install lowest dependencies from composer.json"
if: matrix.dependencies == 'lowest'
run: composer update --no-interaction --no-progress --no-suggest --prefer-lowest

- name: "Install highest dependencies from composer.json"
if: matrix.dependencies == 'highest'
run: composer install --no-interaction --no-progress --no-suggest
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"php": "^7.1",
"ext-simplexml": "*",
"symfony/framework-bundle": "^3.0 || ^4.0 || ^5.0",
"vimeo/psalm": "^3.13"
"vimeo/psalm": "^3.16 <3.17"
},
"require-dev": {
"doctrine/orm": "^2.7",
Expand Down
12 changes: 3 additions & 9 deletions src/Handler/DoctrineRepositoryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Doctrine\Common\Annotations\AnnotationReader;
use Doctrine\ORM\Mapping\Entity as EntityAnnotation;
use function GuzzleHttp\Psr7\parse_query;
use PhpParser\Node\Expr;
use PhpParser\Node\Scalar\String_;
use PhpParser\Node\Stmt\ClassLike;
Expand Down Expand Up @@ -75,14 +74,9 @@ public static function afterClassLikeVisit(
$docblock = $stmt->getDocComment();
if ($docblock && false !== strpos((string) $docblock, 'repositoryClass')) {
try {
/** @psalm-suppress DeprecatedMethod */
$parsedComment = DocComment::parse(
(string) $docblock->getReformattedText()
);
if (isset($parsedComment['specials']['Entity'][0])) {
$entitySpecial = trim($parsedComment['specials']['Entity'][0], '()');
/** @psalm-suppress MixedArgument */
$repositoryClassName = trim(parse_query($entitySpecial)['repositoryClass'], '"');
$parsedComment = DocComment::parsePreservingLength($docblock);
if (isset($parsedComment->tags['Entity'])) {
$repositoryClassName = str_replace(['"', '(', ')', 'repositoryClass', '\'', '='], '', array_values($parsedComment->tags['Entity'])[0]);

$file_path = $statements_source->getFilePath();
$file_storage = $codebase->file_storage_provider->get($file_path);
Expand Down

0 comments on commit 1978eda

Please sign in to comment.