| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | public static function processFormula($cellValue, $rangeCellValue, $currentRowNum, $rangeRowNum) |
||
| 8 | { |
||
| 9 | if (substr($rangeCellValue, 0, 1) == '=') { |
||
| 10 | $rowDelta = $currentRowNum + $rangeRowNum; |
||
| 11 | //has ref to field - add row-offset |
||
| 12 | $cellValue = preg_replace_callback( |
||
| 13 | '/([A-Z]+)([0-9])+/', |
||
| 14 | function ($matches) use ($rowDelta) { |
||
| 15 | $offsettedY = ($matches[2] + $rowDelta); |
||
| 16 | |||
| 17 | return $matches[1] . $offsettedY; |
||
| 18 | }, |
||
| 19 | $cellValue); |
||
| 20 | } |
||
| 21 | |||
| 22 | return $cellValue; |
||
| 23 | } |
||
| 24 | } |
||
| 25 |