Skip to content
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

Fix/cov #3702

Merged
merged 4 commits into from
Sep 8, 2020
Merged

Fix/cov #3702

merged 4 commits into from
Sep 8, 2020

Conversation

dunglas
Copy link
Member

@dunglas dunglas commented Sep 1, 2020

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tickets fixes #...
License MIT
Doc PR n/a

@dunglas dunglas changed the base branch from master to 2.5 September 1, 2020 09:10
@soyuka soyuka force-pushed the fix/cov branch 2 times, most recently from da79995 to 0cbfca5 Compare September 4, 2020 14:56
@soyuka soyuka force-pushed the fix/cov branch 4 times, most recently from 2d3f778 to b083283 Compare September 4, 2020 15:42
@@ -120,7 +120,7 @@ jobs:
composer update --no-progress --no-suggest --ansi
- name: Install PHPUnit
env:
SYMFONY_PHPUNIT_VERSION: '9.2'
SYMFONY_PHPUNIT_VERSION: '8.3'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to run PHPStan with the latest versions of all deps.

use PHPUnit\SebastianBergmann\Comparator\ComparisonFailure;
use SebastianBergmann\Comparator\ComparisonFailure as LegacyComparisonFailure;

if (!class_exists(ComparisonFailure::class)) {
class_alias(LegacyComparisonFailure::class, ComparisonFailure::class);
class_alias(LegacyComparisonFailure::class, 'PHPUnit\SebastianBergmann\Comparator\ComparisonFailure');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can keep using ::class even if the class doesn't exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

phpstan does not agree

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using ::class, phpstan loads the class and fails because it doesn't find it.

*
* @see https://github.com/sebastianbergmann/phpunit/issues/3494
*/
final class ArraySubsetV9 extends Constraint
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mark these classes as internal maybe?

@dunglas
Copy link
Member Author

dunglas commented Sep 8, 2020

Thanks @soyuka!

soyuka added a commit that referenced this pull request Sep 10, 2020
* fix prophecy trait (#3700)

* fix prophecy trait

* Support multiple phpunit version ArraySubset (#3702)

* fix: restore coverage

* Fix phpstan

* Remove php-code-coverage dependency

* Support multiple phpunit version ArraySubset

Co-authored-by: soyuka <soyuka@users.noreply.github.com>

Co-authored-by: Grégoire Hébert <gregoire@les-tilleuls.coop>
Co-authored-by: Kévin Dunglas <dunglas@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants