Skip to content

Commit a02d9d4

Browse files
committed
fixes data blocks
1 parent 9bd6307 commit a02d9d4

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

src/Data/Blocks/DelimiterData.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@
33
namespace Yuges\Contentable\Data\Blocks;
44

55
use Yuges\Contentable\Enums\BlockType;
6+
use Yuges\Contentable\Interfaces\BlockType as BlockTypeInterface;
67

78
class DelimiterData extends \Yuges\Contentable\Abstracts\BlockData
89
{
9-
protected const DURATION = 0.5;
10-
11-
public string $type = BlockType::Delimiter->value;
10+
protected const float DURATION = 0.5;
11+
protected const BlockTypeInterface TYPE = BlockType::Delimiter;
1212

1313
public function __construct() {
14+
parent::__construct();
1415
}
1516

1617
public function getData(): array

src/Data/Blocks/HeaderData.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
use Yuges\Contentable\Config\Config;
66
use Yuges\Contentable\Enums\BlockType;
77
use Yuges\Contentable\Enums\HeaderLevel;
8+
use Yuges\Contentable\Interfaces\BlockType as BlockTypeInterface;
89

910
class HeaderData extends \Yuges\Contentable\Abstracts\BlockData
1011
{
11-
public string $type = BlockType::Header->value;
12+
protected const BlockTypeInterface TYPE = BlockType::Header;
1213

1314
public function __construct(
1415
public ?string $text = '',
1516
public HeaderLevel $level = HeaderLevel::Level3,
1617
) {
18+
parent::__construct();
1719
}
1820

1921
public function getData(): array

src/Data/Blocks/ListData.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
use Yuges\Contentable\Config\Config;
66
use Yuges\Contentable\Enums\BlockType;
77
use Yuges\Contentable\Enums\ListStyle;
8+
use Yuges\Contentable\Interfaces\BlockType as BlockTypeInterface;
89

910
class ListData extends \Yuges\Contentable\Abstracts\BlockData
1011
{
11-
public string $type = BlockType::List->value;
12+
protected const BlockTypeInterface TYPE = BlockType::List;
1213

1314
public function __construct(
1415
public ?array $items = [],
1516
public ListStyle $style = ListStyle::Unordered,
1617
) {
18+
parent::__construct();
1719
}
1820

1921
public function getData(): array

src/Data/Blocks/QuoteData.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@
55
use Yuges\Contentable\Config\Config;
66
use Yuges\Contentable\Enums\Alignment;
77
use Yuges\Contentable\Enums\BlockType;
8+
use Yuges\Contentable\Interfaces\BlockType as BlockTypeInterface;
89

910
class QuoteData extends \Yuges\Contentable\Abstracts\BlockData
1011
{
11-
public string $type = BlockType::Quote->value;
12+
protected const BlockTypeInterface TYPE = BlockType::Quote;
1213

1314
public function __construct(
1415
public ?string $text = '',
1516
public ?string $caption = '',
1617
public Alignment $alignment = Alignment::Left,
1718
) {
19+
parent::__construct();
1820
}
1921

2022
public function getData(): array

0 commit comments

Comments
 (0)