Skip to content

Commit c1739d0

Browse files
herndlmondrejmirtes
authored andcommitted
Revert non-empty-array specification for Assert::uniqueValues
1 parent 0307f23 commit c1739d0

File tree

2 files changed

+0
-31
lines changed

2 files changed

+0
-31
lines changed

src/Type/WebMozartAssert/AssertTypeSpecifyingExtension.php

-25
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,6 @@ private function getExpressionResolvers(): array
752752
)
753753
);
754754
},
755-
'uniqueValues' => static function (Scope $scope, Arg $value): array {
756-
return self::createIsNonEmptyArrayAndSomethingExprPair('uniqueValues', [$value]);
757-
},
758755
];
759756

760757
foreach (['contains', 'startsWith', 'endsWith'] as $name) {
@@ -1005,28 +1002,6 @@ private static function createIsNonEmptyStringAndSomethingExprPair(string $name,
10051002
return [$expr, $rootExpr];
10061003
}
10071004

1008-
/**
1009-
* @param Arg[] $args
1010-
* @return array{Expr, Expr}
1011-
*/
1012-
private static function createIsNonEmptyArrayAndSomethingExprPair(string $name, array $args): array
1013-
{
1014-
$expr = new GreaterOrEqual(
1015-
new FuncCall(
1016-
new Name('count'),
1017-
[$args[0]]
1018-
),
1019-
new LNumber(1)
1020-
);
1021-
1022-
$rootExpr = new BooleanAnd(
1023-
$expr,
1024-
new FuncCall(new Name('FAUX_FUNCTION_ ' . $name), $args)
1025-
);
1026-
1027-
return [$expr, $rootExpr];
1028-
}
1029-
10301005
private function specifyRootExprIfSet(?Expr $rootExpr, SpecifiedTypes $specifiedTypes): SpecifiedTypes
10311006
{
10321007
if ($rootExpr === null) {

tests/Type/WebMozartAssert/data/type.php

-6
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,6 @@ public function isArrayAccessible($a, $b): void
305305
Assert::nullOrIsArrayAccessible($b);
306306
assertType('array|ArrayAccess|null', $b);
307307
}
308-
309-
public function uniqueValues(array $a): void
310-
{
311-
Assert::uniqueValues($a);
312-
assertType('non-empty-array', $a);
313-
}
314308
}
315309

316310
class Foo {}

0 commit comments

Comments
 (0)