Skip to content

Can't inherit global rules #186

Description

@pattisahusiwa

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');

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions