Skip to content

Commit 02c4962

Browse files
committed
feat: add getComment() method annotation into ColumnInterface
(cherry picked from commit c3cab76)
1 parent 2808de0 commit 02c4962

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

src/ColumnInterface.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313

1414
/**
1515
* Represents table schema column abstraction.
16+
*
17+
* @method string getComment() Get column comment.
18+
* An empty string will be returned if the feature is not supported by the driver.
1619
*/
1720
interface ColumnInterface
1821
{

src/Schema/AbstractColumn.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,4 +785,13 @@ protected function formatDatetime(
785785
default => $value,
786786
};
787787
}
788+
789+
/**
790+
* Get column comment.
791+
* An empty string will be returned if the feature is not supported by the driver.
792+
*/
793+
public function getComment(): string
794+
{
795+
return '';
796+
}
788797
}

tests/Database/Functional/Driver/Common/Schema/CommentTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Cycle\Database\Tests\Functional\Driver\Common\Schema;
66

77
// phpcs:ignore
8+
use Cycle\Database\ColumnInterface;
89
use Cycle\Database\Tests\Functional\Driver\Common\BaseTest;
910
use Cycle\Database\Tests\Utils\DontGenerateAttribute;
1011

0 commit comments

Comments
 (0)