src/Contao/Callback/Callbacks.php
private static function evaluateServiceCallback($callback)
    {
        $container = System::getContainer();

        if ($container->has($callback[0])
            && ((false !== \strpos($callback[0], '\\')) || !\class_exists($callback[0]))
        ) {
            $callback[0] = $container->get($callback[0]);

            return $callback;
        }

        if ($container instanceof Container && isset($container->getRemovedIds()[$callback[0]])) {
            throw new ServiceNotFoundException(
                $callback[0],
                null,
                null,
                [],
                sprintf(
                    'The "%s" service or alias has been removed or inlined when the container was compiled. ' .
                    'You should either make it public, ' .
                    'or stop using the container directly and use dependency injection instead.',
                    $callback[0]
                )
            );
        }

        return $callback;
    }
private static function evaluateServiceCallback($callback)
    {
        $container = System::getContainer();

        if ($container->has($callback[0])
            && ((false !== \strpos($callback[0], '\\')) || !\class_exists($callback[0]))
        ) {
            $callback[0] = $container->get($callback[0]);

            return $callback;
        }

        if ($container instanceof Container && isset($container->getRemovedIds()[$callback[0]])) {
            throw new ServiceNotFoundException(
                $callback[0],
                null,
                null,
                [],
                sprintf(
                    'The "%s" service or alias has been removed or inlined when the container was compiled. ' .
                    'You should either make it public, ' .
                    'or stop using the container directly and use dependency injection instead.',
                    $callback[0]
                )
            );
        }

        return $callback;
    }
private static function evaluateServiceCallback ( $ callback ) { $ container = System :: getContainer ( ) ; if ( $ container -> has ( $ callback [ 0 ] ) && ( ( false !== \ strpos ( $ callback [ 0 ] , '\\' ) ) || ! \ class_exists ( $ callback [ 0 ] ) ) ) { $ callback [ 0 ] = $ container -> get ( $ callback [ 0 ] ) ; return $ callback ; } if ( $ container instanceof Container && isset ( $ container -> getRemovedIds ( ) [ $ callback [ 0 ] ] ) ) { throw new ServiceNotFoundException ( $ callback [ 0 ] , null , null , [ ] , sprintf ( 'The "%s" service or alias has been removed or inlined when the container was compiled. ' . 'You should either make it public, ' . 'or stop using the container directly and use dependency injection instead.' , $ callback [ 0 ] ) ) ; } return $ callback ; }
Evaluate the callback from the service container.

@param array $callback The callback.

@return array

@throws ServiceNotFoundException When service is not public or removed.
Evaluate the callback from the service container .