RawLayoutBuilder.php
protected function validateBlockType($blockType)
    {
        if (!$blockType) {
            throw new Exception\InvalidArgumentException('The block type name must not be empty.');
        }
        if (!$blockType instanceof BlockTypeInterface) {
            if (!is_string($blockType)) {
                throw new Exception\UnexpectedTypeException($blockType, 'string or BlockTypeInterface', 'blockType');
            }
            if (!preg_match('/^[a-z][a-z0-9_]*$/iD', $blockType)) {
                throw new Exception\InvalidArgumentException(
                    sprintf(
                        'The "%s" string cannot be used as the name of the block type '
                        . 'because it contains illegal characters. '
                        . 'The valid block type name should start with a letter and only contain '
                        . 'letters, numbers and underscores ("_").',
                        $blockType
                    )
                );
            }
        }
    }
protected function validateBlockType($blockType)
    {
        if (!$blockType) {
            throw new Exception\InvalidArgumentException('The block type name must not be empty.');
        }
        if (!$blockType instanceof BlockTypeInterface) {
            if (!is_string($blockType)) {
                throw new Exception\UnexpectedTypeException($blockType, 'string or BlockTypeInterface', 'blockType');
            }
            if (!preg_match('/^[a-z][a-z0-9_]*$/iD', $blockType)) {
                throw new Exception\InvalidArgumentException(
                    sprintf(
                        'The "%s" string cannot be used as the name of the block type '
                        . 'because it contains illegal characters. '
                        . 'The valid block type name should start with a letter and only contain '
                        . 'letters, numbers and underscores ("_").',
                        $blockType
                    )
                );
            }
        }
    }
protected function validateBlockType ( $ blockType ) { if ( ! $ blockType ) { throw new Exception \ InvalidArgumentException ( 'The block type name must not be empty.' ) ; } if ( ! $ blockType instanceof BlockTypeInterface ) { if ( ! is_string ( $ blockType ) ) { throw new Exception \ UnexpectedTypeException ( $ blockType , 'string or BlockTypeInterface' , 'blockType' ) ; } if ( ! preg_match ( '/^[a-z][a-z0-9_]*$/iD' , $ blockType ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'The "%s" string cannot be used as the name of the block type ' . 'because it contains illegal characters. ' . 'The valid block type name should start with a letter and only contain ' . 'letters, numbers and underscores ("_").' , $ blockType ) ) ; } } }
Checks if the given value can be used as the block type name

@param string|BlockTypeInterface $blockType The block type

@throws Exception\InvalidArgumentException if the block type name is not valid
Checks if the given value can be used as the block type name