Skip to content

Test all jobs on PHP 8.1 #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jan 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 27 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
runs-on: "ubuntu-latest"

strategy:
fail-fast: false
matrix:
php-version:
- "7.1"
Expand All @@ -36,12 +37,16 @@ jobs:
- name: "Validate Composer"
run: "composer validate"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"

- name: "Downgrade PHPUnit"
if: matrix.php-version == '7.1' || matrix.php-version == '7.2' || matrix.php-version == '7.3'
run: "composer require --dev phpunit/phpunit:^7.5.20 --update-with-dependencies"
run: "composer require --dev phpunit/phpunit:^7.5.20 --no-update --update-with-dependencies"

- name: "Downgrade Doctrine ORM"
if: matrix.php-version == '7.1'
run: "composer require --dev doctrine/orm:^2.7.5 doctrine/lexer:^1.0 --no-update --update-with-dependencies"

- name: "Install dependencies"
run: "composer install --no-interaction --no-progress"

- name: "Lint"
run: "make lint"
Expand Down Expand Up @@ -86,6 +91,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
dependencies:
- "lowest"
- "highest"
Expand All @@ -100,6 +106,14 @@ jobs:
coverage: "none"
php-version: "${{ matrix.php-version }}"

- name: "Downgrade PHPUnit"
if: matrix.php-version == '7.1' || matrix.php-version == '7.2' || matrix.php-version == '7.3'
run: "composer require --dev phpunit/phpunit:^7.5.20 --no-update --update-with-dependencies"

- name: "Downgrade Doctrine ORM"
if: matrix.php-version == '7.1'
run: "composer require --dev doctrine/orm:^2.7.5 doctrine/lexer:^1.0 --no-update --update-with-dependencies"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"
Expand All @@ -108,10 +122,6 @@ jobs:
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Downgrade PHPUnit"
if: matrix.php-version == '7.1' || matrix.php-version == '7.2' || matrix.php-version == '7.3'
run: "composer require --dev phpunit/phpunit:^7.5.20 --update-with-dependencies"

- name: "Tests"
run: "make tests"

Expand All @@ -128,6 +138,7 @@ jobs:
- "7.3"
- "7.4"
- "8.0"
- "8.1"
dependencies:
- "lowest"
- "highest"
Expand All @@ -144,6 +155,14 @@ jobs:
extensions: mbstring
tools: composer:v2

- name: "Downgrade PHPUnit"
if: matrix.php-version == '7.1' || matrix.php-version == '7.2' || matrix.php-version == '7.3'
run: "composer require --dev phpunit/phpunit:^7.5.20 --no-update --update-with-dependencies"

- name: "Downgrade Doctrine ORM"
if: matrix.php-version == '7.1'
run: "composer require --dev doctrine/orm:^2.7.5 doctrine/lexer:^1.0 --no-update --update-with-dependencies"

- name: "Install lowest dependencies"
if: ${{ matrix.dependencies == 'lowest' }}
run: "composer update --prefer-lowest --no-interaction --no-progress"
Expand All @@ -152,9 +171,5 @@ jobs:
if: ${{ matrix.dependencies == 'highest' }}
run: "composer update --no-interaction --no-progress"

- name: "Downgrade PHPUnit"
if: matrix.php-version == '7.1' || matrix.php-version == '7.2' || matrix.php-version == '7.3'
run: "composer require --dev phpunit/phpunit:^7.5.20 --update-with-dependencies"

