[web-php] master: Enhancement: Enable and configure `increment_style` fixer
| From: | Andreas Möller via GitHub | Date: | Mon, 12 Sep 2022 13:35:47 +0000 |
| Subject: | [web-php] master: Enhancement: Enable and configure `increment_style` fixer | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-30543@lists.php.net to get a copy of this message | ||
Author: Andreas Möller (localheinz)
Committer: GitHub (web-flow)
Pusher: cmb69
Date: 2022-09-12T15:27:05+02:00
Commit: https://github.com/php/web-php/commit/2ae10ff262f2e35b4cf36a7cc8b348c0538d9d74
Raw diff: https://github.com/php/web-php/commit/2ae10ff262f2e35b4cf36a7cc8b348c0538d9d74.diff
Enhancement: Enable and configure
increment_style fixer
Co-authored-by: Mathias Reker <mathias@reker.dk>
Closes GH-698.
Changed paths:
M .php-cs-fixer.php
M include/layout.inc
M src/News/Entry.php
Diff:
diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php
index 42c7e609c..22a9275ef 100644
--- a/.php-cs-fixer.php
+++ b/.php-cs-fixer.php
@@ -27,6 +27,9 @@
'spacing' => 'one',
],
'constant_case' => true,
+ 'increment_style' => [
+ 'style' => 'post',
+ ],
'indentation_type' => true,
'line_ending' => true,
'no_extra_blank_lines' => true,
diff --git a/include/layout.inc b/include/layout.inc
index acf9f27f2..27e2aa8fa 100644
--- a/include/layout.inc
+++ b/include/layout.inc
@@ -404,7 +404,7 @@ function print_news($news, $dog, $max = 5, $onlyyear = null, $return = false) {
foreach ($item["category"] as $category) {
if (is_null($dog) || in_array($category["term"], (array)$dog, true)) {
$ok = true;
- ++$count;
+ $count++;
break;
}
}
diff --git a/src/News/Entry.php b/src/News/Entry.php
index e2923a670..838a56a2b 100755
--- a/src/News/Entry.php
+++ b/src/News/Entry.php
@@ -183,7 +183,7 @@ private static function selectNextId(): string {
$filename = date("Y-m-d", $_SERVER["REQUEST_TIME"]);
$count = 0;
do {
- ++$count;
+ $count++;
$id = $filename . "-" . $count;
$basename = "{$id}.xml";
} while (file_exists(self::ARCHIVE_ENTRIES_ABS . $basename));