clean code

This commit is contained in:
Maxime Rault 2016-08-24 09:41:28 +02:00
parent e8f17c13a7
commit ecba8b0b03
8 changed files with 7 additions and 9 deletions

View File

@ -45,7 +45,7 @@ Add the laravel-db2 Service Provider to your config in ``app/config/app.php``:
There are two ways to configure laravel-db2. You can choose the most convenient way for you. You can put your DB2 credentials into ``app/config/database.php`` (option 1) file or use package config file which you can be generated through command line by artisan (option 2).
#### Option 1: Configure DB2 using ``app/config/database.php`` file
#### Option 1: Configure DB2 using ``app/config/database.php`` file
Simply add this code at the end of your ``app/config/database.php`` file:

View File

@ -52,7 +52,7 @@ class DB2ServiceProvider extends ServiceProvider {
//Create a connector
$this->app['db']->extend($conn, function($config)
{
{
switch ($config['driver']) {
case 'odbc':
$connector = new ODBCConnector();

View File

@ -6,7 +6,7 @@ use Illuminate\Database\Query\Builder;
class DB2Grammar extends Grammar
{
/**
* Wrap a single string in keyword identifiers.
*

View File

@ -48,7 +48,7 @@ class DB2Processor extends Processor {
$sequenceStr = $grammar->columnize($sequence);
}
$sql = 'select ' . $sequenceStr . ' from new table (' . $sql;
$sql .= ')';
$sql .= ')';
$results = $query->getConnection()->select($sql, $values);
if (is_array($sequence))
{
@ -60,7 +60,6 @@ class DB2Processor extends Processor {
$id = $result[$sequenceStr];
return is_numeric($id) ? (int) $id : $id;
}
}
}

View File

@ -46,7 +46,6 @@ class Blueprint extends \Illuminate\Database\Schema\Blueprint {
$index = $this->createIndexName($type, $columns);
return $this->addCommand($type, compact('index', 'indexSystem', 'columns'));
break;
default:
break;
}

View File

@ -20,7 +20,7 @@ class Builder extends \Illuminate\Database\Schema\Builder {
if (count($schemaTable) > 1)
{
$schema = $schemaTable[0];
$table = $this->connection->getTablePrefix().$schemaTable[1];
$table = $this->connection->getTablePrefix().$schemaTable[1];
}
else
{

View File

@ -92,7 +92,7 @@ class DB2Grammar extends Grammar {
* @return string
*/
public function compileLabel(Blueprint $blueprint, Fluent $command, Connection $connection)
{
{
return 'label on table '.$this->wrapTable($blueprint).' is \'' . $command->label . '\'';
}

View File

@ -57,7 +57,7 @@ PDO::CASE_NATURAL
*/
return [
'connections' => [
'ibmi' => [