Conditions | 3 |
Paths | 6 |
Total Lines | 25 |
Code Lines | 17 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 3.0146 |
Changes | 0 |
1 | <?php |
||
32 | 2 | public function execute() |
|
33 | { |
||
34 | try { |
||
35 | /** @var Finder $finder */ |
||
36 | 2 | $finder = Finder::create() |
|
37 | 2 | ->files() |
|
38 | 2 | ->in($this->vars['skeleton']) |
|
39 | 2 | ->ignoreDotFiles(false); |
|
40 | |||
41 | 2 | foreach ($finder as $file) { |
|
42 | 2 | $target = str_replace( |
|
43 | 2 | $this->vars['skeleton'], |
|
44 | 2 | $this->vars['root'], |
|
45 | 2 | $file->getRealPath() |
|
46 | ); |
||
47 | 2 | $this->fs->rename( |
|
48 | 2 | $file->getRealPath(), |
|
49 | 2 | (string)StaticStringy::removeRight($target, '.skltn'), |
|
50 | 2 | true |
|
51 | ); |
||
52 | } |
||
53 | } catch (\Exception $e) { |
||
54 | throw new \RuntimeException($e->getMessage(), $e->getCode(), $e); |
||
55 | } |
||
56 | 2 | } |
|
57 | |||
66 |