| Conditions | 5 |
| Paths | 5 |
| Total Lines | 22 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 19 |
| CRAP Score | 5 |
| Changes | 4 | ||
| Bugs | 1 | Features | 1 |
| 1 | <?php |
||
| 30 | 3 | protected function execute() |
|
| 31 | { |
||
| 32 | 3 | $command = new FindResourceOptionsCommand($this->resourceDO, $this->filesystem); |
|
| 33 | 3 | $result = $command([ |
|
|
1 ignored issue
–
show
|
|||
| 34 | 3 | ResourceImageDO::TOKEN_DIMENSION, |
|
| 35 | 3 | ]); |
|
| 36 | 2 | foreach ($result as $dimension) { |
|
| 37 | 1 | $dimension = array_key_exists(ResourceImageDO::TOKEN_DIMENSION, $dimension) |
|
| 38 | 1 | ? $dimension[ResourceImageDO::TOKEN_DIMENSION] |
|
| 39 | 1 | : ''; |
|
| 40 | 1 | $dimension = explode('x', $dimension); |
|
| 41 | 1 | if (false !== $dimension && 2 === count($dimension)) { |
|
| 42 | 1 | $destroyDO = clone $this->resourceDO; |
|
| 43 | 1 | $destroyDO->setWidth($dimension[0]); |
|
| 44 | 1 | $destroyDO->setHeight($dimension[1]); |
|
| 45 | 1 | $command = new DestroyResourceCommand($destroyDO, $this->filesystem); |
|
| 46 | 1 | $command(true); |
|
| 47 | 1 | } |
|
| 48 | 2 | } |
|
| 49 | |||
| 50 | 2 | return true; |
|
| 51 | } |
||
| 52 | } |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.