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