1313
1414class AdapterPlatform extends AbstractPlatform
1515{
16- public final const PLATFORM_NAME = 'SQLite ' ;
16+ final public const PLATFORM_NAME = 'SQLite ' ;
17+
1718 /** @var string[] */
1819
1920 protected array $ quoteIdentifier = ['" ' , '" ' ];
@@ -27,27 +28,25 @@ class AdapterPlatform extends AbstractPlatform
2728 protected string $ quoteIdentifierTo = '\'' ;
2829
2930 public function __construct (
30- protected readonly PdoDriverInterface |PDO |null $ driver = null
31- ) {
32- }
31+ protected readonly PdoDriverInterface |PDO |null $ driver = null ,
32+ ) {}
3333
3434 /**
3535 * {@inheritDoc}
3636 */
3737 #[Override]
38- public function quoteValue ( string $ value ): string
38+ public function getName ( ): string
3939 {
40- $ resource = $ this ->resource ;
41-
42- if ($ resource instanceof PdoDriverInterface) {
43- $ resource = $ resource ->getConnection ()->getResource ();
44- }
45-
46- if ($ resource instanceof PDO ) {
47- return $ resource ->quote ($ value );
48- }
40+ return self ::PLATFORM_NAME ;
41+ }
4942
50- return parent ::quoteValue ($ value );
43+ /**
44+ * {@inheritDoc}
45+ */
46+ #[Override]
47+ public function getSqlPlatformDecorator (): PlatformDecoratorInterface
48+ {
49+ return new Platform ();
5150 }
5251
5352 /**
@@ -73,17 +72,18 @@ public function quoteTrustedValue(int|float|string|bool $value): ?string
7372 * {@inheritDoc}
7473 */
7574 #[Override]
76- public function getName ( ): string
75+ public function quoteValue ( string $ value ): string
7776 {
78- return self ::PLATFORM_NAME ;
79- }
77+ $ resource = $ this ->resource ;
8078
81- /**
82- * {@inheritDoc}
83- */
84- #[Override]
85- public function getSqlPlatformDecorator (): PlatformDecoratorInterface
86- {
87- return new Platform ();
79+ if ($ resource instanceof PdoDriverInterface) {
80+ $ resource = $ resource ->getConnection ()->getResource ();
81+ }
82+
83+ if ($ resource instanceof PDO ) {
84+ return $ resource ->quote ($ value );
85+ }
86+
87+ return parent ::quoteValue ($ value );
8888 }
8989}
0 commit comments