mirror of
https://github.com/YGGverse/gemtext-php.git
synced 2026-04-01 10:15:33 +00:00
40 lines
No EOL
619 B
PHP
40 lines
No EOL
619 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Yggverse\Gemtext\Entity;
|
|
|
|
class Text
|
|
{
|
|
private string $_data;
|
|
|
|
public function __construct(
|
|
string $data,
|
|
bool $trim = false
|
|
) {
|
|
$this->setData(
|
|
$data,
|
|
$trim
|
|
);
|
|
}
|
|
|
|
public function setData(
|
|
string $data,
|
|
bool $trim = false
|
|
): void
|
|
{
|
|
$this->_data = $trim ? trim(
|
|
$data
|
|
) : $data;
|
|
}
|
|
|
|
public function getData(): string
|
|
{
|
|
return $this->_data;
|
|
}
|
|
|
|
public function toString(): string
|
|
{
|
|
return $this->_data;
|
|
}
|
|
} |