function DrupalDataCollectorTrait::getMethodData

Parameters

$class:

$method:

Return value

array

File

webprofiler/src/DataCollector/DrupalDataCollectorTrait.php, line 58

Class

DrupalDataCollectorTrait
Class DrupalDataCollectorTrait

Namespace

Drupal\webprofiler\DataCollector

Code

public function getMethodData($class, $method) {
    $class = is_object($class) ? get_class($class) : $class;
    $data = [];
    try {
        $reflectedMethod = new \ReflectionMethod($class, $method);
        $data = [
            'class' => $class,
            'method' => $method,
            'file' => $reflectedMethod->getFilename(),
            'line' => $reflectedMethod->getStartLine(),
        ];
    } catch (\ReflectionException $re) {
        // TODO: handle the exception.
    } finally {
        return $data;
    }
}