for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/*
* This file is part of the G.L.S.R. Apps package.
*
* (c) Dev-Int Création <[email protected]>.
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Administration\Domain\User\Command;
use Core\Domain\Common\Model\VO\EmailField;
use Core\Domain\Common\Model\VO\NameField;
use Core\Domain\Protocol\Common\Command\CommandProtocol;
final class CreateUser implements CommandProtocol
{
private NameField $username;
private EmailField $email;
private string $password;
private array $roles;
public function __construct(
NameField $username,
EmailField $email,
string $password,
array $roles = []
) {
$this->username = $username;
$this->email = $email;
$this->password = $password;
$this->roles = $roles;
}
public function username(): NameField
return $this->username;
public function email(): EmailField
return $this->email;
public function password(): string
return $this->password;
public function roles(): array
return $this->roles;