1 | <?php |
||
30 | class InterceptedClass |
||
31 | { |
||
32 | /** |
||
33 | * A method returing a value. |
||
34 | * |
||
35 | * @return null Null value. |
||
36 | */ |
||
37 | public function aMethod() |
||
38 | { |
||
39 | return null; |
||
40 | } |
||
41 | |||
42 | /** |
||
43 | * A method throwing an exception. |
||
44 | * |
||
45 | * @param string $exceptionClass Exception class to be thrown. |
||
46 | * @throws Exception The thrown exception. |
||
47 | */ |
||
48 | public function bMethodThrowException($exceptionClass) |
||
49 | { |
||
50 | $reflectedException = new ReflectionClass($exceptionClass); |
||
51 | throw $reflectedException->newInstance(); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * A method returning the result of another method (to check nested transactions). |
||
56 | * |
||
57 | * @param Closure $nestedCallback Nested [@link TransactionalInterceptor::intercept} call. |
||
58 | * @param array $parameters Parameters for the nested call. |
||
59 | * @return null Null value. |
||
60 | */ |
||
61 | public function cMethod(Closure $nestedCallback, array $parameters = null) |
||
62 | { |
||
63 | return call_user_func_array($nestedCallback, $parameters); |
||
64 | } |
||
65 | } |
||
66 |