src/Listeners/Renderer/Validations/GenericConsoleTableRenderer.php
/**
     * Renders the rows to the output, in that case as table to the console.
     *
     * @param array $rows            The rows to render
     * @param array $columnMaxWidths The array with the maximum column widths
     *
     * @return void
     */
Renders the rows to the output, in that case as table to the console.
@param array $rows            The rows to render
@param array $columnMaxWidths The array with the maximum column widths

@return void
Renders the rows to the output in that case as table to the console . @param array $rows The rows to render @param array $columnMaxWidths The array with the maximum column widths @return void
public function render(array $rows = array(), array $columnMaxWidths = array())
    {
        if (sizeof($rows) === 0) {
            return;
        }
        $rows = array_slice($rows, 0, $this->input->getOption(InputOptionKeysInterface::RENDER_VALIDATION_ISSUES));
        $table = new Table($this->output);
        $table->setHeaders(array_keys(current($rows)))->setRows($rows);
        foreach ($columnMaxWidths as $key => $width) {
            if (method_exists($table, $methodName = 'setColumnMaxWidth')) {
                call_user_func(array($table, $methodName), $key, $width);
            }
        }
        $table->render();
    }
public function render ( array $ rows = array ( ) , array $ columnMaxWidths = array ( ) ) { if ( sizeof ( $ rows ) === 0 ) { return ; } $ rows = array_slice ( $ rows , 0 , $ this -> input -> getOption ( InputOptionKeysInterface :: RENDER_VALIDATION_ISSUES ) ) ; $ table = new Table ( $ this -> output ) ; $ table -> setHeaders ( array_keys ( current ( $ rows ) ) ) -> setRows ( $ rows ) ; foreach ( $ columnMaxWidths as $ key => $ width ) { if ( method_exists ( $ table , $ methodName = 'setColumnMaxWidth' ) ) { call_user_func ( array ( $ table , $ methodName ) , $ key , $ width ) ; } } $ table -> render ( ) ; }
Renders the rows to the output, in that case as table to the console.
Renders the rows to the output in that case as table to the console .
// do nothing, if no validation error messages are available // slice the number of messages, that has to be rendered, out of the rows // initialize the console table/set the headers // set the column max width, if passed // this is because of the used symfony/console version which // can differ as a result of the Magento/PHP version used. // So the method setColumnMaxWidth() will be available up // from symfony/console version 4.2.0. // render the table