Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- declare(strict_types=1);
- namespace ValueObjectTest;
- use Sushi\ValueObject;
- class PersonValueObject extends ValueObject
- {
- const KEY_FIRSTNAME = 'firstname';
- const KEY_LASTNAME = 'lastname';
- const KEY_CITY = 'city';
- const KEY_OCCUPATION = 'occupation';
- protected $keys = [
- self::KEY_FIRSTNAME,
- self::KEY_LASTNAME,
- self::KEY_CITY,
- self::KEY_OCCUPATION,
- ];
- public static function create(
- string $firstname,
- string $lastname,
- string $city,
- string $occupation
- ): self {
- return new static([
- static::KEY_FIRSTNAME => $firstname,
- static::KEY_LASTNAME => $lastname,
- static::KEY_CITY => $city,
- static::KEY_OCCUPATION => $occupation,
- ]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement