Skip to content

Commit 6bfa943

Browse files
authored
Update CS (#4)
1 parent 5d67c18 commit 6bfa943

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

src/Constraint/XmlMatchesXsdForV5.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct($xsd)
4545
// replace first only
4646
$needle = 'http://www.w3.org/2001/xml.xsd';
4747
if (false !== $pos = strpos($xsd, $needle)) {
48-
$xsd = substr_replace($xsd, 'file:///'.str_replace('\\', '/', __DIR__).'/xml.xsd', $pos, strlen($needle));
48+
$xsd = substr_replace($xsd, 'file:///'.str_replace('\\', '/', __DIR__).'/xml.xsd', $pos, \strlen($needle));
4949
}
5050

5151
$this->xsd = $xsd;
@@ -64,16 +64,16 @@ public function toString()
6464
*/
6565
protected function failureDescription($other)
6666
{
67-
if (is_string($other)) {
67+
if (\is_string($other)) {
6868
return sprintf("%s %s.\n%s", $other, $this->toString(), implode("\n", $this->xmlConstraintErrors));
6969
}
7070

71-
if (is_object($other)) {
72-
$type = sprintf('%s#%s', get_class($other), method_exists($other, '__toString') ? $other->__toString() : '');
71+
if (\is_object($other)) {
72+
$type = sprintf('%s#%s', \get_class($other), method_exists($other, '__toString') ? $other->__toString() : '');
7373
} elseif (null === $other) {
7474
$type = 'null';
7575
} else {
76-
$type = gettype($other).'#'.$other;
76+
$type = \gettype($other).'#'.$other;
7777
}
7878

7979
return $type.' '.$this->toString();
@@ -84,7 +84,7 @@ protected function failureDescription($other)
8484
*/
8585
protected function matches($other)
8686
{
87-
return is_string($other)
87+
return \is_string($other)
8888
? $this->stringMatches($other)
8989
: false
9090
;
@@ -105,7 +105,7 @@ private function stringMatches($other)
105105
$dom->preserveWhiteSpace = false;
106106
$dom->validateOnParse = true;
107107

108-
if (!@$dom->loadXML($other, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
108+
if (!@$dom->loadXML($other, LIBXML_NONET | (\defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
109109
libxml_disable_entity_loader($disableEntities);
110110
$this->setXMLConstraintErrors();
111111
libxml_clear_errors();

src/Constraint/XmlMatchesXsdForV7.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct($xsd)
4141
// replace first only
4242
$needle = 'http://www.w3.org/2001/xml.xsd';
4343
if (false !== $pos = strpos($xsd, $needle)) {
44-
$xsd = substr_replace($xsd, 'file:///'.str_replace('\\', '/', __DIR__).'/xml.xsd', $pos, strlen($needle));
44+
$xsd = substr_replace($xsd, 'file:///'.str_replace('\\', '/', __DIR__).'/xml.xsd', $pos, \strlen($needle));
4545
}
4646

4747
$this->xsd = $xsd;
@@ -60,16 +60,16 @@ public function toString(): string
6060
*/
6161
protected function failureDescription($other): string
6262
{
63-
if (is_string($other)) {
63+
if (\is_string($other)) {
6464
return sprintf("%s %s.\n%s", $other, $this->toString(), implode("\n", $this->xmlConstraintErrors));
6565
}
6666

67-
if (is_object($other)) {
68-
$type = sprintf('%s#%s', get_class($other), method_exists($other, '__toString') ? $other->__toString() : '');
67+
if (\is_object($other)) {
68+
$type = sprintf('%s#%s', \get_class($other), method_exists($other, '__toString') ? $other->__toString() : '');
6969
} elseif (null === $other) {
7070
$type = 'null';
7171
} else {
72-
$type = gettype($other).'#'.$other;
72+
$type = \gettype($other).'#'.$other;
7373
}
7474

7575
return $type.' '.$this->toString();
@@ -80,7 +80,7 @@ protected function failureDescription($other): string
8080
*/
8181
protected function matches($other): bool
8282
{
83-
return is_string($other)
83+
return \is_string($other)
8484
? $this->stringMatches($other)
8585
: false
8686
;
@@ -101,7 +101,7 @@ private function stringMatches($other)
101101
$dom->preserveWhiteSpace = false;
102102
$dom->validateOnParse = true;
103103

104-
if (!@$dom->loadXML($other, LIBXML_NONET | (defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
104+
if (!@$dom->loadXML($other, LIBXML_NONET | (\defined('LIBXML_COMPACT') ? LIBXML_COMPACT : 0))) {
105105
libxml_disable_entity_loader($disableEntities);
106106
$this->setXMLConstraintErrors();
107107
libxml_clear_errors();

0 commit comments

Comments
 (0)