@@ -41,7 +41,7 @@ public function __construct($xsd)
41
41
// replace first only
42
42
$ needle = 'http://www.w3.org/2001/xml.xsd ' ;
43
43
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 ));
45
45
}
46
46
47
47
$ this ->xsd = $ xsd ;
@@ -60,16 +60,16 @@ public function toString(): string
60
60
*/
61
61
protected function failureDescription ($ other ): string
62
62
{
63
- if (is_string ($ other )) {
63
+ if (\ is_string ($ other )) {
64
64
return sprintf ("%s %s. \n%s " , $ other , $ this ->toString (), implode ("\n" , $ this ->xmlConstraintErrors ));
65
65
}
66
66
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 () : '' );
69
69
} elseif (null === $ other ) {
70
70
$ type = 'null ' ;
71
71
} else {
72
- $ type = gettype ($ other ).'# ' .$ other ;
72
+ $ type = \ gettype ($ other ).'# ' .$ other ;
73
73
}
74
74
75
75
return $ type .' ' .$ this ->toString ();
@@ -80,7 +80,7 @@ protected function failureDescription($other): string
80
80
*/
81
81
protected function matches ($ other ): bool
82
82
{
83
- return is_string ($ other )
83
+ return \ is_string ($ other )
84
84
? $ this ->stringMatches ($ other )
85
85
: false
86
86
;
@@ -101,7 +101,7 @@ private function stringMatches($other)
101
101
$ dom ->preserveWhiteSpace = false ;
102
102
$ dom ->validateOnParse = true ;
103
103
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 ))) {
105
105
libxml_disable_entity_loader ($ disableEntities );
106
106
$ this ->setXMLConstraintErrors ();
107
107
libxml_clear_errors ();
0 commit comments