Skip to content

php 8.4 and phpunit 11 #890

php 8.4 and phpunit 11

php 8.4 and phpunit 11 #890

Triggered via push December 7, 2024 14:05
Status Success
Total duration 1m 10s
Artifacts

ci.yml

on: push
Fit to window
Zoom out
Zoom in

Annotations

25 warnings
PHP 8.2: src/MockByCallsTrait.php#L127
Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ { $expectedArgumentsCount = \count($expectedArguments); $argumentsCount = \count($arguments); - self::assertSame($expectedArgumentsCount, $argumentsCount, \sprintf('Method "%s" on class "%s" at call %d, got %d arguments, but %d are expected', $method, $class, $at, $expectedArgumentsCount, $argumentsCount)); + foreach ($expectedArguments as $index => $expectedArgument) { if ($expectedArgument instanceof ArgumentInterface) { $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]);
PHP 8.2: src/MockByCallsTrait.php#L147
Escaped Mutant for Mutator "Continue_": @@ @@ foreach ($expectedArguments as $index => $expectedArgument) { if ($expectedArgument instanceof ArgumentInterface) { $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]); - continue; + break; } self::assertSame($expectedArgument, $arguments[$index], \sprintf('Method "%s" on class "%s" at call %d, argument %d', $method, $class, $at, $index)); }
PHP 8.2: src/MockByCallsTrait.php#L150
Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]); continue; } - self::assertSame($expectedArgument, $arguments[$index], \sprintf('Method "%s" on class "%s" at call %d, argument %d', $method, $class, $at, $index)); + } } /**
PHP 8.2: src/MockByCallsTrait.php#L170
Escaped Mutant for Mutator "FalseValue": @@ @@ private function getStackTrace(string $mockName): array { $trace = []; - $enableTrace = false; + $enableTrace = true; foreach (debug_backtrace() as $row) { if (isset($row['class']) && $row['class'] === $mockName) { $enableTrace = true;
PHP 8.2: src/MockByCallsTrait.php#L172
Escaped Mutant for Mutator "Identical": @@ @@ $trace = []; $enableTrace = false; foreach (debug_backtrace() as $row) { - if (isset($row['class']) && $row['class'] === $mockName) { + if (isset($row['class']) && $row['class'] !== $mockName) { $enableTrace = true; } if ($enableTrace) {
PHP 8.2: src/MockByCallsTrait.php#L172
Escaped Mutant for Mutator "LogicalAndNegation": @@ @@ $trace = []; $enableTrace = false; foreach (debug_backtrace() as $row) { - if (isset($row['class']) && $row['class'] === $mockName) { + if (!(isset($row['class']) && $row['class'] === $mockName)) { $enableTrace = true; } if ($enableTrace) {
PHP 8.2: src/MockByCallsTrait.php#L180
Escaped Mutant for Mutator "Assignment": @@ @@ if ($enableTrace) { $traceRow = ''; if (isset($row['class'])) { - $traceRow .= $row['class']; + $traceRow = $row['class']; } if (isset($row['type'])) { $traceRow .= $row['type'];
PHP 8.2: src/MockByCallsTrait.php#L197
Escaped Mutant for Mutator "FunctionCallRemoval": @@ @@ $trace[] = $traceRow; } } - krsort($trace); + return array_values($trace); } }
PHP 8.3: src/MockByCallsTrait.php#L127
Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ { $expectedArgumentsCount = \count($expectedArguments); $argumentsCount = \count($arguments); - self::assertSame($expectedArgumentsCount, $argumentsCount, \sprintf('Method "%s" on class "%s" at call %d, got %d arguments, but %d are expected', $method, $class, $at, $expectedArgumentsCount, $argumentsCount)); + foreach ($expectedArguments as $index => $expectedArgument) { if ($expectedArgument instanceof ArgumentInterface) { $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]);
PHP 8.3: src/MockByCallsTrait.php#L147
Escaped Mutant for Mutator "Continue_": @@ @@ foreach ($expectedArguments as $index => $expectedArgument) { if ($expectedArgument instanceof ArgumentInterface) { $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]); - continue; + break; } self::assertSame($expectedArgument, $arguments[$index], \sprintf('Method "%s" on class "%s" at call %d, argument %d', $method, $class, $at, $index)); }
PHP 8.3: src/MockByCallsTrait.php#L150
Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]); continue; } - self::assertSame($expectedArgument, $arguments[$index], \sprintf('Method "%s" on class "%s" at call %d, argument %d', $method, $class, $at, $index)); + } } /**
PHP 8.3: src/MockByCallsTrait.php#L170
Escaped Mutant for Mutator "FalseValue": @@ @@ private function getStackTrace(string $mockName): array { $trace = []; - $enableTrace = false; + $enableTrace = true; foreach (debug_backtrace() as $row) { if (isset($row['class']) && $row['class'] === $mockName) { $enableTrace = true;
PHP 8.3: src/MockByCallsTrait.php#L172
Escaped Mutant for Mutator "Identical": @@ @@ $trace = []; $enableTrace = false; foreach (debug_backtrace() as $row) { - if (isset($row['class']) && $row['class'] === $mockName) { + if (isset($row['class']) && $row['class'] !== $mockName) { $enableTrace = true; } if ($enableTrace) {
PHP 8.3: src/MockByCallsTrait.php#L172
Escaped Mutant for Mutator "LogicalAndNegation": @@ @@ $trace = []; $enableTrace = false; foreach (debug_backtrace() as $row) { - if (isset($row['class']) && $row['class'] === $mockName) { + if (!(isset($row['class']) && $row['class'] === $mockName)) { $enableTrace = true; } if ($enableTrace) {
PHP 8.3: src/MockByCallsTrait.php#L180
Escaped Mutant for Mutator "Assignment": @@ @@ if ($enableTrace) { $traceRow = ''; if (isset($row['class'])) { - $traceRow .= $row['class']; + $traceRow = $row['class']; } if (isset($row['type'])) { $traceRow .= $row['type'];
PHP 8.3: src/MockByCallsTrait.php#L197
Escaped Mutant for Mutator "FunctionCallRemoval": @@ @@ $trace[] = $traceRow; } } - krsort($trace); + return array_values($trace); } }
SonarScanner
This action is deprecated and will be removed in a future release. Please use the sonarqube-scan-action action instead. The sonarqube-scan-action is a drop-in replacement for this action.
PHP 8.4: src/MockByCallsTrait.php#L127
Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ { $expectedArgumentsCount = \count($expectedArguments); $argumentsCount = \count($arguments); - self::assertSame($expectedArgumentsCount, $argumentsCount, \sprintf('Method "%s" on class "%s" at call %d, got %d arguments, but %d are expected', $method, $class, $at, $expectedArgumentsCount, $argumentsCount)); + foreach ($expectedArguments as $index => $expectedArgument) { if ($expectedArgument instanceof ArgumentInterface) { $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]);
PHP 8.4: src/MockByCallsTrait.php#L147
Escaped Mutant for Mutator "Continue_": @@ @@ foreach ($expectedArguments as $index => $expectedArgument) { if ($expectedArgument instanceof ArgumentInterface) { $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]); - continue; + break; } self::assertSame($expectedArgument, $arguments[$index], \sprintf('Method "%s" on class "%s" at call %d, argument %d', $method, $class, $at, $index)); }
PHP 8.4: src/MockByCallsTrait.php#L150
Escaped Mutant for Mutator "MethodCallRemoval": @@ @@ $expectedArgument->assert($arguments[$index], ['class' => $class, 'method' => $method, 'at' => $at, 'index' => $index]); continue; } - self::assertSame($expectedArgument, $arguments[$index], \sprintf('Method "%s" on class "%s" at call %d, argument %d', $method, $class, $at, $index)); + } } /**
PHP 8.4: src/MockByCallsTrait.php#L170
Escaped Mutant for Mutator "FalseValue": @@ @@ private function getStackTrace(string $mockName): array { $trace = []; - $enableTrace = false; + $enableTrace = true; foreach (debug_backtrace() as $row) { if (isset($row['class']) && $row['class'] === $mockName) { $enableTrace = true;
PHP 8.4: src/MockByCallsTrait.php#L172
Escaped Mutant for Mutator "Identical": @@ @@ $trace = []; $enableTrace = false; foreach (debug_backtrace() as $row) { - if (isset($row['class']) && $row['class'] === $mockName) { + if (isset($row['class']) && $row['class'] !== $mockName) { $enableTrace = true; } if ($enableTrace) {
PHP 8.4: src/MockByCallsTrait.php#L172
Escaped Mutant for Mutator "LogicalAndNegation": @@ @@ $trace = []; $enableTrace = false; foreach (debug_backtrace() as $row) { - if (isset($row['class']) && $row['class'] === $mockName) { + if (!(isset($row['class']) && $row['class'] === $mockName)) { $enableTrace = true; } if ($enableTrace) {
PHP 8.4: src/MockByCallsTrait.php#L180
Escaped Mutant for Mutator "Assignment": @@ @@ if ($enableTrace) { $traceRow = ''; if (isset($row['class'])) { - $traceRow .= $row['class']; + $traceRow = $row['class']; } if (isset($row['type'])) { $traceRow .= $row['type'];
PHP 8.4: src/MockByCallsTrait.php#L197
Escaped Mutant for Mutator "FunctionCallRemoval": @@ @@ $trace[] = $traceRow; } } - krsort($trace); + return array_values($trace); } }