Skip to content

Commit c8cad0e

Browse files
committed
Reinstate SQLServerPlatform and SQLServerKeywords
1 parent 666c065 commit c8cad0e

18 files changed

+1985
-1956
lines changed

UPGRADE.md

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ awareness about deprecated code.
1111
## Deprecated versioned platform classes that represent the lowest supported version:
1212

1313
1. `PostgreSQL94Platform` and `PostgreSQL94Keywords`. Use `PostgreSQLPlatform` and `PostgreSQLKeywords` instead.
14+
2. `SQLServer2012Platform` and `SQLServer2012Keywords`. Use `SQLServerPlatform` and `SQLServerKeywords` instead.
1415

1516
## Deprecated schema comparison APIs that don't account for the current database connection and the database platform
1617

docs/en/reference/platforms.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ Oracle
5050
Microsoft SQL Server
5151
^^^^^^^^^^^^^^^^^^^^
5252

53-
- ``SQLServer2012Platform`` for version 2012 and above.
53+
- ``SQLServerPlatform`` for version 2012 and above.
5454

5555
PostgreSQL
5656
^^^^^^^^^^

phpstan.neon.dist

+2-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ parameters:
8383
-
8484
message: '~^Only numeric types are allowed in -, int<1, max>\|false given on the left side\.~'
8585
paths:
86-
- %currentWorkingDirectory%/src/Platforms/SQLServer2012Platform.php
86+
- %currentWorkingDirectory%/src/Platforms/SQLServerPlatform.php
8787

8888
# Unlike Psalm, PHPStan doesn't understand the shape of the parse_str() return value
8989
-
@@ -95,7 +95,7 @@ parameters:
9595
-
9696
message: '~^Only numeric types are allowed in pre\-decrement, int\<1, max\>\|false given\.$~'
9797
paths:
98-
- %currentWorkingDirectory%/src/Platforms/SQLServer2012Platform.php
98+
- %currentWorkingDirectory%/src/Platforms/SQLServerPlatform.php
9999

100100
# https://github.com/phpstan/phpstan-phpunit/issues/83
101101
-

psalm.xml.dist

+3-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@
6565
TODO: remove in 4.0.0
6666
-->
6767
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords"/>
68+
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords"/>
6869
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQL94Platform"/>
70+
<referencedClass name="Doctrine\DBAL\Platforms\SQLServer2012Platform"/>
6971
</errorLevel>
7072
</DeprecatedClass>
7173
<DeprecatedInterface>
@@ -182,7 +184,7 @@
182184
<file name="src/DriverManager.php"/>
183185
<file name="src/Platforms/AbstractPlatform.php"/>
184186
<file name="src/Platforms/MySQLPlatform.php"/>
185-
<file name="src/Platforms/SQLServer2012Platform.php"/>
187+
<file name="src/Platforms/SQLServerPlatform.php"/>
186188
<file name="src/Platforms/SqlitePlatform.php"/>
187189
<file name="src/Schema/Column.php"/>
188190
<!--

src/Platforms/Keywords/SQLServer2012Keywords.php

+3-204
Original file line numberDiff line numberDiff line change
@@ -4,210 +4,9 @@
44

