feat: add ForbidEloquentMutationInControllersRule (queue #87) #53
Annotations
20 warnings
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L144
Escaped Mutant for Mutator "LogicalNot":
@@ @@
{
if (
!$node->var instanceof PropertyFetch
- || !$node->var->var instanceof Variable
+ || $node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
) {
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L144
Escaped Mutant for Mutator "InstanceOf_":
@@ @@
{
if (
!$node->var instanceof PropertyFetch
- || !$node->var->var instanceof Variable
+ || $node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
) {
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "LogicalOr":
@@ @@
if (
!$node->var instanceof PropertyFetch
|| !$node->var->var instanceof Variable
- || $node->var->var->name !== 'this'
- || !$node->var->name instanceof Identifier
+ || $node->var->var->name !== 'this' && !$node->var->name instanceof Identifier
) {
return false;
}
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "LogicalOr":
@@ @@
{
if (
!$node->var instanceof PropertyFetch
- || !$node->var->var instanceof Variable
- || $node->var->var->name !== 'this'
+ || !$node->var->var instanceof Variable && $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
) {
return false;
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "LogicalOr":
@@ @@
private function isOnNonDatabaseProperty(MethodCall $node, array $nonDatabaseProperties): bool
{
if (
- !$node->var instanceof PropertyFetch
- || !$node->var->var instanceof Variable
+ !$node->var instanceof PropertyFetch && !$node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
) {
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "LogicalNot":
@@ @@
private function isOnNonDatabaseProperty(MethodCall $node, array $nonDatabaseProperties): bool
{
if (
- !$node->var instanceof PropertyFetch
+ $node->var instanceof PropertyFetch
|| !$node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "InstanceOf_":
@@ @@
private function isOnNonDatabaseProperty(MethodCall $node, array $nonDatabaseProperties): bool
{
if (
- !$node->var instanceof PropertyFetch
+ $node->var instanceof PropertyFetch
|| !$node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L125
Escaped Mutant for Mutator "LogicalAnd":
@@ @@
$count = 0;
$this->walkNodes($method->stmts ?? [], function(Node $node) use (&$count, $nonDatabaseProperties): void {
if (
- $node instanceof MethodCall
- && $node->name instanceof Identifier
+ ($node instanceof MethodCall || $node->name instanceof Identifier)
&& in_array($node->name->toString(), self::WRITE_METHODS, true)
&& !$this->isOnNonDatabaseProperty($node, $nonDatabaseProperties)
) {
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L94
Escaped Mutant for Mutator "LogicalOr":
@@ @@
$executeMethod = $node->getMethod('execute');
- if ($executeMethod === null || $executeMethod->stmts === null) {
+ if ($executeMethod === null && $executeMethod->stmts === null) {
return [];
}
|
|
check (8.5):
src/Rules/EnforceActionTransactionsRule.php#L88
Escaped Mutant for Mutator "LogicalOr":
@@ @@
{
$namespace = $scope->getNamespace();
- if ($namespace === null || !str_starts_with($namespace, 'App\Actions')) {
+ if ($namespace === null && !str_starts_with($namespace, 'App\Actions')) {
return [];
}
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L144
Escaped Mutant for Mutator "LogicalNot":
@@ @@
{
if (
!$node->var instanceof PropertyFetch
- || !$node->var->var instanceof Variable
+ || $node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
) {
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L144
Escaped Mutant for Mutator "InstanceOf_":
@@ @@
{
if (
!$node->var instanceof PropertyFetch
- || !$node->var->var instanceof Variable
+ || $node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
) {
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "LogicalOr":
@@ @@
if (
!$node->var instanceof PropertyFetch
|| !$node->var->var instanceof Variable
- || $node->var->var->name !== 'this'
- || !$node->var->name instanceof Identifier
+ || $node->var->var->name !== 'this' && !$node->var->name instanceof Identifier
) {
return false;
}
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "LogicalOr":
@@ @@
{
if (
!$node->var instanceof PropertyFetch
- || !$node->var->var instanceof Variable
- || $node->var->var->name !== 'this'
+ || !$node->var->var instanceof Variable && $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
) {
return false;
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "LogicalOr":
@@ @@
private function isOnNonDatabaseProperty(MethodCall $node, array $nonDatabaseProperties): bool
{
if (
- !$node->var instanceof PropertyFetch
- || !$node->var->var instanceof Variable
+ !$node->var instanceof PropertyFetch && !$node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
) {
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "LogicalNot":
@@ @@
private function isOnNonDatabaseProperty(MethodCall $node, array $nonDatabaseProperties): bool
{
if (
- !$node->var instanceof PropertyFetch
+ $node->var instanceof PropertyFetch
|| !$node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L143
Escaped Mutant for Mutator "InstanceOf_":
@@ @@
private function isOnNonDatabaseProperty(MethodCall $node, array $nonDatabaseProperties): bool
{
if (
- !$node->var instanceof PropertyFetch
+ $node->var instanceof PropertyFetch
|| !$node->var->var instanceof Variable
|| $node->var->var->name !== 'this'
|| !$node->var->name instanceof Identifier
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L125
Escaped Mutant for Mutator "LogicalAnd":
@@ @@
$count = 0;
$this->walkNodes($method->stmts ?? [], function(Node $node) use (&$count, $nonDatabaseProperties): void {
if (
- $node instanceof MethodCall
- && $node->name instanceof Identifier
+ ($node instanceof MethodCall || $node->name instanceof Identifier)
&& in_array($node->name->toString(), self::WRITE_METHODS, true)
&& !$this->isOnNonDatabaseProperty($node, $nonDatabaseProperties)
) {
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L94
Escaped Mutant for Mutator "LogicalOr":
@@ @@
$executeMethod = $node->getMethod('execute');
- if ($executeMethod === null || $executeMethod->stmts === null) {
+ if ($executeMethod === null && $executeMethod->stmts === null) {
return [];
}
|
|
check (8.4):
src/Rules/EnforceActionTransactionsRule.php#L88
Escaped Mutant for Mutator "LogicalOr":
@@ @@
{
$namespace = $scope->getNamespace();
- if ($namespace === null || !str_starts_with($namespace, 'App\Actions')) {
+ if ($namespace === null && !str_starts_with($namespace, 'App\Actions')) {
return [];
}
|
Artifacts
Produced during runtime
| Name | Size | Digest | |
|---|---|---|---|
|
clover-php-8.4
|
4.52 KB |
sha256:4d5b12bc6b7fad229fc3d81e98c9dac040f3a72e8c08da2fc2e4b7f5113eca2c
|
|
|
clover-php-8.5
|
4.52 KB |
sha256:90678d9e3394be5a93cb0a58b81edac4dd43154c25f3eaaba08a64c028e11d5a
|
|
|
infection-php-8.4
|
312 KB |
sha256:96ee6ba822a250e59dc8310cb1ffc27b49d56957de97b316c97a01f40a4d5fb6
|
|
|
infection-php-8.5
|
312 KB |
sha256:8b0ed0a72e4964986ffe4f8bdbab87d65b0e6a518395c5082792c3614173dad7
|
|