src/Colorium/Runtime/Annotation.php
public static function ofClass($class, $key = null)
	{
		$reflector = is_object($class) ? new \ReflectionObject($class) : new \ReflectionClass($class);

		if(!static::cache()->hasClass($reflector->getName())) {
			$annotations = static::parser()->parse($reflector->getDocComment());
			static::cache()->storeClass($reflector->getName(), $annotations);
		}
		else {
			$annotations = static::cache()->getClass($reflector->getName());
		}

		if($key) {
			return isset($annotations[$key]) ? $annotations[$key] : null;
		}

		return $annotations;
	}
public static function ofClass($class, $key = null)
	{
		$reflector = is_object($class) ? new \ReflectionObject($class) : new \ReflectionClass($class);

		if(!static::cache()->hasClass($reflector->getName())) {
			$annotations = static::parser()->parse($reflector->getDocComment());
			static::cache()->storeClass($reflector->getName(), $annotations);
		}
		else {
			$annotations = static::cache()->getClass($reflector->getName());
		}

		if($key) {
			return isset($annotations[$key]) ? $annotations[$key] : null;
		}

		return $annotations;
	}
public static function ofClass ( $ class , $ key = null ) { $ reflector = is_object ( $ class ) ? new \ ReflectionObject ( $ class ) : new \ ReflectionClass ( $ class ) ; if ( ! static :: cache ( ) -> hasClass ( $ reflector -> getName ( ) ) ) { $ annotations = static :: parser ( ) -> parse ( $ reflector -> getDocComment ( ) ) ; static :: cache ( ) -> storeClass ( $ reflector -> getName ( ) , $ annotations ) ; } else { $ annotations = static :: cache ( ) -> getClass ( $ reflector -> getName ( ) ) ; } if ( $ key ) { return isset ( $ annotations [ $ key ] ) ? $ annotations [ $ key ] : null ; } return $ annotations ; }
Parse class annotations

@param $class
@param string $key
@return array
Parse class annotations