| Total Complexity | 5 |
| Total Lines | 42 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class MoveCodeToSRC extends Task |
||
| 12 | { |
||
| 13 | protected $taskStep = 's30'; |
||
| 14 | |||
| 15 | public function getTitle() |
||
| 16 | { |
||
| 17 | return 'Move code to src folder'; |
||
| 18 | } |
||
| 19 | |||
| 20 | public function getDescription() |
||
| 23 | Move the code folder to the src folder to match PSR requirements.'; |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * [runActualTask description] |
||
| 28 | * @param array $params not currently used for this task |
||
| 29 | * @return [type] [description] |
||
|
|
|||
| 30 | */ |
||
| 31 | public function runActualTask($params = []) |
||
| 32 | { |
||
| 33 | foreach ($this->mu()->getExistingModuleDirLocations() as $moduleDir) { |
||
| 34 | $old = './code/'; |
||
| 35 | $new = './src/'; |
||
| 36 | $this->mu()->execMe( |
||
| 37 | $moduleDir, |
||
| 38 | ' |
||
| 39 | if test -d ' . $old . '; then |
||
| 40 | mv -vn ' . $old . ' ' . $new . '; |
||
| 41 | else |
||
| 42 | echo \' !!!!!!!!! Error in moving ' . $moduleDir . '/' . $old . ' to ' . $moduleDir . '/' . $new . ' !!!!!!!!! \'; |
||
| 43 | fi;', |
||
| 44 | 'moving ' . $old . ' to ' . $new . ' -v is verbose, -n is only if destination does not exists', |
||
| 45 | false |
||
| 46 | ); |
||
| 47 | } |
||
| 48 | } |
||
| 49 | |||
| 50 | protected function hasCommitAndPush() |
||
| 53 | } |
||
| 54 | } |
||
| 55 |