private function validateParameterLists(): void
  {
    // Make list with names of parameters used in database.
    $database_parameters_names = [];
    foreach ($this->parameters as $parameter_info)
    {
      $database_parameters_names[] = $parameter_info['parameter_name'];
    }

    // Make list with names of parameters used in dock block of routine.
    $doc_block_parameters_names = [];
    if (isset($this->docBlockPartsSource['parameters']))
    {
      foreach ($this->docBlockPartsSource['parameters'] as $parameter)
      {
        $doc_block_parameters_names[] = $parameter['name'];
      }
    }

    // Check and show warning if any parameters is missing in doc block.
    $tmp = array_diff($database_parameters_names, $doc_block_parameters_names);
    foreach ($tmp as $name)
    {
      $this->io->logNote('Parameter <dbo>%s</dbo> is missing from doc block', $name);
    }

    // Check and show warning if find unknown parameters in doc block.
    $tmp = array_diff($doc_block_parameters_names, $database_parameters_names);
    foreach ($tmp as $name)
    {
      $this->io->logNote('Unknown parameter <dbo>%s</dbo> found in doc block', $name);
    }
  }
private function validateParameterLists(): void
  {
    // Make list with names of parameters used in database.
    $database_parameters_names = [];
    foreach ($this->parameters as $parameter_info)
    {
      $database_parameters_names[] = $parameter_info['parameter_name'];
    }

    // Make list with names of parameters used in dock block of routine.
    $doc_block_parameters_names = [];
    if (isset($this->docBlockPartsSource['parameters']))
    {
      foreach ($this->docBlockPartsSource['parameters'] as $parameter)
      {
        $doc_block_parameters_names[] = $parameter['name'];
      }
    }

    // Check and show warning if any parameters is missing in doc block.
    $tmp = array_diff($database_parameters_names, $doc_block_parameters_names);
    foreach ($tmp as $name)
    {
      $this->io->logNote('Parameter <dbo>%s</dbo> is missing from doc block', $name);
    }

    // Check and show warning if find unknown parameters in doc block.
    $tmp = array_diff($doc_block_parameters_names, $database_parameters_names);
    foreach ($tmp as $name)
    {
      $this->io->logNote('Unknown parameter <dbo>%s</dbo> found in doc block', $name);
    }
  }
private function validateParameterLists ( ) : void { // Make list with names of parameters used in database. $ database_parameters_names = [ ] ; foreach ( $ this -> parameters as $ parameter_info ) { $ database_parameters_names [ ] = $ parameter_info [ 'parameter_name' ] ; } // Make list with names of parameters used in dock block of routine. $ doc_block_parameters_names = [ ] ; if ( isset ( $ this -> docBlockPartsSource [ 'parameters' ] ) ) { foreach ( $ this -> docBlockPartsSource [ 'parameters' ] as $ parameter ) { $ doc_block_parameters_names [ ] = $ parameter [ 'name' ] ; } } // Check and show warning if any parameters is missing in doc block. $ tmp = array_diff ( $ database_parameters_names , $ doc_block_parameters_names ) ; foreach ( $ tmp as $ name ) { $ this -> io -> logNote ( 'Parameter <dbo>%s</dbo> is missing from doc block' , $ name ) ; } // Check and show warning if find unknown parameters in doc block. $ tmp = array_diff ( $ doc_block_parameters_names , $ database_parameters_names ) ; foreach ( $ tmp as $ name ) { $ this -> io -> logNote ( 'Unknown parameter <dbo>%s</dbo> found in doc block' , $ name ) ; } }
Validates the parameters found the DocBlock in the source of the stored routine against the parameters from the
metadata of MySQL and reports missing and unknown parameters names.
Validates the parameters found the DocBlock in the source of the stored routine against the parameters from the metadata of MySQL and reports missing and unknown parameters names .