Skip to content

Commit a928762

Browse files
authored
Merge pull request #24 from ste101/patch-3
Remove PHP version check for pattern
2 parents be5c879 + 8110ad6 commit a928762

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

Classes/ResourceMatcher.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public function match(string $input): array
2828
}
2929
$matches = [];
3030
preg_match_all(
31-
$this->getPatternForCurrentPhpVersion(),
31+
$this->getPattern(),
3232
$input,
3333
$matches
3434
);
@@ -47,18 +47,11 @@ public function match(string $input): array
4747
/**
4848
* @return string
4949
*/
50-
protected function getPatternForCurrentPhpVersion(): string
50+
protected function getPattern(): string
5151
{
52-
if (version_compare(phpversion(), '7.3', '>')) {
53-
return '/<script[\/\s\w\-="]*src=' . $this->resourcePattern . '[^>]*>'
54-
. '|' .
55-
'<link[\/\s\w\-="]*href=' . $this->resourcePattern . '[^>]*>'
56-
. '/ui';
57-
} else {
58-
return '/<script[\/\s\w-="]*src=' . $this->resourcePattern . '[^>]*>'
59-
. '|' .
60-
'<link[\/\s\w-="]*href=' . $this->resourcePattern . '[^>]*>'
61-
. '/ui';
62-
}
52+
return '/<script[\/\s\w\-="]*src=' . $this->resourcePattern . '[^>]*>'
53+
. '|' .
54+
'<link[\/\s\w\-="]*href=' . $this->resourcePattern . '[^>]*>'
55+
. '/ui';
6356
}
6457
}

0 commit comments

Comments
 (0)