$ composer update #142
Annotations
39 errors and 66 warnings
runs-on (ubuntu-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L50
BaseQueryTest.php: The method testReOrderNestedPosts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (ElseExpression, Clean Code Rules)
|
runs-on (ubuntu-latest) / phpmd
Process completed with exit code 2.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L37
BatchTableSQLGenerator.php: property.notFound: Access to an undefined property App\Eloquent\Model\Forum::$fid.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L38
BatchTableSQLGenerator.php: argument.type: Parameter #3 $subject of function str_replace expects array|string, mixed given.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L45
BatchTableSQLGenerator.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Connection::statement().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L25
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\Post\Reply>::whereBetween().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::groupBy().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::selectRaw().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::whereIn().
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L42
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (ubuntu-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L63
GenerateBilibiliVote.php: method.notFound: Call to an undefined method App\Eloquent\Model\BilibiliVote::chunkInsertOnDuplicate().
|
runs-on (ubuntu-latest) / psalm
Process completed with exit code 2.
|
runs-on (windows-latest) / psalm
Process completed with exit code 127.
|
runs-on (windows-latest) / phpmd:
be/tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L50
BaseQueryTest.php: The method testReOrderNestedPosts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (ElseExpression, Clean Code Rules)
|
runs-on (windows-latest) / phpmd
Process completed with exit code 2.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L37
BatchTableSQLGenerator.php: property.notFound: Access to an undefined property App\Eloquent\Model\Forum::$fid.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L38
BatchTableSQLGenerator.php: argument.type: Parameter #3 $subject of function str_replace expects array|string, mixed given.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L45
BatchTableSQLGenerator.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Connection::statement().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L25
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\Post\Reply>::whereBetween().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::groupBy().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::selectRaw().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::whereIn().
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L42
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (windows-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L63
GenerateBilibiliVote.php: method.notFound: Call to an undefined method App\Eloquent\Model\BilibiliVote::chunkInsertOnDuplicate().
|
runs-on (macos-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L50
BaseQueryTest.php: The method testReOrderNestedPosts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. (ElseExpression, Clean Code Rules)
|
runs-on (macos-latest) / phpmd
Process completed with exit code 2.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L37
BatchTableSQLGenerator.php: property.notFound: Access to an undefined property App\Eloquent\Model\Forum::$fid.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L38
BatchTableSQLGenerator.php: argument.type: Parameter #3 $subject of function str_replace expects array|string, mixed given.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L45
BatchTableSQLGenerator.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Connection::statement().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/BatchTableSQLGenerator.php#L46
BatchTableSQLGenerator.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L25
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\Post\Reply>::whereBetween().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::groupBy().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::selectRaw().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L31
GenerateBilibiliVote.php: staticMethod.dynamicCall: Dynamic call to static method Illuminate\Database\Eloquent\Builder<App\Eloquent\Model\BilibiliVote>::whereIn().
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L42
GenerateBilibiliVote.php: nullCoalesce.expr: Expression on left side of ?? is not nullable.
|
runs-on (macos-latest) / phpstan:
app/Console/Commands/GenerateBilibiliVote.php#L63
GenerateBilibiliVote.php: method.notFound: Call to an undefined method App\Eloquent\Model\BilibiliVote::chunkInsertOnDuplicate().
|
runs-on (macos-latest) / psalm
Process completed with exit code 2.
|
runs-on (ubuntu-latest) / php-cs-fixer
Cache save failed.
|
runs-on (ubuntu-latest) / pint
Cache save failed.
|
runs-on (ubuntu-latest) / phpmd
Cache save failed.
|
runs-on (ubuntu-latest) / phpmd:
app/Http/Controllers/PostsQuery.php#L18
PostsQuery.php: The class PostsQuery has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13. (CouplingBetweenObjects, Design Rules)
|
runs-on (ubuntu-latest) / phpmd:
app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (ubuntu-latest) / phpmd:
app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has an NPath complexity of 400. The configured NPath complexity threshold is 200. (NPathComplexity, Code Size Rules)
|
runs-on (ubuntu-latest) / phpmd:
app/Http/PostsQuery/SearchQuery.php#L53
SearchQuery.php: The method applyQueryParamsOnQuery() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (ubuntu-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L55
BaseQueryTest.php: The method provideReOrderNestedPostsData() has 168 lines of code. Current threshold is set to 100. Avoid really long methods. (ExcessiveMethodLength, Code Size Rules)
|
runs-on (ubuntu-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/ParamsValidatorTest.php#L17
ParamsValidatorTest.php: The class ParamsValidatorTest has 11 public methods. Consider refactoring ParamsValidatorTest to keep number of public methods under 10. (TooManyPublicMethods, Code Size Rules)
|
runs-on (ubuntu-latest) / phpstan
Cache save failed.
|
runs-on (ubuntu-latest) / psalm
Cache save failed.
|
runs-on (windows-latest) / pint
Cache save failed.
|
runs-on (ubuntu-latest) / phpunit-infection
Cache save failed.
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L281
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
// use the topmost value between sorting key or value of orderBy field within its child posts
$curAndChildSortingKeys = collect([
// value of orderBy field in the first sorted child post that isMatchQuery after previous sorting
- $childPosts->filter(static fn(Collection $p) => ($p['isMatchQuery'] ?? true) === true)->first()[$this->orderByField] ?? null,
+ $childPosts->filter(static fn(Collection $p) => (true ?? $p['isMatchQuery']) === true)->first()[$this->orderByField] ?? null,
// sorting key from the first sorted child posts
// not requiring isMatchQuery since a child post without isMatchQuery
// might have its own child posts with isMatchQuery
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L33
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
return '0';
}
$prefix = match (true) {
- \is_int($cursor) && $cursor < 0 => '-',
+ \is_int($cursor) && $cursor <= 0 => '-',
\is_string($cursor) => 'S',
default => '',
};
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L40
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
\is_string($cursor) => 'S',
default => '',
};
- $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor >= 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
+ $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor > 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
if ($prefix !== 'S') {
// https://en.wikipedia.org/wiki/Base64#URL_applications
$value = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($value));
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L75
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* @var string $cursor
* @var string $prefix
*/
- [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 2, null);
+ [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 3, null);
if ($cursor === null) {
// no prefix being provided means the value of cursor is a positive int
$cursor = $prefix;
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L82
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// keep 0 as is
'S' => $cursor,
// string literal is not base64 encoded
- default => ((array) unpack(format: 'P', string: str_pad(
+ default => unpack(format: 'P', string: str_pad(
// re-add removed trailing 0x00 or 0xFF
base64_decode(
// https://en.wikipedia.org/wiki/Base64#URL_applications
@@ @@
),
length: 8,
pad_string: $prefix === '-' ? "\xff" : "\x00"
- )))[1],
+ ))[1],
};
})->chunk(2)->map(static fn(Collection $i) => $i->values()))->mapWithKeys(fn(Collection $cursors, string $postType) => [$postType => $cursors->mapWithKeys(fn(int|string|null $cursor, int $index) => [$index === 0 ? Helper::POST_TYPE_TO_ID[$postType] : $orderByField => $cursor])])->reject(static fn(Collection $cursors) => $cursors->every(static fn(int|string|null $cursor) => $cursor === null))->map(static fn(Collection $cursors) => new Cursor($cursors->toArray()));
}
}
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L90
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
// https://en.wikipedia.org/wiki/Base64#URL_applications
str_replace(['-', '_'], ['+', '/'], $cursor)
),
- length: 8,
+ length: 9,
pad_string: $prefix === '-' ? "\xff" : "\x00"
)))[1],
};
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L28
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function addDefaultParamsThenValidate(bool $shouldSkip40003) : void
{
- $this->params->addDefaultValueOnParams();
+
$this->params->addDefaultValueOnUniqueParams();
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L29
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function addDefaultParamsThenValidate(bool $shouldSkip40003) : void
{
$this->params->addDefaultValueOnParams();
- $this->params->addDefaultValueOnUniqueParams();
+
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
$this->params->setUniqueParamValue('postTypes', $sortedPostTypes);
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L33
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
$this->params->setUniqueParamValue('postTypes', $sortedPostTypes);
- $currentPostTypes = (array) $this->params->getUniqueParamValue('postTypes');
+ $currentPostTypes = $this->params->getUniqueParamValue('postTypes');
if (!$shouldSkip40003) {
$this->validate40003($currentPostTypes);
}
|
runs-on (ubuntu-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L37
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
if (!$shouldSkip40003) {
$this->validate40003($currentPostTypes);
}
- $this->validate40004($currentPostTypes);
+
}
private function validateParamsValue(array $params) : void
{
|
runs-on (windows-latest) / php-cs-fixer
Cache save failed.
|
runs-on (windows-latest) / phpcs
Cache save failed.
|
runs-on (windows-latest) / phpmd
Cache save failed.
|
runs-on (windows-latest) / phpmd:
be/app/Http/Controllers/PostsQuery.php#L18
PostsQuery.php: The class PostsQuery has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13. (CouplingBetweenObjects, Design Rules)
|
runs-on (windows-latest) / phpmd:
be/app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (windows-latest) / phpmd:
be/app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has an NPath complexity of 400. The configured NPath complexity threshold is 200. (NPathComplexity, Code Size Rules)
|
runs-on (windows-latest) / phpmd:
be/app/Http/PostsQuery/SearchQuery.php#L53
SearchQuery.php: The method applyQueryParamsOnQuery() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (windows-latest) / phpmd:
be/tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L55
BaseQueryTest.php: The method provideReOrderNestedPostsData() has 168 lines of code. Current threshold is set to 100. Avoid really long methods. (ExcessiveMethodLength, Code Size Rules)
|
runs-on (windows-latest) / phpmd:
be/tests/Feature/App/Http/PostsQuery/ParamsValidatorTest.php#L17
ParamsValidatorTest.php: The class ParamsValidatorTest has 11 public methods. Consider refactoring ParamsValidatorTest to keep number of public methods under 10. (TooManyPublicMethods, Code Size Rules)
|
runs-on (macos-latest) / phpcs
Cache save failed.
|
runs-on (windows-latest) / phpstan
Cache save failed.
|
runs-on (macos-latest) / phpmd
Cache save failed.
|
runs-on (macos-latest) / phpmd:
app/Http/Controllers/PostsQuery.php#L18
PostsQuery.php: The class PostsQuery has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13. (CouplingBetweenObjects, Design Rules)
|
runs-on (macos-latest) / phpmd:
app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has a Cyclomatic Complexity of 13. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (macos-latest) / phpmd:
app/Http/PostsQuery/IndexQuery.php#L17
IndexQuery.php: The method query() has an NPath complexity of 400. The configured NPath complexity threshold is 200. (NPathComplexity, Code Size Rules)
|
runs-on (macos-latest) / phpmd:
app/Http/PostsQuery/SearchQuery.php#L53
SearchQuery.php: The method applyQueryParamsOnQuery() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10. (CyclomaticComplexity, Code Size Rules)
|
runs-on (macos-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/BaseQueryTest.php#L55
BaseQueryTest.php: The method provideReOrderNestedPostsData() has 168 lines of code. Current threshold is set to 100. Avoid really long methods. (ExcessiveMethodLength, Code Size Rules)
|
runs-on (macos-latest) / phpmd:
tests/Feature/App/Http/PostsQuery/ParamsValidatorTest.php#L17
ParamsValidatorTest.php: The class ParamsValidatorTest has 11 public methods. Consider refactoring ParamsValidatorTest to keep number of public methods under 10. (TooManyPublicMethods, Code Size Rules)
|
runs-on (macos-latest) / php-cs-fixer
Cache save failed.
|
runs-on (macos-latest) / phpunit-infection
Cache save failed.
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L281
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
// use the topmost value between sorting key or value of orderBy field within its child posts
$curAndChildSortingKeys = collect([
// value of orderBy field in the first sorted child post that isMatchQuery after previous sorting
- $childPosts->filter(static fn(Collection $p) => ($p['isMatchQuery'] ?? true) === true)->first()[$this->orderByField] ?? null,
+ $childPosts->filter(static fn(Collection $p) => (true ?? $p['isMatchQuery']) === true)->first()[$this->orderByField] ?? null,
// sorting key from the first sorted child posts
// not requiring isMatchQuery since a child post without isMatchQuery
// might have its own child posts with isMatchQuery
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L33
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
return '0';
}
$prefix = match (true) {
- \is_int($cursor) && $cursor < 0 => '-',
+ \is_int($cursor) && $cursor <= 0 => '-',
\is_string($cursor) => 'S',
default => '',
};
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L40
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
\is_string($cursor) => 'S',
default => '',
};
- $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor >= 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
+ $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor > 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
if ($prefix !== 'S') {
// https://en.wikipedia.org/wiki/Base64#URL_applications
$value = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($value));
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L75
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* @var string $cursor
* @var string $prefix
*/
- [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 2, null);
+ [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 3, null);
if ($cursor === null) {
// no prefix being provided means the value of cursor is a positive int
$cursor = $prefix;
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L82
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// keep 0 as is
'S' => $cursor,
// string literal is not base64 encoded
- default => ((array) unpack(format: 'P', string: str_pad(
+ default => unpack(format: 'P', string: str_pad(
// re-add removed trailing 0x00 or 0xFF
base64_decode(
// https://en.wikipedia.org/wiki/Base64#URL_applications
@@ @@
),
length: 8,
pad_string: $prefix === '-' ? "\xff" : "\x00"
- )))[1],
+ ))[1],
};
})->chunk(2)->map(static fn(Collection $i) => $i->values()))->mapWithKeys(fn(Collection $cursors, string $postType) => [$postType => $cursors->mapWithKeys(fn(int|string|null $cursor, int $index) => [$index === 0 ? Helper::POST_TYPE_TO_ID[$postType] : $orderByField => $cursor])])->reject(static fn(Collection $cursors) => $cursors->every(static fn(int|string|null $cursor) => $cursor === null))->map(static fn(Collection $cursors) => new Cursor($cursors->toArray()));
}
}
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L90
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
// https://en.wikipedia.org/wiki/Base64#URL_applications
str_replace(['-', '_'], ['+', '/'], $cursor)
),
- length: 8,
+ length: 9,
pad_string: $prefix === '-' ? "\xff" : "\x00"
)))[1],
};
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L28
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function addDefaultParamsThenValidate(bool $shouldSkip40003) : void
{
- $this->params->addDefaultValueOnParams();
+
$this->params->addDefaultValueOnUniqueParams();
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L29
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function addDefaultParamsThenValidate(bool $shouldSkip40003) : void
{
$this->params->addDefaultValueOnParams();
- $this->params->addDefaultValueOnUniqueParams();
+
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
$this->params->setUniqueParamValue('postTypes', $sortedPostTypes);
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L32
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
$this->params->addDefaultValueOnUniqueParams();
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
- $this->params->setUniqueParamValue('postTypes', $sortedPostTypes);
+
$currentPostTypes = (array) $this->params->getUniqueParamValue('postTypes');
if (!$shouldSkip40003) {
$this->validate40003($currentPostTypes);
|
runs-on (macos-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L33
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
$this->params->setUniqueParamValue('postTypes', $sortedPostTypes);
- $currentPostTypes = (array) $this->params->getUniqueParamValue('postTypes');
+ $currentPostTypes = $this->params->getUniqueParamValue('postTypes');
if (!$shouldSkip40003) {
$this->validate40003($currentPostTypes);
}
|
runs-on (windows-latest) / phpunit-infection
Cache save failed.
|
runs-on (windows-latest) / phpunit-infection
JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled.
|
runs-on (windows-latest) / phpunit-infection
JIT is incompatible with third party extensions that override zend_execute_ex(). JIT disabled.
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/BaseQuery.php#L281
Escaped Mutant for Mutator "Coalesce":
--- Original
+++ New
@@ @@
// use the topmost value between sorting key or value of orderBy field within its child posts
$curAndChildSortingKeys = collect([
// value of orderBy field in the first sorted child post that isMatchQuery after previous sorting
- $childPosts->filter(static fn(Collection $p) => ($p['isMatchQuery'] ?? true) === true)->first()[$this->orderByField] ?? null,
+ $childPosts->filter(static fn(Collection $p) => (true ?? $p['isMatchQuery']) === true)->first()[$this->orderByField] ?? null,
// sorting key from the first sorted child posts
// not requiring isMatchQuery since a child post without isMatchQuery
// might have its own child posts with isMatchQuery
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L33
Escaped Mutant for Mutator "LessThan":
--- Original
+++ New
@@ @@
return '0';
}
$prefix = match (true) {
- \is_int($cursor) && $cursor < 0 => '-',
+ \is_int($cursor) && $cursor <= 0 => '-',
\is_string($cursor) => 'S',
default => '',
};
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L40
Escaped Mutant for Mutator "GreaterThanOrEqualTo":
--- Original
+++ New
@@ @@
\is_string($cursor) => 'S',
default => '',
};
- $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor >= 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
+ $value = \is_int($cursor) ? rtrim(pack('P', $cursor), $cursor > 0 ? "\x00" : "\xff") : ($prefix === 'S' ? $cursor : throw new \RuntimeException('Invalid cursor value'));
if ($prefix !== 'S') {
// https://en.wikipedia.org/wiki/Base64#URL_applications
$value = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode($value));
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L75
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
* @var string $cursor
* @var string $prefix
*/
- [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 2, null);
+ [$prefix, $cursor] = array_pad(explode(':', $encodedCursor), 3, null);
if ($cursor === null) {
// no prefix being provided means the value of cursor is a positive int
$cursor = $prefix;
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L82
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// keep 0 as is
'S' => $cursor,
// string literal is not base64 encoded
- default => ((array) unpack(format: 'P', string: str_pad(
+ default => unpack(format: 'P', string: str_pad(
// re-add removed trailing 0x00 or 0xFF
base64_decode(
// https://en.wikipedia.org/wiki/Base64#URL_applications
@@ @@
),
length: 8,
pad_string: $prefix === '-' ? "\xff" : "\x00"
- )))[1],
+ ))[1],
};
})->chunk(2)->map(static fn(Collection $i) => $i->values()))->mapWithKeys(fn(Collection $cursors, string $postType) => [$postType => $cursors->mapWithKeys(fn(int|string|null $cursor, int $index) => [$index === 0 ? Helper::POST_TYPE_TO_ID[$postType] : $orderByField => $cursor])])->reject(static fn(Collection $cursors) => $cursors->every(static fn(int|string|null $cursor) => $cursor === null))->map(static fn(Collection $cursors) => new Cursor($cursors->toArray()));
}
}
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/CursorCodec.php#L90
Escaped Mutant for Mutator "IncrementInteger":
--- Original
+++ New
@@ @@
// https://en.wikipedia.org/wiki/Base64#URL_applications
str_replace(['-', '_'], ['+', '/'], $cursor)
),
- length: 8,
+ length: 9,
pad_string: $prefix === '-' ? "\xff" : "\x00"
)))[1],
};
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L28
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
}
public function addDefaultParamsThenValidate(bool $shouldSkip40003) : void
{
- $this->params->addDefaultValueOnParams();
+
$this->params->addDefaultValueOnUniqueParams();
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L29
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
public function addDefaultParamsThenValidate(bool $shouldSkip40003) : void
{
$this->params->addDefaultValueOnParams();
- $this->params->addDefaultValueOnUniqueParams();
+
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
$this->params->setUniqueParamValue('postTypes', $sortedPostTypes);
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L33
Escaped Mutant for Mutator "CastArray":
--- Original
+++ New
@@ @@
// sort here to prevent further sort while validating
$sortedPostTypes = collect($this->params->getUniqueParamValue('postTypes'))->sort()->values()->all();
$this->params->setUniqueParamValue('postTypes', $sortedPostTypes);
- $currentPostTypes = (array) $this->params->getUniqueParamValue('postTypes');
+ $currentPostTypes = $this->params->getUniqueParamValue('postTypes');
if (!$shouldSkip40003) {
$this->validate40003($currentPostTypes);
}
|
runs-on (windows-latest) / phpunit-infection:
be/app/Http/PostsQuery/ParamsValidator.php#L37
Escaped Mutant for Mutator "MethodCallRemoval":
--- Original
+++ New
@@ @@
if (!$shouldSkip40003) {
$this->validate40003($currentPostTypes);
}
- $this->validate40004($currentPostTypes);
+
}
private function validateParamsValue(array $params) : void
{
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
coverage-macos-latest
|
5.52 KB |
|
coverage-ubuntu-latest
|
5.52 KB |
|
coverage-windows-latest
|
5.46 KB |
|