]> git.mxchange.org Git - core.git/blobdiff - framework/main/classes/user/class_BaseUser.php
Continued:
[core.git] / framework / main / classes / user / class_BaseUser.php
index 1a2da22ed2f91654659e391d0cd594eace12d347..468f235dc0902bcf6de2ed1d2295dd413fcedafa 100644 (file)
@@ -6,7 +6,7 @@ namespace Org\Mxchange\CoreFramework\User;
 use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
 use Org\Mxchange\CoreFramework\Database\Frontend\User\UserDatabaseFrontend;
 use Org\Mxchange\CoreFramework\Database\Updateable;
-use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
+use Org\Mxchange\CoreFramework\Factory\Object\ObjectFactory;
 use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
 use Org\Mxchange\CoreFramework\Request\Requestable;
 use Org\Mxchange\CoreFramework\Result\Search\SearchableResult;
@@ -17,7 +17,7 @@ use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
  *
  * @author             Roland Haeder <webmaster@shipsimu.org>
  * @version            0.0.0
- * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @copyright  Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2021 Core Developer Team
  * @license            GNU GPL 3.0 or any newer version
  * @link               http://www.shipsimu.org
  *
@@ -76,8 +76,8 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
         * @param       $userName       The username to set
         * @return      void
         */
-       public final function setUserName ($userName) {
-               $this->userName = (string) $userName;
+       public final function setUserName (string $userName) {
+               $this->userName = $userName;
        }
 
        /**
@@ -96,7 +96,7 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
         * @return      void
         * @todo        Find a way of casting here. "(int)" might destroy the user id > 32766
         */
-       public final function setUserId ($userId) {
+       public final function setUserId (int $userId) {
                $this->userId = $userId;
        }
 
@@ -115,8 +115,8 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
         * @param       $email  The email to set
         * @return      void
         */
-       protected final function setEmail ($email) {
-               $this->email = (string) $email;
+       protected final function setEmail (string $email) {
+               $this->email = $email;
        }
 
        /**
@@ -157,16 +157,16 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
 
                        // And finally set it
                        $this->setResultInstance($resultInstance);
-               } // END - if
+               }
 
                // Rewind it
                $this->getResultInstance()->rewind();
 
                // Search for it
-               if ($this->getResultInstance()->next()) {
+               if ($this->getResultInstance()->valid()) {
                        // Entry found
                        $exists = true;
-               } // END - if
+               }
 
                // Return the status
                return $exists;
@@ -201,13 +201,13 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
 
                        // And finally set it
                        $this->setResultInstance($resultInstance);
-               } // END - if
+               }
 
                // Rewind it
                $this->getResultInstance()->rewind();
 
                // Search for it
-               if ($this->getResultInstance()->next()) {
+               if ($this->getResultInstance()->valid()) {
                        // Entry found
                        $exists = true;
 
@@ -218,8 +218,8 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
 
                                // Set the username
                                $this->setUserName($currEntry['username']);
-                       } // END - if
-               } // END - if
+                       }
+               }
 
                // Return the status
                return $exists;
@@ -256,7 +256,7 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
 
                        // And finally set it
                        $this->setResultInstance($resultInstance);
-               } // END - if
+               }
 
                // Rewind it and advance to first entry
                $this->getResultInstance()->rewind();
@@ -269,7 +269,7 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
                        // So does the hashes match?
                        //* DEBUG: */ echo $requestInstance->getRequestElement('pass_hash') . '<br />' . $this->getResultInstance()->getFoundValue() . '<br />';
                        $matches = ($requestInstance->getRequestElement('pass_hash') === $this->getResultInstance()->getFoundValue());
-               } // END - if
+               }
 
                // Return the status
                return $matches;
@@ -291,7 +291,7 @@ abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
                if (isset($entry['pass_hash'])) {
                        // Get it
                        $passHash = $entry['pass_hash'];
-               } // END - if
+               }
 
                // And return the hash
                return $passHash;