This groups Value Objects use for any string type
__construct()
The constructor checks that the value not empty__toString()
You canecho $myValue
, it will display the string value.getValue()
Returns the current valueisEqualTo()
Tests whether instances are equal (returnstrue
if values are equal,false
otherwise)
use Myks92\ValueObjects\String\StringLiteral;
final class MyTitle extends StringLiteral
{
}
$myTitle = new MyTitle('Title');
$myTitle->getValue(); //Title