diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Authentication/Token/PublicKeyToken.php | 15 | ||||
-rw-r--r-- | lib/private/Updater/Changes.php | 3 | ||||
-rw-r--r-- | lib/public/AppFramework/Db/Entity.php | 7 |
3 files changed, 13 insertions, 12 deletions
diff --git a/lib/private/Authentication/Token/PublicKeyToken.php b/lib/private/Authentication/Token/PublicKeyToken.php index 961b7191d84..be427ab4839 100644 --- a/lib/private/Authentication/Token/PublicKeyToken.php +++ b/lib/private/Authentication/Token/PublicKeyToken.php @@ -10,6 +10,7 @@ namespace OC\Authentication\Token; use OCP\AppFramework\Db\Entity; use OCP\Authentication\Token\IToken; +use OCP\DB\Types; /** * @method void setId(int $id) @@ -88,16 +89,16 @@ class PublicKeyToken extends Entity implements INamedToken, IWipeableToken { $this->addType('passwordHash', 'string'); $this->addType('name', 'string'); $this->addType('token', 'string'); - $this->addType('type', 'int'); - $this->addType('remember', 'int'); - $this->addType('lastActivity', 'int'); - $this->addType('lastCheck', 'int'); + $this->addType('type', Types::INTEGER); + $this->addType('remember', Types::INTEGER); + $this->addType('lastActivity', Types::INTEGER); + $this->addType('lastCheck', Types::INTEGER); $this->addType('scope', 'string'); - $this->addType('expires', 'int'); + $this->addType('expires', Types::INTEGER); $this->addType('publicKey', 'string'); $this->addType('privateKey', 'string'); - $this->addType('version', 'int'); - $this->addType('passwordInvalid', 'bool'); + $this->addType('version', Types::INTEGER); + $this->addType('passwordInvalid', Types::BOOLEAN); } public function getId(): int { diff --git a/lib/private/Updater/Changes.php b/lib/private/Updater/Changes.php index bdf799a0100..c941dfb3fa5 100644 --- a/lib/private/Updater/Changes.php +++ b/lib/private/Updater/Changes.php @@ -9,6 +9,7 @@ declare(strict_types=1); namespace OC\Updater; use OCP\AppFramework\Db\Entity; +use OCP\DB\Types; /** * Class Changes @@ -39,7 +40,7 @@ class Changes extends Entity { public function __construct() { $this->addType('version', 'string'); $this->addType('etag', 'string'); - $this->addType('lastCheck', 'int'); + $this->addType('lastCheck', Types::INTEGER); $this->addType('data', 'string'); } } diff --git a/lib/public/AppFramework/Db/Entity.php b/lib/public/AppFramework/Db/Entity.php index 882902a212e..cd15df134f1 100644 --- a/lib/public/AppFramework/Db/Entity.php +++ b/lib/public/AppFramework/Db/Entity.php @@ -15,7 +15,6 @@ use function substr; /** * @method int getId() * @method void setId(int $id) - * @psalm-type AllowedTypes = 'json'|'blob'|'datetime'|'string'|'int'|'integer'|'bool'|'boolean'|'float'|'double'|'array'|'object' * @since 7.0.0 * @psalm-consistent-constructor */ @@ -26,7 +25,7 @@ abstract class Entity { public $id; private array $_updatedFields = []; - /** @var array<string, AllowedTypes> */ + /** @var array<string, \OCP\DB\Types::*> */ private array $_fieldTypes = ['id' => 'integer']; /** @@ -67,7 +66,7 @@ abstract class Entity { /** - * @return array<string, AllowedTypes> with attribute and type + * @return array<string, \OCP\DB\Types::*> with attribute and type * @since 7.0.0 */ public function getFieldTypes(): array { @@ -260,7 +259,7 @@ abstract class Entity { * that value once its being returned from the database * * @param string $fieldName the name of the attribute - * @param AllowedTypes $type the type which will be used to match a cast + * @param \OCP\DB\Types::* $type the type which will be used to match a cast * @since 7.0.0 */ protected function addType(string $fieldName, string $type): void { |