Size validator for comment dimensions and margins

This commit is contained in:
MarkBaker 2020-11-02 22:18:33 +01:00
parent 0502fd3e7f
commit a16badbcc4
1 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ class Size
public function __construct(string $size)
{
$this->valid = preg_match(self::REGEXP_SIZE_VALIDATION, $size, $matches);
$this->valid = preg_match(self::REGEXP_SIZE_VALIDATION, $size, $matches);
if ($this->valid) {
$this->size = $matches['size'];
$this->unit = $matches['unit'] ?? 'pt';
@ -26,12 +26,12 @@ class Size
return $this->valid;
}
public function size()
public function size(): string
{
return $this->size;
}
public function unit()
public function unit(): string
{
return $this->unit;
}