| @@ -17,9 +17,9 @@ | ||
| 17 | 17 | * Accepts the following keys: "required", "min", |
| 18 | 18 | * "max", and "pattern". If a key is not |
| 19 | 19 | * provided, the constraint will assume false. |
| 20 | 20 | */ |
| 21 | - public function __construct(array $constraints = null) | |
| 21 | + public function __construct(?array $constraints = null) | |
| 22 | 22 | { |
| 23 | 23 | static $assumedFalseValues = ['required' => \false, 'min' => \false, 'max' => \false, 'pattern' => \false]; |
| 24 | 24 | $this->constraints = empty($constraints) ? self::$defaultConstraints : $constraints + $assumedFalseValues; |
| 25 | 25 | } |
| @@ -172,17 +172,9 @@ | ||
| 172 | 172 | } |
| 173 | 173 | } |
| 174 | 174 | private function checkArray($arr) |
| 175 | 175 | { |
| 176 | - return $this->isIndexed($arr) || $this->isAssociative($arr); | |
| 177 | - } | |
| 178 | - private function isAssociative($arr) | |
| 179 | - { | |
| 180 | - return \count(\array_filter(\array_keys($arr), "is_string")) == \count($arr); | |
| 181 | - } | |
| 182 | - private function isIndexed(array $arr) | |
| 183 | - { | |
| 184 | - return $arr == \array_values($arr); | |
| 176 | + return \array_is_list($arr) || Aws\is_associative($arr); | |
| 185 | 177 | } |
| 186 | 178 | private function checkCanString($value) |
| 187 | 179 | { |
| 188 | 180 | static $valid = ['string' => \true, 'integer' => \true, 'double' => \true, 'NULL' => \true]; |