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

WhoopsPrettyPageHandlerDelegator leads to undefined index error #46

Open
arku31 opened this issue Nov 27, 2020 · 4 comments
Open

WhoopsPrettyPageHandlerDelegator leads to undefined index error #46

arku31 opened this issue Nov 27, 2020 · 4 comments
Labels
Bug Something isn't working

Comments

@arku31
Copy link

arku31 commented Nov 27, 2020

Bug Report

Q A
Version(s) 3.1

Summary

vendor/mezzio/mezzio-swoole/src/ConfigProvider.php has delegator defined as

Mezzio\WhoopsPageHandler' => [
                    WhoopsPrettyPageHandlerDelegator::class,
],

Current behavior

This leads to
Notice: Undefined index: Mezzio\WhoopsPageHandler in vendor/elie29/zend-phpdi-config/src/Config.php on line 137

How to reproduce

Expected behaviour

Whoops should not be tied to the application

@arku31 arku31 added the Bug Something isn't working label Nov 27, 2020
@weierophinney
Copy link
Contributor

What DI container are you using, please?

@arku31
Copy link
Author

arku31 commented Nov 30, 2020

Hi,
I am using
php-di/php-di 6.0

I got it offered via mezzio-skeleton

@weierophinney
Copy link
Contributor

We may need to fix this in the php-di wrapper. It's common to define delegators even for services that are not registered, so that once they are, the delegators are present. This seems to be an issue where the wrapper that populates the php-di container is unhappy that the service does not exist when the delegator is registered.

@arku31
Copy link
Author

arku31 commented Feb 23, 2021

If someone will struggle as well: There is a workaround for it.
In any ConfigProvider that you're registering in /config/config.php AFTER the \Mezzio\Swoole\ConfigProvider::class, you may overwrite this by providing an array that contains data that will overwrite the default value: in the getDependencies method, add
'delegators' => [ 'Mezzio\WhoopsPageHandler' => new \stdClass()]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants