Skip to content

Commit 2dcab5b

Browse files
committed
Add namespace shortcut - #26
1 parent eafc7df commit 2dcab5b

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/ValueObjectFactory.php

+4
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,10 @@ private function extractNamespace(string $classNamespacePath, TypeDefinition $ty
376376
}
377377
$namespace = $typeDefinition->custom()['namespace'] ?? '';
378378

379+
if ($namespace === '') {
380+
$namespace = $typeDefinition->custom()['ns'] ?? '';
381+
}
382+
379383
return \trim($classNamespacePath . '\\' . $namespace, '\\');
380384
}
381385

Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"billing_address": "Address|namespace:Billing",
3-
"address?": "ShippingAddresses|namespace:Payment"
3+
"address?": "ShippingAddresses|ns:Payment"
44
}

0 commit comments

Comments
 (0)