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());
// is empty @todo improve
if (strlen($doc->jsonSerialize()['text']) <= 7) {
$doc = new Doc('');
}
$node->setDocComment($doc);
$node->setAttribute('comments', null);
}

View File

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

View File

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