Skip to content

Commit af059aa

Browse files
committed
Fix level 3 errors
1 parent 60970b3 commit af059aa

File tree

200 files changed

+705
-466
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

200 files changed

+705
-466
lines changed

phpstan-baseline.neon

Lines changed: 279 additions & 93 deletions
Large diffs are not rendered by default.

phpstan.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ includes:
22
- phpstan-baseline.neon
33

44
parameters:
5-
level: 2
5+
level: 3
66
paths:
77
- wcfsetup/install/files
88
excludePaths:

wcfsetup/install/files/lib/acp/form/AbstractCustomOptionForm.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ abstract class AbstractCustomOptionForm extends AbstractAcpForm
3838

3939
/**
4040
* option default value
41-
* @var string
41+
* @var string|int|float
4242
*/
4343
public $defaultValue = '';
4444

@@ -56,7 +56,7 @@ abstract class AbstractCustomOptionForm extends AbstractAcpForm
5656

5757
/**
5858
* field is required
59-
* @var bool
59+
* @var int
6060
*/
6161
public $required = 0;
6262

@@ -68,7 +68,7 @@ abstract class AbstractCustomOptionForm extends AbstractAcpForm
6868

6969
/**
7070
* 1 if the option is disabled
71-
* @var bool
71+
* @var int
7272
* @since 5.2
7373
*/
7474
public $isDisabled = 0;

wcfsetup/install/files/lib/acp/form/AdAddForm.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class AdAddForm extends AbstractForm
7070

7171
/**
7272
* list of available locations
73-
* @var string[]
73+
* @var array<string, array<int, string>>
7474
*/
7575
public $locations = [];
7676

wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class ArticleAddForm extends AbstractForm
5959

6060
/**
6161
* true if created article is multi-lingual
62-
* @var bool
62+
* @var int
6363
*/
6464
public $isMultilingual = 0;
6565

@@ -113,7 +113,7 @@ class ArticleAddForm extends AbstractForm
113113

114114
/**
115115
* enables the comment function
116-
* @var bool
116+
* @var int
117117
*/
118118
public $enableComments = ARTICLE_ENABLE_COMMENTS_DEFAULT_VALUE;
119119

@@ -587,7 +587,7 @@ public function save()
587587
$this->categoryID = 0;
588588
$this->publicationStatus = Article::PUBLISHED;
589589
$this->enableComments = ARTICLE_ENABLE_COMMENTS_DEFAULT_VALUE;
590-
$this->title = $this->teaser = $this->content = $this->images = $this->imageID = $this->teaserImages = $this->teaserImageID == $this->tags = [];
590+
$this->title = $this->teaser = $this->content = $this->images = $this->imageID = $this->teaserImages = $this->teaserImageID = $this->tags = [];
591591
$this->metaTitle = $this->metaDescription = [];
592592

593593
// Reload attachment handler to reset the uploaded attachments.

wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ public function readData()
183183
$this->bbcodeTag = $this->bbcode->bbcodeTag;
184184
$this->htmlOpen = $this->bbcode->htmlOpen;
185185
$this->htmlClose = $this->bbcode->htmlClose;
186-
$this->isBlockElement = $this->bbcode->isBlockElement;
187-
$this->isSourceCode = $this->bbcode->isSourceCode;
186+
$this->isBlockElement = !!$this->bbcode->isBlockElement;
187+
$this->isSourceCode = !!$this->bbcode->isSourceCode;
188188
$this->className = $this->bbcode->className;
189-
$this->showButton = $this->bbcode->showButton;
189+
$this->showButton = !!$this->bbcode->showButton;
190190
$this->wysiwygIcon = $this->bbcode->wysiwygIcon;
191191
}
192192
}

wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ class BoxAddForm extends AbstractForm
5353

5454
/**
5555
* true if created box is multi-lingual
56-
* @var bool
56+
* @var int
5757
*/
5858
public $isMultilingual = 0;
5959

@@ -77,7 +77,7 @@ class BoxAddForm extends AbstractForm
7777

7878
/**
7979
* true if created box is visible everywhere
80-
* @var bool
80+
* @var int
8181
*/
8282
public $visibleEverywhere = 1;
8383

@@ -89,7 +89,7 @@ class BoxAddForm extends AbstractForm
8989

9090
/**
9191
* true if box header is visible
92-
* @var bool
92+
* @var int
9393
*/
9494
public $showHeader = 1;
9595

@@ -137,7 +137,7 @@ class BoxAddForm extends AbstractForm
137137

138138
/**
139139
* selected box controller object type
140-
* @var ObjectType
140+
* @var ?ObjectType
141141
*/
142142
public $boxController;
143143

@@ -200,7 +200,7 @@ class BoxAddForm extends AbstractForm
200200
public $availableBoxPositions = [];
201201

202202
/**
203-
* @var bool
203+
* @var int
204204
* @since 5.2
205205
*/
206206
public $isDisabled = 0;
@@ -218,7 +218,7 @@ class BoxAddForm extends AbstractForm
218218
public $presetBox;
219219

220220
/**
221-
* @var bool
221+
* @var int
222222
* @since 5.4
223223
*/
224224
public $invertPermissions;
@@ -480,13 +480,13 @@ public function validate()
480480
}
481481
}
482482
} elseif ($this->boxType !== 'system' && $this->linkType == 'external') {
483-
$this->linkPageID = $this->linkPageObjectID = null;
483+
$this->linkPageID = $this->linkPageObjectID = 0;
484484

485485
if (empty($this->externalURL)) {
486486
throw new UserInputException('externalURL');
487487
}
488488
} else {
489-
$this->linkPageID = $this->linkPageObjectID = null;
489+
$this->linkPageID = $this->linkPageObjectID = 0;
490490
$this->externalURL = '';
491491
}
492492

wcfsetup/install/files/lib/acp/form/ContactRecipientAddForm.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function save()
175175
]);
176176

177177
// reset values
178-
$this->email = $this->name = 0;
178+
$this->email = $this->name = '';
179179
$this->isDisabled = $this->showOrder = 0;
180180

181181
I18nHandler::getInstance()->reset();

wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ class NotificationPresetSettingsForm extends AbstractForm
4545

4646
/**
4747
* true to apply change to existing users
48-
* @var bool
48+
* @var int
4949
*/
5050
public $applyChangesToExistingUsers = 0;
5151

wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class PackageStartInstallForm extends AbstractForm
4242
* data of the uploaded package
4343
* @var string[]
4444
*/
45-
public $uploadPackage = '';
45+
public $uploadPackage = [];
4646

4747
/**
4848
* archive of the installation/update package

0 commit comments

Comments
 (0)