Closed thekid closed 3 years ago
This resolver will be called for any unqualified names and can check import statements as well as the current namespace, e.g.
$t= Type::resolve($name, [ 'self' => function() { return new XPClass(self::class); }, 'parent' => function() { return new XPClass(parent::class); }, '*' => function($type) { // TODO: Check imports return XPClass::forName(__NAMESPACE__.'\\'.$type); } ]);
To check for imports see xp-framework/rfc#339 - this would be done by using XPClass::detailsForClass($name)['use'].
XPClass::detailsForClass($name)['use']
Not quite sure the error below is coming from, the tests are green otherwise:
Released in https://github.com/xp-framework/core/releases/tag/v10.6.0
This resolver will be called for any unqualified names and can check import statements as well as the current namespace, e.g.
To check for imports see xp-framework/rfc#339 - this would be done by using
XPClass::detailsForClass($name)['use']
.