Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Aug 23, 2023. It is now read-only.

Conversation

@alexpott
Copy link
Contributor

Fixes doctrine/reflection on PHP 8. Updates composer.json to allow PHP 8 and uses class aliases and traits to account for changes in \ReflectionClass and \ReflectionMethod

Related to #43

@alexpott alexpott mentioned this pull request Oct 27, 2020
@greg0ire
Copy link
Member

"sort-packages": true,
"platform": {
"php": "7.1.0"
}
Copy link
Member

Choose a reason for hiding this comment

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

It will be hard for you to produce a good lock file if you remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why is there a lock file?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also https://github.com/doctrine/cache doesn't have this in its composer.json file either.

Copy link
Member

Choose a reason for hiding this comment

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

It's a policy that is enforced in some but not all repositories to avoid issues with external tools such as phpcs, phpstan, Psalm etc.

@andypost
Copy link

Looks declaration changed in nightly

........PHP Fatal error:  Declaration of Doctrine\Common\Reflection\Compatibility\Php8\ReflectionClass::newInstance(Doctrine\Common\Reflection\Compatibility\Php8\mixed ...$args) must be compatible with ReflectionClass::newInstance(...$args) in /home/travis/build/doctrine/reflection/lib/Doctrine/Common/Reflection/StaticReflectionClass.php on line 20

@alexpott
Copy link
Contributor Author

Looks declaration changed in nightly

........PHP Fatal error:  Declaration of Doctrine\Common\Reflection\Compatibility\Php8\ReflectionClass::newInstance(Doctrine\Common\Reflection\Compatibility\Php8\mixed ...$args) must be compatible with ReflectionClass::newInstance(...$args) in /home/travis/build/doctrine/reflection/lib/Doctrine/Common/Reflection/StaticReflectionClass.php on line 20

Nope - version of PHP 8 being used is very very old.... jan 2020 :)

@greg0ire greg0ire closed this Oct 27, 2020
@greg0ire greg0ire reopened this Oct 27, 2020
@alexpott
Copy link
Contributor Author

Well that's not fair this is failing because the build now uses composer 2 and the dependencies of the project are not compatible :(

@greg0ire
Copy link
Member

You can upgrade to coding-standard 6, that will fix it ;)

@greg0ire
Copy link
Member

greg0ire commented Oct 27, 2020

I did it for you in #50, you can rebase and drop the commit about reverting to Composer 1 :)

Comment on lines +27 to +28
"phpstan/phpstan": "^0.11.0 || ^0.12.20",
"phpstan/phpstan-phpunit": "^0.11.0 || ^0.12.16",
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that part is necessary for PHPStan, is it?

Suggested change
"phpstan/phpstan": "^0.11.0 || ^0.12.20",
"phpstan/phpstan-phpunit": "^0.11.0 || ^0.12.16",
"phpstan/phpstan": "^0.12.20",
"phpstan/phpstan-phpunit": "^0.12.16",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In order for composer to be able to resolve for 7.1 to 8.0 I found these changes necessary.

Copy link
Member

Choose a reason for hiding this comment

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

Are you sure? 0.12 is compatible with PHP 7.1 …

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes but this library fails badly on 0.12 :(

Copy link
Member

Choose a reason for hiding this comment

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

Ok so it's locked to 0.11 in composer.lock, is that it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep - I've added a comment to .travis.yml to this effect.

@alexpott
Copy link
Contributor Author

So the last commit passes all tests including the nightly build. Yay. The previous commit failed the nightly build (php 8.0 - because as it is nightly fails are allowed there).

@greg0ire greg0ire merged commit fa58717 into doctrine:1.2.x Oct 27, 2020
@greg0ire
Copy link
Member

Thanks @alexpott !

@greg0ire greg0ire added this to the 1.2.2 milestone Oct 27, 2020
@ausi ausi mentioned this pull request Nov 20, 2020
42 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants