If a job with the given name exists, this method returns the job.
If there is no such job yet, it will create, store and return it.

@param  string $name
@return JobInterface
428332
protected function getOrMake(string $name) : JobInterface
    {
        $value = $this->jobs[$name];

        if ($value instanceof JobInterface) {
            return $value;
        }

        if (is_string($value)) {
            $reflectionClass = new ReflectionClass($value);

            $job = $reflectionClass->newInstance(); // Create instance
        } else {
            /** @var Closure $value */
            $job = $value(); // Execute closure
        }

        if (! $job instanceof JobInterface) {
            throw new JobException("Object '$name' is not a job!");
        }

        $this->jobs[$name] = $job;

        return $job;
    }
40032
public function getAppender($name)
    {
        if (!isset($this->appenderMap[$name])) {
            LoggerPolicy::processConfigurationError("Appender {$name} not found");

            return new AppenderNull();
        }

        return $this->appenderMap[$name];
    }
1185161
public function getJob($jobName)
    {
        $jobName = $this->jobPrefix . $jobName;

        foreach ($this->workers as $worker) {

            if (is_array($worker['jobs'])) {

                foreach ($worker['jobs'] as $job) {

                    if ($jobName === $job['realCallableName']) {

                        $worker['job'] = $job;

                        return $worker;
                    }
                }
            }
        }

        throw new JobDoesNotExistException();
    }
1164973
public function getByName($name)
    {
        if (array_key_exists($name, $this->tasks)) {
            return $this->tasks[$name];
        }

        return false;
    }
1289243
public static function create($name)
    {
        $logger = new Logger($name);

        $localLogConfig = config('logger.local_log');
        if($localLogConfig['enabled'] && !in_array($name, $localLogConfig['exclude_names'])) {
            $streamHandler = self::streamHandler($name);
            $logger->pushHandler($streamHandler);
        }

        $logstashConfig = config('logger.logstash');
        if($logstashConfig['enabled'] && !in_array($name, $logstashConfig['exclude_names'])){
            $gelfHandler = self::logStashHandler($logstashConfig);
            $logger->pushHandler($gelfHandler);
        }

        $requestId = Request::header('x-request-id');
        $logger->setRequestId($requestId);

        return $logger;
    }
318910
def job(self, name):
        
        for job in self.jobs():
            if job.data.name == name:
                return job
523615
public function get($name)
    {
        $options = [];
        if (is_array($name)) {
            $options = $name;
            list($name) = array_keys($name);
            $options = $options[$name];
        }

        if (array_key_exists($name, $this->registeredTasks)) {
            /** @var AbstractTask $task */
            $task = $this->registeredTasks[$name];
            $task->setOptions($options);
            return $task;
        } elseif (class_exists($name)) {
            $reflex = new ReflectionClass($name);
            if ($reflex->isInstantiable()) {
                $task = new $name();
                if ($task instanceof AbstractTask) {
                    $task->setOptions($options);
                    $this->add($task);
                    return $task;
                }
            }
        }

        throw new RuntimeException(sprintf('Invalid task name "%s"', $name));
    }
774250
public function createRole($name) {
		$result = $this->repository->createRole($name);
		$this->domain->const->generateRoles();
		return $result;
	}
80916
public function setJobName($name)
    {
        if (!is_string($name)) {
            throw new InvalidArgumentException('Job name must be a string');
        }

        $name = trim($name);
        $strlen = mb_strlen($name);

        if (!$strlen) {
            throw new InvalidArgumentException('Job name cannot be empty');
        } elseif ($strlen < 2 || $strlen > 255) {
            throw new InvalidArgumentException('Job name length must be in range 2-255 characters');
        }

        $this->jobName = $name;

        return $this;
    }
225785
private function resolve($name)
    {   
        // set as resolved
        $this->resolved[$name] = true;
        
        // resolve the service
        if (is_string($this->instances[$name]) && class_exists($this->instances[$name])) 
        {
            
            $object = $this->instances[$name];

            return new $object();

        }
        elseif(is_callable($this->instances[$name]))
        {

            $callable = $this->instances[$name];

            return $callable();

        }    

        return $this->instances[$name];
    }
421938
protected function getManager($name)
    {
        $id = $this->getManagerId($name);

        if ($this->getContainer()->has($id)) {
            return $this->getContainer()->get($id);
        }

        throw new \RuntimeException(
            sprintf(
                'Manager named `%s` not found. Available: `%s`.',
                $name,
                implode('`, `', array_keys($this->getContainer()->getParameter('es.managers')))
            )
        );
    }
1111610
public function get(string $name)
    {
        if ($this->isSingleton($name)) {
            /*
             * Object is instantiated as
             * singleton already. Just fetch it.
             */
            return $this->singletonObjects[$name];
        } elseif ($this->isDefined($name)) {
            /*
             * Creates a new instance
             * using map information.
             */
            return $this->build($name);
        } elseif (class_exists($name)) {
            /*
             * Class exists but it is
             * not mapped yet.
             */
            $this->set(
                $name,
                method_exists($name, '__construct') ?
                    $this->generateArgumentsMap($name) : []
            );

            return $this->get($name);
        }

        throw new \Exception("Couldn't create '$name'");
    }
381157
public function findByName($name)
    {
        $q = $this->createSelectQuery();
        $q->where($q->expr->eq('name', $q->bindValue($name, ':name')));
        return $this->loadOneFromQuery($q);
    }
118878
public static function getInstance($name)
    {
        return (isset(self::$_pool[$name]) ? self::$_pool[$name] : self::create($name));
    }
397511
public function get(string $name)
    {
        if (isset($this->workerClassMap[$name])) {
            return $this->container->get($this->workerClassMap[$name]);
        }
        return $this->container->get($name);
    }
97685
public function get($name)
    {
        $found = null;
        /** @var ElementInterface $element */
        foreach ($this->elements as $element) {
            if ($element->getName() == $name) {
                $found = $element;
            }
        }
        return $found;
    }
526237
public static function init($name)
    {
        if (empty(self::$instance[$name]) || !self::$instance[$name] instanceof self) {
            self::$instance[$name]        = new self();
            self::$instance[$name]->queue = new \SplQueue();
        }
        return self::$instance[$name];
    }