| Total Complexity | 4 |
| Total Lines | 51 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | trait FormulaTrait |
||
| 14 | { |
||
| 15 | /** |
||
| 16 | * @var bool |
||
| 17 | */ |
||
| 18 | protected $isFormula = false; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Formula string. |
||
| 22 | * |
||
| 23 | * In order to be rendered, the formula must comply to PHPSpreadsheet's rules for formulas |
||
| 24 | * |
||
| 25 | * @example =CONCATENATE(A1,A2) |
||
| 26 | * @var string |
||
| 27 | */ |
||
| 28 | protected $formula = ''; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * @return bool |
||
| 32 | */ |
||
| 33 | public function isFormula(): bool |
||
| 34 | { |
||
| 35 | return $this->isFormula; |
||
| 36 | } |
||
| 37 | |||
| 38 | /** |
||
| 39 | * @param bool $isFormula |
||
| 40 | * @return self |
||
| 41 | */ |
||
| 42 | public function setIsFormula(bool $isFormula) : self |
||
| 43 | { |
||
| 44 | $this->isFormula = $isFormula; |
||
| 45 | return $this; |
||
| 46 | } |
||
| 47 | |||
| 48 | /** |
||
| 49 | * @return string |
||
| 50 | */ |
||
| 51 | public function getFormula(): string |
||
| 52 | { |
||
| 53 | return $this->formula; |
||
| 54 | } |
||
| 55 | |||
| 56 | /** |
||
| 57 | * @param string $formula |
||
| 58 | * @return self |
||
| 59 | */ |
||
| 60 | public function setFormula(string $formula) : self |
||
| 64 | } |
||
| 65 | } |
||
| 66 |