mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-07-02 14:34:31 +02:00
Use typed properties
This commit is contained in:
parent
548ec2ea50
commit
51e05a8669
216 changed files with 603 additions and 698 deletions
|
@ -76,7 +76,7 @@ class Group extends AbstractStructuralDBElement implements HasPermissionsInterfa
|
|||
/**
|
||||
* @ORM\OneToMany(targetEntity="User", mappedBy="group")
|
||||
*/
|
||||
protected $users;
|
||||
protected Collection $users;
|
||||
|
||||
/**
|
||||
* @var bool If true all users associated with this group must have enabled some kind of 2 factor authentication
|
||||
|
|
|
@ -68,49 +68,47 @@ class U2FKey implements TwoFactorKeyInterface
|
|||
*
|
||||
* @var string
|
||||
**/
|
||||
public $keyHandle;
|
||||
public string $keyHandle;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
public $publicKey;
|
||||
public string $publicKey;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
public $certificate;
|
||||
public string $certificate;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*
|
||||
* @var int
|
||||
**/
|
||||
public $counter;
|
||||
public int $counter;
|
||||
|
||||
/**
|
||||
* @ORM\Id
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
protected $id;
|
||||
protected int $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string")
|
||||
*
|
||||
* @var string
|
||||
**/
|
||||
protected $name;
|
||||
protected string $name;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="App\Entity\UserSystem\User", inversedBy="u2fKeys")
|
||||
*
|
||||
* @var User
|
||||
**/
|
||||
protected $user;
|
||||
protected ?User $user = null;
|
||||
|
||||
public function fromRegistrationData(Registration $data): void
|
||||
{
|
||||
|
|
|
@ -101,48 +101,48 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
* @var bool Determines if the user is disabled (user can not log in)
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $disabled = false;
|
||||
protected bool $disabled = false;
|
||||
|
||||
/**
|
||||
* @var string|null The theme
|
||||
* @ORM\Column(type="string", name="config_theme", nullable=true)
|
||||
* @Assert\Choice(choices=User::AVAILABLE_THEMES)
|
||||
*/
|
||||
protected $theme = '';
|
||||
protected ?string $theme = '';
|
||||
|
||||
/**
|
||||
* @var string|null the hash of a token the user must provide when he wants to reset his password
|
||||
* @ORM\Column(type="string", nullable=true)
|
||||
*/
|
||||
protected $pw_reset_token;
|
||||
protected ?string $pw_reset_token = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", name="config_instock_comment_a")
|
||||
*/
|
||||
protected $instock_comment_a = '';
|
||||
protected string $instock_comment_a = '';
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text", name="config_instock_comment_w")
|
||||
*/
|
||||
protected $instock_comment_w = '';
|
||||
protected string $instock_comment_w = '';
|
||||
|
||||
/** @var int The version of the trusted device cookie. Used to invalidate all trusted device cookies at once.
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
protected $trustedDeviceCookieVersion = 0;
|
||||
protected int $trustedDeviceCookieVersion = 0;
|
||||
|
||||
/**
|
||||
* @var string[]|null A list of backup codes that can be used, if the user has no access to its Google Authenticator device
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
protected $backupCodes = [];
|
||||
protected ?array $backupCodes = [];
|
||||
|
||||
/**
|
||||
* @ORM\Id()
|
||||
* @ORM\GeneratedValue()
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
protected $id;
|
||||
protected ?int $id = null;
|
||||
|
||||
/**
|
||||
* @var Group|null the group this user belongs to
|
||||
|
@ -150,58 +150,58 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
* @ORM\JoinColumn(name="group_id", referencedColumnName="id")
|
||||
* @Selectable()
|
||||
*/
|
||||
protected $group;
|
||||
protected ?Group $group = null;
|
||||
|
||||
/**
|
||||
* @var string|null The secret used for google authenticator
|
||||
* @ORM\Column(name="google_authenticator_secret", type="string", nullable=true)
|
||||
*/
|
||||
protected $googleAuthenticatorSecret;
|
||||
protected ?string $googleAuthenticatorSecret = null;
|
||||
|
||||
/**
|
||||
* @var string|null The timezone the user prefers
|
||||
* @ORM\Column(type="string", name="config_timezone", nullable=true)
|
||||
* @Assert\Timezone()
|
||||
*/
|
||||
protected $timezone = '';
|
||||
protected ?string $timezone = '';
|
||||
|
||||
/**
|
||||
* @var string|null The language/locale the user prefers
|
||||
* @ORM\Column(type="string", name="config_language", nullable=true)
|
||||
* @Assert\Language()
|
||||
*/
|
||||
protected $language = '';
|
||||
protected ?string $language = '';
|
||||
|
||||
/**
|
||||
* @var string|null The email address of the user
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
* @Assert\Email()
|
||||
*/
|
||||
protected $email = '';
|
||||
protected ?string $email = '';
|
||||
|
||||
/**
|
||||
* @var string|null The department the user is working
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
protected $department = '';
|
||||
protected ?string $department = '';
|
||||
|
||||
/**
|
||||
* @var string|null The last name of the User
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
protected $last_name = '';
|
||||
protected ?string $last_name = '';
|
||||
|
||||
/**
|
||||
* @var string|null The first name of the User
|
||||
* @ORM\Column(type="string", length=255, nullable=true)
|
||||
*/
|
||||
protected $first_name = '';
|
||||
protected ?string $first_name = '';
|
||||
|
||||
/**
|
||||
* @var bool True if the user needs to change password after log in
|
||||
* @ORM\Column(type="boolean")
|
||||
*/
|
||||
protected $need_pw_change = true;
|
||||
protected bool $need_pw_change = true;
|
||||
|
||||
/**
|
||||
* //@ORM\Column(type="json").
|
||||
|
@ -212,20 +212,20 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
* @var string|null The hashed password
|
||||
* @ORM\Column(type="string", nullable=true)
|
||||
*/
|
||||
protected $password;
|
||||
protected ?string $password = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=180, unique=true)
|
||||
* @Assert\NotBlank
|
||||
* @Assert\Regex("/^[\w\.\+\-\$]+$/", message="user.invalid_username")
|
||||
*/
|
||||
protected $name = '';
|
||||
protected string $name = '';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
* @ORM\Column(type="json")
|
||||
*/
|
||||
protected $settings = [];
|
||||
protected ?array $settings = [];
|
||||
|
||||
/**
|
||||
* @var Collection<int, UserAttachment>
|
||||
|
@ -237,7 +237,7 @@ class User extends AttachmentContainingDBElement implements UserInterface, HasPe
|
|||
/** @var DateTime|null The time when the backup codes were generated
|
||||
* @ORM\Column(type="datetime", nullable=true)
|
||||
*/
|
||||
protected $backupCodesGenerationDate;
|
||||
protected ?DateTime $backupCodesGenerationDate = null;
|
||||
|
||||
/** @var Collection<int, TwoFactorKeyInterface>
|
||||
* @ORM\OneToMany(targetEntity="App\Entity\UserSystem\U2FKey", mappedBy="user", cascade={"REMOVE"}, orphanRemoval=true)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue