public function resolve($class, $name = null)
    {
        $class = ltrim($class, '/');

        if (null === $name) {
            $name = $class;
        }

        if (false === $this->has($name)) {
            $this->set($name, $class, null);
        }

        return $this->getFactory($name)->get();
    }
public function resolve($class, $name = null)
    {
        $class = ltrim($class, '/');

        if (null === $name) {
            $name = $class;
        }

        if (false === $this->has($name)) {
            $this->set($name, $class, null);
        }

        return $this->getFactory($name)->get();
    }
public function resolve ( $ class , $ name = null ) { $ class = ltrim ( $ class , '/' ) ; if ( null === $ name ) { $ name = $ class ; } if ( false === $ this -> has ( $ name ) ) { $ this -> set ( $ name , $ class , null ) ; } return $ this -> getFactory ( $ name ) -> get ( ) ; }
Return instance of given class, automatically satisfy dependencies from container payload

@param string $class
@param string|null $name
@throws \ReflectionException
@throws \Janeiro\Di\Exception
@throws \Janeiro\Di\NotFoundException
@return mixed
Return instance of given class automatically satisfy dependencies from container payload