Ensure the callback method from a given name.

The callback method must start with 'callback'.

@param string $callbackName The name of the callback, like `my-action`
@return string Convert the callbackname to `callbackMyAction`
353771
protected function callbackToMethod($callbackName)
    {
        if (!StringHelper::startsWith($callbackName, 'callback')) {
            return 'callback' . Inflector::id2camel($callbackName);
        }
        
        return lcfirst(Inflector::id2camel($callbackName));
    }
148328
public function of($name, $callback = null)
    {

        $type = $this->definition['name'];

        if (is_null($type) || !property_exists($this, $type)) {
            throw new RuntimeException('Not supported.');
        } elseif (!isset($this->keyMap[$name])) {
            throw new InvalidArgumentException("Name [{$name}] is not available.");
        }

        $id = $this->keyMap[$name];

        if (is_callable($callback)) {
            call_user_func($callback, $this->{$type}[$id]);
        }


        return $this->{$type}[$id];
    }
448036
public function findActionByName(string $name)
    {
        foreach ($this->actions as $action) {
            if ($action->getAction() === $name) {
                return $action;
            }
        }

        return null;
    }
581030
protected function getHandlers($eventName)
    {
        return isset($this->events[$eventName]) ? $this->events[$eventName] : new CallbackQueue();
    }
319824
public function name($name = null) {

        if(null !== $name && false === is_string($name) && false === is_numeric($name)) {
            return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string or number, "%s" given', __METHOD__, gettype($name)), E_USER_ERROR);
        }

        $this -> name = $name;
        $this -> attributes['name'] = $name;

        return $this;
    }
903766
public function doAction($actionName)
    {
        if (isset($this->actions[$actionName]))
            return call_user_func_array(array($this, $this->actions[$actionName]), array());
    }
1042292
public function getActionName($name)
    {
        if (!isset($this->actionList[$name])) {
            $this->actionList[$name] = new Action($name);
        }

        return $this->actionList[$name];
    }
1250514
public function callback(string $name, callable $callback): self
    {
        $this->data->callback($name, $callback);
        return $this;
    }
534934
public function startAction($actionName)
    {
        $startStopwatch = $this->stopwatch && empty($this->actionStack);

        $this->actionStack[] = ['name' => $actionName, 'time' => microtime(true), 'subtrahend' => 0];
        $this->lastActionIndex++;
        if ($startStopwatch) {
            $this->stopwatch->start($this->getStopwatchName(), $this->sectionName);
        }
    }
762522
public function register($name, Closure $callback)
    {
        $this->checkCallbackName($name);

        $this->callbacks[$name] = $callback;

        return $this;
    }
475367
public static function script($name, $callback) 
    {
        if (phpQueryPlugin_Scripts::$scriptMethods[$name]) {
            throw new Exception("Script name conflict - '$name'");
        }
        phpQueryPlugin_Scripts::$scriptMethods[$name] = $callback;
    }
500884
public function addAction(ActionInterface $action, $callback = null)
    {
        $this->queue[] = array(
            'action'   => $action,
            'callback' => $callback,
        );

        return $this;
    }
793084
private function doBeforeQuery($callback, $methodName, $arguments)
    {
        $traits = $this->getUsedTraits();

        if (in_array(CacheResults::class, $traits) && $this->caching && $this->isCacheableMethod($methodName)) {
            return $this->processCacheRequest($callback, $methodName, $arguments);
        }

        return $callback();
    }
480836
public function makeOnce($name, $callback)
    {
        if ($this->exists($name)) {
            return null;
        }

        return $this->make($name, $callback);
    }
994845
protected static function callback($callback)
    {
        if( is_string($callback) && ! is_callable($callback) )
        {
            return self::controllerCallback($callback);
        }

        return $callback;
    }
946013
public function addAction($action, $callback)
    {
        if (!is_callable($callback)) {
            throw new \Exception('Callback is not callable.');
        }

        $this->getLogger()->info('[SERVICE] Registering: '.$action);

        $this->actions[$action] = $callback;

        return $this;
    }
546253
public function setClassName($className)
    {
        try {
            $classFilename = ClassLoader::getInstance()->findClass($className);
            if (!file_exists($classFilename)) {
                throw new BootstrapException('The provided callback class "' . $className . '" does not exist.');
            } else {
                $this->className = $className;
            }
        } catch (\Exception $e) {
            throw $e;
        }
    }