public function getName($type)
    {
        $ref = new \ReflectionClass($this);
        foreach ($ref->getConstants() as $name => $value) {
            if ($value === $type) {
                return $name;
            }
        }

        throw new \InvalidArgumentException(sprintf('There is no token with value %s.', json_encode($type)));
    }
public function getName($type)
    {
        $ref = new \ReflectionClass($this);
        foreach ($ref->getConstants() as $name => $value) {
            if ($value === $type) {
                return $name;
            }
        }

        throw new \InvalidArgumentException(sprintf('There is no token with value %s.', json_encode($type)));
    }
public function getName ( $ type ) { $ ref = new \ ReflectionClass ( $ this ) ; foreach ( $ ref -> getConstants ( ) as $ name => $ value ) { if ( $ value === $ type ) { return $ name ; } } throw new \ InvalidArgumentException ( sprintf ( 'There is no token with value %s.' , json_encode ( $ type ) ) ) ; }
Returns the name of the given token.

@param integer $type

@return string
Returns the name of the given token .