@@ 66-81 (lines=16) @@ | ||
63 | } |
|
64 | } |
|
65 | ||
66 | foreach (array_merge(Reflection::ACCESSOR_PREFIXES, Reflection::MUTATOR_PREFIXES) as $prefix) { |
|
67 | $methodName = $prefix.ucfirst($property); |
|
68 | if (!$reflectionClass->hasMethod($methodName)) { |
|
69 | continue; |
|
70 | } |
|
71 | ||
72 | $reflectionMethod = $reflectionClass->getMethod($methodName); |
|
73 | if (!$reflectionMethod->isPublic()) { |
|
74 | continue; |
|
75 | } |
|
76 | ||
77 | $annotation = $this->reader->getMethodAnnotation($reflectionMethod, ApiProperty::class); |
|
78 | if (null !== $annotation) { |
|
79 | return $this->createMetadata($annotation, $parentPropertyMetadata); |
|
80 | } |
|
81 | } |
|
82 | ||
83 | return $this->handleNotFound($parentPropertyMetadata, $resourceClass, $property); |
|
84 | } |
@@ 59-74 (lines=16) @@ | ||
56 | } |
|
57 | } |
|
58 | ||
59 | foreach (array_merge(Reflection::ACCESSOR_PREFIXES, Reflection::MUTATOR_PREFIXES) as $prefix) { |
|
60 | $methodName = $prefix.ucfirst($property); |
|
61 | if (!$reflectionClass->hasMethod($methodName)) { |
|
62 | continue; |
|
63 | } |
|
64 | ||
65 | $reflectionMethod = $reflectionClass->getMethod($methodName); |
|
66 | if (!$reflectionMethod->isPublic()) { |
|
67 | continue; |
|
68 | } |
|
69 | ||
70 | $annotation = $this->reader->getMethodAnnotation($reflectionMethod, ApiSubresource::class); |
|
71 | ||
72 | if (null !== $annotation) { |
|
73 | return $this->updateMetadata($annotation, $propertyMetadata); |
|
74 | } |
|
75 | } |
|
76 | ||
77 | return $propertyMetadata; |