Conditions | 5 |
Paths | 8 |
Total Lines | 19 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 5 | ||
Bugs | 1 | Features | 1 |
1 | <?php |
||
31 | public function prepare() |
||
32 | { |
||
33 | $migrationDirectory = $this->baseDirectory; |
||
34 | if ($this->fileSystem->exists($migrationDirectory)) { |
||
35 | $this->fileSystem->remove(array($migrationDirectory)); |
||
36 | } |
||
37 | $this->fileSystem->mkdir($migrationDirectory); |
||
38 | |||
39 | foreach ($this->bundles as $bundle) { |
||
40 | $bundleMigrationDirectory = $bundle->getPath() . '/Resources/migrations'; |
||
41 | if (file_exists($bundleMigrationDirectory)) { |
||
42 | $finder = new Finder(); |
||
43 | $finder->files('*.php')->in($bundleMigrationDirectory); |
||
44 | foreach ($finder as $file) { |
||
45 | $this->fileSystem->copy($file->getRealpath(), $migrationDirectory . '/' . $file->getFilename(), true); |
||
46 | } |
||
47 | } |
||
48 | } |
||
49 | } |
||
50 | } |
||
51 |
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: