| Total Complexity | 6 |
| Total Lines | 56 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 22 | abstract class HookData extends AbstractData |
||
| 23 | { |
||
| 24 | /** |
||
| 25 | * @var array |
||
| 26 | */ |
||
| 27 | protected $aCalls = []; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | abstract protected function getType(): string; |
||
| 33 | |||
| 34 | /** |
||
| 35 | * @return string |
||
| 36 | */ |
||
| 37 | public function getName(): string |
||
| 38 | { |
||
| 39 | return '__' . $this->getType(); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @return mixed |
||
| 44 | */ |
||
| 45 | public function getValue(): mixed |
||
| 48 | } |
||
| 49 | |||
| 50 | /** |
||
| 51 | * @param string $sMethod |
||
| 52 | * @param array $aParams |
||
| 53 | * |
||
| 54 | * @return void |
||
| 55 | */ |
||
| 56 | public function addCall(string $sMethod, array $aParams): void |
||
| 57 | { |
||
| 58 | if(!$this->validateMethod($sMethod)) |
||
| 59 | { |
||
| 60 | $sType = $this->getType(); |
||
| 61 | throw new SetupException("'$sMethod' is not a valid \"call\" value for $sType."); |
||
| 62 | } |
||
| 63 | $this->aCalls[$sMethod] = $aParams; |
||
| 64 | } |
||
| 65 | |||
| 66 | /** |
||
| 67 | * @inheritDoc |
||
| 68 | */ |
||
| 69 | public function encode(string $sVarName): array |
||
| 78 | } |
||
| 79 | } |
||
| 80 |