* add union type array
for all usages to type ArrayAccess
@ be
#210
Annotations
12 warnings
|
|
be/src/Entity/BlobResourceGetter.php#L42
Escaped Mutant for Mutator "FunctionCallRemoval":
--- Original
+++ New
@@ @@
if ($value === null) {
return null;
}
- rewind($value);
+
return stream_get_contents($value);
}
}
|
be/src/EventListener/ExceptionToJsonResponse.php#L21
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
public function __invoke(ExceptionEvent $event) : void
{
$exception = $event->getThrowable();
- if ($exception instanceof HttpException && collect(Helper::ERROR_STATUS_CODE_INFO)->flatMap(static fn(array $codes) => array_keys($codes))->contains($exception->getCode())) {
+ if (true && collect(Helper::ERROR_STATUS_CODE_INFO)->flatMap(static fn(array $codes) => array_keys($codes))->contains($exception->getCode())) {
$event->setResponse(JsonResponse::fromJsonString($exception->getMessage()));
} elseif ($exception instanceof ValidationFailedException) {
$event->setResponse(JsonResponse::fromJsonString(
|
be/src/EventListener/ExceptionToJsonResponse.php#L21
Escaped Mutant for Mutator "LogicalAnd":
--- Original
+++ New
@@ @@
public function __invoke(ExceptionEvent $event) : void
{
$exception = $event->getThrowable();
- if ($exception instanceof HttpException && collect(Helper::ERROR_STATUS_CODE_INFO)->flatMap(static fn(array $codes) => array_keys($codes))->contains($exception->getCode())) {
+ if ($exception instanceof HttpException || collect(Helper::ERROR_STATUS_CODE_INFO)->flatMap(static fn(array $codes) => array_keys($codes))->contains($exception->getCode())) {
$event->setResponse(JsonResponse::fromJsonString($exception->getMessage()));
} elseif ($exception instanceof ValidationFailedException) {
$event->setResponse(JsonResponse::fromJsonString(
|
be/src/EventListener/ExceptionToJsonResponse.php#L26
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
$exception = $event->getThrowable();
if ($exception instanceof HttpException && collect(Helper::ERROR_STATUS_CODE_INFO)->flatMap(static fn(array $codes) => array_keys($codes))->contains($exception->getCode())) {
$event->setResponse(JsonResponse::fromJsonString($exception->getMessage()));
- } elseif ($exception instanceof ValidationFailedException) {
+ } elseif (true) {
$event->setResponse(JsonResponse::fromJsonString(
// https://github.com/symfony/serializer/blob/7.1/Normalizer/ConstraintViolationListNormalizer.php
$this->serializer->serialize(['errorCode' => 40000, 'errorInfo' => $exception->getViolations()], 'json')
|
be/src/EventListener/PrettyJsonResponse.php#L16
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
{
// https://github.com/laravel/framework/issues/3929#issuecomment-935123918
$response = $event->getResponse();
- if ($response instanceof JsonResponse) {
+ if (true) {
$response->setEncodingOptions(JSON_PRETTY_PRINT);
}
}
}
|
be/src/EventListener/ShowReactJsonView.php#L20
Escaped Mutant for Mutator "InstanceOf_":
--- Original
+++ New
@@ @@
{
$request = $event->getRequest();
$response = $event->getResponse();
- if (!$response instanceof JsonResponse || !in_array('text/html', $request->getAcceptableContentTypes(), true)) {
+ if (!true || !in_array('text/html', $request->getAcceptableContentTypes(), true)) {
return;
}
$json = $response->getContent();
|
be/src/EventListener/ShowReactJsonView.php#L20
Escaped Mutant for Mutator "LogicalOr":
--- Original
+++ New
@@ @@
{
$request = $event->getRequest();
$response = $event->getResponse();
- if (!$response instanceof JsonResponse || !in_array('text/html', $request->getAcceptableContentTypes(), true)) {
+ if (!$response instanceof JsonResponse && !in_array('text/html', $request->getAcceptableContentTypes(), true)) {
return;
}
$json = $response->getContent();
|
be/src/EventListener/ShowReactJsonView.php#L25
Escaped Mutant for Mutator "MBString":
--- Original
+++ New
@@ @@
return;
}
$json = $response->getContent();
- $jsonLength = mb_strlen($json);
+ $jsonLength = strlen($json);
$assetsUrl = collect(['react-json-view', 'react', 'react-dom'])->mapWithKeys(fn($asset) => [$asset => $this->assets->getUrl("/assets/{$asset}.js")]);
$event->setResponse(new Response(<<<HTML
<html>
|
be/src/Helper.php#L85
Escaped Mutant for Mutator "DecrementInteger":
--- Original
+++ New
@@ @@
];
public static function abortAPI(int $errorCode) : never
{
- $statusCode = 0;
+ $statusCode = -1;
$errorInfo = null;
foreach (self::ERROR_STATUS_CODE_INFO as $infoStatusCode => $infoErrorInfo) {
if (\array_key_exists($errorCode, $infoErrorInfo)) {
|
be/src/PostsQuery/BaseQuery.php#L284
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
|
This job succeeded
Loading