misc, keep MagicMethodRector running

This commit is contained in:
TomasVotruba 2017-09-29 21:57:20 +02:00
parent a6f829fbba
commit 87641e9e6f
3 changed files with 11 additions and 16 deletions

View File

@ -34,12 +34,6 @@ final class DocBlockAnalyzer
} }
$doc = new Doc($docBlock->getContent()); $doc = new Doc($docBlock->getContent());
// is empty @todo improve
if (strlen($doc->jsonSerialize()['text']) <= 7) {
$doc = new Doc('');
}
$node->setDocComment($doc); $node->setDocComment($doc);
$node->setAttribute('comments', null); $node->setAttribute('comments', null);
} }

View File

@ -24,11 +24,11 @@ final class MagicMethodRector extends AbstractRector
* @var string * @var string
*/ */
private const MAGIC_METHODS_PATTERN = '~^ private const MAGIC_METHODS_PATTERN = '~^
[ \t*]* @method [ \t]+ [ \t*]* @method [ \t]+
(?: [^\s(]+ [ \t]+ )? (?: [^\s(]+ [ \t]+ )?
(set|get|is|add) ([A-Z]\w*) [ \t]* (set|get|is|add) ([A-Z]\w*) [ \t]*
(?: \( [ \t]* ([^)$\s]+) )? (?: \( [ \t]* ([^)$\s]+) )?
()~mx'; ()~mx';
/** /**
* @var mixed[] * @var mixed[]
@ -145,13 +145,11 @@ final class MagicMethodRector extends AbstractRector
} }
$methods[$name] = [ $methods[$name] = [
'propertyType' => $type, 'propertyType' => $type,
'propertyName' => $prop, 'propertyName' => $prop,
]; ];
} }
// }
return $methods; return $methods;
} }
} }

View File

@ -4,6 +4,9 @@ namespace SomeNamespace;
use Nette\Object; use Nette\Object;
/**
* @method getValue()
*/
class SomeClass extends Object class SomeClass extends Object
{ {
public function getValue() public function getValue()