From 81d163fb66a9793d4bae68f0ad0b1055ec343c85 Mon Sep 17 00:00:00 2001 From: prolic Date: Fri, 29 Jun 2018 18:15:39 +0800 Subject: [PATCH] apply php cs fixes --- src/CommandResult.php | 5 +++-- src/ConnectionException.php | 3 ++- src/Connector.php | 3 ++- src/Executor.php | 3 ++- src/FailureException.php | 3 ++- src/Link.php | 3 ++- src/Operation.php | 3 ++- src/Pool.php | 3 ++- src/PoolError.php | 3 ++- src/QueryError.php | 12 ++++++++---- src/Statement.php | 3 ++- src/Transaction.php | 3 ++- src/TransactionError.php | 3 ++- 13 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/CommandResult.php b/src/CommandResult.php index cdc86ed..046b531 100644 --- a/src/CommandResult.php +++ b/src/CommandResult.php @@ -2,11 +2,12 @@ namespace Amp\Sql; -interface CommandResult { +interface CommandResult +{ /** * Returns the number of rows affected by the query. * * @return int */ public function affectedRows(): int; -} \ No newline at end of file +} diff --git a/src/ConnectionException.php b/src/ConnectionException.php index 3672312..36ffc29 100644 --- a/src/ConnectionException.php +++ b/src/ConnectionException.php @@ -2,5 +2,6 @@ namespace Amp\Sql; -class ConnectionException extends FailureException { +class ConnectionException extends FailureException +{ } diff --git a/src/Connector.php b/src/Connector.php index 5014dfe..90bdc9a 100644 --- a/src/Connector.php +++ b/src/Connector.php @@ -4,7 +4,8 @@ namespace Amp\Sql; use Amp\Promise; -interface Connector { +interface Connector +{ /** * @param ConnectionConfig $config * diff --git a/src/Executor.php b/src/Executor.php index 07c7844..9607bca 100644 --- a/src/Executor.php +++ b/src/Executor.php @@ -4,7 +4,8 @@ namespace Amp\Sql; use Amp\Promise; -interface Executor { +interface Executor +{ /** * @param string $sql SQL query to execute. * diff --git a/src/FailureException.php b/src/FailureException.php index 31171ea..9c66413 100644 --- a/src/FailureException.php +++ b/src/FailureException.php @@ -2,5 +2,6 @@ namespace Amp\Sql; -class FailureException extends \Exception { +class FailureException extends \Exception +{ } diff --git a/src/Link.php b/src/Link.php index 1f67e28..5d117a3 100644 --- a/src/Link.php +++ b/src/Link.php @@ -4,7 +4,8 @@ namespace Amp\Sql; use Amp\Promise; -interface Link extends Executor { +interface Link extends Executor +{ /** * Starts a transaction on a single connection. * diff --git a/src/Operation.php b/src/Operation.php index 0f98a46..3316cc8 100644 --- a/src/Operation.php +++ b/src/Operation.php @@ -2,7 +2,8 @@ namespace Amp\Sql; -interface Operation { +interface Operation +{ /** * @param callable $onDestruct Callback executed when the operation completes or the object is destroyed. */ diff --git a/src/Pool.php b/src/Pool.php index e92d26b..1c71b96 100644 --- a/src/Pool.php +++ b/src/Pool.php @@ -4,7 +4,8 @@ namespace Amp\Sql; use Amp\Promise; -interface Pool extends Link { +interface Pool extends Link +{ const DEFAULT_MAX_CONNECTIONS = 100; const DEFAULT_IDLE_TIMEOUT = 60; diff --git a/src/PoolError.php b/src/PoolError.php index 150e1ca..fe623ff 100644 --- a/src/PoolError.php +++ b/src/PoolError.php @@ -2,5 +2,6 @@ namespace Amp\Sql; -class PoolError extends \Error { +class PoolError extends \Error +{ } diff --git a/src/QueryError.php b/src/QueryError.php index 2d00f50..2a9d460 100644 --- a/src/QueryError.php +++ b/src/QueryError.php @@ -2,21 +2,25 @@ namespace Amp\Sql; -class QueryError extends \Error { +class QueryError extends \Error +{ protected $query = ""; - public function __construct(string $message, string $query = "", \Throwable $previous = null) { + public function __construct(string $message, string $query = "", \Throwable $previous = null) + { if ($query != "") { $this->query = $query; } parent::__construct($message, 0, $previous); } - final public function getQuery(): string { + final public function getQuery(): string + { return $this->query; } - public function __toString(): string { + public function __toString(): string + { if ($this->query == "") { return parent::__toString(); } diff --git a/src/Statement.php b/src/Statement.php index 0443cdd..fc1c8fc 100644 --- a/src/Statement.php +++ b/src/Statement.php @@ -4,7 +4,8 @@ namespace Amp\Sql; use Amp\Promise; -interface Statement { +interface Statement +{ /** * @param mixed[] $params * diff --git a/src/Transaction.php b/src/Transaction.php index 03a76b3..14debba 100644 --- a/src/Transaction.php +++ b/src/Transaction.php @@ -4,7 +4,8 @@ namespace Amp\Sql; use Amp\Promise; -interface Transaction extends Executor, Operation { +interface Transaction extends Executor, Operation +{ const ISOLATION_UNCOMMITTED = 0; const ISOLATION_COMMITTED = 1; const ISOLATION_REPEATABLE = 2; diff --git a/src/TransactionError.php b/src/TransactionError.php index 05faa12..ea44546 100644 --- a/src/TransactionError.php +++ b/src/TransactionError.php @@ -2,5 +2,6 @@ namespace Amp\Sql; -class TransactionError extends \Error { +class TransactionError extends \Error +{ }