| Total Complexity | 8 |
| Total Lines | 48 |
| Duplicated Lines | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 21 | class Mailcode_Commands_Command_ShowVariable extends Mailcode_Commands_Command |
||
| 22 | { |
||
| 23 | // TODO needs real code |
||
| 24 | const VALIDATION_VARIABLE_COUNT_MISMATCH = 112001; |
||
| 25 | |||
| 26 | public function getName() : string |
||
| 27 | { |
||
| 28 | return 'showvar'; |
||
| 29 | } |
||
| 30 | |||
| 31 | public function getLabel() : string |
||
| 34 | } |
||
| 35 | |||
| 36 | public function supportsType(): bool |
||
| 37 | { |
||
| 38 | return false; |
||
| 39 | } |
||
| 40 | |||
| 41 | public function requiresParameters(): bool |
||
| 42 | { |
||
| 43 | return true; |
||
| 44 | } |
||
| 45 | |||
| 46 | protected function validateSyntax_require_variable() |
||
| 47 | { |
||
| 48 | $amount = $this->getVariables()->countVariables(); |
||
| 49 | |||
| 50 | if($amount === 1) |
||
| 51 | { |
||
| 52 | return; |
||
| 53 | } |
||
| 54 | |||
| 55 | $this->validationResult->makeError( |
||
| 56 | t('Command has %1$s variables, %2$s expected.', $amount, 1), |
||
| 57 | self::VALIDATION_VARIABLE_COUNT_MISMATCH |
||
| 58 | ); |
||
| 59 | } |
||
| 60 | |||
| 61 | protected function getValidations() : array |
||
| 64 | } |
||
| 65 | |||
| 66 | public function generatesContent() : bool |
||
| 69 | } |
||
| 70 | } |
||
| 71 |