Update to PHP 7.4
This commit is contained in:
parent
36b8cfe8b1
commit
87928dbbc9
16 changed files with 99 additions and 147 deletions
|
|
@ -8,12 +8,9 @@ class ActionResult
|
|||
private const STATUS_SUCCESS = 'success';
|
||||
private const STATUS_ERROR = 'error';
|
||||
|
||||
/** @var string */
|
||||
private $status;
|
||||
/** @var string */
|
||||
private $message;
|
||||
/** @var null|array */
|
||||
private $inputData;
|
||||
private string $status;
|
||||
private string $message;
|
||||
private ?array $inputData;
|
||||
|
||||
private function __construct(string $status, string $message, ?array $inputData = null)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,10 +9,8 @@ use MailAccountAdmin\Repositories\AdminUserRepository;
|
|||
|
||||
class UserHelper
|
||||
{
|
||||
/** @var SessionHelper */
|
||||
private $sessionHelper;
|
||||
/** @var AdminUserRepository */
|
||||
private $adminUserRepository;
|
||||
private SessionHelper $sessionHelper;
|
||||
private AdminUserRepository $adminUserRepository;
|
||||
|
||||
public function __construct(SessionHelper $sessionHelper, AdminUserRepository $adminUserRepository)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -16,12 +16,9 @@ use Slim\Views\Twig;
|
|||
|
||||
class AccountController extends BaseController
|
||||
{
|
||||
/** @var AccountHandler */
|
||||
private $accountHandler;
|
||||
/** @var AccountRepository */
|
||||
private $accountRepository;
|
||||
/** @var AliasRepository */
|
||||
private $aliasRepository;
|
||||
private AccountHandler $accountHandler;
|
||||
private AccountRepository $accountRepository;
|
||||
private AliasRepository $aliasRepository;
|
||||
|
||||
public function __construct(Twig $view, SessionHelper $sessionHelper, UserHelper $userHelper, AccountHandler $accountHandler, AccountRepository $accountRepository, AliasRepository $aliasRepository)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,20 +7,13 @@ use MailAccountAdmin\Exceptions\InputValidationError;
|
|||
|
||||
class AccountEditData
|
||||
{
|
||||
/** @var null|string */
|
||||
private $username;
|
||||
/** @var bool */
|
||||
private $usernameCreateAlias;
|
||||
/** @var bool */
|
||||
private $usernameReplaceAlias;
|
||||
/** @var null|string */
|
||||
private $password;
|
||||
/** @var bool */
|
||||
private $active;
|
||||
/** @var null|string */
|
||||
private $homeDir;
|
||||
/** @var null|string */
|
||||
private $memo;
|
||||
private ?string $username;
|
||||
private bool $usernameCreateAlias;
|
||||
private bool $usernameReplaceAlias;
|
||||
private ?string $password;
|
||||
private bool $active;
|
||||
private ?string $homeDir;
|
||||
private ?string $memo;
|
||||
|
||||
private function __construct(?string $username, bool $usernameCreateAlias, bool $usernameReplaceAlias, ?string $password, bool $active,
|
||||
?string $homeDir, ?string $memo)
|
||||
|
|
|
|||
|
|
@ -11,12 +11,9 @@ use MailAccountAdmin\Repositories\AliasRepository;
|
|||
|
||||
class AccountHandler
|
||||
{
|
||||
/** @var AccountRepository */
|
||||
private $accountRepository;
|
||||
/** @var AliasRepository */
|
||||
private $aliasRepository;
|
||||
/** @var PasswordHelper */
|
||||
private $passwordHelper;
|
||||
private AccountRepository $accountRepository;
|
||||
private AliasRepository $aliasRepository;
|
||||
private PasswordHelper $passwordHelper;
|
||||
|
||||
public function __construct(AccountRepository $accountRepository, AliasRepository $aliasRepository, PasswordHelper $passwordHelper)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -9,12 +9,9 @@ use Slim\Views\Twig;
|
|||
|
||||
class BaseController
|
||||
{
|
||||
/** @var Twig */
|
||||
protected $view;
|
||||
/** @var SessionHelper */
|
||||
protected $sessionHelper;
|
||||
/** @var UserHelper */
|
||||
protected $userHelper;
|
||||
protected Twig $view;
|
||||
protected SessionHelper $sessionHelper;
|
||||
protected UserHelper $userHelper;
|
||||
|
||||
public function __construct(Twig $view, SessionHelper $sessionHelper, UserHelper $userHelper)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -13,8 +13,7 @@ use Slim\Views\Twig;
|
|||
|
||||
class DomainController extends BaseController
|
||||
{
|
||||
/** @var DomainRepository */
|
||||
private $domainRepository;
|
||||
private DomainRepository $domainRepository;
|
||||
|
||||
public function __construct(Twig $view, SessionHelper $sessionHelper, UserHelper $userHelper, DomainRepository $domainRepository)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -15,10 +15,8 @@ use Slim\Views\Twig;
|
|||
|
||||
class LoginController extends BaseController
|
||||
{
|
||||
/** @var AdminUserRepository */
|
||||
private $adminUserRepository;
|
||||
/** @var PasswordHelper */
|
||||
private $passwordHelper;
|
||||
private AdminUserRepository $adminUserRepository;
|
||||
private PasswordHelper $passwordHelper;
|
||||
|
||||
public function __construct(Twig $view, SessionHelper $sessionHelper, UserHelper $userHelper, AdminUserRepository $adminUserRepository,
|
||||
PasswordHelper $passwordHelper)
|
||||
|
|
|
|||
|
|
@ -8,32 +8,20 @@ use MailAccountAdmin\Exceptions\InformationUnknownException;
|
|||
|
||||
class Account
|
||||
{
|
||||
/** @var int */
|
||||
private $id;
|
||||
/** @var string */
|
||||
private $username;
|
||||
/** @var string */
|
||||
private $passwordHash;
|
||||
/** @var bool */
|
||||
private $active;
|
||||
/** @var string */
|
||||
private $homeDir;
|
||||
/** @var string */
|
||||
private $memo;
|
||||
/** @var DateTimeImmutable */
|
||||
private $createdAt;
|
||||
/** @var DateTimeImmutable */
|
||||
private $modifiedAt;
|
||||
|
||||
// Extra data that is not part of the data model
|
||||
private int $id;
|
||||
private string $username;
|
||||
private string $passwordHash;
|
||||
private bool $active;
|
||||
private string $homeDir;
|
||||
private string $memo;
|
||||
private DateTimeImmutable $createdAt;
|
||||
private DateTimeImmutable $modifiedAt;
|
||||
|
||||
// Domain (extracted from username)
|
||||
/** @var string */
|
||||
private $domain;
|
||||
private string $domain;
|
||||
|
||||
// Number of aliases (not always available)
|
||||
/** @var int|null */
|
||||
private $aliasCount;
|
||||
private ?int $aliasCount;
|
||||
|
||||
private function __construct(int $id, string $username, string $passwordHash, bool $active, string $homeDir, string $memo,
|
||||
DateTimeImmutable $createdAt, DateTimeImmutable $modifiedAt)
|
||||
|
|
|
|||
|
|
@ -7,18 +7,12 @@ use DateTimeImmutable;
|
|||
|
||||
class AdminUser
|
||||
{
|
||||
/** @var int */
|
||||
private $id;
|
||||
/** @var string */
|
||||
private $username;
|
||||
/** @var string */
|
||||
private $passwordHash;
|
||||
/** @var bool */
|
||||
private $active;
|
||||
/** @var DateTimeImmutable */
|
||||
private $createdAt;
|
||||
/** @var DateTimeImmutable */
|
||||
private $modifiedAt;
|
||||
private int $id;
|
||||
private string $username;
|
||||
private string $passwordHash;
|
||||
private bool $active;
|
||||
private DateTimeImmutable $createdAt;
|
||||
private DateTimeImmutable $modifiedAt;
|
||||
|
||||
private function __construct(int $id, string $username, string $passwordHash, bool $isActive,
|
||||
DateTimeImmutable $createdAt, DateTimeImmutable $modifiedAt)
|
||||
|
|
|
|||
|
|
@ -7,16 +7,11 @@ use DateTimeImmutable;
|
|||
|
||||
class Alias
|
||||
{
|
||||
/** @var int */
|
||||
private $id;
|
||||
/** @var int */
|
||||
private $userId;
|
||||
/** @var string */
|
||||
private $mailAddress;
|
||||
/** @var DateTimeImmutable */
|
||||
private $createdAt;
|
||||
/** @var DateTimeImmutable */
|
||||
private $modifiedAt;
|
||||
private int $id;
|
||||
private int $userId;
|
||||
private string $mailAddress;
|
||||
private DateTimeImmutable $createdAt;
|
||||
private DateTimeImmutable $modifiedAt;
|
||||
|
||||
private function __construct(int $id, int $userId, string $mailAddress, DateTimeImmutable $createdAt, DateTimeImmutable $modifiedAt)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,8 +7,7 @@ use PDO;
|
|||
|
||||
class BaseRepository
|
||||
{
|
||||
/** @var PDO */
|
||||
protected $pdo;
|
||||
protected PDO $pdo;
|
||||
|
||||
public function __construct(PDO $pdo)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue