1 | <?php |
||
11 | trait UpdateOneVersionOneMethod |
||
12 | { |
||
13 | |||
14 | /** |
||
15 | * Find update methods (syntax : update_X_Y_Z()) |
||
16 | * |
||
17 | * @param UpdateInterface $object |
||
18 | * @return array |
||
19 | */ |
||
20 | protected function findUpdateMethods(UpdateInterface $object) |
||
34 | |||
35 | /** |
||
36 | * Update bundle |
||
37 | * |
||
38 | * @param UpdateInterface $updater Use $this in your class |
||
39 | * @param BundleVersion $bundleVersion |
||
40 | * @param Version $version Update to this version |
||
41 | * @return Version |
||
42 | */ |
||
43 | protected function updateOneVersionOneMethod(UpdateInterface $updater, BundleVersion $bundleVersion, Version $version) |
||
57 | |||
58 | /** |
||
59 | * Update bundle |
||
60 | * |
||
61 | * @param BundleVersion $bundleVersion |
||
62 | * @param Version $version Update to this version |
||
63 | * @return Version |
||
64 | */ |
||
65 | public function update(BundleVersion $bundleVersion, Version $version) |
||
69 | } |
||
70 |
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: