Return the registered callable object

@return object
336602
public function getRegisteredObject()
    {
        if($this->registeredObject == null)
        {
            $di = jaxon()->di();
            // Use the Reflection class to get the parameters of the constructor
            if(($constructor = $this->reflectionClass->getConstructor()) != null)
            {
                $parameters = $constructor->getParameters();
                $parameterInstances = [];
                foreach($parameters as $parameter)
                {
                    // Get the parameter instance from the DI
                    $parameterInstances[] = $di->get($parameter->getClass()->getName());
                }
                $this->registeredObject = $this->reflectionClass->newInstanceArgs($parameterInstances);
            }
            else
            {
                $this->registeredObject = $this->reflectionClass->newInstance();
            }
        }
        return $this->registeredObject;
    }
291321
public function toObject() {

		$options = $this->getOptions();
		$result = (object) [
			'type' => 'list',
			'count' => $this->getCount(),
			'limit' => elgg_extract('limit', $options, elgg_get_config('default_limit')),
			'offset' => elgg_extract('offset', $options, 0),
			'sorts' => $this->sorts,
			'filters' => array_map(function($e) {
				return [
					'filter' => $e['filter'],
					'target' => $e['target'] ? $e['target']->guid : 0,
				];
			}, $this->fiilters),
			'items' => [],
		];

		$entities = new ElggBatch($this->getter, $options);
		foreach ($entities as $entity) {
			if (is_object($entity) && is_callable([$entity, 'toObject'])) {
				$result->items[] = $entity->toObject();
			} else {
				$result->items[] = $entity;
			}
		}

		return $result;
	}
713225
protected function getDataTable() {
		if (! $this->_datatable) {
			if (in_array($this->params('table'), $this->getNameManager()->getTableNames())) {
				$DataTable = "\\{$this->getNameManager()->namespace_model}\\{$this->getNameManager()->modelName}";
				$this->_datatable = new $DataTable();
			}
		}
		return $this->_datatable;
	}
91800
public function getReflection()
	{
		if($this->reflection === NULL)
		{
			if(is_array($this->callback))
			{
				$this->reflection = (new \ReflectionClass($this->callback[0]))->getMethod($this->callback[1]);
			}
			elseif(is_object($this->callback) && !$this->callback instanceof \Closure)
			{
				$this->reflection = (new \ReflectionClass($this->callback))->getMethod('__invoke');
			}
			else
			{
				$this->reflection = new \ReflectionFunction($this->callback);
			}
		}
		
		return $this->reflection;
	}
102447
public function parseIdGenerator($callable)
    {
        if ($callable instanceof Closure) {
            return $callable;
        }

        $class    = null;
        $method   = null;
        $isMethod = false;
        $isModel  = false;
        $bail     = false;

        if (is_array($callable) && count($callable) === 2) {
            list($class, $func) = $callable;
            $isMethod = ($class && $func);
        } elseif (is_string($callable) && strpos($callable, '::') > 1) {
            list($class, $func) = explode('::', $callable);
            $isMethod = ($class && $func);
        }

        if ($isMethod) {
            $model   = $this->targetModel();
            $isModel = is_a($model, $class);

            $method = new ReflectionMethod($class, $func);
            if ($isModel && $method->isPublic()) {
                return $method->getClosure($model);
            } elseif ($method->isStatic() && $method->isPublic()) {
                return $callable;
            } else {
                $bail = true;
            }
        }

        if ($bail || !(is_string($callable) && function_exists($callable))) {
            throw new InvalidArgumentException(
                sprintf(
                    'The ID generator must be callable, received: %s',
                    is_object($callable)
                        ? get_class($callable)
                        : (is_string($callable)
                            ? $callable
                            : gettype($callable)
                        )
                )
            );
        }

        return $callable;
    }
