Skip to content

Commit

Permalink
chore: upgrade PHP CS Fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Feb 9, 2025
1 parent db3feb2 commit b41bc42
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dev-tools/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
6 changes: 3 additions & 3 deletions src/Constraint/XmlMatchesXsdForV5.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}
}
6 changes: 3 additions & 3 deletions src/Constraint/XmlMatchesXsdForV7.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}
}
6 changes: 3 additions & 3 deletions src/Constraint/XmlMatchesXsdForV8.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
}
}
2 changes: 1 addition & 1 deletion tests/Constraint/XmlMatchesXsdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] : ''
Expand Down

0 comments on commit b41bc42

Please sign in to comment.