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

Add PHP 8.0 support #10

Merged
merged 4 commits into from
Apr 13, 2021
Merged

Add PHP 8.0 support #10

merged 4 commits into from
Apr 13, 2021

Conversation

bfoosness
Copy link
Contributor

Q A
New Feature yes

Description

Close #9

@@ -376,6 +381,7 @@ public function testCanDisplayListOfCurrentMessagesCustomisedByConfigSeparator()
$helperPluginManager = $services->get('ViewHelperManager');
$helper = $helperPluginManager->get('flashmessenger');

$helper->setView(new PhpRenderer());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Resolves

TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given

/usr/src/myapp/vendor/laminas/laminas-view/src/Helper/FlashMessenger.php:344
/usr/src/myapp/vendor/laminas/laminas-view/src/Helper/FlashMessenger.php:165
/usr/src/myapp/vendor/laminas/laminas-view/src/Helper/FlashMessenger.php:128
/usr/src/myapp/test/View/Helper/FlashMessengerTest.php:384

Please advise if another solution is preferred.

Copy link
Member

Choose a reason for hiding this comment

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

@bfoosness
Please check #11

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I updated to reflect a similar change to https://github.com/laminas/laminas-view/blob/3.0.x/src/Helper/FlashMessenger.php#L344

Currently tests are failing when we use the lowest dependencies for PHP 8 (https://github.com/laminas/laminas-mvc-plugin-flashmessenger/pull/10/checks?check_run_id=2313255852) due to the same line above at version 2.10 of laminas-view: https://github.com/laminas/laminas-view/blob/2.10.0/src/Helper/FlashMessenger.php#L344

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is the solution to bump the minimum version of laminas-view to 2.12, which is when it was fixed? https://github.com/laminas/laminas-view/blob/2.12.0/src/Helper/FlashMessenger.php#L344

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 does this class live in both this repository and laminas-view?

Copy link
Member

Choose a reason for hiding this comment

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

BC reasons. It will be removed when next major is released

Copy link
Member

Choose a reason for hiding this comment

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

Yes, bump the laminas-view but also open issue about FlashMessager helper from laminas-view being preferred over the one provided by this package. This is either a test setup issue or a legit problem that needs to be investigated for a potential fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought as much. Unfortunately it looks like laminas-view 2.12 requires PHP 8, so by making that the minimum we'd be forcing PHP 8 to use this package?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Never mind; it allows ^7.3, too.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like laminas/laminas-view#16 already exists. Does that cover us here?

@fezfez
Copy link
Contributor

fezfez commented Feb 8, 2021

can it be merge ?

@bfoosness
Copy link
Contributor Author

can it be merge ?

laminas-json has just been updated (which is an indirect dependency of this module via laminas-view), so I believe this is now ready.

@froschdesign froschdesign added this to the 1.3.0 milestone Apr 10, 2021
@froschdesign
Copy link
Member

@bfoosness
Could you rebase against the branch 1.3.x? This will use the new CI workflow.
Thanks in advance! 👍

Signed-off-by: Brent Foosness <bfoosness@users.noreply.github.com>
Signed-off-by: Brent Foosness <bfoosness@users.noreply.github.com>
@bfoosness
Copy link
Contributor Author

I also updated all Composer dependencies to latest so the new CI check against the lock file would pass.

Signed-off-by: Brent Foosness <bfoosness@users.noreply.github.com>
@Xerkus Xerkus mentioned this pull request Apr 13, 2021
…test.

Signed-off-by: Brent Foosness <bfoosness@users.noreply.github.com>
@Xerkus Xerkus merged commit f7569d0 into laminas:1.3.x Apr 13, 2021
@bfoosness bfoosness deleted the php-8.0 branch April 13, 2021 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PHP 8.0 support
4 participants