| Conditions | 3 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 32 | protected function validateSyntax_check_timezone(): void |
||
| 33 | { |
||
| 34 | // first, check if we have an explicit timezone |
||
| 35 | $tokens = $this->requireParams() |
||
|
|
|||
| 36 | ->getInfo() |
||
| 37 | ->getStringLiterals(); |
||
| 38 | |||
| 39 | if (count($tokens) > 1) { |
||
| 40 | $this->timezoneString = $tokens[1]->getText(); |
||
| 41 | return; |
||
| 42 | } |
||
| 43 | |||
| 44 | // then, check if a variable is used for timezone |
||
| 45 | $variables = $this->requireParams() |
||
| 46 | ->getInfo() |
||
| 47 | ->getVariables(); |
||
| 48 | |||
| 49 | if (count($variables) > 1) { |
||
| 50 | $this->timezoneVariable = $variables[1]->getFullName(); |
||
| 51 | return; |
||
| 52 | } |
||
| 53 | |||
| 54 | // neither explicit timezone nor variable present, so use nothing |
||
| 55 | $this->timezoneString= null; |
||
| 56 | $this->timezoneVariable = null; |
||
| 57 | } |
||
| 74 |