private function makeConstantStatements(): array
  {
    $width1    = 0;
    $width2    = 0;
    $constants = [];

    foreach ($this->constants as $constant => $value)
    {
      $width1 = max(mb_strlen($constant), $width1);
      $width2 = max(mb_strlen((string)$value), $width2);
    }

    $line_format = sprintf('  const %%-%ds = %%%dd;', $width1, $width2);
    foreach ($this->constants as $constant => $value)
    {
      $constants[] = sprintf($line_format, $constant, $value);
    }

    return $constants;
  }
private function makeConstantStatements(): array
  {
    $width1    = 0;
    $width2    = 0;
    $constants = [];

    foreach ($this->constants as $constant => $value)
    {
      $width1 = max(mb_strlen($constant), $width1);
      $width2 = max(mb_strlen((string)$value), $width2);
    }

    $line_format = sprintf('  const %%-%ds = %%%dd;', $width1, $width2);
    foreach ($this->constants as $constant => $value)
    {
      $constants[] = sprintf($line_format, $constant, $value);
    }

    return $constants;
  }
private function makeConstantStatements ( ) : array { $ width1 = 0 ; $ width2 = 0 ; $ constants = [ ] ; foreach ( $ this -> constants as $ constant => $ value ) { $ width1 = max ( mb_strlen ( $ constant ) , $ width1 ) ; $ width2 = max ( mb_strlen ( ( string ) $ value ) , $ width2 ) ; } $ line_format = sprintf ( '  const %%-%ds = %%%dd;' , $ width1 , $ width2 ) ; foreach ( $ this -> constants as $ constant => $ value ) { $ constants [ ] = sprintf ( $ line_format , $ constant , $ value ) ; } return $ constants ; }
Generates PHP code with constant declarations.

@return array The generated PHP code, lines are stored as rows in the array.
Generates PHP code with constant declarations .