Skip to content

Commit 5b371c4

Browse files
committed
Use constant instead of property
1 parent 6475c0a commit 5b371c4

4 files changed

Lines changed: 16 additions & 10 deletions

File tree

src/mako/database/connections/Connection.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,11 @@
4646
*/
4747
class Connection
4848
{
49+
/**
50+
* Does the connection support transactional DDL?
51+
*/
52+
protected const bool SUPPORTS_TRANSACTIONAL_DDL = false;
53+
4954
/**
5055
* Connection DSN.
5156
*/
@@ -101,11 +106,6 @@ class Connection
101106
*/
102107
protected array $log = [];
103108

104-
/**
105-
* Does the connection support transactional DDL?
106-
*/
107-
protected bool $supportsTransactionalDDL = false;
108-
109109
/**
110110
* Constructor.
111111
*/
@@ -167,7 +167,7 @@ public function close(): void
167167
*/
168168
public function supportsTransactionalDDL(): bool
169169
{
170-
return $this->supportsTransactionalDDL;
170+
return static::SUPPORTS_TRANSACTIONAL_DDL;
171171
}
172172

173173
/**

src/mako/database/connections/Postgres.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class Postgres extends Connection
1717
/**
1818
* {@inheritDoc}
1919
*/
20-
#[Override]
21-
protected bool $supportsTransactionalDDL = true;
20+
//#[Override]
21+
protected const bool SUPPORTS_TRANSACTIONAL_DDL = true;
2222
}

src/mako/database/connections/SQLServer.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
*/
1515
class SQLServer extends Connection
1616
{
17+
/**
18+
* {@inheritDoc}
19+
*/
20+
//#[Override]
21+
protected const bool SUPPORTS_TRANSACTIONAL_DDL = true;
22+
1723
/**
1824
* {@inheritDoc}
1925
*/

src/mako/database/connections/SQLite.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class SQLite extends Connection
1717
/**
1818
* {@inheritDoc}
1919
*/
20-
#[Override]
21-
protected bool $supportsTransactionalDDL = true;
20+
//#[Override]
21+
protected const bool SUPPORTS_TRANSACTIONAL_DDL = true;
2222
}

0 commit comments

Comments
 (0)