Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
harrygulliford committed Oct 15, 2024
1 parent 58eb006 commit 1f61b07
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 33 deletions.
8 changes: 4 additions & 4 deletions src/FirebirdConnection.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand All @@ -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()
{
Expand All @@ -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()
{
Expand Down
32 changes: 13 additions & 19 deletions src/FirebirdConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/Query/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [])
Expand Down
8 changes: 5 additions & 3 deletions src/Query/Grammars/FirebirdGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
'=', '<', '>', '<=', '>=', '<>', '!=',
Expand All @@ -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
*/
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/Schema/Grammars/FirebirdGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 1f61b07

Please sign in to comment.