Conditions | 4 |
Paths | 6 |
Total Lines | 23 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 4.0058 |
Changes | 0 |
1 | <?php |
||
31 | 3 | public function invoke(MethodInvocation $invocation) |
|
32 | { |
||
33 | /** @var ReflectionMethod $method */ |
||
34 | 3 | $method = $invocation->getMethod(); |
|
35 | /** @var Transactional $transactional */ |
||
36 | 3 | $transactional = $method->getAnnotation(Transactional::class); |
|
37 | 3 | if (\count($transactional->value) > 1) { |
|
|
|||
38 | 1 | return (new PropTransaction)($invocation, $transactional); |
|
39 | } |
||
40 | 2 | if (! $this->pdo instanceof ExtendedPdoInterface) { |
|
41 | return $invocation->proceed(); |
||
42 | } |
||
43 | try { |
||
44 | 2 | $this->pdo->beginTransaction(); |
|
45 | 2 | $result = $invocation->proceed(); |
|
46 | 1 | $this->pdo->commit(); |
|
47 | 1 | } catch (\PDOException $e) { |
|
48 | 1 | $this->pdo->rollBack(); |
|
49 | 1 | throw new RollbackException($e->getMessage(), 0, $e); |
|
50 | } |
||
51 | |||
52 | 1 | return $result; |
|
53 | } |
||
54 | } |
||
55 |
This property has been deprecated. The supplier of the class has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the property will be removed from the class and what other property to use instead.