mirror of
https://github.com/YGGverse/gemtext-php.git
synced 2026-03-31 09:45:33 +00:00
implement Line class
This commit is contained in:
parent
120af66967
commit
a4e9b6fffa
1 changed files with 58 additions and 0 deletions
58
src/Line.php
Normal file
58
src/Line.php
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Yggverse\Gemtext;
|
||||
|
||||
class Line
|
||||
{
|
||||
private string $_data;
|
||||
|
||||
private bool $_escaped;
|
||||
private ?int $_number;
|
||||
|
||||
public function __construct(string $data = '', bool $escaped = false, ?int $number = null)
|
||||
{
|
||||
$this->setData(
|
||||
$data
|
||||
);
|
||||
|
||||
$this->setEscaped(
|
||||
$escaped
|
||||
);
|
||||
|
||||
$this->setNumber(
|
||||
$number
|
||||
);
|
||||
}
|
||||
|
||||
public function getData(): string
|
||||
{
|
||||
return $this->_data;
|
||||
}
|
||||
|
||||
public function setData(string $data): void
|
||||
{
|
||||
$this->_data = $data;
|
||||
}
|
||||
|
||||
public function getEscaped(): bool
|
||||
{
|
||||
return $this->_escaped;
|
||||
}
|
||||
|
||||
public function setEscaped(bool $escaped): void
|
||||
{
|
||||
$this->_escaped = $escaped;
|
||||
}
|
||||
|
||||
public function getNumber(): ?int
|
||||
{
|
||||
return $this->_number;
|
||||
}
|
||||
|
||||
public function setNumber(?int $number): void
|
||||
{
|
||||
$this->_number = $number;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue