diff --git a/src/Mutator/Unwrap/UnwrapArrayIntersectAssoc.php b/src/Mutator/Unwrap/UnwrapArrayIntersectAssoc.php new file mode 100644 index 000000000..1e7abc51f --- /dev/null +++ b/src/Mutator/Unwrap/UnwrapArrayIntersectAssoc.php @@ -0,0 +1,54 @@ +args); + } +} diff --git a/src/Mutator/Util/MutatorProfile.php b/src/Mutator/Util/MutatorProfile.php index ba113192e..86fe92729 100644 --- a/src/Mutator/Util/MutatorProfile.php +++ b/src/Mutator/Util/MutatorProfile.php @@ -202,6 +202,7 @@ final class MutatorProfile Mutator\Unwrap\UnwrapArrayFilter::class, Mutator\Unwrap\UnwrapArrayFlip::class, Mutator\Unwrap\UnwrapArrayIntersect::class, + Mutator\Unwrap\UnwrapArrayIntersectAssoc::class, Mutator\Unwrap\UnwrapArrayIntersectKey::class, Mutator\Unwrap\UnwrapArrayIntersectUassoc::class, Mutator\Unwrap\UnwrapArrayIntersectUkey::class, @@ -367,6 +368,7 @@ final class MutatorProfile 'UnwrapArrayFilter' => Mutator\Unwrap\UnwrapArrayFilter::class, 'UnwrapArrayFlip' => Mutator\Unwrap\UnwrapArrayFlip::class, 'UnwrapArrayIntersect' => Mutator\Unwrap\UnwrapArrayIntersect::class, + 'UnwrapArrayIntersectAssoc' => Mutator\Unwrap\UnwrapArrayIntersectAssoc::class, 'UnwrapArrayIntersectKey' => Mutator\Unwrap\UnwrapArrayIntersectKey::class, 'UnwrapArrayIntersectUassoc' => Mutator\Unwrap\UnwrapArrayIntersectUassoc::class, 'UnwrapArrayIntersectUkey' => Mutator\Unwrap\UnwrapArrayIntersectUkey::class, diff --git a/tests/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php b/tests/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php new file mode 100644 index 000000000..49a59e974 --- /dev/null +++ b/tests/Mutator/Unwrap/UnwrapArrayIntersectAssocTest.php @@ -0,0 +1,295 @@ +doTest($input, $expected); + } + + public function provideMutationCases(): \Generator + { + yield 'It mutates correctly when provided with an array' => [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' +bar(), $foo->baz()); +PHP + , + [ + <<<'PHP' +bar(); +PHP + , + <<<'PHP' +baz(); +PHP + , + ], + ]; + + yield 'It mutates correctly when provided with a more complex situation' => [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' + [ + <<<'PHP' +