-
Notifications
You must be signed in to change notification settings - Fork 4
Allow PHP 8 #12
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 #12
Conversation
Test errors are caused by this https://php.watch/versions/8.0/deprecate-required-param-after-optional Mostly in Jackalope FS and this phpcr-migrations/lib/Migrator.php Line 65 in c7d4ef5
It can be solved with
but , which php versions are supported? |
I think we can bump to 7.1 if not higher cc @dbu @alexander-schranz |
if ($tokens[$j][0] === T_STRING) { | ||
if (\defined('T_NAME_QUALIFIED') && $tokens[$j][0] === T_NAME_QUALIFIED) { | ||
$namespace .= '\\' . $tokens[$j][1]; | ||
} elseif ($tokens[$j][0] === T_STRING) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's fine, I did a similar fix here https://github.com/phpbench/phpbench/pull/665/files#diff-6b0463b0983e774b73f65bfc37e8d70567eb9a7939e81e61976541661d8200e1R139
@dantleech the current major of sulu requires |
Symfony 3.4 will be unmaintained next month. Maybe we can require "php": ">=7.1.3" like finder & console in 4.4? |
requiring php |
Let's go with |
ef834dd
to
349ac13
Compare
Simple phpunit is causing errors. But runing ./vendor/bin/phpunit works fine. Can i change it for phpunit? |
349ac13
to
e8d738f
Compare
Maybe @alexander-schranz can comment on that - not sure about simple phpunit. This error |
dump lower php versions dump lower php versions Remove simple phpunit remove phpspec/prophecy-phpunit
e8d738f
to
3357634
Compare
I have removed
|
|
Removed then 😄 Test are failing due to jackalope/jackalope-fs |
yeah, agree that phpunit-bridge is not necessary here. adjusting jackalope-fs for php 8 probably needs some effort... i did it for jackalope-jackrabbit, so the whole of jackalope/jackalope and the phpcr repos are ready: https://github.com/jackalope/jackalope-jackrabbit/releases/tag/1.4.1 |
lib/Migrator.php
Outdated
* @return VersionInterface[] Executed migrations | ||
*/ | ||
public function migrate($to = null, OutputInterface $output) | ||
public function migrate(?string $to, OutputInterface $output) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be a BC break?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did change this back in: becd9b9
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so. The minimum version required is 7.2 even if it is not specified in composer but we can change it to phpdoc instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did not mean that its not compatible with PHP Version but public function should not add any typehints or other things in minor or hotfix releases, as somebody could call or extend from that class and php would then error which it would not before. So I would avoid adding any typehints aslong as we don't plan to release a new major version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed !
In PHP 8 namespaces are treated as single token (T_NAME_FULLY_QUALIFIED)
RFC: https://wiki.php.net/rfc/namespaced_names_as_token
This PR add compatibility with this token