Skip to content

Commit b043352

Browse files
authored
Merge pull request #18 from swaggest/imported-type
Add imported type to PHP class meta
2 parents ea7f641 + e0765fa commit b043352

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/JsonSchema/PhpBuilder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class PhpBuilder
3636
const SCHEMA = 'schema';
3737
const ORIGIN = 'origin';
3838
const PROPERTY_NAME = 'property_name';
39+
const IMPORT_TYPE = 'import_type';
3940

4041
/** @var \SplObjectStorage */
4142
private $generatedClasses;
@@ -211,6 +212,7 @@ private function makeClass($schema, $path)
211212
$phpDoc = $class->getPhpDoc();
212213
$type = $this->getType($schema, $path);
213214
if (!$type instanceof PhpClass) {
215+
$class->addMeta($type, self::IMPORT_TYPE);
214216
$phpDoc->add(
215217
PhpDoc::TAG_METHOD,
216218
new PlaceholderString(

0 commit comments

Comments
 (0)