Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Context/FieldSelector.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
// Try magic __get method as last resort
try {
$data = $data->__get($key);
} catch (Throwable $e) {
} catch (Throwable) {
throw new InvalidArgumentException("Key '{$key}' does not exist or is not accessible via __get method.");
}
} else {
Expand Down Expand Up @@ -138,10 +138,10 @@
return $item->{'get' . ucfirst($key)}();
}

if (method_exists($item, '__get')) {

Check warning on line 141 in src/Context/FieldSelector.php

View workflow job for this annotation

GitHub Actions / Mutation Testing

Escaped Mutant for Mutator "IfNegation": @@ @@ if (method_exists($item, 'get' . ucfirst($key))) { return $item->{'get' . ucfirst($key)}(); } - if (method_exists($item, '__get')) { + if (!method_exists($item, '__get')) { try { return $item->__get($key); } catch (Throwable) {
try {
return $item->__get($key);
} catch (Throwable $e) {
} catch (Throwable) {
return null;
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/Context/ObjectContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
use JsonException;
use Stringable;

/**
* @see ObjectContextTest
*/
final class ObjectContext implements ContextInterface, Stringable
{
public function __construct(
Expand Down
2 changes: 0 additions & 2 deletions tests/Actions/CallableActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Maniaba\RuleEngine\Actions\CallableAction;
use Maniaba\RuleEngine\Context\ArrayContext;
use Maniaba\RuleEngine\Context\ContextInterface;
use PHPUnit\Framework\Attributes\Group;
use RuntimeException;
use Tests\Support\TestCase;

Expand All @@ -17,7 +16,6 @@
*
* @internal
*/
#[Group('Others')]
final class CallableActionTest extends TestCase
{
public function testExecutesCallableWithContext(): void
Expand Down
2 changes: 0 additions & 2 deletions tests/Builders/ArrayBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
use Maniaba\RuleEngine\Context\ContextInterface;
use Maniaba\RuleEngine\Exceptions\BuilderException;
use Maniaba\RuleEngine\Rules\RuleSet;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\Actions\DummyArgumentsAction;
use Tests\Support\TestCase;

Expand All @@ -22,7 +21,6 @@
*
* @description Testing the ArrayBuilder class. Tests building a RuleSet based on configuration from the self::configBuilder() array.
*/
#[Group('Others')]
final class ArrayBuilderTest extends TestCase
{
use BuilderTestDemoConfigTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Builders/JsonBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use Maniaba\RuleEngine\Builders\JsonBuilder;
use Maniaba\RuleEngine\Context\ContextInterface;
use Maniaba\RuleEngine\Rules\RuleSet;
use PHPUnit\Framework\Attributes\Group;
use SplFileInfo;
use Tests\Support\Actions\DummyArgumentsAction;
use Tests\Support\TestCase;
Expand All @@ -19,7 +18,6 @@
*
* @internal
*/
#[Group('Others')]
final class JsonBuilderTest extends TestCase
{
use BuilderTestDemoConfigTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/ArrayContainsAllConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

use Maniaba\RuleEngine\Conditions\ArrayContainsAllCondition;
use Maniaba\RuleEngine\Context\ContextInterface;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class ArrayContainsAllConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/ArrayContainsAnyConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Tests\Conditions;

use Maniaba\RuleEngine\Conditions\ArrayContainsAnyCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class ArrayContainsAnyConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/ArrayContainsConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Tests\Conditions;

use Maniaba\RuleEngine\Conditions\ArrayContainsCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class ArrayContainsConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
62 changes: 0 additions & 62 deletions tests/Conditions/ArrayContextTest.php

This file was deleted.

2 changes: 0 additions & 2 deletions tests/Conditions/CollectionConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,12 @@
use Maniaba\RuleEngine\Conditions\CollectionCondition;
use Maniaba\RuleEngine\Conditions\ConditionInterface;
use Maniaba\RuleEngine\Enums\CollectionConditionType;
use PHPUnit\Framework\Attributes\Group;
use stdClass;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class CollectionConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/EndsWithConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Tests\Conditions;

use Maniaba\RuleEngine\Conditions\EndsWithCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class EndsWithConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/EqualsConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Tests\Conditions;

use Maniaba\RuleEngine\Conditions\EqualsCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class EqualsConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/GreaterThanConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

use Maniaba\RuleEngine\Conditions\GreaterThanCondition;
use Maniaba\RuleEngine\Context\ContextInterface;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class GreaterThanConditionTest extends TestCase
{
public function testEvaluateConditionPassesWhenValueIsGreater(): void
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/GreaterThanOrEqualConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

use Maniaba\RuleEngine\Conditions\GreaterThanOrEqualCondition;
use Maniaba\RuleEngine\Context\ContextInterface;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class GreaterThanOrEqualConditionTest extends TestCase
{
public function testEvaluateConditionPassesWhenValueIsGreater(): void
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/IfElseConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
use Maniaba\RuleEngine\Conditions\IfElseCondition;
use Maniaba\RuleEngine\Context\ContextInterface;
use Maniaba\RuleEngine\Enums\CollectionConditionType;
use PHPUnit\Framework\Attributes\Group;
use stdClass;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class IfElseConditionTest extends TestCase
{
public function testIfConditionSatisfiedExecutesThenAction(): void
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/LessThanConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Tests\Conditions;

use Maniaba\RuleEngine\Conditions\LessThanCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class LessThanConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/LessThanOrEqualConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Tests\Conditions;

use Maniaba\RuleEngine\Conditions\LessThanOrEqualCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class LessThanOrEqualConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/NotConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,11 @@
use Maniaba\RuleEngine\Context\ArrayContext;
use Maniaba\RuleEngine\Context\ContextInterface;
use Maniaba\RuleEngine\Enums\CollectionConditionType;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class NotConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/NumericInRangeConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@

use InvalidArgumentException;
use Maniaba\RuleEngine\Conditions\NumericInRangeCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class NumericInRangeConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/StartsWithConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Tests\Conditions;

use Maniaba\RuleEngine\Conditions\StartsWithCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class StartsWithConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
2 changes: 0 additions & 2 deletions tests/Conditions/StringContainConditionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
namespace Tests\Conditions;

use Maniaba\RuleEngine\Conditions\StringContainCondition;
use PHPUnit\Framework\Attributes\Group;
use Tests\Support\TestCase;

/**
* @internal
*/
#[Group('Others')]
final class StringContainConditionTest extends TestCase
{
use MockContextTrait;
Expand Down
Loading