Skip to content

Commit b658e61

Browse files
authored
Merge pull request #91 from packagist/drop-composer-pcre-dependency
Remove single-use undeclared composer/pcre dependency with native preg_match
2 parents 73c1bdb + 86bbb14 commit b658e61

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

src/Api/AbstractApi.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
namespace PrivatePackagist\ApiClient\Api;
1111

12-
use Composer\Pcre\Preg;
1312
use PrivatePackagist\ApiClient\Client;
1413
use PrivatePackagist\ApiClient\HttpClient\Message\ResponseMediator;
1514

@@ -179,7 +178,7 @@ protected function createJsonBody(array $parameters)
179178
private function parseLinkHeader(string $header, string $type): ?string
180179
{
181180
foreach (explode(',', $header) as $relation) {
182-
if (Preg::isMatch('/<(.*)>; rel="(.*)"/i', \trim($relation, ','), $match)) {
181+
if (preg_match('/<(.*)>; rel="(.*)"/i', \trim($relation, ','), $match) === 1) {
183182
/** @var string[] $match */
184183
if (3 === count($match) && $match[2] === $type) {
185184
return $match[1];

0 commit comments

Comments
 (0)