public function get($id)
    {
        if ($id instanceof \Closure) {
            return $id($this);
        }

        if (!$this->has($id)) {
            $service = $this->factory->create($id, $this);
            $this->repository->set($id, $service);
        }

        return $this->repository->get($id);
    }
public function get($id)
    {
        if ($id instanceof \Closure) {
            return $id($this);
        }

        if (!$this->has($id)) {
            $service = $this->factory->create($id, $this);
            $this->repository->set($id, $service);
        }

        return $this->repository->get($id);
    }
public function get ( $ id ) { if ( $ id instanceof \ Closure ) { return $ id ( $ this ) ; } if ( ! $ this -> has ( $ id ) ) { $ service = $ this -> factory -> create ( $ id , $ this ) ; $ this -> repository -> set ( $ id , $ service ) ; } return $ this -> repository -> get ( $ id ) ; }
Get a service or params and create it first if it's not already defined.

@param int $id

@return mixed
Get a service or params and create it first if it s not already defined .