Ver código fonte

Merge pull request #276 from ajcastro/fix

Fix condition when value is null and type is array
Shalvah 3 anos atrás
pai
commit
4b1ddc6ba9
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      src/Extracting/ParamHelpers.php

+ 1 - 1
src/Extracting/ParamHelpers.php

@@ -183,7 +183,7 @@ trait ParamHelpers
             case 'bool':
                 return str_replace($base, 'boolean', $typeName);
             case 'array':
-                return array_keys($value)[0] === 0 ? 'array' : 'object';
+                return is_null($value) || array_keys($value)[0] === 0 ? 'array' : 'object';
             default:
                 return $typeName;
         }