public function setDefault($default)
    {
        switch ($this->type) {
            case self::TYPE_STRING:
                if (!\is_string($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a string');
                }

                break;
            case self::TYPE_NUMBER:
                if (!\is_numeric($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a number');
                }

                break;
            case self::TYPE_INTEGER:
                if (!\is_numeric($default) || (int) $default != $default) {
                    throw new \InvalidArgumentException('Default parameter is not an integer');
                }

                break;
            case self::TYPE_DATE:
                if (!$default instanceof \DateTimeImmutable) {
                    throw new \InvalidArgumentException('Default parameter is not a dateTime object');
                }

                break;
            case self::TYPE_BOOLEAN:
                if (!\is_bool($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a boolean');
                }

                break;
            case self::TYPE_FILE:
                throw new \InvalidArgumentException('A default value cannot be set for a file');

                break;
        }

        $this->default = $default;
    }
public function setDefault($default)
    {
        switch ($this->type) {
            case self::TYPE_STRING:
                if (!\is_string($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a string');
                }

                break;
            case self::TYPE_NUMBER:
                if (!\is_numeric($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a number');
                }

                break;
            case self::TYPE_INTEGER:
                if (!\is_numeric($default) || (int) $default != $default) {
                    throw new \InvalidArgumentException('Default parameter is not an integer');
                }

                break;
            case self::TYPE_DATE:
                if (!$default instanceof \DateTimeImmutable) {
                    throw new \InvalidArgumentException('Default parameter is not a dateTime object');
                }

                break;
            case self::TYPE_BOOLEAN:
                if (!\is_bool($default)) {
                    throw new \InvalidArgumentException('Default parameter is not a boolean');
                }

                break;
            case self::TYPE_FILE:
                throw new \InvalidArgumentException('A default value cannot be set for a file');

                break;
        }

        $this->default = $default;
    }
public function setDefault ( $ default ) { switch ( $ this -> type ) { case self :: TYPE_STRING : if ( ! \ is_string ( $ default ) ) { throw new \ InvalidArgumentException ( 'Default parameter is not a string' ) ; } break ; case self :: TYPE_NUMBER : if ( ! \ is_numeric ( $ default ) ) { throw new \ InvalidArgumentException ( 'Default parameter is not a number' ) ; } break ; case self :: TYPE_INTEGER : if ( ! \ is_numeric ( $ default ) || ( int ) $ default != $ default ) { throw new \ InvalidArgumentException ( 'Default parameter is not an integer' ) ; } break ; case self :: TYPE_DATE : if ( ! $ default instanceof \ DateTimeImmutable ) { throw new \ InvalidArgumentException ( 'Default parameter is not a dateTime object' ) ; } break ; case self :: TYPE_BOOLEAN : if ( ! \ is_bool ( $ default ) ) { throw new \ InvalidArgumentException ( 'Default parameter is not a boolean' ) ; } break ; case self :: TYPE_FILE : throw new \ InvalidArgumentException ( 'A default value cannot be set for a file' ) ; break ; } $ this -> default = $ default ; }
Set the default


@throws \InvalidArgumentException
Set the default