@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function execute($bound_input_params = NULL) { |
31 | 31 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
32 | - return $this->invokeEventHandler($methodName, array($bound_input_params), function () { |
|
32 | + return $this->invokeEventHandler($methodName, array($bound_input_params), function() { |
|
33 | 33 | return true; |
34 | 34 | }); |
35 | 35 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function fetch($fetch_style = null, $cursor_orientation = PDO::FETCH_ORI_NEXT, $cursor_offset = 0) { |
44 | 44 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
45 | - return $this->invokeEventHandler($methodName, array($fetch_style, $cursor_orientation, $cursor_offset), function () { |
|
45 | + return $this->invokeEventHandler($methodName, array($fetch_style, $cursor_orientation, $cursor_offset), function() { |
|
46 | 46 | return []; |
47 | 47 | }); |
48 | 48 | } |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | */ |
58 | 58 | public function bindParam($parameter, &$variable, $data_type = PDO::PARAM_STR, $length = null, $driver_options = null) { |
59 | 59 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
60 | - return $this->invokeEventHandler($methodName, array($parameter, $variable, $data_type, $driver_options), function () { |
|
60 | + return $this->invokeEventHandler($methodName, array($parameter, $variable, $data_type, $driver_options), function() { |
|
61 | 61 | return true; |
62 | 62 | }); |
63 | 63 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | */ |
73 | 73 | public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null) { |
74 | 74 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
75 | - return $this->invokeEventHandler($methodName, array($column, $param, $type, $maxlen, $driverdata), function () { |
|
75 | + return $this->invokeEventHandler($methodName, array($column, $param, $type, $maxlen, $driverdata), function() { |
|
76 | 76 | return true; |
77 | 77 | }); |
78 | 78 | } |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function bindValue($parameter, $value, $data_type = PDO::PARAM_STR) { |
87 | 87 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
88 | - return $this->invokeEventHandler($methodName, array($parameter, $value, $data_type), function () { |
|
88 | + return $this->invokeEventHandler($methodName, array($parameter, $value, $data_type), function() { |
|
89 | 89 | return true; |
90 | 90 | }); |
91 | 91 | } |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function rowCount() { |
97 | 97 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
98 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
98 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
99 | 99 | return 0; |
100 | 100 | }); |
101 | 101 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function fetchColumn($column_number = 0) { |
108 | 108 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
109 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
109 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
110 | 110 | return ''; |
111 | 111 | }); |
112 | 112 | } |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function fetchAll($how = NULL, $class_name = NULL, $ctor_args = NULL) { |
121 | 121 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
122 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
122 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
123 | 123 | return []; |
124 | 124 | }); |
125 | 125 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function fetchObject($class_name = NULL, $ctor_args = NULL) { |
133 | 133 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
134 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
134 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
135 | 135 | return new \stdClass(); |
136 | 136 | }); |
137 | 137 | } |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function errorCode() { |
143 | 143 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
144 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
144 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
145 | 145 | return ''; |
146 | 146 | }); |
147 | 147 | } |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function errorInfo() { |
153 | 153 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
154 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
154 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
155 | 155 | return [0, 0, 0]; |
156 | 156 | }); |
157 | 157 | } |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | */ |
163 | 163 | public function getAttribute($attribute) { |
164 | 164 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
165 | - return $this->invokeEventHandler($methodName, array($attribute), function ($attribute) { |
|
165 | + return $this->invokeEventHandler($methodName, array($attribute), function($attribute) { |
|
166 | 166 | $attribute = json_encode($attribute); |
167 | - if(array_key_exists($attribute, $this->attributes)) { |
|
167 | + if (array_key_exists($attribute, $this->attributes)) { |
|
168 | 168 | return $this->attributes[$attribute]; |
169 | 169 | } |
170 | 170 | return null; |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function setAttribute($attribute, $value) { |
180 | 180 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
181 | - return $this->invokeEventHandler($methodName, array($attribute, $value), function ($attribute, $value) { |
|
181 | + return $this->invokeEventHandler($methodName, array($attribute, $value), function($attribute, $value) { |
|
182 | 182 | $attribute = json_encode($attribute); |
183 | 183 | $this->attributes[$attribute] = $value; |
184 | 184 | return true; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function columnCount() { |
192 | 192 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
193 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
193 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
194 | 194 | return 0; |
195 | 195 | }); |
196 | 196 | } |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function getColumnMeta($column) { |
203 | 203 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
204 | - return $this->invokeEventHandler($methodName, array($column), function () { |
|
204 | + return $this->invokeEventHandler($methodName, array($column), function() { |
|
205 | 205 | return []; |
206 | 206 | }); |
207 | 207 | } |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | */ |
214 | 214 | public function setFetchMode($mode, $params = NULL) { |
215 | 215 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
216 | - return $this->invokeEventHandler($methodName, array($mode), function () { |
|
216 | + return $this->invokeEventHandler($methodName, array($mode), function() { |
|
217 | 217 | return true; |
218 | 218 | }); |
219 | 219 | } |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function nextRowset() { |
225 | 225 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
226 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
226 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
227 | 227 | return true; |
228 | 228 | }); |
229 | 229 | } |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | */ |
234 | 234 | public function closeCursor() { |
235 | 235 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
236 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
236 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
237 | 237 | return true; |
238 | 238 | }); |
239 | 239 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | */ |
244 | 244 | public function debugDumpParams() { |
245 | 245 | $methodName = $this->methodNameGenerator->getQualifiedMethodName(__FUNCTION__); |
246 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
246 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
247 | 247 | return true; |
248 | 248 | }); |
249 | 249 | } |
@@ -26,11 +26,11 @@ |
||
26 | 26 | * @return mixed |
27 | 27 | */ |
28 | 28 | public function invoke($eventName, array $params, $callee) { |
29 | - if(!$this->isResponsible($eventName, $params, $callee)) { |
|
29 | + if (!$this->isResponsible($eventName, $params, $callee)) { |
|
30 | 30 | return null; |
31 | 31 | } |
32 | 32 | $handler = $this->handlers[$eventName]; |
33 | - if($handler['filterFn'] === null || call_user_func($handler['filterFn'], $eventName, $params, $callee)) { |
|
33 | + if ($handler['filterFn'] === null || call_user_func($handler['filterFn'], $eventName, $params, $callee)) { |
|
34 | 34 | return call_user_func($handler['callback'], $eventName, $params, $callee); |
35 | 35 | } |
36 | 36 | return null; |
@@ -29,10 +29,10 @@ |
||
29 | 29 | */ |
30 | 30 | protected function invokeEventHandler($eventName, array $params = array(), $defaultCallback = null) { |
31 | 31 | $eventHandler = $this->eventHandler; |
32 | - if($eventHandler !== null && $eventHandler->isResponsible($eventName, $params, $this)) { |
|
32 | + if ($eventHandler !== null && $eventHandler->isResponsible($eventName, $params, $this)) { |
|
33 | 33 | return $eventHandler->invoke($eventName, $params, $this); |
34 | 34 | } |
35 | - if($defaultCallback !== null) { |
|
35 | + if ($defaultCallback !== null) { |
|
36 | 36 | return call_user_func_array($defaultCallback, $params); |
37 | 37 | } |
38 | 38 | return null; |
@@ -35,7 +35,7 @@ |
||
35 | 35 | * @return bool |
36 | 36 | */ |
37 | 37 | public function isResponsible($eventName, array $params, $callee) { |
38 | - if($this->isResponsible) { |
|
38 | + if ($this->isResponsible) { |
|
39 | 39 | return call_user_func($this->isResponsible, $eventName, $params); |
40 | 40 | } |
41 | 41 | return true; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | */ |
39 | 39 | public function prepare($statement, $options = NULL) { |
40 | 40 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
41 | - return $this->invokeEventHandler($methodName, array($statement, $options), function () { |
|
41 | + return $this->invokeEventHandler($methodName, array($statement, $options), function() { |
|
42 | 42 | return new FakePDOStatement($this->getEventHandler()); |
43 | 43 | }); |
44 | 44 | } |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function beginTransaction() { |
50 | 50 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
51 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
51 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
52 | 52 | $inTransaction = $this->inTransaction(); |
53 | - if($inTransaction) { |
|
53 | + if ($inTransaction) { |
|
54 | 54 | return false; |
55 | 55 | } else { |
56 | 56 | $this->inTransaction = true; |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function commit() { |
66 | 66 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
67 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
67 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
68 | 68 | $inTransaction = $this->inTransaction(); |
69 | - if($inTransaction) { |
|
69 | + if ($inTransaction) { |
|
70 | 70 | $this->inTransaction = false; |
71 | 71 | return true; |
72 | 72 | } else { |
@@ -80,9 +80,9 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function rollback() { |
82 | 82 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
83 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
83 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
84 | 84 | $inTransaction = $this->inTransaction(); |
85 | - if($inTransaction) { |
|
85 | + if ($inTransaction) { |
|
86 | 86 | $this->inTransaction = false; |
87 | 87 | return true; |
88 | 88 | } else { |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | */ |
97 | 97 | public function inTransaction() { |
98 | 98 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
99 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
99 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
100 | 100 | return $this->inTransaction; |
101 | 101 | }); |
102 | 102 | } |
@@ -107,9 +107,9 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function getAttribute($attribute) { |
109 | 109 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
110 | - return $this->invokeEventHandler($methodName, array($attribute), function ($attribute) { |
|
110 | + return $this->invokeEventHandler($methodName, array($attribute), function($attribute) { |
|
111 | 111 | $attribute = json_encode($attribute); |
112 | - if(array_key_exists($attribute, $this->attributes)) { |
|
112 | + if (array_key_exists($attribute, $this->attributes)) { |
|
113 | 113 | return $this->attributes[$attribute]; |
114 | 114 | } |
115 | 115 | return null; |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function setAttribute($attribute, $value) { |
125 | 125 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
126 | - return $this->invokeEventHandler($methodName, array($attribute, $value), function ($attribute, $value) { |
|
126 | + return $this->invokeEventHandler($methodName, array($attribute, $value), function($attribute, $value) { |
|
127 | 127 | $attribute = json_encode($attribute); |
128 | 128 | $this->attributes[$attribute] = $value; |
129 | 129 | return true; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | */ |
137 | 137 | public function exec($statement) { |
138 | 138 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
139 | - return $this->invokeEventHandler($methodName, array($statement), function () { |
|
139 | + return $this->invokeEventHandler($methodName, array($statement), function() { |
|
140 | 140 | return 1; |
141 | 141 | }); |
142 | 142 | } |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function query($statement, ?int $fetchMode = null, ...$fetchModeArgs) { |
149 | 149 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
150 | - return $this->invokeEventHandler($methodName, array($statement), function () { |
|
150 | + return $this->invokeEventHandler($methodName, array($statement), function() { |
|
151 | 151 | return new FakePDOStatement($this->getEventHandler()); |
152 | 152 | }); |
153 | 153 | } |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function lastInsertId($name = null) { |
160 | 160 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
161 | - return $this->invokeEventHandler($methodName, array($name), function () { |
|
161 | + return $this->invokeEventHandler($methodName, array($name), function() { |
|
162 | 162 | return null; |
163 | 163 | }); |
164 | 164 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function errorCode() { |
170 | 170 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
171 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
171 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
172 | 172 | return null; |
173 | 173 | }); |
174 | 174 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | */ |
179 | 179 | public function errorInfo() { |
180 | 180 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
181 | - return $this->invokeEventHandler($methodName, array(), function () { |
|
181 | + return $this->invokeEventHandler($methodName, array(), function() { |
|
182 | 182 | return [0, 0, 0]; |
183 | 183 | }); |
184 | 184 | } |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function quote($string, $parameter_type = PDO::PARAM_STR) { |
192 | 192 | $methodName = $this->methodNameGeneratorA->getQualifiedMethodName(__FUNCTION__); |
193 | - return $this->invokeEventHandler($methodName, array($string, $parameter_type), function ($string) { |
|
193 | + return $this->invokeEventHandler($methodName, array($string, $parameter_type), function($string) { |
|
194 | 194 | return $string; |
195 | 195 | }); |
196 | 196 | } |