Skip to content

Commit

Permalink
Change ConnectionInterface typehint to Connection.
Browse files Browse the repository at this point in the history
ConnectionInterface does not provide driver() method
which *Sql() methods require.
  • Loading branch information
Robert Pustułka committed May 5, 2017
1 parent 1e20350 commit 0dec817
Showing 1 changed file with 11 additions and 11 deletions.
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 0dec817

Please sign in to comment.