function KeywordPatch::apply
Remove methods that clash with php keywords
Parameters
ClassNode $node:
Overrides ClassPatchInterface::apply
File
-
vendor/
phpspec/ prophecy/ src/ Prophecy/ Doubler/ ClassPatch/ KeywordPatch.php, line 40
Class
- KeywordPatch
- Remove method functionality from the double which will clash with php keywords.
Namespace
Prophecy\Doubler\ClassPatchCode
public function apply(ClassNode $node) {
$methodNames = array_keys($node->getMethods());
$methodsToRemove = array_intersect($methodNames, $this->getKeywords());
foreach ($methodsToRemove as $methodName) {
$node->removeMethod($methodName);
}
}