Skip to content

Commit

Permalink
Fix for Lumen
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxime Rault committed Jun 9, 2017
1 parent ebf2348 commit dd6771f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
3 changes: 1 addition & 2 deletions src/Connectors/ODBCZOSConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ protected function getDsn(array $config)
'Protocol=TCPIP',
'Uid=%s',
'Pwd=%s',
'',
// Just to add a semicolon to the end of string
'', // Just to add a semicolon to the end of string
];

$dsnConfig = [
Expand Down
4 changes: 2 additions & 2 deletions src/DB2Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ protected function getDefaultQueryGrammar()
*/
protected function getDefaultSchemaGrammar()
{
return $this->withTablePrefix(new SchemaGrammar($this->config['driver'] == "odbc"?"i":"c"));
return $this->withTablePrefix(new SchemaGrammar($this->config['driver'] == 'odbc' ? 'i' : 'c'));
}

/**
Expand All @@ -115,6 +115,6 @@ protected function getDefaultPostProcessor()
return new DB2ZOSProcessor();
}

return new DB2Processor($this->config['driver'] == "odbc"?"i":"c");
return new DB2Processor($this->config['driver'] == 'odbc' ? 'i' : 'c');
}
}
12 changes: 3 additions & 9 deletions src/DB2ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Cooperl\Database\DB2\Connectors\IBMConnector;
use Cooperl\Database\DB2\Connectors\ODBCZOSConnector;
use Illuminate\Support\ServiceProvider;
use Config;

/**
* Class DB2ServiceProvider
Expand Down Expand Up @@ -39,18 +38,13 @@ public function boot()
public function register()
{
// get the configs
$conns = is_array(Config::get('laravel-db2::database.connections'))
? Config::get('laravel-db2::database.connections')
: [];
$conns = is_array(config('laravel-db2::database.connections')) ? config('laravel-db2::database.connections') : [];

// Add my database configurations to the default set of configurations
$this->app['config']['database.connections'] = array_merge(
$conns,
$this->app['config']['database.connections']
);
config(['database.connections' => array_merge($conns, config('database.connections'))]);

// Extend the connections with pdo_odbc and pdo_ibm drivers
foreach (Config::get('database.connections') as $conn => $config) {
foreach (config('database.connections') as $conn => $config) {
// Only use configurations that feature a "odbc", "ibm" or "odbczos" driver
if (!isset($config['driver']) || !in_array($config['driver'], ['odbc', 'ibm', 'odbczos', 'odbcexpress'])) {
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/Schema/Blueprint.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function label($label)
*
* @return \Illuminate\Support\Fluent
*/
protected function indexCommand($type, $columns, $index, $algorithm = NULL)
protected function indexCommand($type, $columns, $index, $algorithm = null)
{
$columns = (array) $columns;

Expand Down

0 comments on commit dd6771f

Please sign in to comment.