Skip to content

Commit 19c4e50

Browse files
committed
Add Psalm; Fix Tests namespace; Upgrade ByJG components
1 parent 28d9458 commit 19c4e50

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

src/Interfaces/UsersInterface.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use ByJG\Authenticate\Definition\UserDefinition;
77
use ByJG\Authenticate\Definition\UserPropertiesDefinition;
88
use ByJG\Authenticate\Model\UserModel;
9+
use ByJG\Authenticate\Model\UserPropertiesModel;
910
use ByJG\Util\JwtWrapper;
1011

1112
/**
@@ -109,9 +110,9 @@ public function hasProperty(string $userId, string $propertyName, string $value
109110
* @desc Return all sites from a specific user
110111
* @param string $userId
111112
* @param string $propertyName
112-
* @return string|array|null String vector with all sites
113+
* @return UserPropertiesModel|array<array-key, mixed>|null|string String vector with all sites
113114
*/
114-
public function getProperty(string $userId, string $propertyName): array|string|null;
115+
public function getProperty(string $userId, string $propertyName): array|string|\ByJG\Authenticate\Model\UserPropertiesModel|null;
115116

116117
/**
117118
*

src/UsersBase.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
use ByJG\Authenticate\Exception\UserNotFoundException;
1212
use ByJG\Authenticate\Interfaces\UsersInterface;
1313
use ByJG\Authenticate\Model\UserModel;
14+
use ByJG\Authenticate\Model\UserPropertiesModel;
1415
use ByJG\Util\JwtWrapper;
1516
use ByJG\Util\JwtWrapperException;
1617
use InvalidArgumentException;
@@ -242,11 +243,11 @@ public function hasProperty(string $userId, string $propertyName, string $value
242243
*
243244
* @param string $userId User ID
244245
* @param string $propertyName Property name
245-
* @return array|string|null
246+
* @return array|string|UserPropertiesModel|null
246247
* @throws UserNotFoundException
247248
* @throws \ByJG\Serializer\Exception\InvalidArgumentException
248249
*/
249-
public function getProperty(string $userId, string $propertyName): array|string|null
250+
public function getProperty(string $userId, string $propertyName): array|string|UserPropertiesModel|null
250251
{
251252
$user = $this->getById($userId);
252253
if ($user !== null) {

src/UsersDBDataset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ public function removeAllProperties(string $propertyName, string|null $value = n
383383
$this->propertiesRepository->deleteByQuery($updateable);
384384
}
385385

386-
public function getProperty(string $userId, string $propertyName): array|string|null
386+
public function getProperty(string $userId, string $propertyName): array|string|UserPropertiesModel|null
387387
{
388388
$query = Query::getInstance()
389389
->table($this->getUserPropertiesDefinition()->table())

0 commit comments

Comments
 (0)