protected function getFormatter(XType $type)
    {
        $name = $type->getName();

        if (isset($this->formatterCache[$name])) {
            return $this->formatterCache[$name];
        }

        $class = get_class($type);

        if (isset($this->formatterCache[$class])) {
            return $this->formatterCache[$class];
        }

        if (isset($this->_extensions[$name])) {
            $this->formatterCache[$name] = $this->_extensions[$name];
            return $this->formatterCache[$name];
        }

        if ($extension = $this->nearestForClass($class)) {
            $this->formatterCache[$name] = $extension;
            $this->formatterCache[$class] = $extension;
            return $this->formatterCache[$name];
        }

        return $this->ownExtension;
    }
protected function getFormatter(XType $type)
    {
        $name = $type->getName();

        if (isset($this->formatterCache[$name])) {
            return $this->formatterCache[$name];
        }

        $class = get_class($type);

        if (isset($this->formatterCache[$class])) {
            return $this->formatterCache[$class];
        }

        if (isset($this->_extensions[$name])) {
            $this->formatterCache[$name] = $this->_extensions[$name];
            return $this->formatterCache[$name];
        }

        if ($extension = $this->nearestForClass($class)) {
            $this->formatterCache[$name] = $extension;
            $this->formatterCache[$class] = $extension;
            return $this->formatterCache[$name];
        }

        return $this->ownExtension;
    }
protected function getFormatter ( XType $ type ) { $ name = $ type -> getName ( ) ; if ( isset ( $ this -> formatterCache [ $ name ] ) ) { return $ this -> formatterCache [ $ name ] ; } $ class = get_class ( $ type ) ; if ( isset ( $ this -> formatterCache [ $ class ] ) ) { return $ this -> formatterCache [ $ class ] ; } if ( isset ( $ this -> _extensions [ $ name ] ) ) { $ this -> formatterCache [ $ name ] = $ this -> _extensions [ $ name ] ; return $ this -> formatterCache [ $ name ] ; } if ( $ extension = $ this -> nearestForClass ( $ class ) ) { $ this -> formatterCache [ $ name ] = $ extension ; $ this -> formatterCache [ $ class ] = $ extension ; return $ this -> formatterCache [ $ name ] ; } return $ this -> ownExtension ; }
Get the right formatter from extensions or itself.

@param XType $type

@return callable
Get the right formatter from extensions or itself .