original_string: 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
                      )
                  );
              }
          }
      }
code: 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
                      )
                  );
              }
          }
      }
code_tokens: 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 ) ) ; } } }
docstring: 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
docstring_tokens: Checks if the given value can be used as the block type name