mirror of
https://github.com/YGGverse/gemtext-php.git
synced 2026-03-31 09:45:33 +00:00
implement Text entity
This commit is contained in:
parent
940819fdb7
commit
ed5b33c708
1 changed files with 37 additions and 0 deletions
37
src/Entity/Text.php
Normal file
37
src/Entity/Text.php
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Gemtext\Entity;
|
||||
|
||||
class Text
|
||||
{
|
||||
private string $_data;
|
||||
|
||||
public function __construct(
|
||||
string $data
|
||||
) {
|
||||
$this->setData(
|
||||
$data
|
||||
);
|
||||
}
|
||||
|
||||
public function setData(
|
||||
string $data
|
||||
): void
|
||||
{
|
||||
$this->_data = trim(
|
||||
$data
|
||||
);
|
||||
}
|
||||
|
||||
public function getData(): string
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
public function toString(): string
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue