Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. KeywordPatch.php

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\ClassPatch

Code

public function apply(ClassNode $node) {
    $methodNames = array_keys($node->getMethods());
    $methodsToRemove = array_intersect($methodNames, $this->getKeywords());
    foreach ($methodsToRemove as $methodName) {
        $node->removeMethod($methodName);
    }
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal