1 | <?php |
||
9 | abstract class MigrationFieldAbstract implements MigrationFieldTypeInterface |
||
10 | { |
||
11 | use CrudColumn, CrudField, ValidationRule; |
||
12 | |||
13 | private $name; |
||
14 | |||
15 | private $nullable; |
||
16 | |||
17 | private $unique; |
||
18 | |||
19 | public function __construct(string $name, array $options = []) |
||
27 | |||
28 | private function parseOptions(string $param) |
||
44 | |||
45 | /** |
||
46 | * @return string |
||
47 | */ |
||
48 | public function getName() |
||
52 | |||
53 | /** |
||
54 | * @return bool |
||
55 | */ |
||
56 | public function isNullable() |
||
60 | |||
61 | /** |
||
62 | * @return bool |
||
63 | */ |
||
64 | public function isUnique(): bool |
||
68 | } |
||
69 |
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: