@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | { |
| 104 | 104 | // defensive programming! |
| 105 | 105 | RequireObject::check($data, E4xx_UnsupportedType::class); |
| 106 | - RequireAnyOneOf::check([ new IsObject, new IsStringy], [$constraint], E4xx_UnsupportedType::class); |
|
| 106 | + RequireAnyOneOf::check([new IsObject, new IsStringy], [$constraint], E4xx_UnsupportedType::class); |
|
| 107 | 107 | |
| 108 | 108 | // this is the easiest test case of all :) |
| 109 | 109 | return $data instanceof $constraint; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | { |
| 125 | 125 | // defensive programming! |
| 126 | 126 | RequireStringy::check($data, E4xx_UnsupportedType::class); |
| 127 | - RequireAnyOneOf::check([ new IsObject, new IsStringy], [$constraint], E4xx_UnsupportedType::class); |
|
| 127 | + RequireAnyOneOf::check([new IsObject, new IsStringy], [$constraint], E4xx_UnsupportedType::class); |
|
| 128 | 128 | |
| 129 | 129 | $compatibleTypes = AllMatchingTypesList::fromClass($data); |
| 130 | 130 | if (is_object($constraint)) { |
@@ -147,6 +147,9 @@ discard block |
||
| 147 | 147 | return $retval; |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | + /** |
|
| 151 | + * @param string $className |
|
| 152 | + */ |
|
| 150 | 153 | private static function buildCombinedClassNameDetails($className) |
| 151 | 154 | { |
| 152 | 155 | if (class_exists($className)) { |
@@ -180,6 +183,9 @@ discard block |
||
| 180 | 183 | return $retval; |
| 181 | 184 | } |
| 182 | 185 | |
| 186 | + /** |
|
| 187 | + * @param string $className |
|
| 188 | + */ |
|
| 183 | 189 | private static function getClassHierarchy($className) |
| 184 | 190 | { |
| 185 | 191 | // our return value |
@@ -347,7 +353,7 @@ discard block |
||
| 347 | 353 | * |
| 348 | 354 | * @param mixed $item |
| 349 | 355 | * the item to examine |
| 350 | - * @return array |
|
| 356 | + * @return string[] |
|
| 351 | 357 | * the basic type of the examined item |
| 352 | 358 | */ |
| 353 | 359 | private static function fromString($item) |
@@ -374,7 +380,7 @@ discard block |
||
| 374 | 380 | * |
| 375 | 381 | * @param mixed $item |
| 376 | 382 | * the item to examine |
| 377 | - * @return array |
|
| 383 | + * @return string[] |
|
| 378 | 384 | * the list of type(s) that this item can be |
| 379 | 385 | */ |
| 380 | 386 | public function __invoke($item) |