lib/BlockCypher/Common/ReflectionUtil.php
public static function propertyAnnotations($class, $propertyName)
    {
        $class = is_object($class) ? get_class($class) : $class;
        if (!class_exists('ReflectionProperty')) {
            throw new \RuntimeException("Property type of " . $class . "::{$propertyName} cannot be resolved");
        }

        if ($annotations =& self::$propertiesType[$class][$propertyName]) {
            return $annotations;
        }

        if (!($refl =& self::$propertiesRefl[$class][$propertyName])) {
            $getter = self::getter($class, $propertyName);
            $refl = new \ReflectionMethod($class, $getter);
            self::$propertiesRefl[$class][$propertyName] = $refl;
        }

        // todo: smarter regexp
        if (!preg_match_all(
            '~\@([^\s@\(]+)[\t ]*(?:\(?([^\n@]+)\)?)?~i',
            $refl->getDocComment(),
            $annots,
            PREG_PATTERN_ORDER)
        ) {
            return null;
        }
        foreach ($annots[1] as $i => $annot) {
            $annotations[strtolower($annot)] = empty($annots[2][$i]) ? TRUE : rtrim($annots[2][$i], " \t\n\r)");
        }

        return $annotations;
    }
public static function propertyAnnotations($class, $propertyName)
    {
        $class = is_object($class) ? get_class($class) : $class;
        if (!class_exists('ReflectionProperty')) {
            throw new \RuntimeException("Property type of " . $class . "::{$propertyName} cannot be resolved");
        }

        if ($annotations =& self::$propertiesType[$class][$propertyName]) {
            return $annotations;
        }

        if (!($refl =& self::$propertiesRefl[$class][$propertyName])) {
            $getter = self::getter($class, $propertyName);
            $refl = new \ReflectionMethod($class, $getter);
            self::$propertiesRefl[$class][$propertyName] = $refl;
        }

        // todo: smarter regexp
        if (!preg_match_all(
            '~\@([^\s@\(]+)[\t ]*(?:\(?([^\n@]+)\)?)?~i',
            $refl->getDocComment(),
            $annots,
            PREG_PATTERN_ORDER)
        ) {
            return null;
        }
        foreach ($annots[1] as $i => $annot) {
            $annotations[strtolower($annot)] = empty($annots[2][$i]) ? TRUE : rtrim($annots[2][$i], " \t\n\r)");
        }

        return $annotations;
    }
public static function propertyAnnotations ( $ class , $ propertyName ) { $ class = is_object ( $ class ) ? get_class ( $ class ) : $ class ; if ( ! class_exists ( 'ReflectionProperty' ) ) { throw new \ RuntimeException ( "Property type of " . $ class . "::{$propertyName} cannot be resolved" ) ; } if ( $ annotations = & self :: $ propertiesType [ $ class ] [ $ propertyName ] ) { return $ annotations ; } if ( ! ( $ refl = & self :: $ propertiesRefl [ $ class ] [ $ propertyName ] ) ) { $ getter = self :: getter ( $ class , $ propertyName ) ; $ refl = new \ ReflectionMethod ( $ class , $ getter ) ; self :: $ propertiesRefl [ $ class ] [ $ propertyName ] = $ refl ; } // todo: smarter regexp if ( ! preg_match_all ( '~\@([^\s@\(]+)[\t ]*(?:\(?([^\n@]+)\)?)?~i' , $ refl -> getDocComment ( ) , $ annots , PREG_PATTERN_ORDER ) ) { return null ; } foreach ( $ annots [ 1 ] as $ i => $ annot ) { $ annotations [ strtolower ( $ annot ) ] = empty ( $ annots [ 2 ] [ $ i ] ) ? TRUE : rtrim ( $ annots [ 2 ] [ $ i ] , " \t\n\r)" ) ; } return $ annotations ; }
Retrieves Annotations of each property

@param $class
@param $propertyName
@throws \RuntimeException
@return mixed
Retrieves Annotations of each property