Skip to content

Commit

Permalink
replace PHP_EOL to \n
Browse files Browse the repository at this point in the history
  • Loading branch information
vjik committed Nov 27, 2023
1 parent 2eacd5c commit 81f2baf
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions src/BaseListView.php
Original file line number Diff line number Diff line change
Expand Up @@ -460,13 +460,13 @@ private function renderGrid(): string

return match ($this->withContainer) {

Check warning on line 461 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), }; } private function renderGridTable() : string

Check warning on line 461 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "MatchArmRemoval": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), }; } private function renderGridTable() : string
true => trim(
$contentGrid . PHP_EOL . Div::tag()
$contentGrid . "\n" . Div::tag()
->attributes($attributes)
->content(PHP_EOL . $this->renderGridTable() . PHP_EOL)
->content("\n" . $this->renderGridTable() . "\n")
->encode(false)
->render()
),
false => trim($contentGrid . PHP_EOL . $this->renderGridTable()),
false => trim($contentGrid . "\n" . $this->renderGridTable()),

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "Concat": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim("\n" . $contentGrid . $this->renderGridTable()), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim("\n" . $this->renderGridTable()), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim($contentGrid . $this->renderGridTable()), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "Concat": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim($contentGrid . $this->renderGridTable() . "\n"), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim($contentGrid . "\n"), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "UnwrapTrim": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => $contentGrid . "\n" . $this->renderGridTable(), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "Concat": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim("\n" . $contentGrid . $this->renderGridTable()), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim("\n" . $this->renderGridTable()), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim($contentGrid . $this->renderGridTable()), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "Concat": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim($contentGrid . $this->renderGridTable() . "\n"), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "ConcatOperandRemoval": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => trim($contentGrid . "\n"), }; } private function renderGridTable() : string

Check warning on line 469 in src/BaseListView.php

View workflow job for this annotation

GitHub Actions / mutation / PHP 8.1-ubuntu-latest

Escaped Mutant for Mutator "UnwrapTrim": --- Original +++ New @@ @@ } return match ($this->withContainer) { true => trim($contentGrid . "\n" . Div::tag()->attributes($attributes)->content("\n" . $this->renderGridTable() . "\n")->encode(false)->render()), - false => trim($contentGrid . "\n" . $this->renderGridTable()), + false => $contentGrid . "\n" . $this->renderGridTable(), }; } private function renderGridTable() : string
};
}

Expand Down
2 changes: 1 addition & 1 deletion src/Column/ActionColumnRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function (array $matches) use ($column, $buttons, $context): string {

return $cell
->addAttributes($column->bodyAttributes)
->content(PHP_EOL . $content . PHP_EOL)
->content("\n" . $content . "\n")
->encode(false);
}

Expand Down
4 changes: 2 additions & 2 deletions src/DetailView.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ private function renderItems(): string
]);
}

return implode(PHP_EOL, $rows);
return implode("\n", $rows);
}

private function renderValue(string $attribute, mixed $value): mixed
Expand Down Expand Up @@ -421,6 +421,6 @@ private function renderValue(string $attribute, mixed $value): mixed
*/
private function removeDoubleLinesBreaks(string $string): string
{
return preg_replace("/([\r\n]{4,}|[\n]{2,}|[\r]{2,})/", PHP_EOL, $string);
return preg_replace("/([\r\n]{4,}|[\n]{2,}|[\r]{2,})/", "\n", $string);
}
}
6 changes: 3 additions & 3 deletions src/GridView.php
Original file line number Diff line number Diff line change
Expand Up @@ -528,9 +528,9 @@ protected function renderItems(): string
: Html::tbody($this->tbodyAttributes)->rows(...$rows)->render();

return Html::tag('table', attributes: $this->tableAttributes)->open()
. PHP_EOL
. implode(PHP_EOL, $blocks)
. PHP_EOL
. "\n"
. implode("\n", $blocks)
. "\n"
. '</table>';
}

Expand Down
4 changes: 2 additions & 2 deletions src/KeysetPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public function render(): string
Nav::tag()
->attributes($attributes)
->content(
PHP_EOL .
"\n" .
Menu::widget()
->class($this->getMenuClass())
->items(array_filter($items))
->itemsContainerClass($this->getMenuItemContainerClass())
->linkClass($this->getMenuItemLinkClass()) .
PHP_EOL
"\n"
)
->encode(false)
->render();
Expand Down
2 changes: 1 addition & 1 deletion src/ListView.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected function renderItem(array|object $data, mixed $key, int $index): strin

return Div::tag()
->attributes($this->itemViewAttributes)
->content(PHP_EOL . $content)
->content("\n" . $content)
->encode(false)
->render();
}
Expand Down
4 changes: 2 additions & 2 deletions src/OffsetPagination.php
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,13 @@ public function render(): string
Nav::tag()
->attributes($attributes)
->content(
PHP_EOL .
"\n" .
Menu::widget()
->class($this->getMenuClass())
->items(array_filter($items))
->itemsContainerClass($this->getMenuItemContainerClass())
->linkClass($this->getMenuItemLinkClass()) .
PHP_EOL
"\n"
)
->encode(false)
->render();
Expand Down

0 comments on commit 81f2baf

Please sign in to comment.