original_string: public function validateSchema($command)
      {
          if ($command->option('schema')) {
              $definitions = $this->calibrateDefinitions($command->option('schema'));
  
              foreach ($definitions as $column) {
                  $columnDefinition = explode(':', $column);
                  if (!isset($columnDefinition[1])) {
                      throw new Exception('All schema columns require a column type.', 1);
                  }
  
                  $columnDetails = explode('|', $columnDefinition[1]);
  
                  preg_match('('.self::VALID_COLUMN_NAME_REGEX.')', $columnDetails[0], $columnDetailsType);
  
                  if (!in_array(camel_case($columnDetailsType[0]), $command->columnTypes)) {
                      throw new Exception($columnDetailsType[0].' is not in the array of valid column types: '.implode(', ', $command->columnTypes), 1);
                  }
              }
          }
  
          return true;
      }
code: public function validateSchema($command)
      {
          if ($command->option('schema')) {
              $definitions = $this->calibrateDefinitions($command->option('schema'));
  
              foreach ($definitions as $column) {
                  $columnDefinition = explode(':', $column);
                  if (!isset($columnDefinition[1])) {
                      throw new Exception('All schema columns require a column type.', 1);
                  }
  
                  $columnDetails = explode('|', $columnDefinition[1]);
  
                  preg_match('('.self::VALID_COLUMN_NAME_REGEX.')', $columnDetails[0], $columnDetailsType);
  
                  if (!in_array(camel_case($columnDetailsType[0]), $command->columnTypes)) {
                      throw new Exception($columnDetailsType[0].' is not in the array of valid column types: '.implode(', ', $command->columnTypes), 1);
                  }
              }
          }
  
          return true;
      }
code_tokens: public function validateSchema ( $ command ) { if ( $ command -> option ( 'schema' ) ) { $ definitions = $ this -> calibrateDefinitions ( $ command -> option ( 'schema' ) ) ; foreach ( $ definitions as $ column ) { $ columnDefinition = explode ( ':' , $ column ) ; if ( ! isset ( $ columnDefinition [ 1 ] ) ) { throw new Exception ( 'All schema columns require a column type.' , 1 ) ; } $ columnDetails = explode ( '|' , $ columnDefinition [ 1 ] ) ; preg_match ( '(' . self :: VALID_COLUMN_NAME_REGEX . ')' , $ columnDetails [ 0 ] , $ columnDetailsType ) ; if ( ! in_array ( camel_case ( $ columnDetailsType [ 0 ] ) , $ command -> columnTypes ) ) { throw new Exception ( $ columnDetailsType [ 0 ] . ' is not in the array of valid column types: ' . implode ( ', ' , $ command -> columnTypes ) , 1 ) ; } } } return true ; }
docstring: Validate the Schema.
  
  @param \Grafite\CrudMaker\Console\CrudMaker $command
  
  @return bool|Exception
docstring_tokens: Validate the Schema .