guil95/vos

值对象公用库

1.0.0 2021-05-28 18:52 UTC

This package is auto-updated.

Last update: 2024-09-29 02:59:12 UTC


README

值对象公用

如何安装

$ composer require guil95/vos

如何使用

<?php
namespace MyNamespace;

use Guil95\Vos;

$email = new Email('invalidEmail'); // throws VoInvalidException
$email = new Email('gui@email.com'); // $email->getvalue() returns gui@email.com

$name = new Name('Name%$invalid Ch4aract8er'); // $name->getValue() returns Nameinvalid Character
$name = new Name('Name Gui'); // $name->getValue() returns Name Gui