Created
May 15, 2015 09:23
-
-
Save sergigp/dbb389deb3289840e644 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final class User extends AggregateRoot | |
{ | |
private $id; | |
protected function getRules() | |
{ | |
return [ | |
'id' => [UserId::class], | |
]; | |
} | |
} | |
final class UserStub | |
{ | |
public static function create(UserId $userId) | |
{ | |
return new User(['id' => $userId]); | |
} | |
public static function random() | |
{ | |
return static::create(UserIdStub::random()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment