Skip to content

Commit

Permalink
model/Configuration/Category: Fix regex for PHPStan
Browse files Browse the repository at this point in the history
PHPStan 1.12 gained a support for regex analysis but there are still some bugs.
See: phpstan/phpstan#12173

Fortunately, the capture group is extraneous.
  • Loading branch information
jtojnar committed Dec 8, 2024
1 parent 66f3f0d commit 07ae6ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Model/Configuration/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public static function from(
}

public const CONSTRAINT_REGEX = '(^\s*(?P<quant>all|some)\((?P<key>age|gender)(?P<op>[<>]?=?)(?P<val>.+)\)$\s*)';
public const AGGREGATE_CONSTRAINT_REGEX = '(^\s*(?P<aggr>(sum|min|max))\((?P<key>age)\)(?P<op>[<>]?=?)(?P<val>[0-9]+)$\s*)';
public const AGGREGATE_CONSTRAINT_REGEX = '(^\s*(?P<aggr>sum|min|max)\((?P<key>age)\)(?P<op>[<>]?=?)(?P<val>[0-9]+)$\s*)';

public const OP_LOOKUP = [
'<' => Constraints\ComparisonOperator::LessThan,
Expand Down

0 comments on commit 07ae6ee

Please sign in to comment.