src/Styling.php
public function setClass($type, $cls)
    {
        if (!isset($this->cls[$type])) {
            throw new \InvalidArgumentException('Invalid type');
        }
        if (!is_string($cls)) {
            throw new \InvalidArgumentException(
                'Expected a string for the class'
            );
        }
        if (!class_exists($cls)) {
            throw new \InvalidArgumentException('Class not found');
        }
        if (!($cls instanceof \Erebot\Styling\VariableInterface)) {
            throw new \InvalidArgumentException(
                'Must be a subclass of \\Erebot\\Styling\\VariableInterface'
            );
        }
        $this->cls[$type] = $cls;
    }
public function setClass($type, $cls)
    {
        if (!isset($this->cls[$type])) {
            throw new \InvalidArgumentException('Invalid type');
        }
        if (!is_string($cls)) {
            throw new \InvalidArgumentException(
                'Expected a string for the class'
            );
        }
        if (!class_exists($cls)) {
            throw new \InvalidArgumentException('Class not found');
        }
        if (!($cls instanceof \Erebot\Styling\VariableInterface)) {
            throw new \InvalidArgumentException(
                'Must be a subclass of \\Erebot\\Styling\\VariableInterface'
            );
        }
        $this->cls[$type] = $cls;
    }
public function setClass ( $ type , $ cls ) { if ( ! isset ( $ this -> cls [ $ type ] ) ) { throw new \ InvalidArgumentException ( 'Invalid type' ) ; } if ( ! is_string ( $ cls ) ) { throw new \ InvalidArgumentException ( 'Expected a string for the class' ) ; } if ( ! class_exists ( $ cls ) ) { throw new \ InvalidArgumentException ( 'Class not found' ) ; } if ( ! ( $ cls instanceof \ Erebot \ Styling \ VariableInterface ) ) { throw new \ InvalidArgumentException ( 'Must be a subclass of \\Erebot\\Styling\\VariableInterface' ) ; } $ this -> cls [ $ type ] = $ cls ; }
Sets the class to use to wrap a certain scalar type.

\param string $type
Name of a scalar type that can be wrapped
by this class automatically. Must be one
of "int", "string" or "float".

\param string $cls
Name of the class that can be used to wrap
variables of the given type.
Sets the class to use to wrap a certain scalar type .