File tree 1 file changed +9
-4
lines changed
1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change 7
7
use Psr \Container \ContainerInterface ;
8
8
use Webmozart \Assert \Assert ;
9
9
10
- use function array_keys ;
10
+ use function assert ;
11
11
use function is_bool ;
12
+ use function is_int ;
13
+ use function is_string ;
12
14
13
15
class ProblemDetailsResponseFactoryFactory
14
16
{
@@ -24,11 +26,14 @@ public function __invoke(ContainerInterface $container): ProblemDetailsResponseF
24
26
$ problemDetailsConfig = $ config ['problem-details ' ] ?? [];
25
27
Assert::isArrayAccessible ($ problemDetailsConfig );
26
28
$ jsonFlags = $ problemDetailsConfig ['json_flags ' ] ?? null ;
27
- Assert:: nullOrInteger ($ jsonFlags );
29
+ assert ($ jsonFlags === null || is_int ( $ jsonFlags ) );
28
30
$ defaultTypesMap = $ problemDetailsConfig ['default_types_map ' ] ?? [];
29
31
Assert::isArray ($ defaultTypesMap );
30
- Assert::allInteger (array_keys ($ defaultTypesMap ));
31
- Assert::allString ($ defaultTypesMap );
32
+ foreach ($ defaultTypesMap as $ key => $ value ) {
33
+ assert (is_int ($ key ));
34
+ assert (is_string ($ value ));
35
+ }
36
+
32
37
/** @psalm-var array<int, string> $defaultTypesMap */
33
38
34
39
return new ProblemDetailsResponseFactory (
You can’t perform that action at this time.
0 commit comments