|
@@ 140-152 (lines=13) @@
|
| 137 |
|
$metadata = new ObjectMetadata($class->name); |
| 138 |
|
|
| 139 |
|
$properties = $class->getProperties(); |
| 140 |
|
foreach ($properties as $property) { |
| 141 |
|
if ($property->getDeclaringClass()->name !== $class->name) { |
| 142 |
|
continue; |
| 143 |
|
} |
| 144 |
|
|
| 145 |
|
$annotation = $this->reader->getPropertyAnnotation($property, Property::class); |
| 146 |
|
/* @var $annotation Property */ |
| 147 |
|
if (null === $annotation) { |
| 148 |
|
continue; |
| 149 |
|
} |
| 150 |
|
|
| 151 |
|
$metadata->addProperty($this->loadPropertyMetadata($annotation, $property)); |
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
$methods = $class->getMethods(\ReflectionMethod::IS_PUBLIC); |
| 155 |
|
foreach ($methods as $method) { |
|
@@ 155-167 (lines=13) @@
|
| 152 |
|
} |
| 153 |
|
|
| 154 |
|
$methods = $class->getMethods(\ReflectionMethod::IS_PUBLIC); |
| 155 |
|
foreach ($methods as $method) { |
| 156 |
|
if ($method->getDeclaringClass()->name !== $class->name) { |
| 157 |
|
continue; |
| 158 |
|
} |
| 159 |
|
|
| 160 |
|
$annotation = $this->reader->getMethodAnnotation($method, VirtualProperty::class); |
| 161 |
|
/* @var $annotation VirtualProperty */ |
| 162 |
|
if ($annotation === null) { |
| 163 |
|
continue; |
| 164 |
|
} |
| 165 |
|
|
| 166 |
|
$metadata->addProperty($this->loadVirtualMetadata($annotation, $method)); |
| 167 |
|
} |
| 168 |
|
|
| 169 |
|
if (null !== $object) { |
| 170 |
|
$this->loadDiscriminatorMetadata($object, $metadata); |
|
@@ 189-201 (lines=13) @@
|
| 186 |
|
$metadata->setAllowEmpty($document->allowEmpty); |
| 187 |
|
|
| 188 |
|
$properties = $class->getProperties(); |
| 189 |
|
foreach ($properties as $property) { |
| 190 |
|
if ($property->getDeclaringClass()->name !== $class->name) { |
| 191 |
|
continue; |
| 192 |
|
} |
| 193 |
|
|
| 194 |
|
$annotation = $this->reader->getPropertyAnnotation($property, ApiContent::class); |
| 195 |
|
/* @var $annotation ApiContent */ |
| 196 |
|
if (null !== $annotation) { |
| 197 |
|
$metadata->setContentMetadata($this->loadPropertyMetadata($annotation, $property)); |
| 198 |
|
|
| 199 |
|
break; |
| 200 |
|
} |
| 201 |
|
} |
| 202 |
|
|
| 203 |
|
return $metadata; |
| 204 |
|
} |