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

Breadcrumb

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

function TraceableSerializer::getCaller

6 calls to TraceableSerializer::getCaller()
TraceableSerializer::decode in vendor/symfony/serializer/Debug/TraceableSerializer.php
Decodes a string into PHP data.
TraceableSerializer::denormalize in vendor/symfony/serializer/Debug/TraceableSerializer.php
Denormalizes data back into an object of the given class.
TraceableSerializer::deserialize in vendor/symfony/serializer/Debug/TraceableSerializer.php
Deserializes data into the given type.
TraceableSerializer::encode in vendor/symfony/serializer/Debug/TraceableSerializer.php
Encodes data into the given format.
TraceableSerializer::normalize in vendor/symfony/serializer/Debug/TraceableSerializer.php
Normalizes data into a set of arrays/scalars.

... See full list

File

vendor/symfony/serializer/Debug/TraceableSerializer.php, line 162

Class

TraceableSerializer
Collects some data about serialization.

Namespace

Symfony\Component\Serializer\Debug

Code

private function getCaller(string $method, string $interface) : array {
    $trace = debug_backtrace(\DEBUG_BACKTRACE_IGNORE_ARGS, 8);
    $file = $trace[0]['file'];
    $line = $trace[0]['line'];
    for ($i = 1; $i < 8; ++$i) {
        if (isset($trace[$i]['class'], $trace[$i]['function']) && $method === $trace[$i]['function'] && is_a($trace[$i]['class'], $interface, true)) {
            $file = $trace[$i]['file'];
            $line = $trace[$i]['line'];
            break;
        }
    }
    $name = str_replace('\\', '/', $file);
    $name = substr($name, strrpos($name, '/') + 1);
    return compact('name', 'file', 'line');
}

API Navigation

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