| 1 | <?php |
||
| 5 | trait PaddingTrait |
||
| 6 | { |
||
| 7 | protected $padding_length; |
||
| 8 | |||
| 9 | public function __construct(array $options = []) |
||
| 14 | |||
| 15 | /** |
||
| 16 | * @param int $padding_length |
||
| 17 | */ |
||
| 18 | 1 | public function setPaddingLength(int $padding_length) |
|
| 22 | |||
| 23 | /** |
||
| 24 | * @return int |
||
| 25 | */ |
||
| 26 | 2 | public function getPaddingLength() |
|
| 30 | |||
| 31 | /** |
||
| 32 | * @return string |
||
| 33 | */ |
||
| 34 | 10 | protected function serializePaddingData(): string |
|
| 42 | |||
| 43 | /** |
||
| 44 | * @param string $data |
||
| 45 | * |
||
| 46 | * @return int |
||
| 47 | * @throws Exception\InvalidFrameException |
||
| 48 | */ |
||
| 49 | 15 | protected function parsePaddingData(string $data): int |
|
| 63 | } |
||
| 64 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: