Skip to content

Commit 3f67cb7

Browse files
authored
Merge pull request #2798 from tolbon/Scrutinizer
Fix PSR2 rules : "the static declaration should come after visibility"
2 parents a756a6a + 5d1389d commit 3f67cb7

File tree

15 files changed

+49
-50
lines changed

15 files changed

+49
-50
lines changed

lib/Doctrine/DBAL/Cache/CacheException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ class CacheException extends \Doctrine\DBAL\DBALException
2828
/**
2929
* @return \Doctrine\DBAL\Cache\CacheException
3030
*/
31-
static public function noCacheKey()
31+
public static function noCacheKey()
3232
{
3333
return new self("No cache key was set.");
3434
}
3535

3636
/**
3737
* @return \Doctrine\DBAL\Cache\CacheException
3838
*/
39-
static public function noResultDriverConfigured()
39+
public static function noResultDriverConfigured()
4040
{
4141
return new self("Trying to cache a query but no result driver is configured.");
4242
}

lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,8 @@
1919

2020
namespace Doctrine\DBAL\Driver\OCI8;
2121

22-
use PDO;
23-
use IteratorAggregate;
2422
use Doctrine\DBAL\Driver\Statement;
23+
use PDO;
2524

2625
/**
2726
* The OCI8 implementation of the Statement interface.
@@ -123,7 +122,7 @@ public function __construct($dbh, $statement, OCI8Connection $conn)
123122
* @return string
124123
* @throws \Doctrine\DBAL\Driver\OCI8\OCI8Exception
125124
*/
126-
static public function convertPositionalToNamedPlaceholders($statement)
125+
public static function convertPositionalToNamedPlaceholders($statement)
127126
{
128127
$fragmentOffset = $tokenOffset = 0;
129128
$fragments = $paramMap = [];

lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class SQLSrvException extends AbstractDriverException
2929
*
3030
* @return \Doctrine\DBAL\Driver\SQLSrv\SQLSrvException
3131
*/
32-
static public function fromSqlSrvErrors()
32+
public static function fromSqlSrvErrors()
3333
{
3434
$errors = sqlsrv_errors(SQLSRV_ERR_ERRORS);
3535
$message = "";

lib/Doctrine/DBAL/Platforms/OraclePlatform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class OraclePlatform extends AbstractPlatform
4747
*
4848
* @throws DBALException
4949
*/
50-
static public function assertValidIdentifier($identifier)
50+
public static function assertValidIdentifier($identifier)
5151
{
5252
if ( ! preg_match('(^(([a-zA-Z]{1}[a-zA-Z0-9_$#]{0,})|("[^"]+"))$)', $identifier)) {
5353
throw new DBALException("Invalid Oracle identifier");

lib/Doctrine/DBAL/Platforms/SqlitePlatform.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ public function getTruncateTableSQL($tableName, $cascade = false)
529529
*
530530
* @return float
531531
*/
532-
static public function udfSqrt($value)
532+
public static function udfSqrt($value)
533533
{
534534
return sqrt($value);
535535
}
@@ -542,7 +542,7 @@ static public function udfSqrt($value)
542542
*
543543
* @return integer
544544
*/
545-
static public function udfMod($a, $b)
545+
public static function udfMod($a, $b)
546546
{
547547
return ($a % $b);
548548
}
@@ -554,7 +554,7 @@ static public function udfMod($a, $b)
554554
*
555555
* @return integer
556556
*/
557-
static public function udfLocate($str, $substr, $offset = 0)
557+
public static function udfLocate($str, $substr, $offset = 0)
558558
{
559559
// SQL's LOCATE function works on 1-based positions, while PHP's strpos works on 0-based positions.
560560
// So we have to make them compatible if an offset is given.

lib/Doctrine/DBAL/Query/QueryException.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class QueryException extends DBALException
3232
*
3333
* @return \Doctrine\DBAL\Query\QueryException
3434
*/
35-
static public function unknownAlias($alias, $registeredAliases)
35+
public static function unknownAlias($alias, $registeredAliases)
3636
{
3737
return new self("The given alias '" . $alias . "' is not part of " .
3838
"any FROM or JOIN clause table. The currently registered " .
@@ -45,7 +45,7 @@ static public function unknownAlias($alias, $registeredAliases)
4545
*
4646
* @return \Doctrine\DBAL\Query\QueryException
4747
*/
48-
static public function nonUniqueAlias($alias, $registeredAliases)
48+
public static function nonUniqueAlias($alias, $registeredAliases)
4949
{
5050
return new self("The given alias '" . $alias . "' is not unique " .
5151
"in FROM and JOIN clause table. The currently registered " .

lib/Doctrine/DBAL/SQLParserUtils.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class SQLParserUtils
4848
*
4949
* @return array
5050
*/
51-
static public function getPlaceholderPositions($statement, $isPositional = true)
51+
public static function getPlaceholderPositions($statement, $isPositional = true)
5252
{
5353
$match = ($isPositional) ? '?' : ':';
5454
if (strpos($statement, $match) === false) {
@@ -84,7 +84,7 @@ static public function getPlaceholderPositions($statement, $isPositional = true)
8484
*
8585
* @throws SQLParserUtilsException
8686
*/
87-
static public function expandListParameters($query, $params, $types)
87+
public static function expandListParameters($query, $params, $types)
8888
{
8989
$isPositional = is_int(key($params));
9090
$arrayPositions = array();
@@ -199,7 +199,7 @@ static public function expandListParameters($query, $params, $types)
199199
* @param string $statement
200200
* @return array
201201
*/
202-
static private function getUnquotedStatementFragments($statement)
202+
private static function getUnquotedStatementFragments($statement)
203203
{
204204
$literal = self::ESCAPED_SINGLE_QUOTED_TEXT . '|' .
205205
self::ESCAPED_DOUBLE_QUOTED_TEXT . '|' .
@@ -219,7 +219,7 @@ static private function getUnquotedStatementFragments($statement)
219219
* @throws SQLParserUtilsException
220220
* @return mixed
221221
*/
222-
static private function extractParam($paramName, $paramsOrTypes, $isParam, $defaultValue = null)
222+
private static function extractParam($paramName, $paramsOrTypes, $isParam, $defaultValue = null)
223223
{
224224
if (array_key_exists($paramName, $paramsOrTypes)) {
225225
return $paramsOrTypes[$paramName];

lib/Doctrine/DBAL/Schema/Comparator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class Comparator
3636
*
3737
* @return \Doctrine\DBAL\Schema\SchemaDiff
3838
*/
39-
static public function compareSchemas(Schema $fromSchema, Schema $toSchema)
39+
public static function compareSchemas(Schema $fromSchema, Schema $toSchema)
4040
{
4141
$c = new self();
4242

lib/Doctrine/DBAL/Schema/SchemaException.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class SchemaException extends \Doctrine\DBAL\DBALException
3838
*
3939
* @return \Doctrine\DBAL\Schema\SchemaException
4040
*/
41-
static public function tableDoesNotExist($tableName)
41+
public static function tableDoesNotExist($tableName)
4242
{
4343
return new self("There is no table with name '".$tableName."' in the schema.", self::TABLE_DOESNT_EXIST);
4444
}
@@ -48,7 +48,7 @@ static public function tableDoesNotExist($tableName)
4848
*
4949
* @return \Doctrine\DBAL\Schema\SchemaException
5050
*/
51-
static public function indexNameInvalid($indexName)
51+
public static function indexNameInvalid($indexName)
5252
{
5353
return new self("Invalid index-name $indexName given, has to be [a-zA-Z0-9_]", self::INDEX_INVALID_NAME);
5454
}
@@ -59,7 +59,7 @@ static public function indexNameInvalid($indexName)
5959
*
6060
* @return \Doctrine\DBAL\Schema\SchemaException
6161
*/
62-
static public function indexDoesNotExist($indexName, $table)
62+
public static function indexDoesNotExist($indexName, $table)
6363
{
6464
return new self("Index '$indexName' does not exist on table '$table'.", self::INDEX_DOESNT_EXIST);
6565
}
@@ -70,7 +70,7 @@ static public function indexDoesNotExist($indexName, $table)
7070
*
7171
* @return \Doctrine\DBAL\Schema\SchemaException
7272
*/
73-
static public function indexAlreadyExists($indexName, $table)
73+
public static function indexAlreadyExists($indexName, $table)
7474
{
7575
return new self("An index with name '$indexName' was already defined on table '$table'.", self::INDEX_ALREADY_EXISTS);
7676
}
@@ -81,7 +81,7 @@ static public function indexAlreadyExists($indexName, $table)
8181
*
8282
* @return \Doctrine\DBAL\Schema\SchemaException
8383
*/
84-
static public function columnDoesNotExist($columnName, $table)
84+
public static function columnDoesNotExist($columnName, $table)
8585
{
8686
return new self("There is no column with name '$columnName' on table '$table'.", self::COLUMN_DOESNT_EXIST);
8787
}
@@ -91,7 +91,7 @@ static public function columnDoesNotExist($columnName, $table)
9191
*
9292
* @return \Doctrine\DBAL\Schema\SchemaException
9393
*/
94-
static public function namespaceAlreadyExists($namespaceName)
94+
public static function namespaceAlreadyExists($namespaceName)
9595
{
9696
return new self(
9797
sprintf("The namespace with name '%s' already exists.", $namespaceName),
@@ -104,7 +104,7 @@ static public function namespaceAlreadyExists($namespaceName)
104104
*
105105
* @return \Doctrine\DBAL\Schema\SchemaException
106106
*/
107-
static public function tableAlreadyExists($tableName)
107+
public static function tableAlreadyExists($tableName)
108108
{
109109
return new self("The table with name '".$tableName."' already exists.", self::TABLE_ALREADY_EXISTS);
110110
}
@@ -115,7 +115,7 @@ static public function tableAlreadyExists($tableName)
115115
*
116116
* @return \Doctrine\DBAL\Schema\SchemaException
117117
*/
118-
static public function columnAlreadyExists($tableName, $columnName)
118+
public static function columnAlreadyExists($tableName, $columnName)
119119
{
120120
return new self(
121121
"The column '".$columnName."' on table '".$tableName."' already exists.", self::COLUMN_ALREADY_EXISTS
@@ -127,7 +127,7 @@ static public function columnAlreadyExists($tableName, $columnName)
127127
*
128128
* @return \Doctrine\DBAL\Schema\SchemaException
129129
*/
130-
static public function sequenceAlreadyExists($sequenceName)
130+
public static function sequenceAlreadyExists($sequenceName)
131131
{
132132
return new self("The sequence '".$sequenceName."' already exists.", self::SEQUENCE_ALREADY_EXISTS);
133133
}
@@ -137,7 +137,7 @@ static public function sequenceAlreadyExists($sequenceName)
137137
*
138138
* @return \Doctrine\DBAL\Schema\SchemaException
139139
*/
140-
static public function sequenceDoesNotExist($sequenceName)
140+
public static function sequenceDoesNotExist($sequenceName)
141141
{
142142
return new self("There exists no sequence with the name '".$sequenceName."'.", self::SEQUENCE_DOENST_EXIST);
143143
}
@@ -148,7 +148,7 @@ static public function sequenceDoesNotExist($sequenceName)
148148
*
149149
* @return \Doctrine\DBAL\Schema\SchemaException
150150
*/
151-
static public function foreignKeyDoesNotExist($fkName, $table)
151+
public static function foreignKeyDoesNotExist($fkName, $table)
152152
{
153153
return new self("There exists no foreign key with the name '$fkName' on table '$table'.", self::FOREIGNKEY_DOESNT_EXIST);
154154
}
@@ -159,7 +159,7 @@ static public function foreignKeyDoesNotExist($fkName, $table)
159159
*
160160
* @return \Doctrine\DBAL\Schema\SchemaException
161161
*/
162-
static public function namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey)
162+
public static function namedForeignKeyRequired(Table $localTable, ForeignKeyConstraint $foreignKey)
163163
{
164164
return new self(
165165
"The performed schema operation on ".$localTable->getName()." requires a named foreign key, ".
@@ -174,7 +174,7 @@ static public function namedForeignKeyRequired(Table $localTable, ForeignKeyCons
174174
*
175175
* @return \Doctrine\DBAL\Schema\SchemaException
176176
*/
177-
static public function alterTableChangeNotSupported($changeName)
177+
public static function alterTableChangeNotSupported($changeName)
178178
{
179179
return new self("Alter table change not supported, given '$changeName'");
180180
}

lib/Doctrine/DBAL/Sharding/ShardingException.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,47 +31,47 @@ class ShardingException extends DBALException
3131
/**
3232
* @return \Doctrine\DBAL\Sharding\ShardingException
3333
*/
34-
static public function notImplemented()
34+
public static function notImplemented()
3535
{
3636
return new self("This functionality is not implemented with this sharding provider.", 1331557937);
3737
}
3838

3939
/**
4040
* @return \Doctrine\DBAL\Sharding\ShardingException
4141
*/
42-
static public function missingDefaultFederationName()
42+
public static function missingDefaultFederationName()
4343
{
4444
return new self("SQLAzure requires a federation name to be set during sharding configuration.", 1332141280);
4545
}
4646

4747
/**
4848
* @return \Doctrine\DBAL\Sharding\ShardingException
4949
*/
50-
static public function missingDefaultDistributionKey()
50+
public static function missingDefaultDistributionKey()
5151
{
5252
return new self("SQLAzure requires a distribution key to be set during sharding configuration.", 1332141329);
5353
}
5454

5555
/**
5656
* @return \Doctrine\DBAL\Sharding\ShardingException
5757
*/
58-
static public function activeTransaction()
58+
public static function activeTransaction()
5959
{
6060
return new self("Cannot switch shard during an active transaction.", 1332141766);
6161
}
6262

6363
/**
6464
* @return \Doctrine\DBAL\Sharding\ShardingException
6565
*/
66-
static public function noShardDistributionValue()
66+
public static function noShardDistributionValue()
6767
{
6868
return new self("You have to specify a string or integer as shard distribution value.", 1332142103);
6969
}
7070

7171
/**
7272
* @return \Doctrine\DBAL\Sharding\ShardingException
7373
*/
74-
static public function missingDistributionType()
74+
public static function missingDistributionType()
7575
{
7676
return new self("You have to specify a sharding distribution type such as 'integer', 'string', 'guid'.");
7777
}

0 commit comments

Comments
 (0)