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());
|
$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);
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user