1 | <?php |
||
23 | class DeclareErrorInterceptor extends BaseInterceptor |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * Error message to show for this interceptor |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | private $message = ''; |
||
32 | |||
33 | /** |
||
34 | * Default level of error |
||
35 | * |
||
36 | * @var int |
||
37 | */ |
||
38 | private $level = E_USER_NOTICE; |
||
39 | |||
40 | /** |
||
41 | * Default constructor for interceptor |
||
42 | * |
||
43 | * @param string $message Text message for error |
||
44 | * @param int $level Level of error |
||
45 | * @param string|null $pointcutExpression Pointcut expression |
||
46 | */ |
||
47 | public function __construct($message, $level, $pointcutExpression) |
||
54 | |||
55 | /** |
||
56 | * Serializes an interceptor into string representation |
||
57 | * |
||
58 | * @return string the string representation of the object or null |
||
59 | */ |
||
60 | public function serialize() |
||
67 | |||
68 | /** |
||
69 | * Unserialize an interceptor from the string |
||
70 | * |
||
71 | * @param string $serialized The string representation of the object. |
||
72 | * @return void |
||
73 | */ |
||
74 | public function unserialize($serialized) |
||
82 | |||
83 | /** |
||
84 | * Returns an advice |
||
85 | * |
||
86 | * @return \Closure |
||
87 | */ |
||
88 | private static function getDeclareErrorAdvice() |
||
104 | |||
105 | /** |
||
106 | * Implement this method to perform extra treatments before and |
||
107 | * after the invocation. Polite implementations would certainly |
||
108 | * like to invoke {@link Joinpoint::proceed()}. |
||
109 | * |
||
110 | * @param Joinpoint $joinpoint the method invocation joinpoint |
||
111 | * |
||
112 | * @return mixed the result of the call to {@link Joinpoint::proceed()} |
||
113 | */ |
||
114 | public function invoke(Joinpoint $joinpoint) |
||
127 | } |
||
128 |