55
/**
66
* Microsoft SQL Server 2012 reserved keyword dictionary.
7+
*
8+
* @deprecated Use {@link SQLServerKeywords} instead.
79
*/
8-
class SQLServer2012Keywords extends KeywordList
10+
class SQLServer2012Keywords extends SQLServerKeywords
911
{
10-
/**
11-
* {@inheritdoc}
12-
*/
13-
public function getName()
14-
{
15-
return 'SQLServer';
16-
}
17-
18-
/**
19-
* {@inheritdoc}
20-
*
21-
* @link http://msdn.microsoft.com/en-us/library/aa238507%28v=sql.80%29.aspx
22-
*/
23-
protected function getKeywords()
24-
{
25-
return [
26-
'ADD',
27-
'ALL',
28-
'ALTER',
29-
'AND',
30-
'ANY',
31-
'AS',
32-
'ASC',
33-
'AUTHORIZATION',
34-
'BACKUP',
35-
'BEGIN',
36-
'BETWEEN',
37-
'BREAK',
38-
'BROWSE',
39-
'BULK',
40-
'BY',
41-
'CASCADE',
42-
'CASE',
43-
'CHECK',
44-
'CHECKPOINT',
45-
'CLOSE',
46-
'CLUSTERED',
47-
'COALESCE',
48-
'COLLATE',
49-
'COLUMN',
50-
'COMMIT',
51-
'COMPUTE',
52-
'CONSTRAINT',
53-
'CONTAINS',
54-
'CONTAINSTABLE',
55-
'CONTINUE',
56-
'CONVERT',
57-
'CREATE',
58-
'CROSS',
59-
'CURRENT',
60-
'CURRENT_DATE',
61-
'CURRENT_TIME',
62-
'CURRENT_TIMESTAMP',
63-
'CURRENT_USER',
64-
'CURSOR',
65-
'DATABASE',
66-
'DBCC',
67-
'DEALLOCATE',
68-
'DECLARE',
69-
'DEFAULT',
70-
'DELETE',
71-
'DENY',
72-
'DESC',
73-
'DISK',
74-
'DISTINCT',
75-
'DISTRIBUTED',
76-
'DOUBLE',
77-
'DROP',
78-
'DUMP',
79-
'ELSE',
80-
'END',
81-
'ERRLVL',
82-
'ESCAPE',
83-
'EXCEPT',
84-
'EXEC',
85-
'EXECUTE',
86-
'EXISTS',
87-
'EXIT',
88-
'EXTERNAL',
89-
'FETCH',
90-
'FILE',
91-
'FILLFACTOR',
92-
'FOR',
93-
'FOREIGN',
94-
'FREETEXT',
95-
'FREETEXTTABLE',
96-
'FROM',
97-
'FULL',
98-
'FUNCTION',
99-
'GOTO',
100-
'GRANT',
101-
'GROUP',
102-
'HAVING',
103-
'HOLDLOCK',
104-
'IDENTITY',
105-
'IDENTITY_INSERT',
106-
'IDENTITYCOL',
107-
'IF',
108-
'IN',
109-
'INDEX',
110-
'INNER',
111-
'INSERT',
112-
'INTERSECT',
113-
'INTO',
114-
'IS',
115-
'JOIN',
116-
'KEY',
117-
'KILL',
118-
'LEFT',
119-
'LIKE',
120-
'LINENO',
121-
'LOAD',
122-
'MERGE',
123-
'NATIONAL',
124-
'NOCHECK ',
125-
'NONCLUSTERED',
126-
'NOT',
127-
'NULL',
128-
'NULLIF',
129-
'OF',
130-
'OFF',
131-
'OFFSETS',
132-
'ON',
133-
'OPEN',
134-
'OPENDATASOURCE',
135-
'OPENQUERY',
136-
'OPENROWSET',
137-
'OPENXML',
138-
'OPTION',
139-
'OR',
140-
'ORDER',
141-
'OUTER',
142-
'OVER',
143-
'PERCENT',
144-
'PIVOT',
145-
'PLAN',
146-
'PRECISION',
147-
'PRIMARY',
148-
'PRINT',
149-
'PROC',
150-
'PROCEDURE',
151-
'PUBLIC',
152-
'RAISERROR',
153-
'READ',
154-
'READTEXT',
155-
'RECONFIGURE',
156-
'REFERENCES',
157-
'REPLICATION',
158-
'RESTORE',
159-
'RESTRICT',
160-
'RETURN',
161-
'REVERT',
162-
'REVOKE',
163-
'RIGHT',
164-
'ROLLBACK',
165-
'ROWCOUNT',
166-
'ROWGUIDCOL',
167-
'RULE',
168-
'SAVE',
169-
'SCHEMA',
170-
'SECURITYAUDIT',
171-
'SELECT',
172-
'SEMANTICKEYPHRASETABLE',
173-
'SEMANTICSIMILARITYDETAILSTABLE',
174-
'SEMANTICSIMILARITYTABLE',
175-
'SESSION_USER',
176-
'SET',
177-
'SETUSER',
178-
'SHUTDOWN',
179-
'SOME',
180-
'STATISTICS',
181-
'SYSTEM_USER',
182-
'TABLE',
183-
'TABLESAMPLE',
184-
'TEXTSIZE',
185-
'THEN',
186-
'TO',
187-
'TOP',
188-
'TRAN',
189-
'TRANSACTION',
190-
'TRIGGER',
191-
'TRUNCATE',
192-
'TRY_CONVERT',
193-
'TSEQUAL',
194-
'UNION',
195-
'UNIQUE',
196-
'UNPIVOT',
197-
'UPDATE',
198-
'UPDATETEXT',
199-
'USE',
200-
'USER',
201-
'VALUES',
202-
'VARYING',
203-
'VIEW',
204-
'WAITFOR',
205-
'WHEN',
206-
'WHERE',
207-
'WHILE',
208-
'WITH',
209-
'WITHIN GROUP',
210-
'WRITETEXT',
211-
];
212-
}
21312
}

0 commit comments

Comments
 (0)