-
Notifications
You must be signed in to change notification settings - Fork 18
PHP 8 compatibility #49
Changes from all commits
a82bebf
2336d15
06eec07
f3ade86
a8d8225
dc269e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -17,16 +17,16 @@ | |||||||||
| {"name": "Marco Pivetta", "email": "[email protected]"} | ||||||||||
| ], | ||||||||||
| "require": { | ||||||||||
| "php": "^7.1", | ||||||||||
| "php": "^7.1 || ^8.0", | ||||||||||
| "ext-tokenizer": "*", | ||||||||||
| "doctrine/annotations": "^1.0" | ||||||||||
| }, | ||||||||||
| "require-dev": { | ||||||||||
| "doctrine/coding-standard": "^6.0", | ||||||||||
| "doctrine/coding-standard": "^6.0 || ^8.2.0", | ||||||||||
| "doctrine/common": "^2.10", | ||||||||||
| "phpstan/phpstan": "^0.11.0", | ||||||||||
| "phpstan/phpstan-phpunit": "^0.11.0", | ||||||||||
| "phpunit/phpunit": "^7.0" | ||||||||||
| "phpstan/phpstan": "^0.11.0 || ^0.12.20", | ||||||||||
| "phpstan/phpstan-phpunit": "^0.11.0 || ^0.12.16", | ||||||||||
|
Comment on lines
+27
to
+28
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are you sure? 0.12 is compatible with PHP 7.1 …
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes but this library fails badly on 0.12 :(
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok so it's locked to 0.11 in
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep - I've added a comment to .travis.yml to this effect. |
||||||||||
| "phpunit/phpunit": "^7.5 || ^9.1.5" | ||||||||||
| }, | ||||||||||
| "conflict": { | ||||||||||
| "doctrine/common": "<2.9" | ||||||||||
|
|
@@ -43,10 +43,7 @@ | |||||||||
| } | ||||||||||
| }, | ||||||||||
| "config": { | ||||||||||
| "sort-packages": true, | ||||||||||
| "platform": { | ||||||||||
| "php": "7.1.0" | ||||||||||
| } | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is there a lock file?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||||||||||
| "sort-packages": true | ||||||||||
| }, | ||||||||||
| "extra": { | ||||||||||
| "branch-alias": { | ||||||||||
|
|
||||||||||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?php | ||
|
|
||
| namespace Doctrine\Common\Reflection\Compatibility\Php7; | ||
|
|
||
| use ReflectionException; | ||
|
|
||
| trait ReflectionClass | ||
| { | ||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| public function getConstants() | ||
| { | ||
| throw new ReflectionException('Method not implemented'); | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| public function newInstance($args) | ||
| { | ||
| throw new ReflectionException('Method not implemented'); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?php | ||
|
|
||
| namespace Doctrine\Common\Reflection\Compatibility\Php7; | ||
|
|
||
| use ReflectionException; | ||
|
|
||
| trait ReflectionMethod | ||
| { | ||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| public function invoke($object, $parameter = null) | ||
| { | ||
| throw new ReflectionException('Method not implemented'); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?php | ||
|
|
||
| namespace Doctrine\Common\Reflection\Compatibility\Php8; | ||
|
|
||
| use ReflectionException; | ||
|
|
||
| trait ReflectionClass | ||
| { | ||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| public function getConstants(?int $filter = null) | ||
| { | ||
| throw new ReflectionException('Method not implemented'); | ||
| } | ||
|
|
||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| public function newInstance(mixed ...$args) | ||
| { | ||
| throw new ReflectionException('Method not implemented'); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| <?php | ||
|
|
||
| namespace Doctrine\Common\Reflection\Compatibility\Php8; | ||
|
|
||
| use ReflectionException; | ||
|
|
||
| trait ReflectionMethod | ||
| { | ||
| /** | ||
| * {@inheritDoc} | ||
| */ | ||
| public function invoke(?object $object, mixed ...$args) | ||
| { | ||
| throw new ReflectionException('Method not implemented'); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?php | ||
|
|
||
| namespace Doctrine\Common\Reflection\Compatibility; | ||
|
|
||
| use const PHP_VERSION_ID; | ||
| use function class_alias; | ||
|
|
||
| if (PHP_VERSION_ID >= 80000) { | ||
| class_alias('Doctrine\Common\Reflection\Compatibility\Php8\ReflectionClass', 'Doctrine\Common\Reflection\Compatibility\ReflectionClass'); | ||
| } else { | ||
| class_alias('Doctrine\Common\Reflection\Compatibility\Php7\ReflectionClass', 'Doctrine\Common\Reflection\Compatibility\ReflectionClass'); | ||
| } | ||
|
|
||
| if (false) { | ||
| class ReflectionClass | ||
| { | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| <?php | ||
|
|
||
| namespace Doctrine\Common\Reflection\Compatibility; | ||
|
|
||
| use const PHP_VERSION_ID; | ||
| use function class_alias; | ||
|
|
||
| if (PHP_VERSION_ID >= 80000) { | ||
| class_alias('Doctrine\Common\Reflection\Compatibility\Php8\ReflectionMethod', 'Doctrine\Common\Reflection\Compatibility\ReflectionMethod'); | ||
| } else { | ||
| class_alias('Doctrine\Common\Reflection\Compatibility\Php7\ReflectionMethod', 'Doctrine\Common\Reflection\Compatibility\ReflectionMethod'); | ||
| } | ||
|
|
||
| if (false) { | ||
| class ReflectionMethod | ||
| { | ||
| } | ||
| } |
Uh oh!
There was an error while loading. Please reload this page.