Skip to content

Commit 4e6a586

Browse files
committed
Amend CR comments
1 parent 807ee83 commit 4e6a586

13 files changed

Lines changed: 591 additions & 510 deletions

src/Schema/Columns/Column_Types.php

Lines changed: 475 additions & 0 deletions
Large diffs are not rendered by default.

src/Schema/Columns/Contracts/Column.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
namespace StellarWP\Schema\Columns\Contracts;
1313

1414
use StellarWP\Schema\Traits\Indexable as Indexable_Trait;
15+
use StellarWP\Schema\Columns\PHP_Types;
16+
use StellarWP\Schema\Columns\Column_Types;
1517
use InvalidArgumentException;
1618

1719
/**
@@ -279,7 +281,7 @@ public function get_definition(): array {
279281

280282
if ( $this->get_default() ) {
281283
$default = $this->get_default();
282-
$sql .= ' DEFAULT ' . ( in_array( $default, self::SQL_RESERVED_DEFAULTS, true ) || in_array( $this->get_type(), [ self::PHP_TYPE_INT, self::PHP_TYPE_BOOL, self::PHP_TYPE_FLOAT ], true ) ? $default : "'{$default}'" );
284+
$sql .= ' DEFAULT ' . ( in_array( $default, self::SQL_RESERVED_DEFAULTS, true ) || in_array( $this->get_type(), [ PHP_Types::INT, PHP_Types::BOOL, PHP_Types::FLOAT ], true ) ? $default : "'{$default}'" );
283285
}
284286

285287
if ( $this->get_on_update() ) {
@@ -308,7 +310,7 @@ public function get_definition(): array {
308310
* @return string[] The supported column types.
309311
*/
310312
protected function get_supported_column_types(): array {
311-
return self::SUPPORTED_COLUMN_TYPES;
313+
return Column_Types::SUPPORTED;
312314
}
313315

314316
/**
@@ -317,6 +319,6 @@ protected function get_supported_column_types(): array {
317319
* @return string[] The supported PHP types.
318320
*/
319321
protected function get_supported_php_types(): array {
320-
return self::SUPPORTED_PHP_TYPES;
322+
return PHP_Types::SUPPORTED;
321323
}
322324
}

src/Schema/Columns/Contracts/Column_Interface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @package StellarWP\Schema\Columns\Contracts
2222
*/
23-
interface Column_Interface extends PHP_Types, Column_Types {
23+
interface Column_Interface {
2424
/**
2525
* Get the type of the column.
2626
*

0 commit comments

Comments
 (0)