public function tokenResolve($name)
    {
        if(strpos($name, 'self.callable') === 0)
            $name = str_replace('self.callable.', 'callable.', $name);

        if(strpos($name, 'self.factory') === 0)
            $name = str_replace('self.factory.', 'factory.', $name);

        switch($name)
        {
            case 'self':
                return $this;
                break;
            default:
                $split = explode('.', $name, 2);

                if(isset($split[1]))
                {
                    switch($split[0])
                    {
                        case 'self':
                            return $this->{$split[1]};
                            break;
                        case 'service':
                            return $this->get($split[1]);
                            break;
                        case 'factory':
                            return $this->create($split[1]);
                            break;
                        case 'callable':
                            return $this->__call($split[1]);
                            break;
                        default:
                            return $this->{$arg};
                            break;
                    }
                }
                else
                {
                    return $this->get($name);
                }
                break;
        }
    }
public function tokenResolve($name)
    {
        if(strpos($name, 'self.callable') === 0)
            $name = str_replace('self.callable.', 'callable.', $name);

        if(strpos($name, 'self.factory') === 0)
            $name = str_replace('self.factory.', 'factory.', $name);

        switch($name)
        {
            case 'self':
                return $this;
                break;
            default:
                $split = explode('.', $name, 2);

                if(isset($split[1]))
                {
                    switch($split[0])
                    {
                        case 'self':
                            return $this->{$split[1]};
                            break;
                        case 'service':
                            return $this->get($split[1]);
                            break;
                        case 'factory':
                            return $this->create($split[1]);
                            break;
                        case 'callable':
                            return $this->__call($split[1]);
                            break;
                        default:
                            return $this->{$arg};
                            break;
                    }
                }
                else
                {
                    return $this->get($name);
                }
                break;
        }
    }
public function tokenResolve ( $ name ) { if ( strpos ( $ name , 'self.callable' ) === 0 ) $ name = str_replace ( 'self.callable.' , 'callable.' , $ name ) ; if ( strpos ( $ name , 'self.factory' ) === 0 ) $ name = str_replace ( 'self.factory.' , 'factory.' , $ name ) ; switch ( $ name ) { case 'self' : return $ this ; break ; default : $ split = explode ( '.' , $ name , 2 ) ; if ( isset ( $ split [ 1 ] ) ) { switch ( $ split [ 0 ] ) { case 'self' : return $ this -> { $ split [ 1 ] } ; break ; case 'service' : return $ this -> get ( $ split [ 1 ] ) ; break ; case 'factory' : return $ this -> create ( $ split [ 1 ] ) ; break ; case 'callable' : return $ this -> __call ( $ split [ 1 ] ) ; break ; default : return $ this -> { $ arg } ; break ; } } else { return $ this -> get ( $ name ) ; } break ; } }
Resolve services, factories, callables by given token
@param string $name
@return mixed
Resolve services factories callables by given token