Skip to content

Commit

Permalink
Convert array_get to Arr::get
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonard Levering committed Jul 23, 2020
1 parent 497323e commit 210eb00
Showing 1 changed file with 50 additions and 50 deletions.
100 changes: 50 additions & 50 deletions src/ODBCConnector.php
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
<?php
/**
* Created by PhpStorm.
* User: Andrea
* Date: 20/02/2018
* Time: 15:50
*/

namespace Abram\Odbc;

use Illuminate\Database\Connectors\Connector;
use Illuminate\Database\Connectors\ConnectorInterface;

class ODBCConnector extends Connector implements ConnectorInterface
{

/**
* Establish a database connection.
*
* @param array $config
*
* @return \PDO
* @internal param array $options
*
*/
public function connect(array $config)
{
$options = $this->getOptions($config);

$dsn = array_get($config, 'dsn');

$connection = $this->createConnection($dsn, $config, $options);

return $connection;
}

/**
* Create a new PDO connection instance.
*
* @param string $dsn
* @param string $username
* @param string $password
* @param array $options
* @return ODBCPdo
*/
protected function createPdoConnection($dsn, $username, $password, $options)
{
return new ODBCPdo($dsn, $username, $password);
}
}
<?php
/**
* Created by PhpStorm.
* User: Andrea
* Date: 20/02/2018
* Time: 15:50
*/

namespace Abram\Odbc;

use Illuminate\Database\Connectors\Connector;
use Illuminate\Database\Connectors\ConnectorInterface;

class ODBCConnector extends Connector implements ConnectorInterface
{

/**
* Establish a database connection.
*
* @param array $config
*
* @return \PDO
* @internal param array $options
*
*/
public function connect(array $config)
{
$options = $this->getOptions($config);

$dsn = Arr::get($config, 'dsn');

$connection = $this->createConnection($dsn, $config, $options);

return $connection;
}

/**
* Create a new PDO connection instance.
*
* @param string $dsn
* @param string $username
* @param string $password
* @param array $options
* @return ODBCPdo
*/
protected function createPdoConnection($dsn, $username, $password, $options)
{
return new ODBCPdo($dsn, $username, $password);
}
}

0 comments on commit 210eb00

Please sign in to comment.