From 16a0b79cc209c518e651e94a6771e71e88ba2fb6 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Mon, 18 Sep 2017 18:36:40 +0200 Subject: [PATCH] Optimize order --- Account/Account.php | 218 ++++++++++++++++++++++---------------------- 1 file changed, 109 insertions(+), 109 deletions(-) diff --git a/Account/Account.php b/Account/Account.php index e5e85b2c0..d348e4373 100644 --- a/Account/Account.php +++ b/Account/Account.php @@ -238,7 +238,7 @@ class Account implements ArrayableInterface, \JsonSerializable /** * Add permission. * - * @param PermissionAbstract $permissions + * @param PermissionAbstract $permission * * @return void * @@ -307,6 +307,20 @@ class Account implements ArrayableInterface, \JsonSerializable return $this->name1; } + /** + * Set name1. + * + * @param string $name Name + * + * @return void + * + * @since 1.0.0 + */ + public function setName1(string $name) /* : void */ + { + $this->name1 = $name; + } + /** * Get name2. * @@ -319,6 +333,20 @@ class Account implements ArrayableInterface, \JsonSerializable return $this->name2; } + /** + * Set name2. + * + * @param string $name Name + * + * @return void + * + * @since 1.0.0 + */ + public function setName2(string $name) /* : void */ + { + $this->name2 = $name; + } + /** * Get name3. * @@ -331,6 +359,20 @@ class Account implements ArrayableInterface, \JsonSerializable return $this->name3; } + /** + * Set name3. + * + * @param string $name Name + * + * @return void + * + * @since 1.0.0 + */ + public function setName3(string $name) /* : void */ + { + $this->name3 = $name; + } + /** * Get email. * @@ -343,6 +385,24 @@ class Account implements ArrayableInterface, \JsonSerializable return $this->email; } + /** + * Set email. + * + * @param string $email Email + * + * @return void + * + * @since 1.0.0 + */ + public function setEmail(string $email) /* : void */ + { + if (!Email::isValid($email)) { + throw new \InvalidArgumentException(); + } + + $this->email = mb_strtolower($email); + } + /** * Get status. * @@ -357,6 +417,24 @@ class Account implements ArrayableInterface, \JsonSerializable return $this->status; } + /** + * Get status. + * + * @param int $status Status + * + * @return void + * + * @since 1.0.0 + */ + public function setStatus(int $status) /* : void */ + { + if (!AccountStatus::isValidValue($status)) { + throw new \InvalidArgumentException(); + } + + $this->status = $status; + } + /** * Get type. * @@ -371,6 +449,24 @@ class Account implements ArrayableInterface, \JsonSerializable return $this->type; } + /** + * Get type. + * + * @param int $type Type + * + * @return void + * + * @since 1.0.0 + */ + public function setType(int $type) /* : void */ + { + if (!AccountType::isValidValue($type)) { + throw new \InvalidArgumentException(); + } + + $this->type = $type; + } + /** * Get last activity. * @@ -423,102 +519,6 @@ class Account implements ArrayableInterface, \JsonSerializable $this->login = $name; } - /** - * Set name1. - * - * @param string $name Name - * - * @return void - * - * @since 1.0.0 - */ - public function setName1(string $name) /* : void */ - { - $this->name1 = $name; - } - - /** - * Set name2. - * - * @param string $name Name - * - * @return void - * - * @since 1.0.0 - */ - public function setName2(string $name) /* : void */ - { - $this->name2 = $name; - } - - /** - * Set name3. - * - * @param string $name Name - * - * @return void - * - * @since 1.0.0 - */ - public function setName3(string $name) /* : void */ - { - $this->name3 = $name; - } - - /** - * Set email. - * - * @param string $email Email - * - * @return void - * - * @since 1.0.0 - */ - public function setEmail(string $email) /* : void */ - { - if (!Email::isValid($email)) { - throw new \InvalidArgumentException(); - } - - $this->email = mb_strtolower($email); - } - - /** - * Get status. - * - * @param int $status Status - * - * @return void - * - * @since 1.0.0 - */ - public function setStatus(int $status) /* : void */ - { - if (!AccountStatus::isValidValue($status)) { - throw new \InvalidArgumentException(); - } - - $this->status = $status; - } - - /** - * Get type. - * - * @param int $type Type - * - * @return void - * - * @since 1.0.0 - */ - public function setType(int $type) /* : void */ - { - if (!AccountType::isValidValue($type)) { - throw new \InvalidArgumentException(); - } - - $this->type = $type; - } - /** * Update last activity. * @@ -531,6 +531,18 @@ class Account implements ArrayableInterface, \JsonSerializable $this->lastActive = new \DateTime('NOW'); } + /** + * Get string representation. + * + * @return string + * + * @since 1.0.0 + */ + public function __toString() + { + return json_encode($this->toArray()); + } + /** * {@inheritdoc} */ @@ -552,18 +564,6 @@ class Account implements ArrayableInterface, \JsonSerializable ]; } - /** - * Get string representation. - * - * @return string - * - * @since 1.0.0 - */ - public function __toString() - { - return json_encode($this->toArray()); - } - /** * Json serialize. *