Skip to content

Commit

Permalink
Fix level 3 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
dtdesign committed Feb 12, 2025
1 parent 96367aa commit 36bfd67
Show file tree
Hide file tree
Showing 198 changed files with 1,028 additions and 458 deletions.
372 changes: 279 additions & 93 deletions phpstan-baseline.neon

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ includes:
- phpstan-baseline.neon

parameters:
level: 2
level: 3
paths:
- wcfsetup/install/files
excludePaths:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ abstract class AbstractCustomOptionForm extends AbstractAcpForm

/**
* option default value
* @var string
* @var string|int|float
*/
public $defaultValue = '';

Expand All @@ -56,7 +56,7 @@ abstract class AbstractCustomOptionForm extends AbstractAcpForm

/**
* field is required
* @var bool
* @var int
*/
public $required = 0;

Expand All @@ -68,7 +68,7 @@ abstract class AbstractCustomOptionForm extends AbstractAcpForm

/**
* 1 if the option is disabled
* @var bool
* @var int
* @since 5.2
*/
public $isDisabled = 0;
Expand Down
2 changes: 1 addition & 1 deletion wcfsetup/install/files/lib/acp/form/AdAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class AdAddForm extends AbstractForm

/**
* list of available locations
* @var string[]
* @var array<string, array<int, string>>
*/
public $locations = [];

Expand Down
6 changes: 3 additions & 3 deletions wcfsetup/install/files/lib/acp/form/ArticleAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ArticleAddForm extends AbstractForm

/**
* true if created article is multi-lingual
* @var bool
* @var int
*/
public $isMultilingual = 0;

Expand Down Expand Up @@ -113,7 +113,7 @@ class ArticleAddForm extends AbstractForm

/**
* enables the comment function
* @var bool
* @var int
*/
public $enableComments = ARTICLE_ENABLE_COMMENTS_DEFAULT_VALUE;

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

// Reload attachment handler to reset the uploaded attachments.
Expand Down
6 changes: 3 additions & 3 deletions wcfsetup/install/files/lib/acp/form/BBCodeEditForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ public function readData()
$this->bbcodeTag = $this->bbcode->bbcodeTag;
$this->htmlOpen = $this->bbcode->htmlOpen;
$this->htmlClose = $this->bbcode->htmlClose;
$this->isBlockElement = $this->bbcode->isBlockElement;
$this->isSourceCode = $this->bbcode->isSourceCode;
$this->isBlockElement = !!$this->bbcode->isBlockElement;
$this->isSourceCode = !!$this->bbcode->isSourceCode;
$this->className = $this->bbcode->className;
$this->showButton = $this->bbcode->showButton;
$this->showButton = !!$this->bbcode->showButton;
$this->wysiwygIcon = $this->bbcode->wysiwygIcon;
}
}
Expand Down
16 changes: 8 additions & 8 deletions wcfsetup/install/files/lib/acp/form/BoxAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class BoxAddForm extends AbstractForm

/**
* true if created box is multi-lingual
* @var bool
* @var int
*/
public $isMultilingual = 0;

Expand All @@ -77,7 +77,7 @@ class BoxAddForm extends AbstractForm

/**
* true if created box is visible everywhere
* @var bool
* @var int
*/
public $visibleEverywhere = 1;

Expand All @@ -89,7 +89,7 @@ class BoxAddForm extends AbstractForm

/**
* true if box header is visible
* @var bool
* @var int
*/
public $showHeader = 1;

Expand Down Expand Up @@ -137,7 +137,7 @@ class BoxAddForm extends AbstractForm

/**
* selected box controller object type
* @var ObjectType
* @var ?ObjectType
*/
public $boxController;

Expand Down Expand Up @@ -200,7 +200,7 @@ class BoxAddForm extends AbstractForm
public $availableBoxPositions = [];

/**
* @var bool
* @var int
* @since 5.2
*/
public $isDisabled = 0;
Expand All @@ -218,7 +218,7 @@ class BoxAddForm extends AbstractForm
public $presetBox;

/**
* @var bool
* @var int
* @since 5.4
*/
public $invertPermissions;
Expand Down Expand Up @@ -480,13 +480,13 @@ public function validate()
}
}
} elseif ($this->boxType !== 'system' && $this->linkType == 'external') {
$this->linkPageID = $this->linkPageObjectID = null;
$this->linkPageID = $this->linkPageObjectID = 0;

if (empty($this->externalURL)) {
throw new UserInputException('externalURL');
}
} else {
$this->linkPageID = $this->linkPageObjectID = null;
$this->linkPageID = $this->linkPageObjectID = 0;
$this->externalURL = '';
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function save()
]);

// reset values
$this->email = $this->name = 0;
$this->email = $this->name = '';
$this->isDisabled = $this->showOrder = 0;

I18nHandler::getInstance()->reset();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class NotificationPresetSettingsForm extends AbstractForm

/**
* true to apply change to existing users
* @var bool
* @var int
*/
public $applyChangesToExistingUsers = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class PackageStartInstallForm extends AbstractForm
* data of the uploaded package
* @var string[]
*/
public $uploadPackage = '';
public $uploadPackage = [];

/**
* archive of the installation/update package
Expand Down
16 changes: 8 additions & 8 deletions wcfsetup/install/files/lib/acp/form/PageAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class PageAddForm extends AbstractForm

/**
* true if created page is multi-lingual
* @var bool
* @var int
*/
public $isMultilingual = 0;

Expand All @@ -79,7 +79,7 @@ class PageAddForm extends AbstractForm

/**
* true if page is disabled
* @var bool
* @var int
*/
public $isDisabled = 0;

Expand Down Expand Up @@ -156,25 +156,25 @@ class PageAddForm extends AbstractForm

