| Conditions | 5 |
| Paths | 12 |
| Total Lines | 22 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 30 |
| Changes | 0 | ||
| 1 | <?php |
||
| 20 | public function resolve($flagString, $flags = null, $mapping = null) |
||
| 21 | { |
||
| 22 | if ($flags === null) |
||
| 23 | { |
||
| 24 | $flags = $this->getFlags(); |
||
| 25 | } |
||
| 26 | |||
| 27 | if ($mapping === null) |
||
| 28 | { |
||
| 29 | $mapping = $this->getMapping(); |
||
| 30 | } |
||
| 31 | |||
| 32 | foreach (str_split($flagString) as $flag) |
||
| 33 | { |
||
| 34 | if (isset($mapping[$flag])) |
||
| 35 | { |
||
| 36 | $flags |= $mapping[$flag]; |
||
| 37 | } |
||
| 38 | } |
||
| 39 | |||
| 40 | return $flags; |
||
| 41 | } |
||
| 42 | } |
||
| 43 |