1: | <?php declare(strict_types=1); |
2: | |
3: | namespace Salient\Contract\Core; |
4: | |
5: | /** |
6: | * Array mapper flags |
7: | */ |
8: | interface ArrayMapperFlag |
9: | { |
10: | /** |
11: | * Remove null values from the output array |
12: | */ |
13: | public const REMOVE_NULL = 1; |
14: | |
15: | /** |
16: | * Add unmapped values to the output array |
17: | */ |
18: | public const ADD_UNMAPPED = 2; |
19: | |
20: | /** |
21: | * Add missing values to the output array |
22: | * |
23: | * If applied, `null` is added to the output array if the input array has no |
24: | * data for a given map. |
25: | */ |
26: | public const ADD_MISSING = 4; |
27: | |
28: | /** |
29: | * Throw an exception if there are missing values |
30: | * |
31: | * If applied and the input array has no data for a given map, an |
32: | * `UnexpectedValueException` is thrown. |
33: | */ |
34: | public const REQUIRE_MAPPED = 8; |
35: | } |
36: |