public static function trimEmptyLines(array $lines) : array
    {
        for ($last = count($lines) - 1; $last > -1; $last--) {
            if (!empty($lines[$last])) {
                return $lines;
            }
            unset($lines[$last]);
        }
        return $lines;
    }
public static function trimEmptyLines(array $lines) : array
    {
        for ($last = count($lines) - 1; $last > -1; $last--) {
            if (!empty($lines[$last])) {
                return $lines;
            }
            unset($lines[$last]);
        }
        return $lines;
    }
public static function trimEmptyLines ( array $ lines ) : array { for ( $ last = count ( $ lines ) - 1 ; $ last > - 1 ; $ last -- ) { if ( ! empty ( $ lines [ $ last ] ) ) { return $ lines ; } unset ( $ lines [ $ last ] ) ; } return $ lines ; }
Remove empty entries at the end of an array.

@param  array $lines
@return array
Remove empty entries at the end of an array .