| Conditions | 4 |
| Paths | 6 |
| Total Lines | 26 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | public function __construct($closure = null) |
||
| 37 | { |
||
| 38 | if (!is_callable($closure)) { |
||
| 39 | throw new \Exception("Transaction must have a callable as parameter."); |
||
| 40 | |||
| 41 | } else { |
||
| 42 | $connection = $this->getConnection(); |
||
| 43 | |||
| 44 | try { |
||
| 45 | $connection->beginTransaction(); |
||
| 46 | |||
| 47 | $this->results = $closure($connection); |
||
| 48 | |||
| 49 | if ($this->results === false) { |
||
| 50 | $connection->rollbackTransaction(); |
||
| 51 | } else { |
||
| 52 | $connection->commitTransaction(); |
||
| 53 | } |
||
| 54 | |||
| 55 | } catch (\Exception $e) { |
||
| 56 | $connection->rollbackTransaction(); |
||
| 57 | $this->error = $e; |
||
| 58 | } |
||
| 59 | |||
| 60 | } |
||
| 61 | return $this; |
||
| 62 | } |
||
| 101 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths