Unverified Commit c55e22ef authored by Sergei Morozov's avatar Sergei Morozov Committed by Grégoire Paris

Updated CS libs

parent 3213aa78
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "b7f970513c9756e5eaaba3974429c23c", "content-hash": "6bf4905b268231ccd58bdbe30d4ecf81",
"packages": [ "packages": [
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
...@@ -478,28 +478,28 @@ ...@@ -478,28 +478,28 @@
}, },
{ {
"name": "doctrine/coding-standard", "name": "doctrine/coding-standard",
"version": "6.0.0", "version": "7.0.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/coding-standard.git", "url": "https://github.com/doctrine/coding-standard.git",
"reference": "d33f69eb98b25aa51ffe3a909f0ec77000af4701" "reference": "d8a60ec4da68025c42795b714f66e277dd3e11de"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/coding-standard/zipball/d33f69eb98b25aa51ffe3a909f0ec77000af4701", "url": "https://api.github.com/repos/doctrine/coding-standard/zipball/d8a60ec4da68025c42795b714f66e277dd3e11de",
"reference": "d33f69eb98b25aa51ffe3a909f0ec77000af4701", "reference": "d8a60ec4da68025c42795b714f66e277dd3e11de",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0",
"php": "^7.1", "php": "^7.2",
"slevomat/coding-standard": "^5.0", "slevomat/coding-standard": "^6.0",
"squizlabs/php_codesniffer": "^3.4.0" "squizlabs/php_codesniffer": "^3.5.3"
}, },
"type": "phpcodesniffer-standard", "type": "phpcodesniffer-standard",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "6.0.x-dev" "dev-master": "7.0.x-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -535,7 +535,7 @@ ...@@ -535,7 +535,7 @@
"standard", "standard",
"style" "style"
], ],
"time": "2019-03-15T12:45:47+00:00" "time": "2019-12-11T07:59:21+00:00"
}, },
{ {
"name": "doctrine/instantiator", "name": "doctrine/instantiator",
...@@ -1282,16 +1282,16 @@ ...@@ -1282,16 +1282,16 @@
}, },
{ {
"name": "phpstan/phpdoc-parser", "name": "phpstan/phpdoc-parser",
"version": "0.3.5", "version": "0.4.4",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/phpstan/phpdoc-parser.git", "url": "https://github.com/phpstan/phpdoc-parser.git",
"reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4" "reference": "d8d9d4645379e677466d407034436bb155b11c65"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/8c4ef2aefd9788238897b678a985e1d5c8df6db4", "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/d8d9d4645379e677466d407034436bb155b11c65",
"reference": "8c4ef2aefd9788238897b678a985e1d5c8df6db4", "reference": "d8d9d4645379e677466d407034436bb155b11c65",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -1299,18 +1299,20 @@ ...@@ -1299,18 +1299,20 @@
}, },
"require-dev": { "require-dev": {
"consistence/coding-standard": "^3.5", "consistence/coding-standard": "^3.5",
"ergebnis/composer-normalize": "^2.0.2",
"jakub-onderka/php-parallel-lint": "^0.9.2", "jakub-onderka/php-parallel-lint": "^0.9.2",
"phing/phing": "^2.16.0", "phing/phing": "^2.16.0",
"phpstan/phpstan": "^0.10", "phpstan/extension-installer": "^1.0",
"phpstan/phpstan": "^0.12.19",
"phpstan/phpstan-strict-rules": "^0.12",
"phpunit/phpunit": "^6.3", "phpunit/phpunit": "^6.3",
"slevomat/coding-standard": "^4.7.2", "slevomat/coding-standard": "^4.7.2",
"squizlabs/php_codesniffer": "^3.3.2", "symfony/process": "^4.0"
"symfony/process": "^3.4 || ^4.0"
}, },
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "0.3-dev" "dev-master": "0.4-dev"
} }
}, },
"autoload": { "autoload": {
...@@ -1325,7 +1327,7 @@ ...@@ -1325,7 +1327,7 @@
"MIT" "MIT"
], ],
"description": "PHPDoc parser with support for nullable, intersection and generic types", "description": "PHPDoc parser with support for nullable, intersection and generic types",
"time": "2019-06-07T19:13:52+00:00" "time": "2020-04-13T16:28:46+00:00"
}, },
{ {
"name": "phpstan/phpstan", "name": "phpstan/phpstan",
...@@ -2414,32 +2416,39 @@ ...@@ -2414,32 +2416,39 @@
}, },
{ {
"name": "slevomat/coding-standard", "name": "slevomat/coding-standard",
"version": "5.0.2", "version": "6.3.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/slevomat/coding-standard.git", "url": "https://github.com/slevomat/coding-standard.git",
"reference": "223f02b6193fe47b7b483bfa5bf75693535482dd" "reference": "b905a82255749de847fd4de607c7a4c8163f058d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/slevomat/coding-standard/zipball/223f02b6193fe47b7b483bfa5bf75693535482dd", "url": "https://api.github.com/repos/slevomat/coding-standard/zipball/b905a82255749de847fd4de607c7a4c8163f058d",
"reference": "223f02b6193fe47b7b483bfa5bf75693535482dd", "reference": "b905a82255749de847fd4de607c7a4c8163f058d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": "^7.1", "php": "^7.1",
"phpstan/phpdoc-parser": "^0.3.1", "phpstan/phpdoc-parser": "0.4.0 - 0.4.4",
"squizlabs/php_codesniffer": "^3.4.0" "squizlabs/php_codesniffer": "^3.5.5"
}, },
"require-dev": { "require-dev": {
"jakub-onderka/php-parallel-lint": "1.0.0", "dealerdirect/phpcodesniffer-composer-installer": "0.6.2",
"phing/phing": "2.16.1", "phing/phing": "2.16.3",
"phpstan/phpstan": "0.11.1", "php-parallel-lint/php-parallel-lint": "1.2.0",
"phpstan/phpstan-phpunit": "0.11", "phpstan/phpstan": "0.12.19",
"phpstan/phpstan-strict-rules": "0.11", "phpstan/phpstan-deprecation-rules": "0.12.2",
"phpunit/phpunit": "8.0.0" "phpstan/phpstan-phpunit": "0.12.8",
"phpstan/phpstan-strict-rules": "0.12.2",
"phpunit/phpunit": "7.5.20|8.5.2|9.1.2"
}, },
"type": "phpcodesniffer-standard", "type": "phpcodesniffer-standard",
"extra": {
"branch-alias": {
"dev-master": "6.x-dev"
}
},
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"SlevomatCodingStandard\\": "SlevomatCodingStandard" "SlevomatCodingStandard\\": "SlevomatCodingStandard"
...@@ -2450,20 +2459,30 @@ ...@@ -2450,20 +2459,30 @@
"MIT" "MIT"
], ],
"description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.", "description": "Slevomat Coding Standard for PHP_CodeSniffer complements Consistence Coding Standard by providing sniffs with additional checks.",
"time": "2019-03-12T20:26:36+00:00" "funding": [
{
"url": "https://github.com/kukulich",
"type": "github"
},
{
"url": "https://tidelift.com/funding/github/packagist/slevomat/coding-standard",
"type": "tidelift"
}
],
"time": "2020-04-28T07:15:08+00:00"
}, },
{ {
"name": "squizlabs/php_codesniffer", "name": "squizlabs/php_codesniffer",
"version": "3.4.0", "version": "3.5.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/squizlabs/PHP_CodeSniffer.git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git",
"reference": "379deb987e26c7cd103a7b387aea178baec96e48" "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/379deb987e26c7cd103a7b387aea178baec96e48", "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6",
"reference": "379deb987e26c7cd103a7b387aea178baec96e48", "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
...@@ -2496,12 +2515,12 @@ ...@@ -2496,12 +2515,12 @@
} }
], ],
"description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.",
"homepage": "http://www.squizlabs.com/php-codesniffer", "homepage": "https://github.com/squizlabs/PHP_CodeSniffer",
"keywords": [ "keywords": [
"phpcs", "phpcs",
"standards" "standards"
], ],
"time": "2018-12-19T23:57:18+00:00" "time": "2020-04-17T01:09:41+00:00"
}, },
{ {
"name": "symfony/console", "name": "symfony/console",
......
...@@ -32,8 +32,10 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver, ...@@ -32,8 +32,10 @@ abstract class AbstractMySQLDriver implements Driver, ExceptionConverterDriver,
switch ($exception->getErrorCode()) { switch ($exception->getErrorCode()) {
case '1213': case '1213':
return new Exception\DeadlockException($message, $exception); return new Exception\DeadlockException($message, $exception);
case '1205': case '1205':
return new Exception\LockWaitTimeoutException($message, $exception); return new Exception\LockWaitTimeoutException($message, $exception);
case '1050': case '1050':
return new Exception\TableExistsException($message, $exception); return new Exception\TableExistsException($message, $exception);
......
...@@ -33,6 +33,7 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri ...@@ -33,6 +33,7 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
case '40001': case '40001':
case '40P01': case '40P01':
return new Exception\DeadlockException($message, $exception); return new Exception\DeadlockException($message, $exception);
case '0A000': case '0A000':
// Foreign key constraint violations during a TRUNCATE operation // Foreign key constraint violations during a TRUNCATE operation
// are considered "feature not supported" in PostgreSQL. // are considered "feature not supported" in PostgreSQL.
...@@ -41,6 +42,7 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri ...@@ -41,6 +42,7 @@ abstract class AbstractPostgreSQLDriver implements Driver, ExceptionConverterDri
} }
break; break;
case '23502': case '23502':
return new Exception\NotNullConstraintViolationException($message, $exception); return new Exception\NotNullConstraintViolationException($message, $exception);
......
...@@ -32,31 +32,41 @@ abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDr ...@@ -32,31 +32,41 @@ abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDr
case '-307': case '-307':
case '-684': case '-684':
return new Exception\DeadlockException($message, $exception); return new Exception\DeadlockException($message, $exception);
case '-210': case '-210':
case '-1175': case '-1175':
case '-1281': case '-1281':
return new Exception\LockWaitTimeoutException($message, $exception); return new Exception\LockWaitTimeoutException($message, $exception);
case '-100': case '-100':
case '-103': case '-103':
case '-832': case '-832':
return new Exception\ConnectionException($message, $exception); return new Exception\ConnectionException($message, $exception);
case '-143': case '-143':
return new Exception\InvalidFieldNameException($message, $exception); return new Exception\InvalidFieldNameException($message, $exception);
case '-193': case '-193':
case '-196': case '-196':
return new Exception\UniqueConstraintViolationException($message, $exception); return new Exception\UniqueConstraintViolationException($message, $exception);
case '-194': case '-194':
case '-198': case '-198':
return new Exception\ForeignKeyConstraintViolationException($message, $exception); return new Exception\ForeignKeyConstraintViolationException($message, $exception);
case '-144': case '-144':
return new Exception\NonUniqueFieldNameException($message, $exception); return new Exception\NonUniqueFieldNameException($message, $exception);
case '-184': case '-184':
case '-195': case '-195':
return new Exception\NotNullConstraintViolationException($message, $exception); return new Exception\NotNullConstraintViolationException($message, $exception);
case '-131': case '-131':
return new Exception\SyntaxErrorException($message, $exception); return new Exception\SyntaxErrorException($message, $exception);
case '-110': case '-110':
return new Exception\TableExistsException($message, $exception); return new Exception\TableExistsException($message, $exception);
case '-141': case '-141':
case '-1041': case '-1041':
return new Exception\TableNotFoundException($message, $exception); return new Exception\TableNotFoundException($message, $exception);
...@@ -90,10 +100,13 @@ abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDr ...@@ -90,10 +100,13 @@ abstract class AbstractSQLAnywhereDriver implements Driver, ExceptionConverterDr
switch (true) { switch (true) {
case version_compare($version, '16', '>='): case version_compare($version, '16', '>='):
return new SQLAnywhere16Platform(); return new SQLAnywhere16Platform();
case version_compare($version, '12', '>='): case version_compare($version, '12', '>='):
return new SQLAnywhere12Platform(); return new SQLAnywhere12Platform();
case version_compare($version, '11', '>='): case version_compare($version, '11', '>='):
return new SQLAnywhere11Platform(); return new SQLAnywhere11Platform();
default: default:
return new SQLAnywherePlatform(); return new SQLAnywherePlatform();
} }
......
...@@ -310,11 +310,13 @@ class DB2Statement implements IteratorAggregate, Statement ...@@ -310,11 +310,13 @@ class DB2Statement implements IteratorAggregate, Statement
$rows[] = $row; $rows[] = $row;
} }
break; break;
case FetchMode::COLUMN: case FetchMode::COLUMN:
while (($row = $this->fetchColumn()) !== false) { while (($row = $this->fetchColumn()) !== false) {
$rows[] = $row; $rows[] = $row;
} }
break; break;
default: default:
while (($row = $this->fetch($fetchMode)) !== false) { while (($row = $this->fetch($fetchMode)) !== false) {
$rows[] = $row; $rows[] = $row;
......
...@@ -2541,6 +2541,7 @@ abstract class AbstractPlatform ...@@ -2541,6 +2541,7 @@ abstract class AbstractPlatform
case 'RESTRICT': case 'RESTRICT':
case 'SET DEFAULT': case 'SET DEFAULT':
return $upper; return $upper;
default: default:
throw new InvalidArgumentException('Invalid foreign key action: ' . $upper); throw new InvalidArgumentException('Invalid foreign key action: ' . $upper);
} }
...@@ -2744,12 +2745,16 @@ abstract class AbstractPlatform ...@@ -2744,12 +2745,16 @@ abstract class AbstractPlatform
switch ($level) { switch ($level) {
case TransactionIsolationLevel::READ_UNCOMMITTED: case TransactionIsolationLevel::READ_UNCOMMITTED:
return 'READ UNCOMMITTED'; return 'READ UNCOMMITTED';
case TransactionIsolationLevel::READ_COMMITTED: case TransactionIsolationLevel::READ_COMMITTED:
return 'READ COMMITTED'; return 'READ COMMITTED';
case TransactionIsolationLevel::REPEATABLE_READ: case TransactionIsolationLevel::REPEATABLE_READ:
return 'REPEATABLE READ'; return 'REPEATABLE READ';
case TransactionIsolationLevel::SERIALIZABLE: case TransactionIsolationLevel::SERIALIZABLE:
return 'SERIALIZABLE'; return 'SERIALIZABLE';
default: default:
throw new InvalidArgumentException('Invalid isolation level:' . $level); throw new InvalidArgumentException('Invalid isolation level:' . $level);
} }
......
...@@ -242,11 +242,14 @@ class OraclePlatform extends AbstractPlatform ...@@ -242,11 +242,14 @@ class OraclePlatform extends AbstractPlatform
switch ($level) { switch ($level) {
case TransactionIsolationLevel::READ_UNCOMMITTED: case TransactionIsolationLevel::READ_UNCOMMITTED:
return 'READ UNCOMMITTED'; return 'READ UNCOMMITTED';
case TransactionIsolationLevel::READ_COMMITTED: case TransactionIsolationLevel::READ_COMMITTED:
return 'READ COMMITTED'; return 'READ COMMITTED';
case TransactionIsolationLevel::REPEATABLE_READ: case TransactionIsolationLevel::REPEATABLE_READ:
case TransactionIsolationLevel::SERIALIZABLE: case TransactionIsolationLevel::SERIALIZABLE:
return 'SERIALIZABLE'; return 'SERIALIZABLE';
default: default:
return parent::_getTransactionIsolationLevelSQL($level); return parent::_getTransactionIsolationLevelSQL($level);
} }
......
...@@ -636,6 +636,7 @@ class SQLAnywherePlatform extends AbstractPlatform ...@@ -636,6 +636,7 @@ class SQLAnywherePlatform extends AbstractPlatform
case self::FOREIGN_KEY_MATCH_FULL_UNIQUE: case self::FOREIGN_KEY_MATCH_FULL_UNIQUE:
return 'UNIQUE FULL'; return 'UNIQUE FULL';
default: default:
throw new InvalidArgumentException('Invalid foreign key match type: ' . $type); throw new InvalidArgumentException('Invalid foreign key match type: ' . $type);
} }
...@@ -1127,8 +1128,10 @@ SQL ...@@ -1127,8 +1128,10 @@ SQL
switch ($pos) { switch ($pos) {
case TrimMode::LEADING: case TrimMode::LEADING:
return $this->getLtrimExpression($str); return $this->getLtrimExpression($str);
case TrimMode::TRAILING: case TrimMode::TRAILING:
return $this->getRtrimExpression($str); return $this->getRtrimExpression($str);
default: default:
return 'TRIM(' . $str . ')'; return 'TRIM(' . $str . ')';
} }
...@@ -1139,8 +1142,10 @@ SQL ...@@ -1139,8 +1142,10 @@ SQL
switch ($pos) { switch ($pos) {
case TrimMode::LEADING: case TrimMode::LEADING:
return 'SUBSTR(' . $str . ', PATINDEX(' . $pattern . ', ' . $str . '))'; return 'SUBSTR(' . $str . ', PATINDEX(' . $pattern . ', ' . $str . '))';
case TrimMode::TRAILING: case TrimMode::TRAILING:
return 'REVERSE(SUBSTR(REVERSE(' . $str . '), PATINDEX(' . $pattern . ', REVERSE(' . $str . '))))'; return 'REVERSE(SUBSTR(REVERSE(' . $str . '), PATINDEX(' . $pattern . ', REVERSE(' . $str . '))))';
default: default:
return 'REVERSE(SUBSTR(REVERSE(SUBSTR(' . $str . ', PATINDEX(' . $pattern . ', ' . $str . '))), ' . return 'REVERSE(SUBSTR(REVERSE(SUBSTR(' . $str . ', PATINDEX(' . $pattern . ', ' . $str . '))), ' .
'PATINDEX(' . $pattern . ', REVERSE(SUBSTR(' . $str . ', PATINDEX(' . $pattern . ', ' . $str . '))))))'; 'PATINDEX(' . $pattern . ', REVERSE(SUBSTR(' . $str . ', PATINDEX(' . $pattern . ', ' . $str . '))))))';
...@@ -1294,12 +1299,16 @@ SQL ...@@ -1294,12 +1299,16 @@ SQL
switch ($level) { switch ($level) {
case TransactionIsolationLevel::READ_UNCOMMITTED: case TransactionIsolationLevel::READ_UNCOMMITTED:
return '0'; return '0';
case TransactionIsolationLevel::READ_COMMITTED: case TransactionIsolationLevel::READ_COMMITTED:
return '1'; return '1';
case TransactionIsolationLevel::REPEATABLE_READ: case TransactionIsolationLevel::REPEATABLE_READ:
return '2'; return '2';
case TransactionIsolationLevel::SERIALIZABLE: case TransactionIsolationLevel::SERIALIZABLE:
return '3'; return '3';
default: default:
throw new InvalidArgumentException('Invalid isolation level:' . $level); throw new InvalidArgumentException('Invalid isolation level:' . $level);
} }
......
...@@ -1669,8 +1669,8 @@ SQL ...@@ -1669,8 +1669,8 @@ SQL
{ {
return sprintf( return sprintf(
<<<'SQL' <<<'SQL'
EXEC sys.sp_addextendedproperty @name=N'MS_Description', EXEC sys.sp_addextendedproperty @name=N'MS_Description',
@value=N%s, @level0type=N'SCHEMA', @level0name=N'dbo', @value=N%s, @level0type=N'SCHEMA', @level0name=N'dbo',
@level1type=N'TABLE', @level1name=N%s @level1type=N'TABLE', @level1name=N%s
SQL SQL
, ,
......
...@@ -64,8 +64,10 @@ class SqlitePlatform extends AbstractPlatform ...@@ -64,8 +64,10 @@ class SqlitePlatform extends AbstractPlatform
switch ($type) { switch ($type) {
case 'time': case 'time':
return 'time(\'now\')'; return 'time(\'now\')';
case 'date': case 'date':
return 'date(\'now\')'; return 'date(\'now\')';
case 'timestamp': case 'timestamp':
default: default:
return 'datetime(\'now\')'; return 'datetime(\'now\')';
...@@ -168,10 +170,12 @@ class SqlitePlatform extends AbstractPlatform ...@@ -168,10 +170,12 @@ class SqlitePlatform extends AbstractPlatform
switch ($level) { switch ($level) {
case TransactionIsolationLevel::READ_UNCOMMITTED: case TransactionIsolationLevel::READ_UNCOMMITTED:
return '0'; return '0';
case TransactionIsolationLevel::READ_COMMITTED: case TransactionIsolationLevel::READ_COMMITTED:
case TransactionIsolationLevel::REPEATABLE_READ: case TransactionIsolationLevel::REPEATABLE_READ:
case TransactionIsolationLevel::SERIALIZABLE: case TransactionIsolationLevel::SERIALIZABLE:
return '1'; return '1';
default: default:
return parent::_getTransactionIsolationLevelSQL($level); return parent::_getTransactionIsolationLevelSQL($level);
} }
......
...@@ -231,6 +231,7 @@ class QueryBuilder ...@@ -231,6 +231,7 @@ class QueryBuilder
case self::INSERT: case self::INSERT:
$sql = $this->getSQLForInsert(); $sql = $this->getSQLForInsert();
break; break;
case self::DELETE: case self::DELETE:
$sql = $this->getSQLForDelete(); $sql = $this->getSQLForDelete();
break; break;
......
...@@ -68,13 +68,16 @@ class DB2SchemaManager extends AbstractSchemaManager ...@@ -68,13 +68,16 @@ class DB2SchemaManager extends AbstractSchemaManager
$length = $tableColumn['length']; $length = $tableColumn['length'];
$fixed = false; $fixed = false;
break; break;
case 'character': case 'character':
$length = $tableColumn['length']; $length = $tableColumn['length'];
$fixed = true; $fixed = true;
break; break;
case 'clob': case 'clob':
$length = $tableColumn['length']; $length = $tableColumn['length'];
break; break;
case 'decimal': case 'decimal':
case 'double': case 'double':
case 'real': case 'real':
......
...@@ -138,6 +138,7 @@ class MySqlSchemaManager extends AbstractSchemaManager ...@@ -138,6 +138,7 @@ class MySqlSchemaManager extends AbstractSchemaManager
case 'binary': case 'binary':
$fixed = true; $fixed = true;
break; break;
case 'float': case 'float':
case 'double': case 'double':
case 'real': case 'real':
...@@ -149,24 +150,31 @@ class MySqlSchemaManager extends AbstractSchemaManager ...@@ -149,24 +150,31 @@ class MySqlSchemaManager extends AbstractSchemaManager
$length = null; $length = null;
} }
break; break;
case 'tinytext': case 'tinytext':
$length = MySqlPlatform::LENGTH_LIMIT_TINYTEXT; $length = MySqlPlatform::LENGTH_LIMIT_TINYTEXT;
break; break;
case 'text': case 'text':
$length = MySqlPlatform::LENGTH_LIMIT_TEXT; $length = MySqlPlatform::LENGTH_LIMIT_TEXT;
break; break;
case 'mediumtext': case 'mediumtext':
$length = MySqlPlatform::LENGTH_LIMIT_MEDIUMTEXT; $length = MySqlPlatform::LENGTH_LIMIT_MEDIUMTEXT;
break; break;
case 'tinyblob': case 'tinyblob':
$length = MySqlPlatform::LENGTH_LIMIT_TINYBLOB; $length = MySqlPlatform::LENGTH_LIMIT_TINYBLOB;
break; break;
case 'blob': case 'blob':
$length = MySqlPlatform::LENGTH_LIMIT_BLOB; $length = MySqlPlatform::LENGTH_LIMIT_BLOB;
break; break;
case 'mediumblob': case 'mediumblob':
$length = MySqlPlatform::LENGTH_LIMIT_MEDIUMBLOB; $length = MySqlPlatform::LENGTH_LIMIT_MEDIUMBLOB;
break; break;
case 'tinyint': case 'tinyint':
case 'smallint': case 'smallint':
case 'mediumint': case 'mediumint':
...@@ -244,8 +252,10 @@ class MySqlSchemaManager extends AbstractSchemaManager ...@@ -244,8 +252,10 @@ class MySqlSchemaManager extends AbstractSchemaManager
switch ($columnDefault) { switch ($columnDefault) {
case 'current_timestamp()': case 'current_timestamp()':
return $platform->getCurrentTimestampSQL(); return $platform->getCurrentTimestampSQL();
case 'curdate()': case 'curdate()':
return $platform->getCurrentDateSQL(); return $platform->getCurrentDateSQL();
case 'curtime()': case 'curtime()':
return $platform->getCurrentTimeSQL(); return $platform->getCurrentTimeSQL();
} }
......
...@@ -176,12 +176,14 @@ class OracleSchemaManager extends AbstractSchemaManager ...@@ -176,12 +176,14 @@ class OracleSchemaManager extends AbstractSchemaManager
} }
break; break;
case 'varchar': case 'varchar':
case 'varchar2': case 'varchar2':
case 'nvarchar2': case 'nvarchar2':
$length = $tableColumn['char_length']; $length = $tableColumn['char_length'];
$fixed = false; $fixed = false;
break; break;
case 'char': case 'char':
case 'nchar': case 'nchar':
$length = $tableColumn['char_length']; $length = $tableColumn['char_length'];
......
...@@ -368,17 +368,20 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -368,17 +368,20 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']);
$length = null; $length = null;
break; break;
case 'int': case 'int':
case 'int4': case 'int4':
case 'integer': case 'integer':
$tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']);
$length = null; $length = null;
break; break;
case 'bigint': case 'bigint':
case 'int8': case 'int8':
$tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']); $tableColumn['default'] = $this->fixVersion94NegativeNumericDefaultValue($tableColumn['default']);
$length = null; $length = null;
break; break;
case 'bool': case 'bool':
case 'boolean': case 'boolean':
if ($tableColumn['default'] === 'true') { if ($tableColumn['default'] === 'true') {
...@@ -391,6 +394,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -391,6 +394,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$length = null; $length = null;
break; break;
case 'text': case 'text':
case '_varchar': case '_varchar':
case 'varchar': case 'varchar':
...@@ -400,10 +404,12 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -400,10 +404,12 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
case 'interval': case 'interval':
$fixed = false; $fixed = false;
break; break;
case 'char': case 'char':
case 'bpchar': case 'bpchar':
$fixed = true; $fixed = true;
break; break;
case 'float': case 'float':
case 'float4': case 'float4':
case 'float8': case 'float8':
...@@ -421,6 +427,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -421,6 +427,7 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$length = null; $length = null;
} }
break; break;
case 'year': case 'year':
$length = null; $length = null;
break; break;
......
...@@ -112,6 +112,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager ...@@ -112,6 +112,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
case 'char': case 'char':
case 'nchar': case 'nchar':
$fixed = true; $fixed = true;
break;
} }
switch ($type) { switch ($type) {
...@@ -119,6 +120,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager ...@@ -119,6 +120,7 @@ class SQLAnywhereSchemaManager extends AbstractSchemaManager
case 'float': case 'float':
$precision = $tableColumn['length']; $precision = $tableColumn['length'];
$scale = $tableColumn['scale']; $scale = $tableColumn['scale'];
break;
} }
return new Column( return new Column(
......
...@@ -87,6 +87,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager ...@@ -87,6 +87,7 @@ class SQLServerSchemaManager extends AbstractSchemaManager
// Unicode data requires 2 bytes per character // Unicode data requires 2 bytes per character
$length /= 2; $length /= 2;
break; break;
case 'varchar': case 'varchar':
// TEXT type is returned as VARCHAR(MAX) with a length of -1 // TEXT type is returned as VARCHAR(MAX) with a length of -1
if ($length === -1) { if ($length === -1) {
......
<?xml version="1.0"?> <?xml version="1.0"?>
<ruleset> <ruleset
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd"
>
<arg name="basepath" value="."/> <arg name="basepath" value="."/>
<arg name="extensions" value="php"/> <arg name="extensions" value="php"/>
<arg name="parallel" value="80"/> <arg name="parallel" value="80"/>
...@@ -17,15 +20,32 @@ ...@@ -17,15 +20,32 @@
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/> <exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming"/> <exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming"/>
<exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming"/> <exclude name="SlevomatCodingStandard.Classes.SuperfluousExceptionNaming"/>
<exclude name="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing.IncorrectLinesCountAfterLastControlStructure"/>
<exclude name="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants.DisallowedLateStaticBindingForConstant"/> <exclude name="SlevomatCodingStandard.Classes.DisallowLateStaticBindingForConstants.DisallowedLateStaticBindingForConstant"/>
<exclude name="SlevomatCodingStandard.ControlStructures.ControlStructureSpacing.IncorrectLinesCountAfterLastControlStructure"/>
<!-- https://github.com/slevomat/coding-standard/issues/867 -->
<exclude name="SlevomatCodingStandard.ControlStructures.JumpStatementsSpacing.IncorrectLinesCountAfterLastControlStructure"/>
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/issues/2937 -->
<exclude name="Squiz.Arrays.ArrayDeclaration.ValueNoNewline"/>
<exclude name="Squiz.NamingConventions.ValidVariableName.PublicHasUnderscore"/>
</rule> </rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingParameterTypeHint"> <!-- Disable the rules that will require PHP 7.4 -->
<rule ref="SlevomatCodingStandard.TypeHints.PropertyTypeHint">
<properties>
<property name="enableNativeTypeHint" value="false"/>
</properties>
</rule>
<rule ref="Squiz.NamingConventions.ValidVariableName.PublicHasUnderscore">
<exclude-pattern>*/lib/*</exclude-pattern> <exclude-pattern>*/lib/*</exclude-pattern>
</rule> </rule>
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.MissingReturnTypeHint"> <rule ref="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint">
<exclude-pattern>*/lib/*</exclude-pattern>
</rule>
<rule ref="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint">
<exclude-pattern>*/lib/*</exclude-pattern> <exclude-pattern>*/lib/*</exclude-pattern>
</rule> </rule>
...@@ -45,6 +65,11 @@ ...@@ -45,6 +65,11 @@
<exclude-pattern>tests/Doctrine/Tests/DBAL/Tools/TestAsset/*</exclude-pattern> <exclude-pattern>tests/Doctrine/Tests/DBAL/Tools/TestAsset/*</exclude-pattern>
</rule> </rule>
<!-- https://github.com/slevomat/coding-standard/issues/868 -->
<rule ref="SlevomatCodingStandard.PHP.UselessParentheses.UselessParentheses">
<exclude-pattern>tests/continuousphp/bootstrap.php</exclude-pattern>
</rule>
<!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2099 --> <!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2099 -->
<rule ref="Squiz.Commenting.FunctionComment.InvalidNoReturn"> <rule ref="Squiz.Commenting.FunctionComment.InvalidNoReturn">
<exclude-pattern>lib/Doctrine/DBAL/Platforms/AbstractPlatform.php</exclude-pattern> <exclude-pattern>lib/Doctrine/DBAL/Platforms/AbstractPlatform.php</exclude-pattern>
...@@ -52,6 +77,31 @@ ...@@ -52,6 +77,31 @@
<exclude-pattern>tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php</exclude-pattern> <exclude-pattern>tests/Doctrine/Tests/DBAL/Platforms/AbstractPlatformTestCase.php</exclude-pattern>
</rule> </rule>
<!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2838 -->
<rule ref="Squiz.Commenting.FunctionComment.SpacingAfter">
<exclude-pattern>lib/Doctrine/DBAL/Driver/AbstractMySQLDriver.php</exclude-pattern>
</rule>
<rule ref="Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps">
<!-- This test contains a fixture class that should use snake case -->
<exclude-pattern>tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php</exclude-pattern>
</rule>
<!-- https://github.com/squizlabs/PHP_CodeSniffer/issues/2837 -->
<rule ref="Squiz.NamingConventions.ValidVariableName.NotCamelCaps">
<!--
This file uses the return value db2_server_info(), which does not follow conventions
phpcs wrongly complains about it, and that has been reported here:
https://github.com/squizlabs/PHP_CodeSniffer/issues/2950
-->
<exclude-pattern>lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php</exclude-pattern>
<!-- See https://github.com/squizlabs/PHP_CodeSniffer/issues/2837 -->
<exclude-pattern>lib/Doctrine/DBAL/SQLParserUtils.php</exclude-pattern>
<exclude-pattern>lib/Doctrine/DBAL/Tools/Dumper.php</exclude-pattern>
<exclude-pattern>tests/Doctrine/Tests/DBAL/Driver/StatementIteratorTest.php</exclude-pattern>
<exclude-pattern>tests/Doctrine/Tests/DBAL/Tools/DumperTest.php</exclude-pattern>
</rule>
<!-- some statement classes close cursor using an empty while-loop --> <!-- some statement classes close cursor using an empty while-loop -->
<rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedWhile"> <rule ref="Generic.CodeAnalysis.EmptyStatement.DetectedWhile">
<exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern> <exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
...@@ -62,21 +112,20 @@ ...@@ -62,21 +112,20 @@
<exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern> <exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
</rule> </rule>
<!-- see https://github.com/squizlabs/PHP_CodeSniffer/issues/2165 -->
<rule ref="Squiz.Arrays.ArrayDeclaration.SpaceBeforeComma">
<exclude-pattern>tests/Doctrine/Tests/DBAL/Platforms/OraclePlatformTest.php</exclude-pattern>
<exclude-pattern>tests/Doctrine/Tests/DBAL/SQLParserUtilsTest.php</exclude-pattern>
</rule>
<!-- see https://github.com/doctrine/dbal/issues/3377 --> <!-- see https://github.com/doctrine/dbal/issues/3377 -->
<rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator"> <rule ref="SlevomatCodingStandard.Operators.DisallowEqualOperators.DisallowedNotEqualOperator">
<exclude-pattern>lib/Doctrine/DBAL/Schema/Comparator.php</exclude-pattern> <exclude-pattern>lib/Doctrine/DBAL/Schema/Comparator.php</exclude-pattern>
</rule> </rule>
<!-- see https://github.com/slevomat/coding-standard/issues/737 --> <!-- DB2_AUTOCOMMIT_ON/DB2_AUTOCOMMIT_OFF are of int type but db2_autocommit() incorrectly expects bool,
<rule ref="SlevomatCodingStandard.TypeHints.TypeHintDeclaration.IncorrectReturnTypeHint"> see https://bugs.php.net/bug.php?id=77591 -->
<exclude-pattern>lib/Doctrine/DBAL/Types/ArrayType.php</exclude-pattern> <rule ref="SlevomatCodingStandard.TypeHints.DeclareStrictTypes.DeclareStrictTypesMissing">
<exclude-pattern>lib/Doctrine/DBAL/Types/ObjectType.php</exclude-pattern> <exclude-pattern>lib/Doctrine/DBAL/Driver/IBMDB2/DB2Connection.php</exclude-pattern>
<exclude-pattern>tests/Doctrine/Tests/DBAL/Driver/Mysqli/MysqliConnectionTest.php</exclude-pattern> </rule>
<!-- The SQLSRV_* functions are defined in the upper case by the sqlsrv extension and violate the standard
see https://docs.microsoft.com/en-us/sql/connect/php/constants-microsoft-drivers-for-php-for-sql-server -->
<rule ref="Squiz.PHP.LowercasePHPFunctions.UseStatementUppercase">
<exclude-pattern>lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php</exclude-pattern>
</rule> </rule>
</ruleset> </ruleset>
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