Code Duplication    Length = 13-13 lines in 3 locations

src/AppserverIo/Lang/Reflection/ReflectionClass.php 1 location

@@ 222-234 (lines=13) @@
219
     * @throws \AppserverIo\Lang\Reflection\ReflectionException Is thrown if the requested annotation is not available
220
     * @see \AppserverIo\Lang\Reflection\ClassInterface::getAnnotation()
221
     */
222
    public function getAnnotation($annotationName)
223
    {
224
225
        // first check if the method is available
226
        $annotations = $this->getAnnotations();
227
        if (isset($annotations[$annotationName])) {
228
            // if yes, return it
229
            return $annotations[$annotationName];
230
        }
231
232
        // if not, throw an exception
233
        throw new ReflectionException(sprintf('The requested reflection annotation %s is not available', $annotationName));
234
    }
235
236
    /**
237
     * Returns the class methods.

src/AppserverIo/Lang/Reflection/ReflectionMethod.php 1 location

@@ 239-251 (lines=13) @@
236
     * @throws \AppserverIo\Lang\Reflection\ReflectionException Is thrown if the requested annotation is not available
237
     * @see \AppserverIo\Lang\Reflection\MethodInterface::hasAnnotation()
238
     */
239
    public function getAnnotation($annotationName)
240
    {
241
242
        // first check if the method is available
243
        $annotations = $this->getAnnotations();
244
        if (isset($annotations[$annotationName])) {
245
            // if yes, return it
246
            return $annotations[$annotationName];
247
        }
248
249
        // if not, throw an exception
250
        throw new ReflectionException(sprintf('The requested reflection annotation %s is not available', $annotationName));
251
    }
252
253
    /**
254
     * Serializes the timeout method and returns a string representation.

src/AppserverIo/Lang/Reflection/ReflectionProperty.php 1 location

@@ 213-225 (lines=13) @@
210
     * @throws \AppserverIo\Lang\Reflection\ReflectionException Is thrown if the requested annotation is not available
211
     * @see \AppserverIo\Lang\Reflection\PropertyInterface::hasAnnotation()
212
     */
213
    public function getAnnotation($annotationName)
214
    {
215
216
        // first check if the method is available
217
        $annotations = $this->getAnnotations();
218
        if (isset($annotations[$annotationName])) {
219
            // if yes, return it
220
            return $annotations[$annotationName];
221
        }
222
223
        // if not, throw an exception
224
        throw new ReflectionException(sprintf('The requested reflection annotation %s is not available', $annotationName));
225
    }
226
227
    /**
228
     * Serializes the timeout method and returns a string representation.