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

Breadcrumb

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

function Mapper::isUserDefinedMethod

Throws

ReflectionException

1 call to Mapper::isUserDefinedMethod()
Mapper::stringToCodeUnits in vendor/sebastian/code-unit/src/Mapper.php

File

vendor/sebastian/code-unit/src/Mapper.php, line 233

Class

Mapper

Namespace

SebastianBergmann\CodeUnit

Code

private function isUserDefinedMethod(string $className, string $methodName) : bool {
    if (!class_exists($className)) {
        // @codeCoverageIgnoreStart
        return false;
        // @codeCoverageIgnoreEnd
    }
    if (!method_exists($className, $methodName)) {
        // @codeCoverageIgnoreStart
        return false;
        // @codeCoverageIgnoreEnd
    }
    try {
        return (new ReflectionMethod($className, $methodName))->isUserDefined();
        // @codeCoverageIgnoreStart
    } catch (\ReflectionException $e) {
        throw new ReflectionException($e->getMessage(), $e->getCode(), $e);
    }
    // @codeCoverageIgnoreEnd
}

API Navigation

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