From 1f61b078e344a3c6ab191dcb3ce30ac9b213edf5 Mon Sep 17 00:00:00 2001 From: Harry Gulliford Date: Tue, 15 Oct 2024 14:40:18 +1100 Subject: [PATCH] Formatting --- src/FirebirdConnection.php | 8 +++---- src/FirebirdConnector.php | 32 ++++++++++--------------- src/Query/Builder.php | 4 ++-- src/Query/Grammars/FirebirdGrammar.php | 8 ++++--- src/Schema/Grammars/FirebirdGrammar.php | 10 ++++---- 5 files changed, 29 insertions(+), 33 deletions(-) diff --git a/src/FirebirdConnection.php b/src/FirebirdConnection.php index 519034c..612ccc6 100755 --- a/src/FirebirdConnection.php +++ b/src/FirebirdConnection.php @@ -32,9 +32,9 @@ protected function getDefaultPostProcessor() } /** - * Get a schema builder instance for this connection. + * Get a schema builder instance for the connection. * - * @return \Firebird\Schema\Builder + * @return \Illuminate\Database\Schema\Builder */ public function getSchemaBuilder() { @@ -48,7 +48,7 @@ public function getSchemaBuilder() /** * Get the default schema grammar instance. * - * @return \Firebird\Schema\Grammars\FirebirdGrammar + * @return \Illuminate\Database\Schema\Grammars\Grammar|null */ protected function getDefaultSchemaGrammar() { @@ -58,7 +58,7 @@ protected function getDefaultSchemaGrammar() /** * Get a new query builder instance. * - * @return \Firebird\Query\Builder + * @return \Illuminate\Database\Query\Builder */ public function query() { diff --git a/src/FirebirdConnector.php b/src/FirebirdConnector.php index b6e42bb..b810124 100755 --- a/src/FirebirdConnector.php +++ b/src/FirebirdConnector.php @@ -15,11 +15,11 @@ class FirebirdConnector extends Connector implements ConnectorInterface */ public function connect(array $config) { - return $this->createConnection( - $this->getDsn($config), - $config, - $this->getOptions($config) - ); + $dsn = $this->getDsn($config); + + $options = $this->getOptions($config); + + return $this->createConnection($dsn, $config, $options); } /** @@ -30,26 +30,20 @@ public function connect(array $config) */ protected function getDsn(array $config) { - extract($config); - - if (! isset($host) || ! isset($database)) { - trigger_error('Cannot connect to Firebird Database, no host or database supplied'); - } - - $dsn = "firebird:dbname={$host}"; + $dsn = "firebird:dbname={$config['host']}"; - if (isset($port)) { - $dsn .= "/{$port}"; + if (isset($config['port'])) { + $dsn .= "/{$config['port']}"; } - $dsn .= ":{$database};"; + $dsn .= ":{$config['database']};"; - if (isset($role)) { - $dsn .= "role={$role};"; + if (isset($config['role'])) { + $dsn .= "role={$config['role']};"; } - if (isset($charset)) { - $dsn .= "charset={$charset};"; + if (isset($config['charset'])) { + $dsn .= "charset={$config['charset']};"; } return $dsn; diff --git a/src/Query/Builder.php b/src/Query/Builder.php index 3e1d516..aed3394 100755 --- a/src/Query/Builder.php +++ b/src/Query/Builder.php @@ -17,10 +17,10 @@ public function exists() } /** - * Add a from stored procedure clause to the query builder. + * Set the stored procedure which the query is targeting. * * @param string $procedure - * @param array $values + * @param array $bindings * @return \Illuminate\Database\Query\Builder|static */ public function fromProcedure(string $procedure, array $values = []) diff --git a/src/Query/Grammars/FirebirdGrammar.php b/src/Query/Grammars/FirebirdGrammar.php index b0b6fc3..98a6047 100755 --- a/src/Query/Grammars/FirebirdGrammar.php +++ b/src/Query/Grammars/FirebirdGrammar.php @@ -32,7 +32,7 @@ class FirebirdGrammar extends Grammar * * @var array * - * @link https://ib-aid.com/download/docs/firebird-language-reference-2.5/fblangref25-commons-predicates.html + * @link https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref40/fblangref40-commons.html#fblangref40-commons-compar */ protected $operators = [ '=', '<', '>', '<=', '>=', '<>', '!=', @@ -42,7 +42,9 @@ class FirebirdGrammar extends Grammar ]; /** - * @param Builder $query + * Compile the "select *" portion of the query. + * + * @param \Illuminate\Database\Query\Builder $query * @param array $columns * @return string|null */ @@ -139,7 +141,7 @@ protected function dateBasedWhere($type, Builder $query, $where) } /** - * Compile SQL statement for a stored procedure. + * Compile the select clause for a stored procedure. * * @param \Illuminate\Database\Query\Builder $query * @param string $procedure diff --git a/src/Schema/Grammars/FirebirdGrammar.php b/src/Schema/Grammars/FirebirdGrammar.php index e56d3e2..439495a 100755 --- a/src/Schema/Grammars/FirebirdGrammar.php +++ b/src/Schema/Grammars/FirebirdGrammar.php @@ -352,7 +352,7 @@ protected function typeLongText(Fluent $column) } /** - * Create the column definition for a integer type. + * Create the column definition for an integer type. * * @param \Illuminate\Support\Fluent $column * @return string @@ -451,7 +451,7 @@ protected function typeBoolean(Fluent $column) } /** - * Create the column definition for an enum type. + * Create the column definition for an enumeration type. * * @param \Illuminate\Support\Fluent $column * @return string @@ -510,7 +510,7 @@ protected function typeDateTime(Fluent $column) } /** - * Create the column definition for a date-time type. + * Create the column definition for a date-time (with time zone) type. * * @param \Illuminate\Support\Fluent $column * @return string @@ -533,7 +533,7 @@ protected function typeTime(Fluent $column) } /** - * Create the column definition for a time type. + * Create the column definition for a time (with time zone) type. * * @param \Illuminate\Support\Fluent $column * @return string @@ -560,7 +560,7 @@ protected function typeTimestamp(Fluent $column) } /** - * Create the column definition for a timestamp type. + * Create the column definition for a timestamp (with time zone) type. * * @param \Illuminate\Support\Fluent $column * @return string