502527
private function getCurloptHeaderFunction() : callable
    {
        return function($ch, $data){
            $str = trim($data);
            if('' !== $str){
                if(strpos(strtolower($str), 'http/') === 0){
                    $status_line                                        = $str;
                    @list($http_version, $http_code, $reason_phrase)    = explode(' ', $status_line, 3);
                    $this->Response = $this->Response->withStatus((int) $http_code, (string) $reason_phrase);
                    $this->Response = $this->Response->withProtocolVersion((string) $http_version);
                }else{
                    $header_line            = $str;
                    @list($name, $value)    = explode(':', $header_line, 2);
                    $this->Response         = $this->Response->withAddedHeader(trim((string) $name), trim((string) $value));
                }
            }
            return strlen($data);
        };
    }
1082939
public function getObject()
    {
        if (null === $this->_identifier || null === $this->_class) {
            return;
        }

        return $this->_em->getRepository($this->_class)->find($this->_identifier);
    }
130946
public function getType()
    {
        if (null === $this->type) {
            $this->type = $this->getCallableType($this->handler);
        }

        return $this->type;
    }
1308270
public function getNextCallable()
    {
        if(!$this->initiated)
        {
            reset($this->callables);

            $this->initiated = true;

            return current($this->callables);
        }

        return next($this->callables);
    }
852730
public static function getInstance()
    {
        $sClass = get_called_class();

        if (!isset(self::$_aInstances[$sClass])) {
            self::$_aInstances[$sClass] = new $sClass();
        }

        return self::$_aInstances[$sClass];
    }
376922
protected function getCallbackFromReference($reference): callable
    {
        $this->reference = $reference;
        if(is_callable($reference)) {
            if(!is_string($reference)) {
                $callback = $reference;
            } else {
                $parts = explode("::", $reference);
                $callback = [new $parts[0](), $parts[1]];
            }
        } else {
            $callback = function () use ($reference) {
                new RegularResponse($reference);
            };
        }

        return $callback;
    }
954926
public static function factory()
    {
        $static = get_called_class();

        return function (
                $callableParameter,
                $scopeType,
                $namespace,
                array $parameterScopedVariableMap,
                array $parameterExpressions,
                array $bodyExpressions = null
        ) use ($static) {
            return new $static(
                    $callableParameter,
                    $scopeType,
                    $namespace,
                    $parameterScopedVariableMap,
                    $parameterExpressions,
                    $bodyExpressions);
        };
    }
1069905
public static function fromCallable(callable $callable)
    {
        $reflection = Reflection::fromCallable($callable);

        return new self(
                $callable,
                $reflection,
                FunctionSignature::fromReflection($reflection),
                FunctionLocation::fromReflection($reflection),
                FunctionScope::fromReflection($reflection, $callable));
    }
29728
def is_callable(self):
        
        self._callable = Call(self, call_name=self._name, callable=True)
        return self
1146001
public static function create($callable)
    {
        // Closure
        if ($callable instanceof \Closure) {
            return new \ReflectionFunction($callable);
        }

        // Array callable
        if (is_array($callable)) {
            list($class, $method) = $callable;

            if (! method_exists($class, $method)) {
                throw NotCallableException::fromInvalidCallable($callable);
            }

            return new \ReflectionMethod($class, $method);
        }

        // Callable object (i.e. implementing __invoke())
        if (is_object($callable) && method_exists($callable, '__invoke')) {
            return new \ReflectionMethod($callable, '__invoke');
        }

        // Callable class (i.e. implementing __invoke())
        if (is_string($callable) && class_exists($callable) && method_exists($callable, '__invoke')) {
            return new \ReflectionMethod($callable, '__invoke');
        }

        // Standard function
        if (is_string($callable) && function_exists($callable)) {
            return new \ReflectionFunction($callable);
        }

        throw new NotCallableException(sprintf(
            '%s is not a callable',
            is_string($callable) ? $callable : 'Instance of ' . get_class($callable)
        ));
    }
100933
public function service($name, $callable) {

        $this->registry[$name] = function($c) use($callable) {
            static $object;

            if (null === $object) {
                $object = $callable($c);
            }

            return $object;
        };

        return $this;
    }
882668
public static function getInstance()
    {
        if (empty(static::$instance)) {
            $className = get_called_class();

            static::$instance = new $className();

            if (method_exists(static::$instance, '__reconstruct')) {
                call_user_func_array([&static::$instance, '__reconstruct'], func_get_args());
            }
        }

        return static::$instance;
    }