| 1 | <?php |
||
| 27 | final class SelfRemoving implements ActionInterface, VarAwareInterface |
||
| 28 | { |
||
| 29 | use VarAwareTrait, |
||
| 30 | FilesystemAwareTrait; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * Function execute |
||
| 34 | * |
||
| 35 | * @throws RuntimeException |
||
| 36 | */ |
||
| 37 | 2 | public function execute() |
|
| 38 | { |
||
| 39 | 2 | $root = $this->vars['root']; |
|
| 40 | |||
| 41 | try { |
||
| 42 | 2 | $finder = Finder::create() |
|
| 43 | 2 | ->files() |
|
| 44 | 2 | ->in($root) |
|
| 45 | 2 | ->exclude(basename($this->vars['skeleton'])) |
|
| 46 | 2 | ->depth(0) |
|
| 47 | 2 | ->ignoreDotFiles(false); |
|
| 48 | 2 | $this->fs->remove($finder); |
|
|
|
|||
| 49 | 2 | $this->fs->remove([$root.'/src', $root.'/tests']); |
|
| 50 | } catch (\Exception $e) { |
||
| 51 | throw new RuntimeException($e->getMessage(), $e->getCode(), $e); |
||
| 52 | } |
||
| 53 | 2 | } |
|
| 54 | |||
| 55 | /** |
||
| 56 | * {@inheritdoc} |
||
| 57 | */ |
||
| 58 | 4 | public function getPriority(): int |
|
| 62 | } |
||
| 63 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: