We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Code to replicate this issue.
interface GlobalInterface { } class GlobalImplementation implements GlobalInterface { } interface GlobalRuleInterface { } class GlobalRuleImplementation implements GlobalRuleInterface { } class Global4 { public $glb; public $glbr; public function __construct(GlobalInterface $glb, GlobalRuleInterface $glbr) { $this->glb = $glb; $this->glbr = $glbr; } } $glbRule = [ 'substitutions' => ['GlobalRuleInterface' => 'GlobalRuleImplementation'] ]; $glb4Rule = [ 'substitutions' => ['GlobalInterface' => 'GlobalImplementation'] ]; $dice = $dice->addRule('*', $glbRule); $dice = $dice->addRule('Global4', $glb4Rule); $obj = $dice->create('Global4');
The text was updated successfully, but these errors were encountered:
The code above works. However, when adding rule for a class and then provide global rule, instance of the object can't be created.
From the code above, this works
$dice = $dice->addRule('*', $glbRule); $dice = $dice->addRule('Global4', $glb4Rule);
and this doesn't work
$dice = $dice->addRule('Global4', $glb4Rule); $dice = $dice->addRule('*', $glbRule);
Sorry, something went wrong.
No branches or pull requests
Code to replicate this issue.
The text was updated successfully, but these errors were encountered: