| Conditions | 5 |
| Paths | 6 |
| Total Lines | 36 |
| Code Lines | 21 |
| Lines | 6 |
| Ratio | 16.67 % |
| Changes | 3 | ||
| Bugs | 1 | Features | 2 |
| 1 | <?php |
||
| 28 | public function handle(Configuration $config, array $data) |
||
| 29 | { |
||
| 30 | foreach ($this->getManifestDirectories() as $name => $dir) { |
||
| 31 | if (is_dir($dir)) { |
||
| 32 | if ($this->override) { |
||
| 33 | $this->logger->info(sprintf( |
||
| 34 | 'REMOVING: Deleting ‘%s‘ folder', |
||
| 35 | $name |
||
| 36 | )); |
||
| 37 | |||
| 38 | General::deleteDirectory($dir); |
||
| 39 | } else { |
||
| 40 | $this->logger->info(sprintf( |
||
| 41 | 'SKIPPING: `%s` folder exists', |
||
| 42 | $name |
||
| 43 | )); |
||
| 44 | |||
| 45 | continue; |
||
| 46 | } |
||
| 47 | } |
||
| 48 | |||
| 49 | $this->logger->info(sprintf( |
||
| 50 | 'WRITING: Creating ‘%s‘ folder', |
||
| 51 | $name |
||
| 52 | )); |
||
| 53 | |||
| 54 | View Code Duplication | if (!General::realiseDirectory($dir, $config->get('write_mode', 'directory'))) { |
|
|
|
|||
| 55 | throw new Exception(sprintf( |
||
| 56 | 'Could not create ‘%s’ directory. Check permission on the root folder.', |
||
| 57 | $name |
||
| 58 | )); |
||
| 59 | } |
||
| 60 | } |
||
| 61 | |||
| 62 | return true; |
||
| 63 | } |
||
| 64 | } |
||
| 65 |
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: