| Conditions | 1 |
| Paths | 1 |
| Total Lines | 19 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 58 | 141 | protected function selectFlag(int $flag, array $flags) |
|
| 59 | { |
||
| 60 | 141 | $all = \array_reduce( |
|
| 61 | 141 | $flags, |
|
| 62 | /** |
||
| 63 | * @param int $result |
||
| 64 | * @param int $item |
||
| 65 | * |
||
| 66 | * @return int |
||
| 67 | */ |
||
| 68 | 141 | function ($result, $item) { |
|
| 69 | 141 | return $result | $item; |
|
| 70 | 141 | }, |
|
| 71 | 141 | 0 |
|
| 72 | ); |
||
| 73 | 141 | $this->setFlag($flag, true); |
|
| 74 | 141 | $this->setFlag($all & ~$flag, false); |
|
| 75 | |||
| 76 | 141 | return $this; |
|
| 77 | } |
||
| 79 |