private function executeTableShowHeader(array $columns): void
  {
    $separator = '+';
    $header    = '|';

    foreach ($columns as $column)
    {
      $separator .= str_repeat('-', $column['length'] + 2).'+';
      $spaces    = ($column['length'] + 2) - mb_strlen((string)$column['header']);

      $spacesLeft  = (int)floor($spaces / 2);
      $spacesRight = (int)ceil($spaces / 2);

      $fillerLeft  = ($spacesLeft>0) ? str_repeat(' ', $spacesLeft) : '';
      $fillerRight = ($spacesRight>0) ? str_repeat(' ', $spacesRight) : '';

      $header .= $fillerLeft.$column['header'].$fillerRight.'|';
    }

    echo "\n", $separator, "\n";
    echo $header, "\n";
    echo $separator, "\n";
  }
private function executeTableShowHeader(array $columns): void
  {
    $separator = '+';
    $header    = '|';

    foreach ($columns as $column)
    {
      $separator .= str_repeat('-', $column['length'] + 2).'+';
      $spaces    = ($column['length'] + 2) - mb_strlen((string)$column['header']);

      $spacesLeft  = (int)floor($spaces / 2);
      $spacesRight = (int)ceil($spaces / 2);

      $fillerLeft  = ($spacesLeft>0) ? str_repeat(' ', $spacesLeft) : '';
      $fillerRight = ($spacesRight>0) ? str_repeat(' ', $spacesRight) : '';

      $header .= $fillerLeft.$column['header'].$fillerRight.'|';
    }

    echo "\n", $separator, "\n";
    echo $header, "\n";
    echo $separator, "\n";
  }
private function executeTableShowHeader ( array $ columns ) : void { $ separator = '+' ; $ header = '|' ; foreach ( $ columns as $ column ) { $ separator .= str_repeat ( '-' , $ column [ 'length' ] + 2 ) . '+' ; $ spaces = ( $ column [ 'length' ] + 2 ) - mb_strlen ( ( string ) $ column [ 'header' ] ) ; $ spacesLeft = ( int ) floor ( $ spaces / 2 ) ; $ spacesRight = ( int ) ceil ( $ spaces / 2 ) ; $ fillerLeft = ( $ spacesLeft > 0 ) ? str_repeat ( ' ' , $ spacesLeft ) : '' ; $ fillerRight = ( $ spacesRight > 0 ) ? str_repeat ( ' ' , $ spacesRight ) : '' ; $ header .= $ fillerLeft . $ column [ 'header' ] . $ fillerRight . '|' ; } echo "\n" , $ separator , "\n" ; echo $ header , "\n" ; echo $ separator , "\n" ; }
Helper method for method executeTable. Shows table header.

@param array $columns
Helper method for method executeTable . Shows table header .