you can replace this if statement with: 

    $maxValueWidth = min($maxValueWidth, $maxTerminalWidth - $maxParameterWidth - 1);