diff --git a/lib/Doctrine/DBAL/Cache/CacheException.php b/lib/Doctrine/DBAL/Cache/CacheException.php index 6b3b5394bbb..1b69058cde9 100644 --- a/lib/Doctrine/DBAL/Cache/CacheException.php +++ b/lib/Doctrine/DBAL/Cache/CacheException.php @@ -28,7 +28,7 @@ class CacheException extends \Doctrine\DBAL\DBALException /** * @return \Doctrine\DBAL\Cache\CacheException */ - static public function noCacheKey() + public static function noCacheKey() { return new self("No cache key was set."); } @@ -36,7 +36,7 @@ static public function noCacheKey() /** * @return \Doctrine\DBAL\Cache\CacheException */ - static public function noResultDriverConfigured() + public static function noResultDriverConfigured() { return new self("Trying to cache a query but no result driver is configured."); } diff --git a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php index 8831a2258ee..313802618b0 100644 --- a/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php +++ b/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php @@ -19,9 +19,8 @@ namespace Doctrine\DBAL\Driver\OCI8; -use PDO; -use IteratorAggregate; use Doctrine\DBAL\Driver\Statement; +use PDO; /** * The OCI8 implementation of the Statement interface. @@ -123,7 +122,7 @@ public function __construct($dbh, $statement, OCI8Connection $conn) * @return string * @throws \Doctrine\DBAL\Driver\OCI8\OCI8Exception */ - static public function convertPositionalToNamedPlaceholders($statement) + public static function convertPositionalToNamedPlaceholders($statement) { $fragmentOffset = $tokenOffset = 0; $fragments = $paramMap = []; diff --git a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php index b2c463259a8..49f5a3ef4ef 100644 --- a/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php +++ b/lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php @@ -29,7 +29,7 @@ class SQLSrvException extends AbstractDriverException * * @return \Doctrine\DBAL\Driver\SQLSrv\SQLSrvException */ - static public function fromSqlSrvErrors() + public static function fromSqlSrvErrors() { $errors = sqlsrv_errors(SQLSRV_ERR_ERRORS); $message = ""; diff --git a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php index a0b01a853f7..90a8521c262 100644 --- a/lib/Doctrine/DBAL/Platforms/OraclePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/OraclePlatform.php @@ -47,7 +47,7 @@ class OraclePlatform extends AbstractPlatform * * @throws DBALException */ - static public function assertValidIdentifier($identifier) + public static function assertValidIdentifier($identifier) { if ( ! preg_match('(^(([a-zA-Z]{1}[a-zA-Z0-9_$#]{0,})|("[^"]+"))$)', $identifier)) { throw new DBALException("Invalid Oracle identifier"); diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index f52e384d8b3..7838f9566ed 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -529,7 +529,7 @@ public function getTruncateTableSQL($tableName, $cascade = false) * * @return float */ - static public function udfSqrt($value) + public static function udfSqrt($value) { return sqrt($value); } @@ -542,7 +542,7 @@ static public function udfSqrt($value) * * @return integer */ - static public function udfMod($a, $b) + public static function udfMod($a, $b) { return ($a % $b); } @@ -554,7 +554,7 @@ static public function udfMod($a, $b) * * @return integer */ - static public function udfLocate($str, $substr, $offset = 0) + public static function udfLocate($str, $substr, $offset = 0) { // SQL's LOCATE function works on 1-based positions, while PHP's strpos works on 0-based positions. // So we have to make them compatible if an offset is given. diff --git a/lib/Doctrine/DBAL/Query/QueryException.php b/lib/Doctrine/DBAL/Query/QueryException.php index 92c9336d6e8..53c7a7fad39 100644 --- a/lib/Doctrine/DBAL/Query/QueryException.php +++ b/lib/Doctrine/DBAL/Query/QueryException.php @@ -32,7 +32,7 @@ class QueryException extends DBALException * * @return \Doctrine\DBAL\Query\QueryException */ - static public function unknownAlias($alias, $registeredAliases) + public static function unknownAlias($alias, $registeredAliases) { return new self("The given alias '" . $alias . "' is not part of " . "any FROM or JOIN clause table. The currently registered " . @@ -45,7 +45,7 @@ static public function unknownAlias($alias, $registeredAliases) * * @return \Doctrine\DBAL\Query\QueryException */ - static public function nonUniqueAlias($alias, $registeredAliases) + public static function nonUniqueAlias($alias, $registeredAliases) { return new self("The given alias '" . $alias . "' is not unique " . "in FROM and JOIN clause table. The currently registered " . diff --git a/lib/Doctrine/DBAL/SQLParserUtils.php b/lib/Doctrine/DBAL/SQLParserUtils.php index 4242989cbf8..b945559030f 100644 --- a/lib/Doctrine/DBAL/SQLParserUtils.php +++ b/lib/Doctrine/DBAL/SQLParserUtils.php @@ -48,7 +48,7 @@ class SQLParserUtils * * @return array */ - static public function getPlaceholderPositions($statement, $isPositional = true) + public static function getPlaceholderPositions($statement, $isPositional = true) { $match = ($isPositional) ? '?' : ':'; if (strpos($statement, $match) === false) { @@ -84,7 +84,7 @@ static public function getPlaceholderPositions($statement, $isPositional = true) * * @throws SQLParserUtilsException */ - static public function expandListParameters($query, $params, $types) + public static function expandListParameters($query, $params, $types) { $isPositional = is_int(key($params)); $arrayPositions = array(); @@ -199,7 +199,7 @@ static public function expandListParameters($query, $params, $types) * @param string $statement * @return array */ - static private function getUnquotedStatementFragments($statement) + private static function getUnquotedStatementFragments($statement) { $literal = self::ESCAPED_SINGLE_QUOTED_TEXT . '|' . self::ESCAPED_DOUBLE_QUOTED_TEXT . '|' . @@ -219,7 +219,7 @@ static private function getUnquotedStatementFragments($statement) * @throws SQLParserUtilsException * @return mixed */ - static private function extractParam($paramName, $paramsOrTypes, $isParam, $defaultValue = null) + private static function extractParam($paramName, $paramsOrTypes, $isParam, $defaultValue = null) { if (array_key_exists($paramName, $paramsOrTypes)) { return $paramsOrTypes[$paramName]; diff --git a/lib/Doctrine/DBAL/Schema/Comparator.php b/lib/Doctrine/DBAL/Schema/Comparator.php index abedfc06281..1c799c2ba2f 100644 --- a/lib/Doctrine/DBAL/Schema/Comparator.php +++ b/lib/Doctrine/DBAL/Schema/Comparator.php @@ -36,7 +36,7 @@ class Comparator * * @return \Doctrine\DBAL\Schema\SchemaDiff */ - static public function compareSchemas(Schema $fromSchema, Schema $toSchema) + public static function compareSchemas(Schema $fromSchema, Schema $toSchema) { $c = new self(); diff --git a/lib/Doctrine/DBAL/Schema/SchemaException.php b/lib/Doctrine/DBAL/Schema/SchemaException.php index 152f374da09..23572074075 100644 --- a/lib/Doctrine/DBAL/Schema/SchemaException.php +++ b/lib/Doctrine/DBAL/Schema/SchemaException.php @@ -38,7 +38,7 @@ class SchemaException extends \Doctrine\DBAL\DBALException * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function tableDoesNotExist($tableName) + public static function tableDoesNotExist($tableName) { return new self("There is no table with name '".$tableName."' in the schema.", self::TABLE_DOESNT_EXIST); } @@ -48,7 +48,7 @@ static public function tableDoesNotExist($tableName) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function indexNameInvalid($indexName) + public static function indexNameInvalid($indexName) { return new self("Invalid index-name $indexName given, has to be [a-zA-Z0-9_]", self::INDEX_INVALID_NAME); } @@ -59,7 +59,7 @@ static public function indexNameInvalid($indexName) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function indexDoesNotExist($indexName, $table) + public static function indexDoesNotExist($indexName, $table) { return new self("Index '$indexName' does not exist on table '$table'.", self::INDEX_DOESNT_EXIST); } @@ -70,7 +70,7 @@ static public function indexDoesNotExist($indexName, $table) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function indexAlreadyExists($indexName, $table) + public static function indexAlreadyExists($indexName, $table) { return new self("An index with name '$indexName' was already defined on table '$table'.", self::INDEX_ALREADY_EXISTS); } @@ -81,7 +81,7 @@ static public function indexAlreadyExists($indexName, $table) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function columnDoesNotExist($columnName, $table) + public static function columnDoesNotExist($columnName, $table) { return new self("There is no column with name '$columnName' on table '$table'.", self::COLUMN_DOESNT_EXIST); } @@ -91,7 +91,7 @@ static public function columnDoesNotExist($columnName, $table) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function namespaceAlreadyExists($namespaceName) + public static function namespaceAlreadyExists($namespaceName) { return new self( sprintf("The namespace with name '%s' already exists.", $namespaceName), @@ -104,7 +104,7 @@ static public function namespaceAlreadyExists($namespaceName) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function tableAlreadyExists($tableName) + public static function tableAlreadyExists($tableName) { return new self("The table with name '".$tableName."' already exists.", self::TABLE_ALREADY_EXISTS); } @@ -115,7 +115,7 @@ static public function tableAlreadyExists($tableName) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function columnAlreadyExists($tableName, $columnName) + public static function columnAlreadyExists($tableName, $columnName) { return new self( "The column '".$columnName."' on table '".$tableName."' already exists.", self::COLUMN_ALREADY_EXISTS @@ -127,7 +127,7 @@ static public function columnAlreadyExists($tableName, $columnName) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function sequenceAlreadyExists($sequenceName) + public static function sequenceAlreadyExists($sequenceName) { return new self("The sequence '".$sequenceName."' already exists.", self::SEQUENCE_ALREADY_EXISTS); } @@ -137,7 +137,7 @@ static public function sequenceAlreadyExists($sequenceName) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function sequenceDoesNotExist($sequenceName) + public static function sequenceDoesNotExist($sequenceName) { return new self("There exists no sequence with the name '".$sequenceName."'.", self::SEQUENCE_DOENST_EXIST); } @@ -148,7 +148,7 @@ static public function sequenceDoesNotExist($sequenceName) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function foreignKeyDoesNotExist($fkName, $table) + public static function foreignKeyDoesNotExist($fkName, $table) { return new self("There exists no foreign key with the name '$fkName' on table '$table'.", self::FOREIGNKEY_DOESNT_EXIST); } @@ -159,7 +159,7 @@ static public function foreignKeyDoesNotExist($fkName, $table) * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey) + public static function namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey) { return new self( "The performed schema operation on ".$localTable->getName()." requires a named foreign key, ". @@ -174,7 +174,7 @@ static public function namedForeignKeyRequired(Table $localTable, ForeignKeyCons * * @return \Doctrine\DBAL\Schema\SchemaException */ - static public function alterTableChangeNotSupported($changeName) + public static function alterTableChangeNotSupported($changeName) { return new self("Alter table change not supported, given '$changeName'"); } diff --git a/lib/Doctrine/DBAL/Sharding/ShardingException.php b/lib/Doctrine/DBAL/Sharding/ShardingException.php index 407bf847d4d..aa14d32af30 100644 --- a/lib/Doctrine/DBAL/Sharding/ShardingException.php +++ b/lib/Doctrine/DBAL/Sharding/ShardingException.php @@ -31,7 +31,7 @@ class ShardingException extends DBALException /** * @return \Doctrine\DBAL\Sharding\ShardingException */ - static public function notImplemented() + public static function notImplemented() { return new self("This functionality is not implemented with this sharding provider.", 1331557937); } @@ -39,7 +39,7 @@ static public function notImplemented() /** * @return \Doctrine\DBAL\Sharding\ShardingException */ - static public function missingDefaultFederationName() + public static function missingDefaultFederationName() { return new self("SQLAzure requires a federation name to be set during sharding configuration.", 1332141280); } @@ -47,7 +47,7 @@ static public function missingDefaultFederationName() /** * @return \Doctrine\DBAL\Sharding\ShardingException */ - static public function missingDefaultDistributionKey() + public static function missingDefaultDistributionKey() { return new self("SQLAzure requires a distribution key to be set during sharding configuration.", 1332141329); } @@ -55,7 +55,7 @@ static public function missingDefaultDistributionKey() /** * @return \Doctrine\DBAL\Sharding\ShardingException */ - static public function activeTransaction() + public static function activeTransaction() { return new self("Cannot switch shard during an active transaction.", 1332141766); } @@ -63,7 +63,7 @@ static public function activeTransaction() /** * @return \Doctrine\DBAL\Sharding\ShardingException */ - static public function noShardDistributionValue() + public static function noShardDistributionValue() { return new self("You have to specify a string or integer as shard distribution value.", 1332142103); } @@ -71,7 +71,7 @@ static public function noShardDistributionValue() /** * @return \Doctrine\DBAL\Sharding\ShardingException */ - static public function missingDistributionType() + public static function missingDistributionType() { return new self("You have to specify a sharding distribution type such as 'integer', 'string', 'guid'."); } diff --git a/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php b/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php index 4af8d128425..61412a7cc5a 100644 --- a/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php +++ b/lib/Doctrine/DBAL/Tools/Console/ConsoleRunner.php @@ -23,10 +23,10 @@ use Doctrine\DBAL\Tools\Console\Command\ImportCommand; use Doctrine\DBAL\Tools\Console\Command\ReservedWordsCommand; use Doctrine\DBAL\Tools\Console\Command\RunSqlCommand; -use Symfony\Component\Console\Helper\HelperSet; use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper; -use Symfony\Component\Console\Application; use Doctrine\DBAL\Version; +use Symfony\Component\Console\Application; +use Symfony\Component\Console\Helper\HelperSet; /** * Handles running the Console Tools inside Symfony Console context. @@ -40,7 +40,7 @@ class ConsoleRunner * * @return HelperSet */ - static public function createHelperSet(Connection $connection) + public static function createHelperSet(Connection $connection) { return new HelperSet([ 'db' => new ConnectionHelper($connection) @@ -55,7 +55,7 @@ static public function createHelperSet(Connection $connection) * * @return void */ - static public function run(HelperSet $helperSet, $commands = []) + public static function run(HelperSet $helperSet, $commands = []) { $cli = new Application('Doctrine Command Line Interface', Version::VERSION); @@ -73,7 +73,7 @@ static public function run(HelperSet $helperSet, $commands = []) * * @return void */ - static public function addCommands(Application $cli) + public static function addCommands(Application $cli) { $cli->addCommands([ new RunSqlCommand(), @@ -85,7 +85,7 @@ static public function addCommands(Application $cli) /** * Prints the instructions to create a configuration file */ - static public function printCliConfigTemplate() + public static function printCliConfigTemplate() { echo <<<'HELP' You are missing a "cli-config.php" or "config/cli-config.php" file in your diff --git a/lib/Doctrine/DBAL/Types/ConversionException.php b/lib/Doctrine/DBAL/Types/ConversionException.php index 5f91cc308e4..bf59eb92220 100644 --- a/lib/Doctrine/DBAL/Types/ConversionException.php +++ b/lib/Doctrine/DBAL/Types/ConversionException.php @@ -39,7 +39,7 @@ class ConversionException extends \Doctrine\DBAL\DBALException * * @return \Doctrine\DBAL\Types\ConversionException */ - static public function conversionFailed($value, $toType) + public static function conversionFailed($value, $toType) { $value = (strlen($value) > 32) ? substr($value, 0, 20) . '...' : $value; @@ -57,7 +57,7 @@ static public function conversionFailed($value, $toType) * * @return \Doctrine\DBAL\Types\ConversionException */ - static public function conversionFailedFormat($value, $toType, $expectedFormat, \Exception $previous = null) + public static function conversionFailedFormat($value, $toType, $expectedFormat, \Exception $previous = null) { $value = (strlen($value) > 32) ? substr($value, 0, 20) . '...' : $value; @@ -78,7 +78,7 @@ static public function conversionFailedFormat($value, $toType, $expectedFormat, * * @return \Doctrine\DBAL\Types\ConversionException */ - static public function conversionFailedInvalidType($value, $toType, array $possibleTypes) + public static function conversionFailedInvalidType($value, $toType, array $possibleTypes) { $actualType = is_object($value) ? get_class($value) : gettype($value); @@ -100,7 +100,7 @@ static public function conversionFailedInvalidType($value, $toType, array $possi )); } - static public function conversionFailedSerialization($value, $format, $error) + public static function conversionFailedSerialization($value, $format, $error) { $actualType = is_object($value) ? get_class($value) : gettype($value); diff --git a/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php b/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php index b4c65748192..bdcd5321d01 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php +++ b/tests/Doctrine/Tests/DBAL/Functional/TypeConversionTest.php @@ -40,7 +40,7 @@ protected function setUp() } } - static public function dataIdempotentDataConversion() + public static function dataIdempotentDataConversion() { $obj = new \stdClass(); $obj->foo = "bar"; diff --git a/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php b/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php index 36000303fba..7f54557a8c5 100644 --- a/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php +++ b/tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php @@ -11,7 +11,7 @@ class OraclePlatformTest extends AbstractPlatformTestCase { - static public function dataValidIdentifiers() + public static function dataValidIdentifiers() { return array( array('a'), @@ -35,7 +35,7 @@ public function testValidIdentifiers($identifier) $platform->assertValidIdentifier($identifier); } - static public function dataInvalidIdentifiers() + public static function dataInvalidIdentifiers() { return array( array('1'), diff --git a/tests/Doctrine/Tests/DBAL/UtilTest.php b/tests/Doctrine/Tests/DBAL/UtilTest.php index afe22144e46..52b49207972 100644 --- a/tests/Doctrine/Tests/DBAL/UtilTest.php +++ b/tests/Doctrine/Tests/DBAL/UtilTest.php @@ -4,7 +4,7 @@ class UtilTest extends \Doctrine\Tests\DbalTestCase { - static public function dataConvertPositionalToNamedParameters() + public static function dataConvertPositionalToNamedParameters() { return array( array(