Hoa central
Public Member Functions | List of all members
Hoa\Devtools\Resource\PHPCSFixer\Fixer\Author Class Reference
Inheritance diagram for Hoa\Devtools\Resource\PHPCSFixer\Fixer\Author:

Public Member Functions

 fix (SplFileInfo $file, $content)
 
 getDescription ()
 
 getName ()
 
 getLevel ()
 

Detailed Description

Class .

Remove @author.

Definition at line 53 of file Author.php.

Member Function Documentation

Hoa\Devtools\Resource\PHPCSFixer\Fixer\Author::fix ( SplFileInfo  $file,
  $content 
)

Definition at line 55 of file Author.php.

56  {
57  $tokens = Tokens::fromCode($content);
58 
59  foreach ($tokens->findGivenKind(T_DOC_COMMENT) as $token) {
60  $docBlock = new DocBlock($token->getContent());
61  $annotations = $docBlock->getAnnotationsOfType('author');
62 
63  if (empty($annotations)) {
64  continue;
65  }
66 
67  foreach ($annotations as $annotation) {
68  $annotation->remove();
69  }
70 
71  $token->setContent($docBlock->getContent());
72  }
73 
74  return $tokens->generateCode();
75  }
$content
Definition: Hoa.php:119
Hoa\Devtools\Resource\PHPCSFixer\Fixer\Author::getDescription ( )

Definition at line 77 of file Author.php.

78  {
79  return 'Remove `@author`.';
80  }
Hoa\Devtools\Resource\PHPCSFixer\Fixer\Author::getLevel ( )

Definition at line 87 of file Author.php.

88  {
89  return FixerInterface::CONTRIB_LEVEL;
90  }
Hoa\Devtools\Resource\PHPCSFixer\Fixer\Author::getName ( )

Definition at line 82 of file Author.php.

83  {
84  return 'author';
85  }

The documentation for this class was generated from the following file: