-
Notifications
You must be signed in to change notification settings - Fork 65
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
Exception on instantiating descendant of \ArrayObject #129
Comments
Could you share a full reproducible code snippet, please? |
<?php
require_once(__DIR__."/vendor/autoload.php");
final class FunctionDirectory extends Directory_ {}
abstract class Directory_ extends \ArrayObject {}
$injector = new Auryn\Injector;
$functionDirectory = $injector->make(FunctionDirectory::class);
|
This happens due to PHP not providing reflection information, see https://3v4l.org/plOeU. While we could fix this particular case by omitting all remaining optional parameters, I think this should be solved in PHP itself providing better reflection information. In the end, it will break once one specifies a last parameter somewhere with the parameters before also optional and without provided reflection information. In this case You can solve this by explicitly providing the exact same constructor in userland, e.g. in |
A mere seven years later, fixed in 113f8c7 |
Hello,
I think I've found a bug when auryn attempts to instantiate an object which is a descendant of
\ArrayObject
.Exception / Stack trace:
Class signatures:
Workaround:
The text was updated successfully, but these errors were encountered: