Skip to content

Commit 8044d97

Browse files
committed
wip
1 parent 7e6c1e8 commit 8044d97

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

src/Properties/RichText.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace NotificationChannels\Notion\Properties;
4+
5+
class RichText extends AbstractProperty
6+
{
7+
public function __construct(protected array $value)
8+
{
9+
}
10+
11+
public function toArray(): array
12+
{
13+
return ['rich_text' => $this->value];
14+
}
15+
}

src/Properties/Status.php

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
3+
namespace NotificationChannels\Notion\Properties;
4+
5+
class Status extends AbstractProperty
6+
{
7+
public function __construct(
8+
protected string $value,
9+
protected string $type = 'name',
10+
protected string $color = 'default',
11+
) {
12+
}
13+
14+
public function name(string $name): self
15+
{
16+
$this->type = 'name';
17+
$this->value = $name;
18+
19+
return $this;
20+
}
21+
22+
public function id(string $id): self
23+
{
24+
$this->type = 'id';
25+
$this->value = $id;
26+
27+
return $this;
28+
}
29+
30+
public function color(string $color): self
31+
{
32+
$this->color = $color;
33+
34+
return $this;
35+
}
36+
37+
public function toArray(): array
38+
{
39+
return [
40+
'status' => [
41+
'type' => $this->type,
42+
'value' => $this->value,
43+
'color' => $this->color,
44+
],
45+
];
46+
}
47+
}

src/Properties/URL.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<?php
2+
3+
namespace NotificationChannels\Notion\Properties;
4+
5+
class URL extends AbstractProperty
6+
{
7+
public function __construct(protected string $value)
8+
{
9+
}
10+
11+
public function toArray(): array
12+
{
13+
return ['url' => $this->value];
14+
}
15+
}

0 commit comments

Comments
 (0)