mirror of
https://github.com/nuxsmin/sysPass.git
synced 2026-03-03 07:04:07 +01:00
chore: Move account data models and unit test for account repository.
Signed-off-by: Rubén D <nuxsmin@syspass.org>
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*
|
||||
* @author nuxsmin
|
||||
* @link https://syspass.org
|
||||
* @copyright 2012-2021, Rubén Domínguez nuxsmin@$syspass.org
|
||||
* @copyright 2012-2022, Rubén Domínguez nuxsmin@$syspass.org
|
||||
*
|
||||
* This file is part of sysPass.
|
||||
*
|
||||
@@ -42,18 +42,18 @@ trait SerializedModel
|
||||
* @return mixed|null
|
||||
* @throws NoSuchPropertyException
|
||||
*/
|
||||
public function hydrate(string $class = null, string $property = 'data')
|
||||
public function hydrate(?string $class = null, string $property = 'data')
|
||||
{
|
||||
if (property_exists($this, $property)) {
|
||||
if ($this->$property === null) {
|
||||
if ($this->{$property} === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if ($class !== null) {
|
||||
return Util::unserialize($class, $this->$property);
|
||||
return Util::unserialize($class, $this->{$property});
|
||||
}
|
||||
|
||||
return unserialize($this->$property);
|
||||
return unserialize($this->{$property});
|
||||
}
|
||||
|
||||
throw new NoSuchPropertyException($property);
|
||||
|
||||
Reference in New Issue
Block a user