@@ -8,13 +8,11 @@ |
||
| 8 | 8 | |
| 9 | 9 | namespace KleijnWeb\PhpApi\Descriptions\Description\Builder; |
| 10 | 10 | |
| 11 | -use KleijnWeb\PhpApi\Descriptions\Description\ComplexType; |
|
| 12 | 11 | use KleijnWeb\PhpApi\Descriptions\Description\Description; |
| 13 | 12 | use KleijnWeb\PhpApi\Descriptions\Description\Operation; |
| 14 | 13 | use KleijnWeb\PhpApi\Descriptions\Description\Parameter; |
| 15 | 14 | use KleijnWeb\PhpApi\Descriptions\Description\Path; |
| 16 | 15 | use KleijnWeb\PhpApi\Descriptions\Description\Response; |
| 17 | -use KleijnWeb\PhpApi\Descriptions\Description\Schema\ObjectSchema; |
|
| 18 | 16 | use KleijnWeb\PhpApi\Descriptions\Description\Schema\Schema; |
| 19 | 17 | use KleijnWeb\PhpApi\Descriptions\Description\Visitor\ClosureVisitor; |
| 20 | 18 | use KleijnWeb\PhpApi\Descriptions\Description\Visitor\ClosureVisitorScope; |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | |
| 46 | 46 | $description = new Description($paths, [], $host, $schemes, $extensions, $this->document); |
| 47 | 47 | |
| 48 | - $this->document->apply(function ($composite, $attribute, $parent, $parentAttribute) use (&$typeSchemas) { |
|
| 48 | + $this->document->apply(function($composite, $attribute, $parent, $parentAttribute) use (&$typeSchemas) { |
|
| 49 | 49 | if ($composite instanceof \stdClass) { |
| 50 | 50 | if ($parentAttribute === 'definitions') { |
| 51 | 51 | $this->schemaFactory->create($composite, $attribute); |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | $this->schemaFactory->setClassNameResolver($this->classNameResolver); |
| 58 | 58 | $types = $this->schemaFactory->resolveTypes(); |
| 59 | 59 | |
| 60 | - $description->accept(new ClosureVisitor($description, function () use ($types) { |
|
| 60 | + $description->accept(new ClosureVisitor($description, function() use ($types) { |
|
| 61 | 61 | /** @noinspection PhpUndefinedFieldInspection */ |
| 62 | 62 | $this->complexTypes = $types; |
| 63 | 63 | })); |
@@ -159,7 +159,7 @@ |
||
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | - return array_map(function(ObjectSchema $schema){ |
|
| 162 | + return array_map(function(ObjectSchema $schema) { |
|
| 163 | 163 | return $schema->getComplexType(); |
| 164 | 164 | }, $this->typedSchemas); |
| 165 | 165 | } |
@@ -45,7 +45,7 @@ |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | // Add schema of all children up to root |
| 48 | - $descend = function (ComplexType $complexType) use (&$descend, $builder, $processor) { |
|
| 48 | + $descend = function(ComplexType $complexType) use (&$descend, $builder, $processor) { |
|
| 49 | 49 | |
| 50 | 50 | foreach ($complexType->getSchema()->getPropertySchemas() as $propertyName => $propertySchema) { |
| 51 | 51 | if ($propertySchema instanceof ObjectSchema && $propertySchema->getXType() !== null && !$propertySchema->hasComplexType()) { |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $lineage = []; |
| 114 | 114 | |
| 115 | 115 | // Determine lineage |
| 116 | - $traverseUp = function (ComplexType $type) use (&$lineage, &$traverseUp) { |
|
| 116 | + $traverseUp = function(ComplexType $type) use (&$lineage, &$traverseUp) { |
|
| 117 | 117 | |
| 118 | 118 | $lineage[] = $type; |
| 119 | 119 | $parents = $type->getParents(); |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | |
| 128 | 128 | $lineage = array_reverse($lineage); |
| 129 | 129 | |
| 130 | - $applyProperties = function ($object, $node) use ($lineage) { |
|
| 130 | + $applyProperties = function($object, $node) use ($lineage) { |
|
| 131 | 131 | foreach ($lineage as $type) { |
| 132 | 132 | $className = $type->getClassName(); |
| 133 | 133 | $objectSchema = $type->getSchema(); |