@@ -98,8 +98,12 @@ discard block |
||
98 | 98 | $structure['proxy'] = array( |
99 | 99 | 'type'=>$classModelProxyAnnotation->name, |
100 | 100 | ) + $classModelProxyAnnotation->option; |
101 | - if ($classModelProxyAnnotation->reader != array()) $structure['proxy']['reader'] = $classModelProxyAnnotation->reader; |
|
102 | - if ($classModelProxyAnnotation->writer != array()) $structure['proxy']['writer'] = $classModelProxyAnnotation->writer; |
|
101 | + if ($classModelProxyAnnotation->reader != array()) { |
|
102 | + $structure['proxy']['reader'] = $classModelProxyAnnotation->reader; |
|
103 | + } |
|
104 | + if ($classModelProxyAnnotation->writer != array()) { |
|
105 | + $structure['proxy']['writer'] = $classModelProxyAnnotation->writer; |
|
106 | + } |
|
103 | 107 | } |
104 | 108 | /** @var $classExclusionPolicy ExclusionPolicy */ |
105 | 109 | $classExclusionPolicy = $this->annoReader->getClassAnnotation($classRef, 'JMS\Serializer\Annotation\ExclusionPolicy'); |
@@ -222,8 +226,9 @@ discard block |
||
222 | 226 | $association['name'] = $property->getName(); |
223 | 227 | $association['model'] = $this->getModelName($annotation->targetEntity); |
224 | 228 | $association['entity'] = $annotation->targetEntity; |
225 | - if (!isset($association['key']) || empty($association['key'])) |
|
226 | - $association['key'] = $this->tryToGetJoinColumnNameOfMappedBy($annotation); |
|
229 | + if (!isset($association['key']) || empty($association['key'])) { |
|
230 | + $association['key'] = $this->tryToGetJoinColumnNameOfMappedBy($annotation); |
|
231 | + } |
|
227 | 232 | break; |
228 | 233 | case 'Doctrine\ORM\Mapping\OneToMany': |
229 | 234 | $association['type'] = substr(get_class($annotation), 21); |
@@ -358,8 +363,11 @@ discard block |
||
358 | 363 | protected function getAnnotation($entity, $property, $annotation) { |
359 | 364 | $classRef = new \ReflectionClass($entity); |
360 | 365 | $propertyRef = $classRef->getProperty($property); |
361 | - if ($propertyRef) return $this->annoReader->getPropertyAnnotation($propertyRef, $annotation); |
|
362 | - else return null; |
|
366 | + if ($propertyRef) { |
|
367 | + return $this->annoReader->getPropertyAnnotation($propertyRef, $annotation); |
|
368 | + } else { |
|
369 | + return null; |
|
370 | + } |
|
363 | 371 | } |
364 | 372 | |
365 | 373 | /** |