diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index ab7733c..4272380 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,5 +1,10 @@ parameters: ignoreErrors: + - + message: "#^Add regex101\\.com link to that shows the regex in practise, so it will be easier to maintain in case of bug/extension in the future$#" + count: 1 + path: src/SapiStreamEmitter.php + - message: "#^Post operation are forbidden, as they make 2 values at the same line\\. Use pre instead$#" count: 1 diff --git a/src/SapiStreamEmitter.php b/src/SapiStreamEmitter.php index 3926d35..56cabde 100644 --- a/src/SapiStreamEmitter.php +++ b/src/SapiStreamEmitter.php @@ -24,7 +24,7 @@ */ final class SapiStreamEmitter extends AbstractSapiEmitter { - private const CONTENT_PATTERN = '/(?P[\w]+)\s+(?P\d+)-(?P\d+)\/(?P\d+|\*)/'; + private const CONTENT_PATTERN_REGEX = '/(?P[\w]+)\s+(?P\d+)-(?P\d+)\/(?P\d+|\*)/'; /** * Maximum output buffering size for each iteration. @@ -74,7 +74,7 @@ public function emit(ResponseInterface $response): void */ private function parseContentRange(string $header): ?array { - if (preg_match(self::CONTENT_PATTERN, $header, $matches) === 1) { + if (preg_match(self::CONTENT_PATTERN_REGEX, $header, $matches) === 1) { return [ (string) $matches['unit'], (int) $matches['first'], diff --git a/tests/SapiStreamEmitterTest.php b/tests/SapiStreamEmitterTest.php index d067ad3..05affb9 100644 --- a/tests/SapiStreamEmitterTest.php +++ b/tests/SapiStreamEmitterTest.php @@ -330,6 +330,7 @@ public function testEmitRangeStreamResponse( * @psalm-param null|array{0: int, 1: int} $rangeBlocks * * @dataProvider provideEmitMemoryUsageCases + * @runInSeparateProcess */ public function testEmitMemoryUsage( bool $seekable,