From b41bc4290eb7c30e487ce24b1760abf9e143810a Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Sun, 9 Feb 2025 22:55:53 +0100 Subject: [PATCH] chore: upgrade PHP CS Fixer --- dev-tools/composer.json | 4 ++-- src/Constraint/XmlMatchesXsdForV5.php | 6 +++--- src/Constraint/XmlMatchesXsdForV7.php | 6 +++--- src/Constraint/XmlMatchesXsdForV8.php | 6 +++--- tests/Constraint/XmlMatchesXsdTest.php | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/dev-tools/composer.json b/dev-tools/composer.json index 37ad8e7..ce71027 100644 --- a/dev-tools/composer.json +++ b/dev-tools/composer.json @@ -6,8 +6,8 @@ "ergebnis/composer-normalize": "*", "maglnet/composer-require-checker": "^3.8", "mi-schi/phpmd-extension": "^4.3", - "php-cs-fixer/shim": "^3.49.0", - "phpmd/phpmd": "^2.13" + "php-cs-fixer/shim": "^3.68.5", + "phpmd/phpmd": "^2.15" }, "config": { "allow-plugins": { diff --git a/src/Constraint/XmlMatchesXsdForV5.php b/src/Constraint/XmlMatchesXsdForV5.php index 18fbd39..b25bab5 100644 --- a/src/Constraint/XmlMatchesXsdForV5.php +++ b/src/Constraint/XmlMatchesXsdForV5.php @@ -59,11 +59,11 @@ public function toString() protected function failureDescription($other) { if (\is_string($other)) { - return sprintf("%s %s.\n%s", $other, $this->toString(), implode("\n", $this->xmlConstraintErrors)); + return \sprintf("%s %s.\n%s", $other, $this->toString(), implode("\n", $this->xmlConstraintErrors)); } if (\is_object($other)) { - $type = sprintf('%s#%s', \get_class($other), method_exists($other, '__toString') ? $other->__toString() : ''); + $type = \sprintf('%s#%s', \get_class($other), method_exists($other, '__toString') ? $other->__toString() : ''); } elseif (null === $other) { $type = 'null'; } else { @@ -129,7 +129,7 @@ private function setXMLConstraintErrors() $level = ''; } - $this->xmlConstraintErrors[] = sprintf('[%s%s] %s (line %d, column %d).', $level, $error->code, trim($error->message), $error->line, $error->column); + $this->xmlConstraintErrors[] = \sprintf('[%s%s] %s (line %d, column %d).', $level, $error->code, trim($error->message), $error->line, $error->column); } } } diff --git a/src/Constraint/XmlMatchesXsdForV7.php b/src/Constraint/XmlMatchesXsdForV7.php index cea09b7..707e7fb 100644 --- a/src/Constraint/XmlMatchesXsdForV7.php +++ b/src/Constraint/XmlMatchesXsdForV7.php @@ -55,11 +55,11 @@ public function toString(): string protected function failureDescription($other): string { if (\is_string($other)) { - return sprintf("%s %s.\n%s", $other, $this->toString(), implode("\n", $this->xmlConstraintErrors)); + return \sprintf("%s %s.\n%s", $other, $this->toString(), implode("\n", $this->xmlConstraintErrors)); } if (\is_object($other)) { - $type = sprintf('%s#%s', \get_class($other), method_exists($other, '__toString') ? $other->__toString() : ''); + $type = \sprintf('%s#%s', \get_class($other), method_exists($other, '__toString') ? $other->__toString() : ''); } elseif (null === $other) { $type = 'null'; } else { @@ -125,7 +125,7 @@ private function setXMLConstraintErrors() $level = ''; } - $this->xmlConstraintErrors[] = sprintf('[%s%s] %s (line %d, column %d).', $level, $error->code, trim($error->message), $error->line, $error->column); + $this->xmlConstraintErrors[] = \sprintf('[%s%s] %s (line %d, column %d).', $level, $error->code, trim($error->message), $error->line, $error->column); } } } diff --git a/src/Constraint/XmlMatchesXsdForV8.php b/src/Constraint/XmlMatchesXsdForV8.php index 749b987..9ab6e64 100644 --- a/src/Constraint/XmlMatchesXsdForV8.php +++ b/src/Constraint/XmlMatchesXsdForV8.php @@ -53,11 +53,11 @@ public function toString(): string protected function failureDescription($other): string { if (\is_string($other)) { - return sprintf("%s %s.\n%s", $other, $this->toString(), implode("\n", $this->xmlConstraintErrors)); + return \sprintf("%s %s.\n%s", $other, $this->toString(), implode("\n", $this->xmlConstraintErrors)); } if (\is_object($other)) { - $type = sprintf('%s#%s', \get_class($other), method_exists($other, '__toString') ? $other->__toString() : ''); + $type = \sprintf('%s#%s', \get_class($other), method_exists($other, '__toString') ? $other->__toString() : ''); } elseif (null === $other) { $type = 'null'; } else { @@ -123,7 +123,7 @@ private function setXMLConstraintErrors() $level = ''; } - $this->xmlConstraintErrors[] = sprintf('[%s%s] %s (line %d, column %d).', $level, $error->code, trim($error->message), $error->line, $error->column); + $this->xmlConstraintErrors[] = \sprintf('[%s%s] %s (line %d, column %d).', $level, $error->code, trim($error->message), $error->line, $error->column); } } } diff --git a/tests/Constraint/XmlMatchesXsdTest.php b/tests/Constraint/XmlMatchesXsdTest.php index 86f9a94..1128291 100644 --- a/tests/Constraint/XmlMatchesXsdTest.php +++ b/tests/Constraint/XmlMatchesXsdTest.php @@ -31,7 +31,7 @@ public function testAssertXMLMatchesXSD() if (false === $content) { $error = error_get_last(); - throw new \RuntimeException(sprintf( + throw new \RuntimeException(\sprintf( 'Failed to read content of the sample file "%s".%s', $content, $error ? ' '.$error['message'] : ''