1111
1212use function addcslashes ;
1313use function array_map ;
14- use function explode ;
1514use function implode ;
16- use function str_contains ;
1715use function str_replace ;
1816
1917/**
@@ -26,50 +24,21 @@ abstract class AbstractPlatform implements PlatformInterface
2624
2725 protected string $ quoteIdentifierTo = '\'' ;
2826
29- protected string $ identifierSeparator = '. ' ;
30-
3127 protected bool $ quoteIdentifiers = true ;
3228
33- /** @var array<string, string> */
34- private array $ identifierCache = [];
35-
3629 /**
3730 * {@inheritDoc}
3831 */
3932 #[Override]
40- public function quoteIdentifier (string $ name , ? string $ prefix = null ): string
33+ public function quoteIdentifier (string $ identifier ): string
4134 {
42- $ cacheKey = $ prefix !== null ? $ prefix . '. ' . $ name : $ name ;
43-
44- if (isset ($ this ->identifierCache [$ cacheKey ])) {
45- return $ this ->identifierCache [$ cacheKey ];
46- }
47-
48- if ($ prefix === null && str_contains ($ name , '. ' )) {
49- [$ prefix , $ name ] = explode ('. ' , $ name , 2 );
50- }
51-
5235 if (! $ this ->quoteIdentifiers ) {
53- return $ prefix !== null
54- ? $ prefix . $ this ->identifierSeparator . $ name
55- : $ name ;
56- }
57-
58- if ($ prefix !== null ) {
59- return $ this ->identifierCache [$ cacheKey ]
60- = $ this ->quoteIdentifier [0 ]
61- . str_replace ($ this ->quoteIdentifier [0 ], $ this ->quoteIdentifierTo , $ prefix )
62- . $ this ->quoteIdentifier [1 ]
63- . $ this ->identifierSeparator
64- . $ this ->quoteIdentifier [0 ]
65- . str_replace ($ this ->quoteIdentifier [0 ], $ this ->quoteIdentifierTo , $ name )
66- . $ this ->quoteIdentifier [1 ];
36+ return $ identifier ;
6737 }
6838
69- return $ this ->identifierCache [$ cacheKey ]
70- = $ this ->quoteIdentifier [0 ]
71- . str_replace ($ this ->quoteIdentifier [0 ], $ this ->quoteIdentifierTo , $ name )
72- . $ this ->quoteIdentifier [1 ];
39+ return $ this ->quoteIdentifier [0 ]
40+ . str_replace ($ this ->quoteIdentifier [0 ], $ this ->quoteIdentifierTo , $ identifier )
41+ . $ this ->quoteIdentifier [1 ];
7342 }
7443
7544 /**
@@ -138,6 +107,6 @@ public function quoteValueList(array|string $valueList): string
138107 #[Override]
139108 public function getIdentifierSeparator (): string
140109 {
141- return $ this -> identifierSeparator ;
110+ return ' . ' ;
142111 }
143112}
0 commit comments