| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | 6 | protected function applyCurrent(CharTree $charTree): CharTree |
|
| 35 | { |
||
| 36 | // When PHP 7.1 is no longer supported, change to using spl_object_id. |
||
| 37 | 6 | $hash = spl_object_hash($charTree); |
|
| 38 | |||
| 39 | 6 | if (!isset(self::$memoization[$hash])) { |
|
| 40 | 6 | self::$memoization[$hash] = $this->leetspeakCoder->apply($charTree); |
|
| 41 | } |
||
| 42 | |||
| 43 | 6 | return self::$memoization[$hash]; |
|
| 44 | } |
||
| 46 |