namespace de\thekid\shorturl;
new RestApi(new ResourcesIn('de.thekid.shorturl.api'));
// or (with a somewhat ugly string concatenation):
new RestApi(new ResourcesIn(__NAMESPACE__.'\\api'));
// or (with the overhead of XP reflection):
new RestApi(new ResourcesIn(typeof($this)->getPackage()->getPackage('api'));
// Alternatively, the `::class` construct will work here, too. However, the
// code does not convey the meaning very well!
// new RestApi(new ResourcesIn(api::class));
After:
namespace de\thekid\shorturl;
new RestApi(new ResourcesIn(api::namespace));
Before:
After: