Returns the caller for a specific method

@return array
176583
public static function caller()
    {
        $bt = debug_backtrace();
        $caller = isset($bt[2]) ? $bt[2] : array();
        $caller['line'] = $bt[1]['line'];
        $caller['file'] = $bt[1]['file'];
        if (!isset($caller['class'])) {
            $caller['class'] = '';
        }
        if (!isset($caller['type'])) {
            $caller['type'] = '';
        }
        if (!isset($caller['function'])) {
            $caller['function'] = '';
        }
        return $caller;
    }
180249
protected function getLoggerCallable()
    {
        if (!is_callable($this->loggerCallable)) {
            $loggerCallable = $this->getOption('logger_callable');

            if (is_callable($loggerCallable)) {
                $this->loggerCallable = $loggerCallable;
            }
        }

        return $this->loggerCallable;
    }
1223520
public function getMethods() {
    $methods = array();
    foreach ($this->methodsOrder as $methodName) {
      $method = $this->methods[$methodName];
      if ($method->getDeclaringClass()->equals($this)) {
        $methods[$method->getName()] = $method;
      }
    }
    return $methods;
  }
898469
public function getCalls()
    {
        if (empty($this->data['calls'])) {
            return [];
        }

        $calls = $count = [];
        foreach ($this->data['calls'] as $hash => $call) {
            list($class, $method) = \explode('::', $call['method']);
            $namespace = \explode('\\', $class);
            $class = \array_pop($namespace);
            $calls[$hash] = [
                'namespace' => $namespace,
                'class' => $class,
                'method' => $method,
                'arguments' => $call['arguments'],
                'stats' => $call['stats'],
            ];
            // Get traces, and order them to have the most called first
            $calls[$hash]['traces'] = $call['traces'];
            $traceCount = [];
            foreach ($call['traces'] as $traceHash => $traceData) {
                $traceCount[$traceHash] = $traceData['count'];
            }
            \array_multisort($traceCount, SORT_DESC, SORT_NUMERIC, $calls[$hash]['traces']);

            // For call sorting count all calls, but weight in-memory lookups lower
            $count[$hash] = $call['stats']['uncached'] + $call['stats']['miss'] + $call['stats']['hit'] + ($call['stats']['memory'] * 0.001);
        }

        // Order calls
        \array_multisort($count, SORT_DESC, SORT_NUMERIC, $calls);

        return $calls;
    }
467132
public function getCallbackIp() {
		if(empty($this->app->ip_list)) {
			$this->refreshIpList();
		}

		return $this->app->ipListArray;
	}
387845
protected function getLockInstancesForCallerRoles()
    {
        return array_map(function ($role) {
            return $this->manager->role($role);
        }, $this->caller->getCallerRoles());
    }
765771
protected function getCalls() {
        if (!$this->_calls) {
            $this->_calls = new CallList($this->version, $this->solution['sid']);
        }

        return $this->_calls;
    }
1030685
public function getCallbackCode()
    {
        $reflection = new \ReflectionFunction($this->_callback);
        
        // Open file and seek to the first line of the closure
        $file = new \SplFileObject($reflection->getFileName());
        $file->seek($reflection->getStartLine() - 1);

        // Retrieve all of the lines that contain code for the closure
        $code = '';
        while ($file->key() < $reflection->getEndLine())
        {
            $code .= $file->current();
            $file->next();
        }

        $begin = strpos($code, 'function');
        $end = strrpos($code, '}');
        $code = substr($code, $begin, $end - $begin + 1);

        return $code;
    }
371027
public function getActivatedPhoneNumbers()
    {
        Piwik::checkUserIsNotAnonymous();

        $phoneNumbers = $this->retrievePhoneNumbers();

        $activatedPhoneNumbers = array();
        foreach ($phoneNumbers as $phoneNumber => $verificationCode) {
            if (self::isActivated($verificationCode)) {
                $activatedPhoneNumbers[] = $phoneNumber;
            }
        }

        return $activatedPhoneNumbers;
    }
1195938
public function getMethods()
    {
        $aMethods = [];
        foreach($this->reflectionClass->getMethods(\ReflectionMethod::IS_PUBLIC) as $xMethod)
        {
            $sMethodName = $xMethod->getShortName();
            // Don't take magic __call, __construct, __destruct methods
            if(strlen($sMethodName) > 2 && substr($sMethodName, 0, 2) == '__')
            {
                continue;
            }
            // Don't take excluded methods
            if(in_array($sMethodName, $this->aProtectedMethods))
            {
                continue;
            }
            $aMethods[] = $sMethodName;
        }
        return $aMethods;
    }
675565
public function getAllMethods() {
    $methods = array();
    foreach ($this->methodsOrder as $methodName) {
      $method = $this->methods[$methodName];
      $methods[$method->getName()] = $method;
    }
    return $methods;
  }
97123
protected function getCallable()
    {
        $callback = null;
        if (is_object($this->runnable) && $this->runnable instanceof Runnable) {
            $callback = array($this->runnable, 'run');
        } elseif (is_callable($this->runnable)) {
            $callback = $this->runnable;
        } else {
            $callback = array($this, 'run');
        }

        return $callback;
    }
975115
public function getClassName()
    {
        if ($this->isMethod() || $this->isInvokedObject()) {
            $callable = $this->explodeCallable();
            if ($this->isInstanceMethod() || $this->isInvokedObject()) {
                return get_class($callable[0]);
            }
            return $callable[0];
        }
        return '';
    }
556864
protected function getCallerByLevel($level)
    {
        $level+=1;
        $backtrace=debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, static::MAX_TRACE_LEVEL);
        $caller_class=$backtrace[$level]['class']??'';
        if ($this->dn_class && (is_subclass_of($this->dn_class, $caller_class) || $this->dn_class===$caller_class)) {
            $caller_class=$backtrace[$level+1]['class']??'';
        }
          

        return $caller_class;
    }
1300257
public static function getCallerMethod($level = 2)
    {
        $callers = debug_backtrace();

        if (isset($callers[$level]['class'])) {
            $class = $callers[$level]['class'] . '::';
        } else {
            $class = 'function ';
        }

        return $class . $callers[$level]['function'];
    }
1217656
protected function getBelongsToManyCaller()
	{
		$self = __FUNCTION__;

		return array_first(debug_backtrace(false), function($trace) use ($self)
		{
			$caller = $trace['function'];

			return ( ! in_array($caller, Model::$manyMethods) && $caller != $self);
		});
	}
68504
public function getClassAndMethodNamesForCalling(): array
    {
        $domain = $this->consoleInput->getDomainName();
        $action = $this->consoleInput->getActionName();

        $className = self::getFQDNClass($domain);

        return [$className, $domain, $action];
    }