Skip to content

Commit

Permalink
Merge pull request #10624 from robertpustulka/table-schema
Browse files Browse the repository at this point in the history
Change ConnectionInterface typehint to Connection in TableSchema.
  • Loading branch information
lorenzo committed May 8, 2017
2 parents a8d2fcb + 577d8c4 commit 6eb6968
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions src/Database/Schema/Collection.php
Expand Up @@ -14,8 +14,8 @@
*/
namespace Cake\Database\Schema;

use Cake\Database\Connection;
use Cake\Database\Exception;
use Cake\Datasource\ConnectionInterface;
use PDOException;

/**
Expand All @@ -30,7 +30,7 @@ class Collection
/**
* Connection object
*
* @var \Cake\Datasource\ConnectionInterface
* @var \Cake\Database\Connection
*/
protected $_connection;

Expand All @@ -44,9 +44,9 @@ class Collection
/**
* Constructor.
*
* @param \Cake\Datasource\ConnectionInterface $connection The connection instance.
* @param \Cake\Database\Connection $connection The connection instance.
*/
public function __construct(ConnectionInterface $connection)
public function __construct(Connection $connection)
{
$this->_connection = $connection;
$this->_dialect = $connection->driver()->schemaDialect();
Expand Down
22 changes: 11 additions & 11 deletions src/Database/Schema/TableSchema.php
Expand Up @@ -14,9 +14,9 @@
*/
namespace Cake\Database\Schema;

use Cake\Database\Connection;
use Cake\Database\Exception;
use Cake\Database\Type;
use Cake\Datasource\ConnectionInterface;

/**
* Represents a single table in a database schema.
Expand Down Expand Up @@ -824,11 +824,11 @@ public function temporary($temporary = null)
* Uses the connection to access the schema dialect
* to generate platform specific SQL.
*
* @param \Cake\Datasource\ConnectionInterface $connection The connection to generate SQL for
* @param \Cake\Database\Connection $connection The connection to generate SQL for.
* @return array List of SQL statements to create the table and the
* required indexes.
*/
public function createSql(ConnectionInterface $connection)
public function createSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();
$columns = $constraints = $indexes = [];
Expand All @@ -851,10 +851,10 @@ public function createSql(ConnectionInterface $connection)
* Uses the connection to access the schema dialect to generate platform
* specific SQL.
*
* @param \Cake\Datasource\ConnectionInterface $connection The connection to generate SQL for.
* @param \Cake\Database\Connection $connection The connection to generate SQL for.
* @return array SQL to drop a table.
*/
public function dropSql(ConnectionInterface $connection)
public function dropSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();

Expand All @@ -864,10 +864,10 @@ public function dropSql(ConnectionInterface $connection)
/**
* Generate the SQL statements to truncate a table
*
* @param \Cake\Datasource\ConnectionInterface $connection The connection to generate SQL for.
* @param \Cake\Database\Connection $connection The connection to generate SQL for.
* @return array SQL to truncate a table.
*/
public function truncateSql(ConnectionInterface $connection)
public function truncateSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();

Expand All @@ -877,10 +877,10 @@ public function truncateSql(ConnectionInterface $connection)
/**
* Generate the SQL statements to add the constraints to the table
*
* @param \Cake\Datasource\ConnectionInterface $connection The connection to generate SQL for.
* @param \Cake\Database\Connection $connection The connection to generate SQL for.
* @return array SQL to drop a table.
*/
public function addConstraintSql(ConnectionInterface $connection)
public function addConstraintSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();

Expand All @@ -890,10 +890,10 @@ public function addConstraintSql(ConnectionInterface $connection)
/**
* Generate the SQL statements to drop the constraints to the table
*
* @param \Cake\Datasource\ConnectionInterface $connection The connection to generate SQL for.
* @param \Cake\Database\Connection $connection The connection to generate SQL for.
* @return array SQL to drop a table.
*/
public function dropConstraintSql(ConnectionInterface $connection)
public function dropConstraintSql(Connection $connection)
{
$dialect = $connection->driver()->schemaDialect();

Expand Down

0 comments on commit 6eb6968

Please sign in to comment.