1 | <?php |
||
5 | class MigrationField |
||
6 | { |
||
7 | private $name; |
||
8 | |||
9 | private $type; |
||
10 | |||
11 | private $nullable = false; |
||
12 | |||
13 | private $unique = false; |
||
14 | |||
15 | private $default = null; |
||
16 | |||
17 | private $foreign = null; |
||
18 | |||
19 | public function __construct(string $field) |
||
23 | |||
24 | private function parse(string $field) |
||
35 | |||
36 | private function fillObject(string $param) |
||
56 | |||
57 | /** |
||
58 | * @return string |
||
59 | */ |
||
60 | public function getName() |
||
64 | |||
65 | /** |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getType() |
||
72 | |||
73 | /** |
||
74 | * @return mixed |
||
|
|||
75 | */ |
||
76 | public function getDefault() |
||
80 | |||
81 | /** |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function isNullable() |
||
88 | |||
89 | /** |
||
90 | * @return bool |
||
91 | */ |
||
92 | public function isUnique(): bool |
||
96 | |||
97 | public function makeValidationRule(): string |
||
118 | |||
119 | public function makeColumn() |
||
127 | |||
128 | public function makeField() |
||
136 | } |
||
137 |
This check looks for the generic type
array
as a return type and suggests a more specific type. This type is inferred from the actual code.