Commit 29b26232 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Fixed Coding Standard Violations and other cleanups

parent fbc1341d
......@@ -3,7 +3,7 @@
use Doctrine\DBAL\DriverManager;
use Doctrine\Shards\DBAL\SQLAzure\SQLAzureShardManager;
require_once "vendor/composer/autoload.php";
require_once "vendor/autoload.php";
$config = array(
'dbname' => 'SalesDB',
......
......@@ -74,9 +74,9 @@ class SingleDatabaseSynchronizer implements SchemaSynchronizer
if ($noDrops) {
return $schemaDiff->toSaveSql($this->platform);
} else {
return $schemaDiff->toSql($this->platform);
}
return $schemaDiff->toSql($this->platform);
}
/**
......@@ -146,7 +146,7 @@ class SingleDatabaseSynchronizer implements SchemaSynchronizer
public function getDropAllSchema()
{
$sm = $this->conn->getSchemaManager();
$visitor = new \Doctrine\DBAL\Schema\Visitor\DropSchemaSqlCollector($this->platform);
$visitor = new DropSchemaSqlCollector($this->platform);
/* @var $schema \Doctrine\DBAL\Schema\Schema */
$schema = $sm->createSchema();
......
......@@ -82,7 +82,7 @@ class PoolingShardConnection extends Connection
private $connections;
/**
* @var PoolingShardManager
* @var ShardManager
*/
private $shardManager;
......@@ -192,7 +192,7 @@ class PoolingShardConnection extends Connection
public function isConnected($shardId = null)
{
if ($shardId === null) {
return ($this->_conn !== null);
return $this->_conn !== null;
}
return isset($this->activeConnections[$shardId]);
......@@ -200,8 +200,8 @@ class PoolingShardConnection extends Connection
public function close()
{
unset($this->_conn);
unset($this->activeConnections);
$this->_conn = null;
$this->activeConnections = null;
}
}
......@@ -30,7 +30,7 @@ use Doctrine\DBAL\Sharding\SingleDatabaseSynchronizer;
* SQL Azure Schema Synchronizer
*
* Will iterate over all shards when performing schema operations. This is done
* by partioning the passed schema into subschemas for the federation and the
* by partitioning the passed schema into subschemas for the federation and the
* global database and then applying the operations step by step using the
* {@see \Doctrine\DBAL\Sharding\SingleDatabaseSynchronizer}.
*
......@@ -38,6 +38,9 @@ use Doctrine\DBAL\Sharding\SingleDatabaseSynchronizer;
*/
class SQLAzureFederationsSynchronizer implements SchemaSynchronizer
{
const FEDERATION_TABLE_FEDERATED = 'azure.federated';
const FEDERATION_DISTRIBUTION_NAME = 'azure.federatedOnDistributionName';
/**
* @var Connection
*/
......@@ -53,9 +56,6 @@ class SQLAzureFederationsSynchronizer implements SchemaSynchronizer
*/
private $synchronizer;
const FEDERATION_TABLE_FEDERATED = 'azure.federated';
const FEDERATION_DISTRIBUTION_NAME = 'azure.federatedOnDistributionName';
public function __construct(Connection $conn, SQLAzureShardManager $shardManager, SchemaSynchronizer $sync = null)
{
$this->conn = $conn;
......@@ -63,7 +63,6 @@ class SQLAzureFederationsSynchronizer implements SchemaSynchronizer
$this->synchronizer = $sync ?: new SingleDatabaseSynchronizer($conn);
}
/**
* Get the SQL statements that can be executed to create the schema.
*
......
......@@ -129,7 +129,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public function selectGlobal()
......@@ -144,7 +143,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public function selectShard($distributionValue)
......@@ -171,7 +169,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public function getCurrentDistributionValue()
......@@ -180,7 +177,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public function getShards()
......@@ -196,7 +192,6 @@ class SQLAzureShardManager implements ShardManager
}
/**
* @override
* {@inheritDoc}
*/
public function queryAll($sql, array $params = array(), array $types = array())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment