mirror of
https://github.com/rectorphp/rector.git
synced 2025-01-18 05:48:21 +01:00
misc, keep MagicMethodRector running
This commit is contained in:
parent
a6f829fbba
commit
87641e9e6f
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,9 @@ namespace SomeNamespace;
|
||||
|
||||
use Nette\Object;
|
||||
|
||||
/**
|
||||
* @method getValue()
|
||||
*/
|
||||
class SomeClass extends Object
|
||||
{
|
||||
public function getValue()
|
||||
|
Loading…
x
Reference in New Issue
Block a user