You are here

public static function Unicode::convertCallback in Express 8

Converts a callback to a string representation.

Parameters

array|string $callback: The callback to convert.

bool $array: Flag determining whether or not to convert the callback to an array.

Return value

string The converted callback as a string or an array if $array is specified.

See also

\Drupal\bootstrap\Bootstrap::addCallback()

1 call to Unicode::convertCallback()
Bootstrap::addCallback in themes/contrib/bootstrap/src/Bootstrap.php
Adds a callback to an array.

File

themes/contrib/bootstrap/src/Utility/Unicode.php, line 52
Contains \Drupal\bootstrap\Utility\Unicode.

Class

Unicode
Extends \Drupal\Component\Utility\Unicode.

Namespace

Drupal\bootstrap\Utility

Code

public static function convertCallback($callback, $array = FALSE) {
  if (is_array($callback)) {
    if (is_object($callback[0])) {
      $callback[0] = get_class($callback[0]);
    }
    $callback = implode('::', $callback);
  }
  if ($callback[0] === '\\') {
    $callback = self::substr($callback, 1);
  }
  if ($array && self::strpos($callback, '::') !== FALSE) {
    $callback = explode('::', $callback);
  }
  return $callback;
}