/**
* true if the page is available during offline mode
* @var bool
* @var int
*/
public $availableDuringOfflineMode = 0;

/**
* true if the page is accessible for search spiders
* @var bool
* @var int
*/
public $allowSpidersToIndex = 1;

/**
* true if page should be added to the main menu
* @var bool
* @var int
*/
public $addPageToMainMenu = 0;

/**
* parent menu item id
* @var int
* @var ?int
*/
public $parentMenuItemID;

Expand All @@ -185,7 +185,7 @@ class PageAddForm extends AbstractForm
public $menuItems;

/**
* @var bool
* @var int
* @since 5.2
*/
public $enableShareButtons = 0;
Expand All @@ -203,7 +203,7 @@ class PageAddForm extends AbstractForm
public $presetPage;

/**
* @var bool
* @var int
* @since 5.4
*/
public $invertPermissions = 0;
Expand Down
2 changes: 1 addition & 1 deletion wcfsetup/install/files/lib/acp/form/PageEditForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class PageEditForm extends PageAddForm
public $activeMenuItem = 'wcf.acp.menu.link.cms.page.list';

/**
* @var int
* @var ?int
*/
public $overrideApplicationPackageID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class PaidSubscriptionAddForm extends AbstractForm

/**
* indicates if the subscription is disabled
* @var bool
* @var int
*/
public $isDisabled = 0;

Expand All @@ -83,7 +83,7 @@ class PaidSubscriptionAddForm extends AbstractForm

/**
* indicates if the subscription is permanent
* @var bool
* @var int
*/
public $subscriptionLengthPermanent = 0;

Expand All @@ -101,7 +101,7 @@ class PaidSubscriptionAddForm extends AbstractForm

/**
* indicates if the subscription is a recurring payment
* @var bool
* @var int
*/
public $isRecurring = 0;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
use wcf\system\exception\PermissionDeniedException;
use wcf\system\language\I18nHandler;
use wcf\system\WCF;
use wcf\util\ArrayUtil;

/**
* Shows the paid subscription edit form.
Expand Down Expand Up @@ -108,8 +109,8 @@ public function readData()
$this->subscriptionLength = $this->subscription->subscriptionLength;
$this->subscriptionLengthUnit = $this->subscription->subscriptionLengthUnit;
$this->isRecurring = $this->subscription->isRecurring;
$this->groupIDs = \explode(',', $this->subscription->groupIDs);
$this->excludedSubscriptionIDs = \explode(',', $this->subscription->excludedSubscriptionIDs);
$this->groupIDs = ArrayUtil::toIntegerArray(\explode(',', $this->subscription->groupIDs));
$this->excludedSubscriptionIDs = ArrayUtil::toIntegerArray(\explode(',', $this->subscription->excludedSubscriptionIDs));
}
}

Expand Down
13 changes: 7 additions & 6 deletions wcfsetup/install/files/lib/acp/form/StyleAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use wcf\system\exception\SystemException;
use wcf\system\exception\UserInputException;
use wcf\system\file\upload\UploadField;
use wcf\system\file\upload\UploadFile;
use wcf\system\file\upload\UploadHandler;
use wcf\system\image\ImageHandler;
use wcf\system\language\I18nHandler;
Expand Down Expand Up @@ -112,9 +113,9 @@ class StyleAddForm extends AbstractForm

/**
* tainted style
* @var bool
* @var int
*/
public $isTainted = true;
public $isTainted = 1;

/**
* license name
Expand Down Expand Up @@ -170,13 +171,13 @@ class StyleAddForm extends AbstractForm
public $tmpHash = '';

/**
* @var string
* @var ?string
*/
public $styleTestFileDir;

/**
* list of variables and their value
* @var string[]
* @var array<string, mixed>
*/
public $variables = [];

Expand All @@ -199,7 +200,7 @@ class StyleAddForm extends AbstractForm
public $uploads = [];

/**
* @var UploadField[]
* @var array{}|array{added: UploadFile[], removed: UploadFile[]}
* @since 5.3
*/
public $customAssets = [];
Expand Down Expand Up @@ -895,7 +896,7 @@ public function save()
$this->authorName = $this->authorURL = $this->copyright = $this->packageName = '';
$this->license = $this->styleDate = $this->styleDescription = $this->styleName = $this->styleVersion = '';
$this->setDefaultValues();
$this->isTainted = true;
$this->isTainted = 1;
$this->templateGroupID = 0;
$this->styleTestFileDir = null;
$this->rebuildUploadFields();
Expand Down
4 changes: 2 additions & 2 deletions wcfsetup/install/files/lib/acp/form/TrophyAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace wcf\acp\form;

use wcf\data\category\Category;
use wcf\data\object\type\ObjectType;
use wcf\data\trophy\category\TrophyCategory;
use wcf\data\trophy\category\TrophyCategoryCache;
use wcf\data\trophy\Trophy;
use wcf\data\trophy\TrophyAction;
Expand Down Expand Up @@ -50,7 +50,7 @@ class TrophyAddForm extends AbstractAcpForm

/**
* Category object.
* @var Category
* @var ?TrophyCategory
*/
public $category;

Expand Down
4 changes: 2 additions & 2 deletions wcfsetup/install/files/lib/acp/form/UserAddForm.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class UserAddForm extends UserOptionListForm

/**
* user password
* @var string
* @var ?string
*/
public $password = '';

Expand Down Expand Up @@ -96,7 +96,7 @@ class UserAddForm extends UserOptionListForm

/**
* true to disable this signature
* @var bool
* @var int
*/
public $disableSignature = 0;

Expand Down
Loading

0 comments on commit 36bfd67

Please sign in to comment.