Skip to content

Commit 4aac4da

Browse files
committed
refactor: replace @var tags with typed properties
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent d385213 commit 4aac4da

35 files changed

Lines changed: 190 additions & 447 deletions

lib/Db/Answer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
* @method void setText(string $value)
2525
*/
2626
class Answer extends Entity {
27-
protected $submissionId;
28-
protected $questionId;
29-
protected $fileId;
30-
protected $text;
27+
protected int $submissionId;
28+
protected int $questionId;
29+
protected ?int $fileId;
30+
protected string $text;
3131

3232
/**
3333
* Answer constructor.

lib/Db/Form.php

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,25 @@
5555
* @method void setLockedUntil(int|null $value)
5656
*/
5757
class Form extends Entity {
58-
protected $hash;
59-
protected $title;
60-
protected $description;
61-
protected $ownerId;
62-
protected $fileId;
63-
protected $fileFormat;
64-
protected $accessEnum;
65-
protected $created;
66-
protected $expires;
67-
protected $isAnonymous;
68-
protected $submitMultiple;
69-
protected $allowEditSubmissions;
70-
protected $showExpiration;
71-
protected $submissionMessage;
72-
protected $lastUpdated;
73-
protected $state;
74-
protected $lockedBy;
75-
protected $lockedUntil;
76-
protected $maxSubmissions;
58+
protected string $hash;
59+
protected string $title;
60+
protected string $description;
61+
protected string $ownerId;
62+
protected ?int $fileId;
63+
protected ?string $fileFormat;
64+
protected int $accessEnum;
65+
protected int $created;
66+
protected int $expires;
67+
protected bool $isAnonymous;
68+
protected bool $submitMultiple;
69+
protected bool $allowEditSubmissions;
70+
protected bool $showExpiration;
71+
protected ?string $submissionMessage;
72+
protected int $lastUpdated;
73+
protected ?int $state;
74+
protected ?string $lockedBy;
75+
protected ?int $lockedUntil;
76+
protected ?int $maxSubmissions;
7777

7878
/**
7979
* Form constructor.

lib/Db/Question.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,14 @@
3434
* @method void setName(string $value)
3535
*/
3636
class Question extends Entity {
37-
protected $formId;
38-
protected $order;
39-
protected $type;
40-
protected $isRequired;
41-
protected $text;
42-
protected $name;
43-
protected $description;
44-
protected $extraSettingsJson;
37+
protected int $formId;
38+
protected int $order;
39+
protected string $type;
40+
protected bool $isRequired;
41+
protected string $text;
42+
protected string $name;
43+
protected string $description;
44+
protected string $extraSettingsJson;
4545

4646
public function __construct() {
4747
$this->addType('formId', 'integer');

lib/Db/Share.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@
2323
* @method void setShareWith(string $value)
2424
*/
2525
class Share extends Entity {
26-
/** @var int */
27-
protected $formId;
28-
/** @var int */
29-
protected $shareType;
30-
/** @var string */
31-
protected $shareWith;
32-
/** @var string */
33-
protected $permissionsJson;
26+
protected int $formId;
27+
protected int $shareType;
28+
protected string $shareWith;
29+
protected string $permissionsJson;
3430

3531
/**
3632
* Option constructor.

lib/Db/Submission.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
* @method void setTimestamp(integer $value)
2121
*/
2222
class Submission extends Entity {
23-
protected $formId;
24-
protected $userId;
25-
protected $timestamp;
23+
protected int $formId;
24+
protected string $userId;
25+
protected int $timestamp;
2626

2727
/**
2828
* Submission constructor.

lib/Db/UploadedFile.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@
2222
* @method void setCreated(int $value)
2323
*/
2424
class UploadedFile extends Entity {
25-
protected $formId;
26-
protected $originalFileName;
27-
protected $fileId;
28-
protected $created;
25+
protected int $formId;
26+
protected string $originalFileName;
27+
protected int $fileId;
28+
protected int $created;
2929

3030
/**
3131
* Answer constructor.

lib/Migration/Version0010Date20190000000007.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,8 @@
1919
*/
2020
class Version0010Date20190000000007 extends SimpleMigrationStep {
2121

22-
/** @var IDBConnection */
23-
protected $connection;
24-
25-
/** @var IConfig */
26-
protected $config;
22+
protected IDBConnection $connection;
23+
protected IConfig $config;
2724

2825
/**
2926
* @param IDBConnection $connection

lib/Migration/Version010200Date20200323141300.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@
2323
*/
2424
class Version010200Date20200323141300 extends SimpleMigrationStep {
2525

26-
/** @var IDBConnection */
27-
protected $connection;
28-
29-
/** @var IConfig */
30-
protected $config;
26+
protected IDBConnection $connection;
27+
protected IConfig $config;
3128

3229
/** Map of questionTypes to change */
33-
private $questionTypeMap = [
30+
private array $questionTypeMap = [
3431
'radiogroup' => 'multiple_unique',
3532
'checkbox' => 'multiple',
3633
'text' => 'short',

lib/Migration/Version020202Date20210311150843.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
use OCP\Migration\SimpleMigrationStep;
1717

1818
class Version020202Date20210311150843 extends SimpleMigrationStep {
19-
/** @var IDBConnection */
20-
protected $connection;
19+
protected IDBConnection $connection;
2120

2221
/**
2322
* @param IDBConnection $connection

lib/Migration/Version020300Date20210406114130.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@
1616
use OCP\Migration\SimpleMigrationStep;
1717

1818
class Version020300Date20210406114130 extends SimpleMigrationStep {
19-
/** @var IDBConnection */
20-
protected $connection;
19+
protected IDBConnection $connection;
2120

2221
/**
2322
* @param IDBConnection $connection

0 commit comments

Comments
 (0)