You are here

protected function DebugCallGraphTrait::getClassName in Varnish purger 8.2

Generate a short and readable class name.

Parameters

string|object $class: Fully namespaced class or an instantiated object.

Return value

string

2 calls to DebugCallGraphTrait::getClassName()
DebugCallGraphTrait::debug in src/DebugCallGraphTrait.php
Log the caller graph using $this->logger()->debug() messages.
DebugCallGraphTrait::logFailedRequest in src/DebugCallGraphTrait.php
Write an error to the log for a failed request.

File

src/DebugCallGraphTrait.php, line 29

Class

DebugCallGraphTrait

Namespace

Drupal\varnish_purger

Code

protected function getClassName($class) {
  if (is_object($class)) {
    $class = get_class($class);
  }
  if ($pos = strrpos($class, '\\')) {
    $class = substr($class, $pos + 1);
  }
  return $class;
}