- name: "PHPStan"
run: "make phpstan"
5 changes: 5 additions & 0 deletions build-cs/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,10 @@
"consistence-community/coding-standard": "^3.10",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"slevomat/coding-standard": "^6.4"
},
"config": {
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"doctrine/collections": "^1.6",
"doctrine/common": "^2.7 || ^3.0",
"doctrine/dbal": "^2.13.1",
"doctrine/lexer": "^1.2.1",
"doctrine/mongodb-odm": "^1.3 || ^2.1",
"doctrine/orm": "^2.9.1",
"doctrine/persistence": "^1.1 || ^2.0",
Expand All @@ -29,14 +30,14 @@
"php-parallel-lint/php-parallel-lint": "^1.2",
"phpstan/phpstan-phpunit": "^1.0",
"phpstan/phpstan-strict-rules": "^1.0",
"phpunit/phpunit": "^9.5",
"phpunit/phpunit": "^9.5.10",
"ramsey/uuid-doctrine": "^1.5.0",
"symfony/cache": "^4.4.35"
},
"config": {
"platform": {
"php": "7.3.24",
"ext-mongo": "1.6.16"
"ext-mongo": "1.12",
"ext-mongodb": "1.6.16"
},
"sort-packages": true,
"allow-plugins": {
Expand Down
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ includes:
parameters:
excludePaths:
- tests/*/data/*
- tests/*/data-php-*/*

ignoreErrors:
-
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ public function dataTopics(): array
{
return [
['entityManagerDynamicReturn'],
['entityRepositoryDynamicReturn'],
['entityManagerMergeReturn'],
['customRepositoryUsage'],
['queryBuilder'],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php declare(strict_types = 1);

namespace PHPStan\DoctrineIntegration\ORM;

use PHPStan\Testing\LevelsTestCase;

final class EntityRepositoryDynamicReturnIntegrationTest extends LevelsTestCase
{

/**
* @return string[][]
*/
public function dataTopics(): array
{
return [
['entityRepositoryDynamicReturn'],
];
}

public function getDataPath(): string
{
if (PHP_MAJOR_VERSION === 7 && PHP_MINOR_VERSION === 1) {
return __DIR__ . '/data-php-7.1';
}

return __DIR__ . '/data';
}

public function getPhpStanExecutablePath(): string
{
return __DIR__ . '/../../../vendor/phpstan/phpstan/phpstan';
}

public function getPhpStanConfigPath(): string
{
return __DIR__ . '/phpstan.neon';
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
[
{
"message": "Call to method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::findOneBy() - entity PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity does not have a field named $blah.",
"line": 94,
"ignorable": true
},
{
"message": "Call to method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::findBy() - entity PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity does not have a field named $blah.",
"line": 116,
"ignorable": true
},
{
"message": "Method Doctrine\\ORM\\EntityRepository<object>::createQueryBuilder() invoked with 0 parameters, 1-2 required.",
"line": 239,
"ignorable": true
},
{
"message": "Could not analyse QueryBuilder with unknown beginning.",
"line": 241,
"ignorable": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[
{
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().",
"line": 89,
"ignorable": true
},
{
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().",
"line": 101,
"ignorable": true
},
{
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().",
"line": 110,
"ignorable": true
},
{
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().",
"line": 120,
"ignorable": true
},
{
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().",
"line": 142,
"ignorable": true
},
{
"message": "Call to an undefined method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::findByNonexistent().",
"line": 148,
"ignorable": true
},
{
"message": "Call to an undefined method PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity::doSomethingElse().",
"line": 160,
"ignorable": true
},
{
"message": "Call to an undefined method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::findOneByNonexistent().",
"line": 165,
"ignorable": true
},
{
"message": "Call to an undefined method Doctrine\\ORM\\EntityRepository<PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\MyEntity>::countByNonexistent().",
"line": 174,
"ignorable": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"message": "Strict comparison using === between int and 'foo' will always evaluate to false.",
"line": 171,
"ignorable": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"message": "Parameter #1 $className of method Doctrine\\Persistence\\ObjectManager::getRepository() expects class-string<nonexistentClass>, string given.",
"line": 212,
"ignorable": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"message": "Property PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\Example::$repository with generic class Doctrine\\ORM\\EntityRepository does not specify its types: TEntityClass",
"line": 16,
"ignorable": true
},
{
"message": "Class PHPStan\\DoctrineIntegration\\ORM\\EntityRepositoryDynamicReturn\\Bug180Repository extends generic class Doctrine\\ORM\\EntityRepository but does not specify its types: TEntityClass",
"line": 232,
"ignorable": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"message": "Call to an undefined method object::doSomething().",
"line": 31,
"ignorable": true
},
{
"message": "Call to an undefined method object::doSomethingElse().",
"line": 32,
"ignorable": true
},
{
"message": "Call to an undefined method object::doSomething().",
"line": 43,
"ignorable": true
},
{
"message": "Call to an undefined method object::doSomethingElse().",
"line": 44,
"ignorable": true
},
{
"message": "Call to an undefined method object::doSomething().",
"line": 52,
"ignorable": true
},
{
"message": "Call to an undefined method object::doSomethingElse().",
"line": 53,
"ignorable": true
},
{
"message": "Call to an undefined method object::doSomething().",
"line": 62,
"ignorable": true
},
{
"message": "Call to an undefined method object::doSomethingElse().",
"line": 63,
"ignorable": true
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[
{
"message": "Cannot cast mixed to int.",
"line": 241,
"ignorable": true
}
]
Loading