original_string: public static function fromClass(
          string $class,
          bool $withParents = false
      ): array
      {
          try {
  
              $class = new \ReflectionClass($class);
          }
          catch (\ReflectionException $e) {
  
              throw new Exception(
                  "Class '{$class}' not found.",
                  Exception::CLASS_NOT_FOUND
              );
          }
  
          $docComment = $class->getDocComment();
  
          if ($withParents) {
  
              while (1) {
  
                  if ($class = $class->getParentClass()) {
  
                      if ($parentDoc = $class->getDocComment()) {
  
                          $docComment = $docComment === false ?
                              $parentDoc :
                              "{$parentDoc}{$docComment}";
                      }
                  }
                  else {
  
                      break;
                  }
              }
          }
  
          unset($class);
  
          if ($docComment === false) {
  
              return [];
          }
  
          return Parser::parseDocComment($docComment);
      }
code: public static function fromClass(
          string $class,
          bool $withParents = false
      ): array
      {
          try {
  
              $class = new \ReflectionClass($class);
          }
          catch (\ReflectionException $e) {
  
              throw new Exception(
                  "Class '{$class}' not found.",
                  Exception::CLASS_NOT_FOUND
              );
          }
  
          $docComment = $class->getDocComment();
  
          if ($withParents) {
  
              while (1) {
  
                  if ($class = $class->getParentClass()) {
  
                      if ($parentDoc = $class->getDocComment()) {
  
                          $docComment = $docComment === false ?
                              $parentDoc :
                              "{$parentDoc}{$docComment}";
                      }
                  }
                  else {
  
                      break;
                  }
              }
          }
  
          unset($class);
  
          if ($docComment === false) {
  
              return [];
          }
  
          return Parser::parseDocComment($docComment);
      }
code_tokens: public static function fromClass ( string $ class , bool $ withParents = false ) : array { try { $ class = new \ ReflectionClass ( $ class ) ; } catch ( \ ReflectionException $ e ) { throw new Exception ( "Class '{$class}' not found." , Exception :: CLASS_NOT_FOUND ) ; } $ docComment = $ class -> getDocComment ( ) ; if ( $ withParents ) { while ( 1 ) { if ( $ class = $ class -> getParentClass ( ) ) { if ( $ parentDoc = $ class -> getDocComment ( ) ) { $ docComment = $ docComment === false ? $ parentDoc : "{$parentDoc}{$docComment}" ; } } else { break ; } } } unset ( $ class ) ; if ( $ docComment === false ) { return [ ] ; } return Parser :: parseDocComment ( $ docComment ) ; }
docstring: Extract the annotations from a class.
  
  @param string $class
  @param bool $withParents
  
  @throws \L\Annotation\Exception
  
  @return array
docstring_tokens: Extract the annotations from a class .