diff --git a/src/LocalDate.php b/src/LocalDate.php index a267b7a..fcc10b6 100644 --- a/src/LocalDate.php +++ b/src/LocalDate.php @@ -786,13 +786,13 @@ public function toISOString(): string { // This code is optimized for high performance return ($this->year < 1000 && $this->year > -1000 - ? ( - $this->year < 0 - ? '-' . str_pad((string) -$this->year, 4, '0', STR_PAD_LEFT) - : str_pad((string) $this->year, 4, '0', STR_PAD_LEFT) - ) - : $this->year + ? ( + $this->year < 0 + ? '-' . str_pad((string) -$this->year, 4, '0', STR_PAD_LEFT) + : str_pad((string) $this->year, 4, '0', STR_PAD_LEFT) ) + : $this->year + ) . '-' . ($this->month < 10 ? '0' . $this->month : $this->month) . '-' diff --git a/src/Month.php b/src/Month.php index b6dd5cc..c9e3955 100644 --- a/src/Month.php +++ b/src/Month.php @@ -9,7 +9,7 @@ /** * Represents a month-of-year such as January. */ -enum Month : int implements JsonSerializable +enum Month: int implements JsonSerializable { case JANUARY = 1; case FEBRUARY = 2; diff --git a/src/YearMonth.php b/src/YearMonth.php index 989b78a..be9524a 100644 --- a/src/YearMonth.php +++ b/src/YearMonth.php @@ -320,13 +320,13 @@ public function toISOString(): string { // This code is optimized for high performance return ($this->year < 1000 && $this->year > -1000 - ? ( - $this->year < 0 - ? '-' . str_pad((string) -$this->year, 4, '0', STR_PAD_LEFT) - : str_pad((string) $this->year, 4, '0', STR_PAD_LEFT) - ) - : $this->year + ? ( + $this->year < 0 + ? '-' . str_pad((string) -$this->year, 4, '0', STR_PAD_LEFT) + : str_pad((string) $this->year, 4, '0', STR_PAD_LEFT) ) + : $this->year + ) . '-' . ($this->month < 10 ? '0' . $this->month : $this->month); } diff --git a/src/YearWeek.php b/src/YearWeek.php index d6c190f..1f4427c 100644 --- a/src/YearWeek.php +++ b/src/YearWeek.php @@ -314,13 +314,13 @@ public function toISOString(): string { // This code is optimized for high performance return ($this->year < 1000 && $this->year > -1000 - ? ( - $this->year < 0 - ? '-' . str_pad((string) -$this->year, 4, '0', STR_PAD_LEFT) - : str_pad((string) $this->year, 4, '0', STR_PAD_LEFT) - ) - : $this->year + ? ( + $this->year < 0 + ? '-' . str_pad((string) -$this->year, 4, '0', STR_PAD_LEFT) + : str_pad((string) $this->year, 4, '0', STR_PAD_LEFT) ) + : $this->year + ) . '-W' . ($this->week < 10 ? '0' . $this->week : $this->week); } diff --git a/tools/ecs/composer.json b/tools/ecs/composer.json index c391767..1bb0fc2 100644 --- a/tools/ecs/composer.json +++ b/tools/ecs/composer.json @@ -1,8 +1,8 @@ { "require": { - "symplify/easy-coding-standard": "^10.3", - "slevomat/coding-standard": "^7.2", - "squizlabs/php_codesniffer": "^3.7" + "symplify/easy-coding-standard": "^12.1", + "slevomat/coding-standard": "^8.15", + "squizlabs/php_codesniffer": "^3.9" }, "config": { "allow-plugins": {