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

Allow PHP 8 #628

Closed
wants to merge 8 commits into from
Closed

Allow PHP 8 #628

wants to merge 8 commits into from

Conversation

greg0ire
Copy link
Contributor

@greg0ire greg0ire commented Nov 8, 2020

No description provided.

A recent enough version is needed for compatiblity with PHP 8
@greg0ire
Copy link
Contributor Author

greg0ire commented Nov 8, 2020

Blocked by laminas/laminas-code#46 I suppose 😬

@Ocramius
Copy link
Owner

Ocramius commented Nov 9, 2020

Yes, and generally needs a lot of testing around PHP 8 features.

@greg0ire greg0ire closed this Nov 12, 2020
@greg0ire greg0ire reopened this Nov 12, 2020
That version is compatible with PHP 8
We need one that has support for PHP 8, so let's pick the latest.
@greg0ire
Copy link
Contributor Author

The blocker is beberlei/assert now, see beberlei/assert#302

@ausi ausi mentioned this pull request Nov 20, 2020
42 tasks
@greg0ire greg0ire force-pushed the allow-php-8 branch 2 times, most recently from c9be49d to acc643c Compare November 20, 2020 18:26
@greg0ire
Copy link
Contributor Author

Hurdle removed: https://github.com/beberlei/assert/releases/tag/v3.3.0

Version 3 has a requirement on webmozart/glob, which is not yet
compatible with PHP 8
@greg0ire
Copy link
Contributor Author

greg0ire commented Nov 20, 2020

Aaaaand it circles back to Doctrine: doctrine/rst-parser 🙈

UPD: fixed

@Ocramius
Copy link
Owner

BTW, I don't mind testing with --ignore-platform-req=php, but we need tests for the new features

@greg0ire
Copy link
Contributor Author

Ah I never used that flag. Let's try it and see if tests pass at all, then we can see what tests need to be added.

Many libs might be compatible although they do not advertise it, using
that flag will allow us to see if tests pass and to add more tests in
the meantime.
3.5.0 is compatible with PHP 8
@greg0ire greg0ire force-pushed the allow-php-8 branch 2 times, most recently from 6f07af2 to 6d4cec0 Compare November 20, 2020 19:15
It should be the easiest one.
@greg0ire
Copy link
Contributor Author

greg0ire commented Nov 20, 2020

Fatal error: Uncaught Laminas\Code\Generator\Exception\InvalidArgumentException: Provided type "array|string|null" is invalid: must conform "/^[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff](\[a-zA-Z_\x80-\xff][a-zA-Z0-9_\x80-\xff])*$/" in /home/runner/work/ProxyManager/ProxyManager/vendor/laminas/laminas-code/src/Generator/TypeGenerator.php:74

I think this needs to be updated to account for union types: https://github.com/laminas/laminas-code/blob/40919916c4ca6ad815874539cf528814429f0269/src/Generator/TypeGenerator.php#L58-L59

@Ocramius
Copy link
Owner

Yup, see laminas/laminas-code#47 (comment)

@martinssipenko
Copy link
Contributor

Waiting on laminas/laminas-code#57

ruudk added a commit to SimpleBus/SimpleBus that referenced this pull request Dec 10, 2020
ruudk added a commit to SimpleBus/SimpleBus that referenced this pull request Dec 10, 2020
cmodijk pushed a commit to SimpleBus/SimpleBus that referenced this pull request Dec 13, 2020
cmodijk pushed a commit to SimpleBus/SimpleBus that referenced this pull request Dec 13, 2020
cmodijk pushed a commit to SimpleBus/symfony-bridge that referenced this pull request Dec 15, 2020
@volga
Copy link

volga commented Dec 17, 2020

This PR has been merged. Any ETA?

Yes: I merged that patch to get things moving.

There is no ETA, as my priority right now is playing Cyberpunk 2077, but I am indeed working on this when my gaming rig is occupied.

Is there anything I can do to help? we'd really like to upgrade to version 8 before christmas.

@Ocramius
Copy link
Owner

@volga you can help by writing tests of codegen for proxies that require PHP 8.0.

Also need to try this patch against laminas/laminas-code#64

I can tell you from my end that I don't expect to release for xmas, since I am closing off other client work too.

@Ocramius
Copy link
Owner

Also see #635 for "why is PHP8 support not here yet?" :-)

@martinssipenko
Copy link
Contributor

@Ocramius @volga I tried this patch against laminas code 4.x in #637. Does it look good? I guess after laminas-code 4.0 is released we could make the required changes in ProxyManager to fix PHPstan and other issues reported by CI.

I'd be happy to help with tests but unfortunately, I don't really get what is required.

@ghost
Copy link

ghost commented Dec 21, 2020

@Ocramius could you just confirm that now allowing php8 isn't because ProxyManager can't run on php8 but because it cannot process php8 features, ie. if I have a codebase that only uses php7 features then ProxyManager works?

@Ocramius
Copy link
Owner

Correct, hence it cannot be allowed on PHP 8 yet.

Be aware that PHP 8 already includes type refinements in core symbols out of the box.

@ghost
Copy link

ghost commented Dec 21, 2020

What do you mean by "Be aware that PHP 8 already includes type refinements in core symbols out of the box."? This refers to static return type + union types?

@Ocramius
Copy link
Owner

Correct: there are already such types when you switch to PHP 8 :)

If you need to install this package with PHP 8 and you take the risks upon yourself, run with --ignore-platform-req=php for now, but otherwise you need to be patient and wait for integration testing to be completed.

@ghost
Copy link

ghost commented Dec 21, 2020

If I have a php7.4 codebase and just want run it on php8 then there should be no problems with the ProxyManager?
Or are there any core PHP changes that could mess things up?

Ps: I don't mind waiting just want to confirm my understanding

@Ocramius
Copy link
Owner

In theory nothing else: in practice, it needs to be tested.

@ghost
Copy link

ghost commented Dec 21, 2020

..., it needs to be tested.

Obviously.

Thank you for taking some time to answer my questions, and good work with this package and other open source project. Your Doctrine Best practices presentation were especially impactful. Too bad I understood them only after making a mess :).

@Ocramius Ocramius self-assigned this Dec 30, 2020
@Ocramius Ocramius added dependencies Pull requests that update a dependency file enhancement labels Dec 30, 2020
@Ocramius Ocramius added this to the 2.11.0 milestone Dec 30, 2020
Ocramius pushed a commit that referenced this pull request Dec 30, 2020
@Ocramius
Copy link
Owner

Currently picking this up for local merging and review in #658

Indeed there were multiple PHP 8.0-related failures :-)

Ocramius added a commit that referenced this pull request Dec 30, 2020
Allow (and test) PHP 8.0 type compatibility
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants