@@ -65,7 +65,7 @@ final public static function countQueryBuilder(array $options): int
6565 $ resolver = new OptionsResolver ();
6666 $ resolver ->setRequired ('query_builder ' );
6767 $ resolver ->setDefaults ([
68- 'behavior ' => function (Options $ options ): string {
68+ 'behavior ' => static function (Options $ options ): string {
6969 /** @var QueryBuilderDBAL|QueryBuilderORM $queryBuilder */
7070 $ queryBuilder = $ options ['query_builder ' ];
7171
@@ -78,15 +78,15 @@ final public static function countQueryBuilder(array $options): int
7878 ]);
7979 $ resolver ->setAllowedTypes ('query_builder ' , [QueryBuilderDBAL::class, QueryBuilderORM::class]);
8080 $ resolver ->setAllowedTypes ('behavior ' , 'string ' );
81- $ resolver ->setAllowedValues ('behavior ' , function (string $ behavior ) use ($ options ): bool {
81+ $ resolver ->setAllowedValues ('behavior ' , static function (string $ behavior ) use ($ options ): bool {
8282 if ($ options ['query_builder ' ] instanceof QueryBuilderDBAL) {
8383 return \in_array ($ behavior , ['count_by_alias ' , 'count_by_sub_request ' , 'count_by_select_all ' ]);
8484 }
8585
8686 return \in_array ($ behavior , ['count_by_alias ' , 'count_by_sub_request ' , 'orm ' ]);
8787 });
8888 $ resolver ->setAllowedTypes ('alias ' , ['string ' , 'null ' ]);
89- $ resolver ->setNormalizer ('alias ' , function (Options $ options , ?string $ alias ): ?string {
89+ $ resolver ->setNormalizer ('alias ' , static function (Options $ options , ?string $ alias ): ?string {
9090 if ('count_by_alias ' === $ options ['behavior ' ] && null === $ alias ) {
9191 throw new MissingOptionsException ('When "behavior" option is set to "count_by_alias", "alias" option is required ' );
9292 } elseif ('count_by_alias ' !== $ options ['behavior ' ] && null !== $ alias ) {
@@ -96,7 +96,7 @@ final public static function countQueryBuilder(array $options): int
9696 return $ alias ;
9797 });
9898 $ resolver ->setAllowedTypes ('distinct_alias ' , ['bool ' , 'null ' ]);
99- $ resolver ->setNormalizer ('distinct_alias ' , function (Options $ options , ?bool $ distinctAlias ): ?bool {
99+ $ resolver ->setNormalizer ('distinct_alias ' , static function (Options $ options , ?bool $ distinctAlias ): ?bool {
100100 if ('count_by_alias ' === $ options ['behavior ' ] && null === $ distinctAlias ) {
101101 return true ;
102102 } elseif ('count_by_alias ' !== $ options ['behavior ' ] && null !== $ distinctAlias ) {
@@ -106,7 +106,7 @@ final public static function countQueryBuilder(array $options): int
106106 return $ distinctAlias ;
107107 });
108108 $ resolver ->setAllowedTypes ('simplified_request ' , ['bool ' , 'null ' ]);
109- $ resolver ->setNormalizer ('simplified_request ' , function (Options $ options , ?bool $ simplifiedRequest ): ?bool {
109+ $ resolver ->setNormalizer ('simplified_request ' , static function (Options $ options , ?bool $ simplifiedRequest ): ?bool {
110110 if (null !== $ simplifiedRequest && !($ options ['query_builder ' ] instanceof QueryBuilderORM)) {
111111 throw new InvalidOptionsException ('The "simplified_request" option can only be used with ORM QueryBuilder ' );
112112 }
@@ -119,7 +119,7 @@ final public static function countQueryBuilder(array $options): int
119119 return $ simplifiedRequest ;
120120 });
121121 $ resolver ->setAllowedTypes ('connection ' , [Connection::class, 'null ' ]);
122- $ resolver ->setNormalizer ('connection ' , function (Options $ options , ?Connection $ connection ): ?Connection {
122+ $ resolver ->setNormalizer ('connection ' , static function (Options $ options , ?Connection $ connection ): ?Connection {
123123 if ('count_by_sub_request ' === $ options ['behavior ' ] && $ options ['query_builder ' ] instanceof QueryBuilderDBAL && null === $ connection ) {
124124 throw new MissingOptionsException ('When "behavior" option is set to "count_by_sub_request" with DBAL QueryBuilder, "connection" option is required ' );
125125 } elseif (null !== $ connection && !($ options ['query_builder ' ] instanceof QueryBuilderDBAL)) {
0 commit comments