File tree Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Expand file tree Collapse file tree 3 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -420,7 +420,7 @@ public function __toString() {
420420 $ unit = '% ' ;
421421 } elseif ( $ this ->type === self ::T_DIMENSION ) {
422422 $ unit = self ::escapeIdent ( $ this ->unit );
423- if ( strpos ( $ number , 'e ' ) === false && strpos ( $ number , 'E ' ) === false &&
423+ if ( ! str_contains ( $ number , 'e ' ) && ! str_contains ( $ number , 'E ' ) &&
424424 preg_match ( '/^[eE][+-]?\d/ ' , $ unit )
425425 ) {
426426 // Unit would look like exponential notation, so escape the leading "e"
Original file line number Diff line number Diff line change @@ -265,7 +265,7 @@ class Encoder {
265265 */
266266 public static function convert ( $ text , $ encodings = [] ) {
267267 // First, check for a BOM and honor that if it's present.
268- if ( strpos ( $ text , "\xef\xbb\xbf" ) === 0 ) {
268+ if ( str_starts_with ( $ text , "\xef\xbb\xbf" ) ) {
269269 // UTF-8 with BOM (convert it anyway in case the BOM is a lie)
270270 return self ::doConvert ( 'UTF-8 ' , substr ( $ text , 3 ) );
271271 }
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ public function urlstring( $type ) {
3131 $ key = __METHOD__ . ': ' . $ type ;
3232 if ( !isset ( $ this ->cache [$ key ] ) ) {
3333 $ this ->cache [$ key ] = new TokenMatcher ( Token::T_STRING , static function ( $ url ) use ( $ type ) {
34- return strpos ( $ url , $ type ) !== false ;
34+ return str_contains ( $ url , $ type );
3535 } );
3636 }
3737 return $ this ->cache [$ key ];
@@ -42,7 +42,7 @@ public function url( $type ) {
4242 $ key = __METHOD__ . ': ' . $ type ;
4343 if ( !isset ( $ this ->cache [$ key ] ) ) {
4444 $ this ->cache [$ key ] = new UrlMatcher ( static function ( $ url , $ modifiers ) use ( $ type ) {
45- return strpos ( $ url , $ type ) !== false ;
45+ return str_contains ( $ url , $ type );
4646 }, [
4747 'modifierMatcher ' => new Alternative ( [
4848 new KeywordMatcher ( [ 'x ' , 'y ' ] ),
You can’t perform that action at this time.
0 commit comments