| Conditions | 2 |
| Paths | 2 |
| Total Lines | 18 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | public function __construct(array|object $bulkCodeSwitch) |
||
| 16 | { |
||
| 17 | if (is_array($bulkCodeSwitch)) { |
||
|
|
|||
| 18 | // Handle array of bulk code switches |
||
| 19 | parent::__construct( |
||
| 20 | array_map( |
||
| 21 | static function ($item) { |
||
| 22 | return (object) $item; |
||
| 23 | }, |
||
| 24 | $bulkCodeSwitch |
||
| 25 | ), |
||
| 26 | self::ARRAY_AS_PROPS |
||
| 27 | ); |
||
| 28 | } else { |
||
| 29 | // Handle single bulk code switch object |
||
| 30 | parent::__construct( |
||
| 31 | [$bulkCodeSwitch], |
||
| 32 | self::ARRAY_AS_PROPS |
||
| 33 | ); |
||
| 37 |