Skip to content

Commit

Permalink
InjectDefault: Codestyle.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Aug 18, 2021
1 parent 0e2daec commit b0c97e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/User/Entity/CmsUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ interface CmsUser extends IIdentity
// Constructor will be reverted in Doctrine 3.0
// public function __construct(string $username, string $password, string $email, string $role = self::ROLE_USER);

public function injectDefault(string $username, string $password, string $email, string $role = self::ROLE_USER): void;
public function injectDefault(
string $username,
string $password,
string $email,
string $role = self::ROLE_USER,
): void;

/**
* @return string[]
Expand Down
8 changes: 6 additions & 2 deletions src/User/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,12 @@ public function __construct(string $username, string $password, string $email, s
}


public function injectDefault(string $username, string $password, string $email, string $role = self::ROLE_USER): void
{
public function injectDefault(
string $username,
string $password,
string $email,
string $role = self::ROLE_USER,
): void {
$this->username = trim(Strings::lower($username));
$this->password = $password
? (new Passwords)->hash($password)
Expand Down

0 comments on commit b0c97e7

Please sign in to comment.