linkmobility-php-client/src/ValueObject/StringValueObject.php

28 lines
445 B
PHP
Raw Normal View History

2022-06-20 14:47:33 +02:00
<?php
declare(strict_types=1);
namespace D3\LinkmobilityClient\ValueObject;
use Assert\Assert;
abstract class StringValueObject extends ValueObject
{
public function __construct(string $number)
2022-06-20 14:47:33 +02:00
{
Assert::that( $number)->notEmpty();
2022-06-20 14:47:33 +02:00
$this->value = $number;
2022-06-20 14:47:33 +02:00
}
public function __toString()
{
return $this->get();
}
public function get() : string
{
return $this->value;
}
}