Get service in container

Returns a service contained in the application container or null if none
is found with that name.

@param string $name Name of service
@return mixed
165036
public function getService($name)
    {
        $container = $this->getContainer();

        return !is_null($container) && isset($container[$name]) ? $container[$name] : null;
    }
772430
public function get($name)
    {
        if (!isset($this->services[$name])) {
            throw ServiceNotFoundException::fromName($name);
        }

        return $this->services[$name]($this);
    }
426216
public function getService($serviceName) {
        if (static::$container->offsetExists($serviceName) === false) {
            return null;
        }

        return static::$container->offsetGet($serviceName);
    }
254611
final public function get(string $name)
    {
        $service_selected = null;
        foreach ($this->services as $one => $val) {
            if ($val['name'] === $name) {
                if (!in_array($val['content']->status, array("enabled", "disabled"))) {
                    throw new Server500(new \ArrayObject(array("explain" =>
                        "Undefined status [ ".$val['content']->status." ] for ".$val['name']." service",
                        "solution" => "Please set the status [disabled] or [enabled]")));
                }
                if ($val['content']->status == "disabled") {
                    throw new Server500(new \ArrayObject(array("explain" =>
                        "The service [ ".$val['name']." ] is currently disabled ",
                        "solution" => "Please set the status [enabled] to enable the service")));
                }
                $i = $val['content']->namespace;
                $container = FrameworkContainer::getInstance();
                return ($container->get($i));
            }
        }

        throw new Server500(new \ArrayObject(array("explain" =>
            "Undefined service : $name", "solution" => "Please register the [$name] service")));
    }
5251
public function get($name = null)
    {
        if (is_null($name)) {
            return $this->all();
        }

        return $this->find($name);
    }
1169475
private function getServiceClass($name)
    {
        $serviceId = $this->getServiceId($name);
        $parameterId = $serviceId.'.class';
        if ($this->container->hasParameter($parameterId)) {
            $class = $this->container->getParameter($parameterId);
        } elseif (array_key_exists($name, $this->options)) {
            $class = $this->options[$name];
        } else {
            throw new \RuntimeException(sprintf('Undefined "%s" service class.', $name));
        }
        return $class;
    }
924551
protected function service($name) {

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

		if(true === ServiceContainer :: has($name)) {
			return ServiceContainer :: get($name);
		}

		$function = Application :: get(['services', $name], false);

		if('object' === gettype($function)) {
			
			$func = $function();

			ServiceContainer :: add($name, $func);
			return $func;
		}

		return trigger_error(sprintf('Argument 1 "%s" passed to %s() is not a known service', $name, __METHOD__), E_USER_ERROR);
	}
1153071
public function get($name)
    {
        $name = strtoupper($name);
        if (isset($_SERVER[$name])) {
            return $_SERVER[$name];
        }
        return null;
    }
973864
public function get($serviceName)
    {
        if ($this->registry->has($serviceName)) {
            $service = $this->registry->getStrict($serviceName);
        }
        elseif ($this->parameterContainer->has($serviceName)) {
            $service = $this->parameterContainer->get($serviceName);
        }
        else {
            $service = $this->resolveService($serviceName);
        }

        return $service;
    }
859501
public function get($name,$default=null)
    {

        // Return null if the service is not in the container
        if(!isset($this->instances[$name]))
             return $default;

        if(array_key_exists($name,$this->bind))
            return $this->resolve($name);


        // Check if the service has been resolved in the container
        if(!$this->resolved[$name]){

            $this->instances[$name] = $this->resolve($name);
            

            return $this->instances[$name];
        }

        return $this->resolve($name);
    }
985686
public function resolve($name)
    {
        return isset($this->services[$name]) ? $this->iteratorFactory->create($this->services[$name]) : null;
    }
818937
public function get($name)
    {
        if(array_key_exists($name, $this->services))
            return $this->services[$name];

        return $this->services[$name] = $this->solve('service', $name, array($this));
    }
448676
public static function serviceClassname($name)
    {
        $services = static::services();

        if (!isset($services[$name])) {
            throw new \InvalidArgumentException(
                sprintf('The provided service %s does not exist.', $name)
            );
        }

        return $services[$name];
    }
934001
public function get($name)
    {
        if (array_key_exists($name, $this->runnableVariables)) {
            return $this->runnableVariables[$name];
        }
        return null;
    }
217672
public function get(string $name)
    {
        if (!isset($this->services[$name])) {
            throw new \LogicException(\sprintf('Global variable %s could not be located. You should define it.', \json_encode($name)));
        }

        return $this->services[$name];
    }
530764
public function getFactory($name)
    {
        if (false === $this->has($name)) {
            if (class_exists($name)) {
                $this->resolve($name);
            } else {
                throw new NotFoundException('Service "' . $name . '" is unknown');
            }
        }

        if (true === isset($this->map[$class = ltrim($name, '/')])) {
            $name = $this->map[$class];
        }

        return $this->payload[$name];
    }
172512
public function service($name)
    {
        if (isset($this->resolved[$name])) {
            return $this->resolved[$name];
        }

        $service = $this->resolver->resolve($name);
        $serviceArgs = $this->resolveFuncArgs($service);

        return $this->resolved[$name] = $service->invoke($serviceArgs);
    }