summaryrefslogtreecommitdiff
path: root/classes/authenticator/User.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/authenticator/User.php')
-rw-r--r--classes/authenticator/User.php102
1 files changed, 102 insertions, 0 deletions
diff --git a/classes/authenticator/User.php b/classes/authenticator/User.php
new file mode 100644
index 0000000..b99fa70
--- /dev/null
+++ b/classes/authenticator/User.php
@@ -0,0 +1,102 @@
+<?php
+
+
+// namespace DevCoder\Authentication;
+
+class User implements UserInterface
+{
+
+ // @var string
+ private $userName;
+
+ // @var string
+ private $password;
+
+ // @var array
+ private $roles = [];
+
+ // @var bool
+ private $enabled = true;
+
+
+ /** GETs
+ * -------------------------------------------------------------------------
+ */
+
+ /** getUserName
+ * @return null|string
+ */
+ public function getUsername(): ?string
+ {
+ return $this->userName;
+ }
+
+ /** getPassword
+ * @return null|string
+ */
+ public function getPassword(): ?string
+ {
+ return $this->password;
+ }
+
+ /** getRoles
+ * @return array
+ */
+ public function getRoles(): array
+ {
+ return $this->roles;
+ }
+
+ /** isEnabled
+ * @return bool
+ */
+ public function isEnabled(): bool
+ {
+ return $this->enabled;
+ }
+
+
+ /** SETs
+ * -------------------------------------------------------------------------
+ */
+
+ /** setUserName
+ * @param string $userName
+ * @return User
+ */
+ public function setUserName(string $userName): self
+ {
+ $this->userName = $userName;
+ return $this;
+ }
+
+ /** setPassword
+ * @param string $password
+ * @return User
+ */
+ public function setPassword(string $password): self
+ {
+ $this->password = $password;
+ return $this;
+ }
+
+ /** setRoles
+ * @param array $roles
+ * @return User
+ */
+ public function setRoles(array $roles): self
+ {
+ $this->roles = $roles;
+ return $this;
+ }
+
+ /**
+ * @param bool $enabled
+ * @return User
+ */
+ public function setEnabled(bool $enabled): self
+ {
+ $this->enabled = $enabled;
+ return $this;
+ }
+}