1919class Client
2020{
2121 private function __construct () {}
22-
22+
2323 private static $ logHandler = null ;
2424 private static $ errorHandler = null ;
2525 private static array $ statistics = [];
@@ -36,7 +36,7 @@ private function __construct() {}
3636
3737 /**
3838 * Assigned handler is called every time query is executed
39- * @var callable|null (string $query, array $params, array $statistics)
39+ * @param callable|null $handler (string $query, array $params, array $statistics)
4040 */
4141 public static function setLogHandler (?callable $ handler = null ): void
4242 {
@@ -45,7 +45,7 @@ public static function setLogHandler(?callable $handler = null): void
4545
4646 /**
4747 * Provided handler is invoked on Exception instead of trigger_error
48- * @var callable|null (Exception $e)
48+ * @param callable|null $handler (Exception $e)
4949 */
5050 public static function setErrorHandler (?callable $ handler = null ): void
5151 {
@@ -54,9 +54,9 @@ public static function setErrorHandler(?callable $handler = null): void
5454
5555 /**
5656 * Format failure response into exception message and throw it
57- *
58- * @param Response $response
59- * @throws Exception
57+ *
58+ * @param Response $response
59+ * @throws Exception
6060 */
6161 private static function failureAsException (Response $ response ): void
6262 {
@@ -248,11 +248,11 @@ public static function queryFirstColumn(string $query, array $params = [], array
248248 */
249249 public static function begin (array $ extra = []): bool
250250 {
251- if (version_compare (self ::getProtocol ()->getVersion (), '3 ' , '< ' )) {
252- return false ;
253- }
254-
255251 try {
252+ if (version_compare (self ::getProtocol ()->getVersion (), '3 ' , '< ' )) {
253+ return false ;
254+ }
255+
256256 /** @var Response $response */
257257 $ response = self ::getProtocol ()->begin ($ extra )->getResponse ();
258258 if ($ response ->signature != Signature::SUCCESS ) {
@@ -276,11 +276,11 @@ public static function begin(array $extra = []): bool
276276 */
277277 public static function commit (): bool
278278 {
279- if (version_compare (self ::getProtocol ()->getVersion (), '3 ' , '< ' )) {
280- return false ;
281- }
282-
283279 try {
280+ if (version_compare (self ::getProtocol ()->getVersion (), '3 ' , '< ' )) {
281+ return false ;
282+ }
283+
284284 /** @var Response $response */
285285 $ response = self ::getProtocol ()->commit ()->getResponse ();
286286 if ($ response ->signature != Signature::SUCCESS ) {
@@ -304,11 +304,11 @@ public static function commit(): bool
304304 */
305305 public static function rollback (): bool
306306 {
307- if (version_compare (self ::getProtocol ()->getVersion (), '3 ' , '< ' )) {
308- return false ;
309- }
310-
311307 try {
308+ if (version_compare (self ::getProtocol ()->getVersion (), '3 ' , '< ' )) {
309+ return false ;
310+ }
311+
312312 /** @var Response $response */
313313 $ response = self ::getProtocol ()->rollback ()->getResponse ();
314314 if ($ response ->signature != Signature::SUCCESS ) {
0 commit comments