Skip to content

Commit 578f80e

Browse files
committedSep 19, 2024
Fix types
1 parent 6656025 commit 578f80e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎src/CompilingMatcher.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public static function clear()
6464
* @phpstan-param Constraint::OP_* $operator
6565
* @param string $version
6666
*
67-
* @return mixed
67+
* @return bool
6868
*/
6969
public static function match(ConstraintInterface $constraint, $operator, $version)
7070
{

‎tests/VersionParserTest.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,9 @@ public static function failingNormalizedVersions()
197197
*/
198198
public function testNormalizeFailsAndReportsAliasIssue($fullInput)
199199
{
200-
preg_match('{^([^,\s#]+)(?:#[^ ]+)? +as +([^,\s]+)$}', $fullInput, $match);
200+
if (!preg_match('{^([^,\s#]+)(?:#[^ ]+)? +as +([^,\s]+)$}', $fullInput, $match)) {
201+
$this->fail($fullInput.' did not match the regex');
202+
}
201203
$parser = new VersionParser();
202204
$parser->normalize($match[1], $fullInput);
203205
try {
@@ -227,7 +229,9 @@ public static function failingNormalizedVersionsWithBadAlias()
227229
*/
228230
public function testNormalizeFailsAndReportsAliaseeIssue($fullInput)
229231
{
230-
preg_match('{^([^,\s#]+)(?:#[^ ]+)? +as +([^,\s]+)$}', $fullInput, $match);
232+
if (!preg_match('{^([^,\s#]+)(?:#[^ ]+)? +as +([^,\s]+)$}', $fullInput, $match)) {
233+
$this->fail($fullInput.' did not match the regex');
234+
}
231235
$parser = new VersionParser();
232236
try {
233237
$parser->normalize($match[1], $fullInput);

0 commit comments

Comments
 (0)