Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 688
Zeile 113... Zeile 113...
113
        $count = \count($lines) - 1;
113
        $count = \count($lines) - 1;
114
        foreach ($lines as $i => $lineContent) {
114
        foreach ($lines as $i => $lineContent) {
115
            // re-add the line break (that has been removed in the above `explode()` for
115
            // re-add the line break (that has been removed in the above `explode()` for
116
            // - every line that is not the last line
116
            // - every line that is not the last line
117
            // - if $newline is required, also add it to the last line
117
            // - if $newline is required, also add it to the last line
-
 
118
            // - if it's not new line, but input ending with `\PHP_EOL`
118
            if ($i < $count || $newline) {
119
            if ($i < $count || $newline || str_ends_with($input, \PHP_EOL)) {
119
                $lineContent .= \PHP_EOL;
120
                $lineContent .= \PHP_EOL;
120
            }
121
            }
Zeile 121... Zeile 122...
121
 
122
 
122
            // skip line if there is no text (or newline for that matter)
123
            // skip line if there is no text (or newline for that matter)
Zeile 147... Zeile 148...
147
        $this->lines += $linesAdded;
148
        $this->lines += $linesAdded;
Zeile 148... Zeile 149...
148
 
149
 
149
        return $linesAdded;
150
        return $linesAdded;
Zeile -... Zeile 151...
-
 
151
    }
-
 
152
 
-
 
153
    /**
-
 
154
     * @internal
-
 
155
     */
-
 
156
    public function addNewLineOfInputSubmit()
-
 
157
    {
-
 
158
        $this->content[] = \PHP_EOL;
-
 
159
        ++$this->lines;
150
    }
160
    }
151
 
161
 
152
    protected function doWrite(string $message, bool $newline)
162
    protected function doWrite(string $message, bool $newline)
153
    {
163
    {