* necessary.
*
* @param string $path
- * @return boolean
+ * @return bool
*/
public static function makePath($path) {
// directory already exists, abort
/**
* indicates if tar file is opened
- * @var boolean
+ * @var bool
*/
protected $opened = false;
/**
* indicates if file content has been read
- * @var boolean
+ * @var bool
*/
protected $read = false;
/**
* indicates if the tar file is (g)zipped
- * @var boolean
+ * @var bool
*/
protected $isZipped = false;
* Unpacks file header for one file entry.
*
* @param string $binaryData
- * @return array|boolean
+ * @return array|bool
*/
protected function readHeader($binaryData) {
if (strlen($binaryData) != 512) {
/**
* Returns true if this tar is (g)zipped.
*
- * @return boolean
+ * @return bool
*/
public function isZipped() {
return $this->isZipped;
/**
* checks if gz*64 functions are available instead of gz*
* https://bugs.php.net/bug.php?id=53829
- * @var boolean
+ * @var bool
*/
protected static $gzopen64 = null;
/**
* field is required
- * @var boolean
+ * @var bool
*/
public $required = 0;
/**
* 1 if the option is disabled
- * @var boolean
+ * @var bool
* @since 5.2
*/
public $isDisabled = 0;
/**
* true if option supports i18n
- * @var boolean
+ * @var bool
*/
public $supportI18n = true;
/**
* true if created article is multi-lingual
- * @var boolean
+ * @var bool
*/
public $isMultilingual = 0;
/**
* enables the comment function
- * @var boolean
+ * @var bool
*/
public $enableComments = ARTICLE_ENABLE_COMMENTS_DEFAULT_VALUE;
/**
* true if bbcode is a block element
- * @var boolean
+ * @var bool
*/
public $isBlockElement = false;
/**
* true, if bbcode contains source code
- * @var boolean
+ * @var bool
*/
public $isSourceCode = false;
/**
* show editor button
- * @var boolean
+ * @var bool
*/
public $showButton = false;
/**
* true if created box is multi-lingual
- * @var boolean
+ * @var bool
*/
public $isMultilingual = 0;
/**
* true if created box is visible everywhere
- * @var boolean
+ * @var bool
*/
public $visibleEverywhere = 1;
/**
* true if box header is visible
- * @var boolean
+ * @var bool
*/
public $showHeader = 1;
/**
* display notice for existing import mappings
- * @var boolean
+ * @var bool
*/
public $showMappingNotice = false;
/**
* force users to select a label
- * @var boolean
+ * @var bool
*/
public $forceSelection = false;
/**
* true to export custom variables
- * @var boolean
+ * @var bool
*/
public $exportCustomValues = false;
/**
* true if created box is visible everywhere
- * @var boolean
+ * @var bool
*/
public $visibleEverywhere = 1;
/**
* true if box header is visible
- * @var boolean
+ * @var bool
*/
public $showHeader = 1;
/**
* activation state
- * @var boolean
+ * @var bool
*/
public $isDisabled = false;
/**
* internal link
- * @var boolean
+ * @var bool
*/
public $isInternalLink = true;
/**
* true to apply change to existing users
- * @var boolean
+ * @var bool
*/
public $applyChangesToExistingUsers = 0;
/**
* true if created page is multi-lingual
- * @var boolean
+ * @var bool
*/
public $isMultilingual = 0;
/**
* true if page is disabled
- * @var boolean
+ * @var bool
*/
public $isDisabled = 0;
/**
* true if page is landing page
- * @var boolean
+ * @var bool
*/
public $isLandingPage = 0;
/**
* true if the page is available during offline mode
- * @var boolean
+ * @var bool
*/
public $availableDuringOfflineMode = 0;
/**
* true if the page is accessible for search spiders
- * @var boolean
+ * @var bool
*/
public $allowSpidersToIndex = 1;
/**
* true if page should be added to the main menu
- * @var boolean
+ * @var bool
*/
public $addPageToMainMenu = 0;
/**
* indicates if the subscription is disabled
- * @var boolean
+ * @var bool
*/
public $isDisabled = 0;
/**
* indicates if the subscription is permanent
- * @var boolean
+ * @var bool
*/
public $subscriptionLengthPermanent = 0;
/**
* indicates if the subscription is a recurring payment
- * @var boolean
+ * @var bool
*/
public $isRecurring = 0;
/**
* tainted style
- * @var boolean
+ * @var bool
*/
public $isTainted = true;
/**
* true, if style has custom images
- * @var boolean
+ * @var bool
*/
public $canExportImages = false;
/**
* true, if style has custom templates
- * @var boolean
+ * @var bool
*/
public $canExportTemplates = false;
/**
* export style as installable package
- * @var boolean
+ * @var bool
*/
public $exportAsPackage = false;
/**
* true, if templates should be exported
- * @var boolean
+ * @var bool
*/
public $exportTemplates = false;
/**
* true to disable this signature
- * @var boolean
+ * @var bool
*/
public $disableSignature = 0;
/**
* ban status
- * @var boolean
+ * @var bool
*/
public $banned = 0;
/**
* true to disable this avatar
- * @var boolean
+ * @var bool
*/
public $disableAvatar = 0;
/**
* true to disable this cover photo
- * @var boolean
+ * @var bool
*/
public $disableCoverPhoto = 0;
/**
* true to delete the current cover photo
- * @var boolean
+ * @var bool
*/
public $deleteCoverPhoto = 0;
/**
* true to delete the current auth data
- * @var boolean
+ * @var bool
*/
public $disconnect3rdParty = 0;
/**
* true to disable multifactor authentication
- * @var boolean
+ * @var bool
*/
public $multifactorDisable = 0;
class UserMailForm extends AbstractForm {
/**
* enable html for message body
- * @var boolean
+ * @var bool
*/
public $enableHTML = false;
/**
* field is required
- * @var boolean
+ * @var bool
*/
public $required = 0;
/**
* shows this field in the registration process
- * @var boolean
+ * @var bool
*/
public $askDuringRegistration = 0;
/**
* field is searchable
- * @var boolean
+ * @var bool
*/
public $searchable = 0;
/**
* true to apply change to existing users
- * @var boolean
+ * @var bool
*/
public $applyChangesToExistingUsers = 0;
/**
* filters the list of boxes showing only custom boxes
- * @var boolean
+ * @var bool
*/
public $originIsNotSystem = 0;
/**
* search for custom values
- * @var boolean
+ * @var bool
*/
public $hasCustomValue = 0;
/**
* search for disabled custom values
- * @var boolean
+ * @var bool
*/
public $hasDisabledCustomValue = 0;
/**
* search for disabled custom values that have been automatically disabled in the past 7 days
- * @var boolean
+ * @var bool
*/
public $hasRecentlyDisabledCustomValue = 0;
/**
* package validation result
- * @var boolean
+ * @var bool
*/
public $validationPassed = false;
/**
* true if the package to be installed was uploaded via the import style
* form
- * @var boolean
+ * @var bool
*/
public $installingImportedStyle = false;
/**
* display 'Add Page' dialog on load
- * @var boolean
+ * @var bool
*/
public $showPageAddDialog = 0;
/**
* filters the list of pages showing only custom pages
- * @var boolean
+ * @var bool
*/
public $originIsNotSystem = 0;
/**
* filters the list of pages showing only pages with custom urls
- * @var boolean
+ * @var bool
*/
public $controllerCustomURL = 0;
/**
* disallow any rebuild actions unless `wcfN_user_storage` uses `utf8mb4`
- * @var boolean
+ * @var bool
*/
public $convertEncoding = false;
/**
* enables debug mode
- * @var boolean
+ * @var bool
*/
public $inDebugMode = false;
abstract class AbstractAction implements IAction {
/**
* indicates if you need to be logged in to execute this action
- * @var boolean
+ * @var bool
*/
public $loginRequired = false;
* information removed.
*
* @param \Throwable|\Exception $e
- * @param boolean $ignorePaths If set to `true`: Don't call `sanitizePath`.
+ * @param bool $ignorePaths If set to `true`: Don't call `sanitizePath`.
* @return mixed[]
*/
function sanitizeStacktrace($e, $ignorePaths = false) {
* Reads an integer value and validates it.
*
* @param string $variableName
- * @param boolean $allowEmpty
+ * @param bool $allowEmpty
* @param string $arrayIndex
*/
protected function readInteger($variableName, $allowEmpty = false, $arrayIndex = '') {
* Reads an integer array and validates it.
*
* @param string $variableName
- * @param boolean $allowEmpty
+ * @param bool $allowEmpty
* @param string $arrayIndex
* @since 3.0
*/
* Reads a string value and validates it.
*
* @param string $variableName
- * @param boolean $allowEmpty
+ * @param bool $allowEmpty
* @param string $arrayIndex
*/
protected function readString($variableName, $allowEmpty = false, $arrayIndex = '') {
* Reads a string array and validates it.
*
* @param string $variableName
- * @param boolean $allowEmpty
+ * @param bool $allowEmpty
* @param string $arrayIndex
* @since 3.0
*/
* Reads a boolean value and validates it.
*
* @param string $variableName
- * @param boolean $allowEmpty
+ * @param bool $allowEmpty
* @param string $arrayIndex
*/
protected function readBoolean($variableName, $allowEmpty = false, $arrayIndex = '') {
* Reads a json-encoded value and validates it.
*
* @param string $variableName
- * @param boolean $allowEmpty
+ * @param bool $allowEmpty
* @param string $arrayIndex
*/
protected function readJSON($variableName, $allowEmpty = false, $arrayIndex = '') {
* variable will be always created with a sane value if it does not exist.
*
* @param string $variableName
- * @param boolean $allowEmpty
+ * @param bool $allowEmpty
* @param string $arrayIndex
* @param int $type
* @param int $structure
/**
* indicates if database table index is an identity column
- * @var boolean
+ * @var bool
*/
protected static $databaseTableIndexIsIdentity = true;
* @param DatabaseObject[] $objects
* @param mixed $sortBy
* @param string $sortOrder
- * @param boolean $maintainIndexAssociation
+ * @param bool $maintainIndexAssociation
*/
public static function sort(&$objects, $sortBy, $sortOrder = 'ASC', $maintainIndexAssociation = true) {
$sortArray = $objects2 = [];
/**
* enables the automatic usage of the qualified shorthand
- * @var boolean
+ * @var bool
*/
public $useQualifiedShorthand = true;
* Returns `true` if the given user can access the object.
*
* @param User $user checked user, if `null` active user is used instead
- * @return boolean
+ * @return bool
*/
public function isAccessible(User $user = null);
}
* object.
*
* @param string $name
- * @return boolean
+ * @return bool
*/
public function __isset($name);
/**
* Returns true, if message is visible for current user.
*
- * @return boolean
+ * @return bool
*/
public function isVisible();
/**
* Returns `true` if this node is the last sibling and `false` otherwise.
*
- * @return boolean
+ * @return bool
*/
public function isLastSibling();
/**
* Returns true if user can vote in polls.
*
- * @return boolean
+ * @return bool
*/
public function canVote();
}
* is not NULL.
*
* @param string $name
- * @return boolean
+ * @return bool
*/
public function __isset($name);
/**
* Returns true if database table index is an identity column.
*
- * @return boolean
+ * @return bool
*/
public static function getDatabaseTableIndexIsIdentity();
/**
* Returns true if at least one of the options required by this object is set.
*
- * @return boolean
+ * @return bool
*/
public function validateOptions() {
if ($this->options) {
* Returns true if the active user has at least one permission required
* by this object.
*
- * @return boolean
+ * @return bool
*/
public function validatePermissions() {
if ($this->permissions) {
* Reads a string value and validates it.
*
* @param string $variableName
- * @param boolean $allowEmpty
+ * @param bool $allowEmpty
* @param string $arrayIndex
* @see AbstractDatabaseObjectAction::readString()
*/
/**
* Returns `true` if the node as any children and return `false` otherwise.
*
- * @return boolean
+ * @return bool
*/
public function hasChildren() {
return !empty($this->children);
/**
* Returns `true` if this node is the last sibling and `false` otherwise.
*
- * @return boolean
+ * @return bool
*/
public function isLastSibling() {
foreach ($this->parentNode as $key => $child) {
/**
* Returns `true` if current iteration position is valid and `false` otherwise.
*
- * @return boolean
+ * @return bool
*/
public function valid() {
return isset($this->children[$this->index]);
/**
* Returns true if this session type supports persistent logins.
*
- * @return boolean
+ * @return bool
*/
public static function supportsPersistentLogins() {
return false;
/**
* Returns true if the URI of this log entry is protected.
*
- * @return boolean
+ * @return bool
*/
public function hasProtectedURI() {
if ($this->requestMethod != 'GET' || !preg_match('/(\?|&)(page|form)=/', $this->requestURI)) {
/**
* Returns true if this session is active.
*
- * @return boolean
+ * @return bool
*/
public function isActive() {
return $this->active ? true : false;
/**
* Returns true if this session is the active user session.
*
- * @return boolean
+ * @return bool
*/
public function isActiveUserSession() {
if ($this->isActive() && $this->sessionID == WCF::getSession()->sessionID) {
/**
* Returns true if the active user can delete this article.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
if (WCF::getSession()->getPermission('admin.content.article.canManageArticle')) {
/**
* Returns true if the active user has access to this article.
*
- * @return boolean
+ * @return bool
*/
public function canRead() {
if ($this->isDeleted && !WCF::getSession()->getPermission('admin.content.article.canManageArticle')) {
/**
* Returns true if the current user can edit these article.
*
- * @return boolean
+ * @return bool
* @since 5.2
*/
public function canEdit() {
/**
* Returns true if the current user can publish these article.
*
- * @return boolean
+ * @return bool
* @since 5.2
*/
public function canPublish() {
* Creates a new CategoryArticleList object.
*
* @param int|int[] $categoryID
- * @param boolean $includeChildCategories
+ * @param bool $includeChildCategories
* @throws \InvalidArgumentException
*/
public function __construct($categoryID, $includeChildCategories = false) {
* Returns a specific article decorated as viewable article or `null` if it does not exist.
*
* @param int $articleID
- * @param boolean $enableContentLoading Enables/disables the loading of article content objects
+ * @param bool $enableContentLoading Enables/disables the loading of article content objects
* @return ViewableArticle
*/
public static function getArticle($articleID, $enableContentLoading = true) {
/**
* Returns true if this article is new for the active user.
*
- * @return boolean
+ * @return bool
*/
public function isNew() {
return $this->time > $this->getVisitTime();
/**
* Returns true if one or more labels are assigned to this article.
*
- * @return boolean
+ * @return bool
*/
public function hasLabels() {
return !empty($this->labels);
/**
* enables/disables the loading of article content objects
- * @var boolean
+ * @var bool
*/
protected $contentLoading = true;
/**
* Enables/disables the loading of article content objects.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableContentLoading($enable = true) {
$this->contentLoading = $enable;
/**
* Returns true if the active user has subscribed to this category.
*
- * @return boolean
+ * @return bool
* @since 5.2
*/
public function isSubscribed() {
/**
* true if container object has been loaded
- * @var boolean
+ * @var bool
*/
protected $containerObjectLoaded = false;
class Attachment extends DatabaseObject implements ILinkableObject, IRouteController, IThumbnailFile {
/**
* indicates if the attachment is embedded
- * @var boolean
+ * @var bool
*/
protected $embedded = false;
/**
* user permissions for attachment access
- * @var boolean[]
+ * @var bool[]
*/
protected $permissions = [];
/**
* Returns true if a user has the permission to download this attachment.
*
- * @return boolean
+ * @return bool
*/
public function canDownload() {
return $this->getPermission('canDownload');
* Returns true if a user has the permission to view the preview of this
* attachment.
*
- * @return boolean
+ * @return bool
*/
public function canViewPreview() {
return $this->getPermission('canViewPreview');
* Returns true if a user has the permission to delete the preview of this
* attachment.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
return $this->getPermission('canDelete');
* Checks permissions.
*
* @param string $permission
- * @return boolean
+ * @return bool
*/
protected function getPermission($permission) {
if (!isset($this->permissions[$permission])) {
/**
* Sets the permissions for attachment access.
*
- * @param boolean[] $permissions
+ * @param bool[] $permissions
*/
public function setPermissions(array $permissions) {
$this->permissions = $permissions;
/**
* Returns true if this attachment is embedded.
*
- * @return boolean
+ * @return bool
*/
public function isEmbedded() {
return $this->embedded;
/**
* Returns true if this attachment should be shown as an image.
*
- * @return boolean
+ * @return bool
*/
public function showAsImage() {
if ($this->isImage) {
/**
* Returns true if this attachment has a thumbnail.
*
- * @return boolean
+ * @return bool
*/
public function hasThumbnail() {
return ($this->thumbnailType ? true : false);
/**
* Returns true if this attachment should be shown as a file.
*
- * @return boolean
+ * @return bool
*/
public function showAsFile() {
return !$this->showAsImage();
/**
* Sets the permissions for attachment access.
*
- * @param boolean[] $permissions
+ * @param bool[] $permissions
*/
public function setPermissions(array $permissions) {
foreach ($this->objects as $attachment) {
*
* @param string $bbcodeTag
* @param string[] $allowedBBCodeTags
- * @return boolean
+ * @return bool
*/
public static function isAllowedBBCode($bbcodeTag, array $allowedBBCodeTags) {
// check if bbcode is unknown or disabled
/**
* Returns true if this BBCode can be deleted.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
if ($this->originIsSystem) {
* Returns true if given URL is a media URL.
*
* @param string $url
- * @return boolean
+ * @return bool
*/
public static function isMediaURL($url) {
foreach (static::getCache() as $provider) {
* Checks whether this provider matches the given URL.
*
* @param string $url
- * @return boolean
+ * @return bool
*/
public function matches($url) {
$lines = explode("\n", StringUtil::unifyNewlines($this->regex));
/**
* Returns true if the active user can delete this box.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
if (WCF::getSession()->getPermission('admin.content.cms.canManageBox') && !$this->originIsSystem) {
/**
* Returns false if this box has no content.
*
- * @return boolean
+ * @return bool
*/
public function hasContent() {
if ($this->boxType == 'system') {
/**
* Returns true if this box has a link.
*
- * @return boolean
+ * @return bool
*/
public function hasLink() {
if ($this->boxType == 'system') {
/**
* Returns true if this box is accessible by current user.
*
- * @return boolean
+ * @return bool
*/
public function isAccessible() {
return SimpleAclResolver::getInstance()->canAccess('com.woltlab.wcf.box', $this->boxID);
/**
* Returns true if an edit button should be displayed for this box.
*
- * @return boolean
+ * @return bool
* @since 5.2
*/
public function showEditButton() {
/**
* enables/disables the loading of box content objects
- * @var boolean
+ * @var bool
*/
protected $contentLoading = false;
/**
* Enables/disables the loading of box content objects.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableContentLoading($enable = true) {
$this->contentLoading = $enable;
/**
* enables/disables the loading of box content images
- * @var boolean
+ * @var bool
*/
protected $imageLoading = false;
/**
* enables/disables the loading of embedded objects
- * @var boolean
+ * @var bool
*/
protected $embeddedObjectLoading = false;
/**
* Enables/disables the loading of box content images.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableImageLoading($enable = true) {
$this->imageLoading = $enable;
/**
* Enables/disables the loading of embedded objects.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableEmbeddedObjectLoading($enable = true) {
$this->embeddedObjectLoading = $enable;
* Returns true if the given user input is an answer to this question.
*
* @param string $answer
- * @return boolean
+ * @return bool
*/
public function isAnswer($answer) {
$answers = explode("\n", StringUtil::unifyNewlines(WCF::getLanguage()->get($this->answers)));
/**
* acl permissions of this category for the active user
* @deprecated
- * @var boolean[]
+ * @var bool[]
*/
protected $permissions = null;
/**
* fallback return value used in Category::getPermission()
- * @var boolean
+ * @var bool
*/
protected $defaultPermission = false;
* Returns true if given category is a parent category of this category.
*
* @param Category $category
- * @return boolean
+ * @return bool
*/
public function isParentCategory(Category $category) {
return in_array($category, $this->getParentCategories());
* Returns true if this category is visible in a nested menu item list.
*
* @param AbstractDecoratedCategory $activeCategory
- * @return boolean
+ * @return bool
* @since 5.2
*/
public function isVisibleInNestedList(AbstractDecoratedCategory $activeCategory = null) {
/**
* if true, disabled categories are also included in the node tree
- * @var boolean
+ * @var bool
*/
protected $includeDisabledCategories = false;
*
* @param string $objectType
* @param int $parentCategoryID
- * @param boolean $includeDisabledCategories
+ * @param bool $includeDisabledCategories
* @param int[] $excludedCategoryIDs
* @throws SystemException
*/
* to be included in this tree.
*
* @param CategoryNode $categoryNode
- * @return boolean
+ * @return bool
*/
protected function isIncluded(CategoryNode $categoryNode) {
return (!$categoryNode->isDisabled || $this->includeDisabledCategories) && !in_array($categoryNode->categoryID, $this->excludedCategoryIDs);
/**
* deletable by current user
- * @var boolean
+ * @var bool
*/
public $deletable = false;
/**
* editable by current user
- * @var boolean
+ * @var bool
*/
public $editable = false;
/**
* Sets deletable state.
*
- * @param boolean $deletable
+ * @param bool $deletable
*/
public function setIsDeletable($deletable) {
$this->deletable = $deletable;
/**
* Sets editable state.
*
- * @param boolean $editable
+ * @param bool $editable
*/
public function setIsEditable($editable) {
$this->editable = $editable;
/**
* Returns true if the comment is deletable by current user.
*
- * @return boolean
+ * @return bool
*/
public function isDeletable() {
return $this->deletable;
/**
* Returns true if the comment is editable by current user.
*
- * @return boolean
+ * @return bool
*/
public function isEditable() {
return $this->editable;
/**
* enables/disables the loading of responses
- * @var boolean
+ * @var bool
*/
public $responseLoading = true;
/**
* deletable by current user
- * @var boolean
+ * @var bool
*/
public $deletable = false;
/**
* editable for current user
- * @var boolean
+ * @var bool
*/
public $editable = false;
/**
* Sets deletable state.
*
- * @param boolean $deletable
+ * @param bool $deletable
*/
public function setIsDeletable($deletable) {
$this->deletable = $deletable;
/**
* Sets editable state.
*
- * @param boolean $editable
+ * @param bool $editable
*/
public function setIsEditable($editable) {
$this->editable = $editable;
/**
* Returns true if the response is deletable by current user.
*
- * @return boolean
+ * @return bool
*/
public function isDeletable() {
return $this->deletable;
/**
* Returns true if the response is editable by current user.
*
- * @return boolean
+ * @return bool
*/
public function isEditable() {
return $this->editable;
/**
* Returns true if current user may edit this cronjob.
*
- * @return boolean
+ * @return bool
*/
public function isEditable() {
return $this->canBeEdited;
/**
* Returns true if current user may delete this cronjob.
*
- * @return boolean
+ * @return bool
*/
public function isDeletable() {
return $this->canBeEdited && $this->canBeDisabled;
/**
* Returns true if current user may enable or disable this cronjob.
*
- * @return boolean
+ * @return bool
*/
public function canBeDisabled() {
return $this->canBeDisabled;
/**
* Returns true if the option is visible
*
- * @return boolean
+ * @return bool
*/
public function isVisible() {
return !$this->isDisabled;
/**
* Returns the formatted value of this option.
*
- * @param boolean $forcePlaintext
+ * @param bool $forcePlaintext
* @return string
*/
public function getFormattedOptionValue($forcePlaintext = false) {
* Returns true if this option can be deleted, defaults to false for
* options created through the package system.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
return !$this->originIsSystem;
/**
* Returns true if this option represents a message-type value.
*
- * @return boolean
+ * @return bool
*/
public function isMessage() {
return ($this->optionType === 'textarea' || $this->optionType === 'message');
protected $didFetchPackage = false;
/**
- * @var boolean
+ * @var bool
*/
protected $isCore;
* Validates the repository and returns the first error message, or
* an empty string on success.
*
- * @param boolean $pathOnly
+ * @param bool $pathOnly
* @return string
*/
public function validate($pathOnly = false) {
/**
* Returns true if this project appears to be `WoltLab Suite Core`.
*
- * @return boolean
+ * @return bool
*/
public function isCore() {
if ($this->isCore === null) {
* Returns true if the path appears to point to `WoltLab Suite Core`.
*
* @param string $path
- * @return boolean
+ * @return bool
*/
public static function pathIsCore($path) {
return (is_dir($path . 'com.woltlab.wcf') && file_exists($path . 'com.woltlab.wcf/package.xml'));
* Returns true, if label is known.
*
* @param int $labelID
- * @return boolean
+ * @return bool
*/
public function isValid($labelID) {
return isset($this->labels[$labelID]);
*
* @param int $optionID
* @param User $user
- * @return boolean
+ * @return bool
*/
public function getPermission($optionID, User $user = null) {
if ($user === null) $user = WCF::getUser();
/**
* Returns true if any permissions have been set for this label group.
*
- * @return boolean
+ * @return bool
*/
public function hasPermissions() {
return !empty($this->permissions['group']) || !empty($this->permissions['user']);
* Returns a single language variable.
*
* @param string $item
- * @param boolean $optional
+ * @param bool $optional
* @return string
*/
public function get($item, $optional = false) {
*
* @param string $item
* @param array $variables
- * @param boolean $optional
+ * @param bool $optional
* @return string result
*/
public function getDynamicVariable($item, array $variables = [], $optional = false) {
* Loads category files.
*
* @param string $category
- * @return boolean
+ * @return bool
*/
protected function loadCategory($category) {
if (!LanguageFactory::getInstance()->isValidCategory($category)) {
* Returns true if given items includes template scripting.
*
* @param string $item
- * @return boolean
+ * @return bool
*/
public function isDynamicItem($item) {
if (isset($this->dynamicItems[$item])) {
* Exports this language.
*
* @param int[] $packageIDArray
- * @param boolean $exportCustomValues
+ * @param bool $exportCustomValues
*/
public function export($packageIDArray = [], $exportCustomValues = false) {
$conditions = new PreparedStatementConditionBuilder();
*
* @param XML $xml
* @param int $packageID
- * @param boolean $updateFiles
- * @param boolean $updateExistingItems
+ * @param bool $updateFiles
+ * @param bool $updateExistingItems
* @throws \InvalidArgumentException if given XML file is invalid
*/
public function updateFromXML(XML $xml, $packageID, $updateFiles = true, $updateExistingItems = true) {
* Returns true if the active user can access the given likeable object.
*
* @param ILikeObject $object
- * @return boolean
+ * @return bool
*/
public function checkPermissions(ILikeObject $object);
}
* Returns true if the active user can like the provided object.
*
* @param ILikeObject $object
- * @return boolean
+ * @return bool
*/
public function canLike(ILikeObject $object);
* Returns true if the active user can view the likes of to the provided object.
*
* @param ILikeObject $object
- * @return boolean
+ * @return bool
*/
public function canViewLikes(ILikeObject $object);
}
/**
* Returns true, if like value is a like.
*
- * @return boolean
+ * @return bool
* @deprecated 5.2
*/
public function isLike() {
/**
* Returns true, if like value is a dislike.
*
- * @return boolean
+ * @return bool
* @deprecated 5.2
*/
public function isDislike() {
/**
* accessible by current user
- * @var boolean
+ * @var bool
*/
protected $isAccessible = false;
/**
* Returns true if like is accessible by current user.
*
- * @return boolean
+ * @return bool
*/
public function isAccessible() {
return $this->isAccessible;
/**
* Returns true if the media file can be accessed by the active user.
*
- * @return boolean
+ * @return bool
*/
public function isAccessible() {
if ($this->canManage()) {
* Returns true if a thumbnail version with the given size is available.
*
* @param string $size
- * @return boolean
+ * @return bool
* @throws \InvalidArgumentException
*/
public function hasThumbnail($size) {
/**
* Returns true if the active user can delete this menu.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
if (WCF::getSession()->getPermission('admin.content.cms.canManageMenu') && !$this->originIsSystem) {
/**
* Returns false if this menu has no content (has menu items).
*
- * @return boolean
+ * @return bool
*/
public function hasContent() {
return $this->getMenuItemNodeTree()->getVisibleItemCount() > 0;
/**
* Returns true if the active user can delete this menu item.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
if (WCF::getSession()->getPermission('admin.content.cms.canManageMenu') && !$this->originIsSystem) {
/**
* Returns true if the active user can disable this menu item.
*
- * @return boolean
+ * @return bool
*/
public function canDisable() {
if (WCF::getSession()->getPermission('admin.content.cms.canManageMenu')) {
/**
* Returns false if this item should be hidden from menu.
*
- * @return boolean
+ * @return bool
*/
public function isVisible() {
if ($this->isDisabled) {
/**
* Returns true if this item is an external link.
*
- * @return boolean
+ * @return bool
*/
public function isExternalLink() {
return ($this->externalURL ? !ApplicationHandler::getInstance()->isInternalURL($this->externalURL) : false);
/**
* true if item or one of its children is active
- * @var boolean
+ * @var bool
*/
protected $isActive = false;
/**
* Returns true if this element is the last sibling.
*
- * @return boolean
+ * @return bool
*/
public function isLastSibling() {
foreach ($this->parentNode as $key => $child) {
/**
* Returns true if this item (or one of its children) is marked as active.
*
- * @return boolean
+ * @return bool
*/
public function isActiveNode() {
return $this->isActive;
class MenuItemNodeTree {
/**
* if `false`, individual menu item visibility will not be checked
- * @var boolean
+ * @var bool
*/
public $checkVisibility;
*
* @param int $menuID menu id
* @param MenuItemList $menuItemList optional object to be provided when building the tree from cache
- * @param boolean $checkVisibility if `false`, individual menu item visibility will not be checked
+ * @param bool $checkVisibility if `false`, individual menu item visibility will not be checked
*/
public function __construct($menuID, MenuItemList $menuItemList = null, $checkVisibility = true) {
$this->menuID = $menuID;
* @property-read int $comments number of comments on the moderation queue entry
* @property-read int $lastChangeTime timestamp at which the moderation queue entry has been changed the last time
* @property-read array $additionalData array with additional data of the moderation queue entry
- * @property-read boolean $markAsJustified true if the report was closed, but it was actually justified and other actions may have been taken
+ * @property-read bool $markAsJustified true if the report was closed, but it was actually justified and other actions may have been taken
*/
class ModerationQueue extends DatabaseObject {
// states of column 'status'
/**
* Returns true if current user can edit this moderation queue.
*
- * @return boolean
+ * @return bool
*/
public function canEdit() {
$sql = "SELECT isAffected
/**
* Returns true, if this queue is done.
*
- * @return boolean
+ * @return bool
*/
public function isDone() {
return ($this->status == self::STATUS_DONE || $this->status == self::STATUS_CONFIRMED || $this->status == self::STATUS_REJECTED);
/**
* Marks this entry as rejected, e.g. report was unjustified or content approval was denied.
*
- * @param boolean $markAsJustified
+ * @param bool $markAsJustified
*/
public function markAsRejected($markAsJustified = false) {
$data = ['status' => ModerationQueue::STATUS_REJECTED];
/**
* true, if associated object was deleted
- * @var boolean
+ * @var bool
*/
protected $isOrphaned = false;
/**
* Returns true if associated object was removed.
*
- * @return boolean
+ * @return bool
*/
public function isOrphaned() {
return $this->isOrphaned;
/**
* Returns true if this queue item is new for the active user.
*
- * @return boolean
+ * @return bool
*/
public function isNew() {
if ($this->time > max(VisitTracker::getInstance()->getVisitTime('com.woltlab.wcf.moderation.queue'), VisitTracker::getInstance()->getObjectVisitTime('com.woltlab.wcf.moderation.queue', $this->queueID))) return true;
class Notice extends DatabaseObject implements IRouteController {
/**
* true if the active user has dismissed the notice
- * @var boolean
+ * @var bool
*/
protected $isDismissed = null;
/**
* Returns true if the active user has dismissed the notice.
*
- * @return boolean
+ * @return bool
*/
public function isDismissed() {
if (!$this->isDismissible) return false;
/**
* Returns true if option is visible
*
- * @return boolean
+ * @return bool
*/
public function isVisible() {
return !$this->hidden;
/**
* Returns true if this package is required by other packages.
*
- * @return boolean
+ * @return bool
*/
public function isRequired() {
self::loadRequirements();
/**
* Returns true if package is a plugin.
*
- * @return boolean
+ * @return bool
*/
public function isPlugin() {
if ($this->isApplication) {
/**
* Returns true if current user can uninstall this package.
*
- * @return boolean
+ * @return bool
*/
public function canUninstall() {
if (!WCF::getSession()->getPermission('admin.configuration.package.canUninstallPackage')) {
* Returns true if package identified by $package is already installed.
*
* @param string $package
- * @return boolean
+ * @return bool
*/
public static function isAlreadyInstalled($package) {
$sql = "SELECT COUNT(*)
* the respective package.
*
* @param string $packageName
- * @return boolean isValid
+ * @return bool isValid
*/
public static function isValidPackageName($packageName) {
if (mb_strlen($packageName) < 3 || mb_strlen($packageName) > 191) {
* 3.1.7 rC 4
*
* @param string $version
- * @return boolean
+ * @return bool
*/
public static function isValidVersion($version) {
return preg_match('~^([0-9]+)\.([0-9]+)\.([0-9]+)(\ (a|alpha|b|beta|d|dev|rc|pl)\ ([0-9]+))?$~is', $version);
*
* @param string $currentVersion
* @param string $fromVersion
- * @return boolean
+ * @return bool
*/
public static function checkFromversion($currentVersion, $fromVersion) {
if (mb_strpos($fromVersion, '*') !== false) {
* @param string $version1
* @param string $version2
* @param string $operator
- * @return boolean result
+ * @return bool result
* @see http://www.php.net/manual/en/function.version-compare.php
*/
public static function compareVersion($version1, $version2, $operator = null) {
/**
* Renders the authentication dialog.
*
- * @param boolean $rejected
+ * @param bool $rejected
* @return string
*/
protected function renderAuthorizationDialog($rejected) {
* Returns true if the given server url is valid.
*
* @param string $serverURL
- * @return boolean
+ * @return bool
*/
public static function isValidServerURL($serverURL) {
$parsedURL = Url::parse($serverURL);
* @param int $packageUpdateServerID
* @param string $username
* @param string $password
- * @param boolean $saveCredentials
+ * @param bool $saveCredentials
*/
public static function storeAuthData($packageUpdateServerID, $username, $password, $saveCredentials = false) {
$packageUpdateAuthData = @unserialize(WCF::getSession()->getVar('packageUpdateAuthData'));
/**
* Returns the list endpoint for package servers.
*
- * @param boolean $forceHTTP
+ * @param bool $forceHTTP
* @return string
*/
public function getListURL($forceHTTP = false) {
/**
* Returns true if a request to this server would make use of a secure connection.
*
- * @return boolean
+ * @return bool
*/
public function attemptSecureConnection() {
if ($this->apiVersion == '2.0') {
/**
* Returns whether the current user may delete this update server.
*
- * @return boolean
+ * @return bool
* @since 5.3
*/
public final function canDelete() {
/**
* Returns whether the current user may disable this update server.
*
- * @return boolean
+ * @return bool
* @since 5.3
*/
public final function canDisable() {
/**
* Returns true if the host is `update.woltlab.com`.
*
- * @return boolean
+ * @return bool
*/
public final function isWoltLabUpdateServer() {
return Url::parse($this->serverURL)['host'] === 'update.woltlab.com';
/**
* Returns true if the host is `store.woltlab.com`.
*
- * @return boolean
+ * @return bool
*/
public final function isWoltLabStoreServer() {
return Url::parse($this->serverURL)['host'] === 'store.woltlab.com';
* Example:
* define('UPDATE_SERVER_TRUSTED_MIRROR', 'mirror.example.com');
*
- * @return boolean
+ * @return bool
*/
public final function isTrustedServer() {
$host = Url::parse($this->serverURL)['host'];
/**
* Returns true if the active user can delete this page.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
if (WCF::getSession()->getPermission('admin.content.cms.canManagePage') && !$this->originIsSystem && !$this->isLandingPage) {
/**
* Returns true if the active user can disable this page.
*
- * @return boolean
+ * @return bool
*/
public function canDisable() {
if (WCF::getSession()->getPermission('admin.content.cms.canManagePage') && (!$this->originIsSystem || $this->pageType != 'system') && !$this->isLandingPage) {
* Returns false if this page should be hidden from menus, but does not control the accessibility
* of the page itself.
*
- * @return boolean false if the page should be hidden from menus
+ * @return bool false if the page should be hidden from menus
*/
public function isVisible() {
if ($this->isDisabled) return false;
/**
* Returns true if this page is accessible by current user.
*
- * @return boolean
+ * @return bool
*/
public function isAccessible() {
return SimpleAclResolver::getInstance()->canAccess('com.woltlab.wcf.page', $this->pageID);
* @param string $customURL
* @param int $packageID
*
- * @return boolean
+ * @return bool
*/
public static function isUniqueCustomUrl($customURL, $packageID = 1) {
// check controller
class Poll extends DatabaseObject {
/**
* participation status
- * @var boolean
+ * @var bool
*/
protected $isParticipant = false;
/**
* Returns a list of poll options.
*
- * @param boolean $isResultDisplay
+ * @param bool $isResultDisplay
* @return PollOption[]
*/
public function getOptions($isResultDisplay = false) {
/**
* Returns true if current user is a participant.
*
- * @return boolean
+ * @return bool
*/
public function isParticipant() {
$this->loadOptions();
/**
* Returns true if poll is already finished.
*
- * @return boolean
+ * @return bool
*/
public function isFinished() {
return ($this->endTime && $this->endTime <= TIME_NOW);
/**
* Returns true if current user can vote.
*
- * @return boolean
+ * @return bool
*/
public function canVote() {
// guest voting is not possible
/**
* Returns true if current user can see the result.
*
- * @return boolean
+ * @return bool
*/
public function canSeeResult() {
if ($this->isFinished() || $this->isParticipant() || !$this->resultsRequireVote) {
/**
* Returns true if current user can view the participant list.
*
- * @return boolean
+ * @return bool
*/
public function canViewParticipants() {
if ($this->canSeeResult() && $this->isPublic) {
class PollOption extends DatabaseObject {
/**
* true, if option was selected by current user
- * @var boolean
+ * @var bool
*/
public $selected = false;
* @property-read string $title
* @property-read int $showOrder position of the reaction type in relation to the other reaction types
* @property-read string $iconFile the file location of the icon
- * @property-read boolean $isAssignable `1`, if the reaction can be assigned
+ * @property-read bool $isAssignable `1`, if the reaction can be assigned
*/
class ReactionType extends DatabaseObject implements ITitledObject {
/**
* in emails)
*
* @param string $variableName
- * @param boolean $toHex
+ * @param bool $toHex
* @return string
*/
public function getVariable($variableName, $toHex = false) {
* Returns the path to a favicon-related file.
*
* @param string $filename name of the file
- * @param boolean $absolutePath if `true`, the absolute path is returned, otherwise the path relative to WCF is returned
+ * @param bool $absolutePath if `true`, the absolute path is returned, otherwise the path relative to WCF is returned
* @return string
*/
protected function getFaviconPath($filename, $absolutePath = true) {
* Updates style variables for given style.
*
* @param Style $style
- * @param boolean $removePreviousVariables
+ * @param bool $removePreviousVariables
*/
protected function updateVariables(Style $style, $removePreviousVariables = false) {
if (!isset($this->parameters['variables']) || !is_array($this->parameters['variables'])) {
* @param string $filename
* @param int $packageID
* @param StyleEditor $style
- * @param boolean $skipFontDownload
+ * @param bool $skipFontDownload
* @return StyleEditor
*/
public static function import($filename, $packageID = 1, StyleEditor $style = null, $skipFontDownload = false) {
/**
* Exports this style.
*
- * @param boolean $templates
- * @param boolean $images
+ * @param bool $templates
+ * @param bool $images
* @param string $packageName
*/
public function export($templates = false, $images = false, $packageName = '') {
* Returns true if current template is considered system critical and
* may not be customized at any point.
*
- * @return boolean
+ * @return bool
*/
public function canCopy() {
if (self::isSystemCritical($this->templateName)) {
* may not be customized at any point.
*
* @param string $templateName
- * @return boolean
+ * @return bool
*/
public static function isSystemCritical($templateName) {
return in_array($templateName, self::$systemCriticalTemplates);
* Returns whether the template group is immutable (i.e. whether it's the email
* template group).
*
- * @return boolean
+ * @return bool
*/
public function isImmutable() {
return $this->templateGroupFolderName === '_wcf_email/';
* Renders a trophy.
*
* @param int $size
- * @param boolean $showTooltip
+ * @param bool $showTooltip
* @return string
*/
public function renderTrophy($size = self::DEFAULT_SIZE, $showTooltip = false) {
/**
* Returns true if the current trophy is disabled. Returns also true if the trophy category is disabled.
*
- * @return boolean
+ * @return bool
*/
public function isDisabled() {
if ($this->isDisabled) {
/**
* Returns the trophies for the category.
*
- * @param boolean $includeDisabled
+ * @param bool $includeDisabled
* @return Trophy[]
*/
public function getTrophies($includeDisabled = false) {
/**
* true, if user has access to the ACP
- * @var boolean
+ * @var bool
*/
protected $hasAdministrativePermissions;
* Returns true if the given password is the correct password for this user.
*
* @param string $password
- * @return boolean password correct
+ * @return bool password correct
*/
public function checkPassword($password) {
$isValid = false;
/**
* Returns an array with all the groups in which the actual user is a member.
*
- * @param boolean $skipCache
+ * @param bool $skipCache
* @return int[]
*/
public function getGroupIDs($skipCache = false) {
* Returns the value of the user option with the given name.
*
* @param string $name user option name
- * @param boolean $filterDisabled suppress values for disabled options
+ * @param bool $filterDisabled suppress values for disabled options
* @return mixed user option value
*/
public function getUserOption($name, $filterDisabled = false) {
/**
* Returns true if this user is marked.
*
- * @return boolean
+ * @return bool
*/
public function isMarked() {
$markedUsers = WCF::getSession()->getVar('markedUsers');
/**
* Returns true if the email is confirmed.
*
- * @return boolean
+ * @return bool
* @since 5.3
*/
public function isEmailConfirmed() {
/**
* Returns true if the active user can edit this user.
*
- * @return boolean
+ * @return bool
*/
public function canEdit() {
return (WCF::getSession()->getPermission('admin.user.canEditUser') && UserGroup::isAccessibleGroup($this->getGroupIDs()));
/**
* Returns true, if this user has access to the ACP.
*
- * @return boolean
+ * @return bool
*/
public function hasAdministrativeAccess() {
if ($this->hasAdministrativePermissions === null) {
* Returns the social network privacy settings of the user.
* @deprecated 3.0
*
- * @return boolean[]
+ * @return bool[]
*/
public function getSocialNetworkPrivacySettings() {
return [
/**
* Returns true, if this user can purchase paid subscriptions.
*
- * @return boolean
+ * @return bool
*/
public function canPurchasePaidSubscriptions() {
return WCF::getUser()->userID && !$this->pendingActivation();
/**
* Returns true if this user is not activated.
*
- * @return boolean
+ * @return bool
* @since 5.3
*/
public function pendingActivation() {
/**
* Returns true if this user requires activation by the user.
*
- * @return boolean
+ * @return bool
* @since 5.3
*/
public function requiresEmailActivation() {
/**
* Returns true if this user requires the activation by an admin.
*
- * @return boolean
+ * @return bool
* @since 5.3
*/
public function requiresAdminActivation() {
/**
* Returns true if this user can confirm the email themself.
*
- * @return boolean
+ * @return bool
* @since 5.3
*/
public function canEmailConfirm() {
/**
* Returns true, if the user must confirm his email by themself.
*
- * @return boolean
+ * @return bool
* @since 5.3
*/
public function mustSelfEmailConfirm() {
/**
* Validates accessible groups.
*
- * @param boolean $ignoreOwnUser
+ * @param bool $ignoreOwnUser
* @throws PermissionDeniedException
* @throws UserInputException
*/
* Adds a user to the groups he should be in.
*
* @param array $groupIDs
- * @param boolean $deleteOldGroups
- * @param boolean $addDefaultGroups
+ * @param bool $deleteOldGroups
+ * @param bool $addDefaultGroups
*/
public function addToGroups(array $groupIDs, $deleteOldGroups = true, $addDefaultGroups = true) {
// add default groups
* Saves the visible languages of a user.
*
* @param array $languageIDs
- * @param boolean $deleteOldLanguages
+ * @param bool $deleteOldLanguages
*/
public function addToLanguages(array $languageIDs, $deleteOldLanguages = true) {
// remove previous languages
* Returns true if current user is following given user id.
*
* @param int $userID
- * @return boolean
+ * @return bool
*/
public function isFollowing($userID) {
return in_array($userID, $this->getFollowingUsers());
* Returns true if given user ids follows current user.
*
* @param int $userID
- * @return boolean
+ * @return bool
*/
public function isFollower($userID) {
return in_array($userID, $this->getFollowers());
* Returns true if given user is ignored.
*
* @param int $userID
- * @return boolean
+ * @return bool
*/
public function isIgnoredUser($userID) {
return in_array($userID, $this->getIgnoredUsers());
* Returns true if the given user ignores the current user.
*
* @param int $userID
- * @return boolean
+ * @return bool
*/
public function isIgnoredByUser($userID) {
return in_array($userID, $this->getIgnoredByUsers());
/**
* Returns true if the active user can view the avatar of this user.
*
- * @return boolean
+ * @return bool
*/
public function canSeeAvatar() {
return (
/**
* Returns the user's cover photo.
*
- * @param boolean $isACP override ban on cover photo
+ * @param bool $isACP override ban on cover photo
* @return IUserCoverPhoto
*/
public function getCoverPhoto($isACP = false) {
/**
* Returns true if the active user can view the cover photo of this user.
*
- * @return boolean
+ * @return bool
*/
public function canSeeCoverPhoto() {
return (WCF::getUser()->userID == $this->userID || WCF::getSession()->getPermission('user.profile.coverPhoto.canSeeCoverPhotos'));
/**
* Returns true if this user is currently online.
*
- * @return boolean
+ * @return bool
*/
public function isOnline() {
if ($this->getLastActivityTime() > (TIME_NOW - USER_ONLINE_TIMEOUT) && $this->canViewOnlineStatus()) {
/**
* Returns true if the active user can view the online status of this user.
*
- * @return boolean
+ * @return bool
*/
public function canViewOnlineStatus() {
return WCF::getUser()->userID == $this->userID
* Returns true if current user fulfills the required permissions.
*
* @param string $name
- * @return boolean
+ * @return bool
*/
public function isAccessible($name) {
/** @noinspection PhpVariableVariableInspection */
/**
* Returns true if current user profile is protected.
*
- * @return boolean
+ * @return bool
*/
public function isProtected() {
return (!WCF::getSession()->getPermission('admin.general.canViewPrivateUserOptions') && !$this->isAccessible('canViewProfile') && $this->userID != WCF::getUser()->userID);
* compatibility, while preventing ACLs from overruling a 'Never' setting.
*
* @param string $permission
- * @return boolean
+ * @return bool
*/
public function getNeverPermission($permission) {
$this->loadGroupData();
/**
* Returns true if this user can edit his profile.
*
- * @return boolean
+ * @return bool
*/
public function canEditOwnProfile() {
if ($this->pendingActivation() || !$this->getPermission('user.profile.canEditUserProfile')) {
/**
* Returns true if the current user is connected with Facebook.
*
- * @return boolean
+ * @return bool
*/
public function isConnectedWithFacebook() {
return StringUtil::startsWith($this->authData, 'facebook:');
/**
* Returns true if the current user is connected with GitHub.
*
- * @return boolean
+ * @return bool
*/
public function isConnectedWithGithub() {
return StringUtil::startsWith($this->authData, 'github:');
/**
* Returns true if the current user is connected with Google Plus.
*
- * @return boolean
+ * @return bool
*/
public function isConnectedWithGoogle() {
return StringUtil::startsWith($this->authData, 'google:');
/**
* Returns true if the current user is connected with Twitter.
*
- * @return boolean
+ * @return bool
*/
public function isConnectedWithTwitter() {
return StringUtil::startsWith($this->authData, 'twitter:');
/**
* Return true if the user's signature is visible.
*
- * @return boolean
+ * @return bool
*/
public function showSignature() {
if (!MODULE_USER_SIGNATURE) return false;
* Returns true, if the active user has access to the user option with the given name.
*
* @param string $name
- * @return boolean
+ * @return bool
*/
public function isVisibleOption($name) {
$option = ViewableUserOption::getUserOption($name);
* Returns the user option handler object.
*
* @param User $user
- * @param boolean $editMode
+ * @param bool $editMode
* @return UserOptionHandler
*/
protected function getOptionHandler(User $user, $editMode = true) {
/**
* accessible by current user
- * @var boolean
+ * @var bool
*/
protected $isAccessible = false;
/**
* associated object was removed
- * @var boolean
+ * @var bool
*/
protected $isOrphaned = false;
/**
* true if event description contains raw html
- * @var boolean
+ * @var bool
*/
protected $isRawHtml = false;
/**
* Returns true if event is accessible by current user.
*
- * @return boolean
+ * @return bool
*/
public function isAccessible() {
return $this->isAccessible;
/**
* Returns true if event is orphaned (associated object removed).
*
- * @return boolean
+ * @return bool
*/
public function isOrphaned() {
return $this->isOrphaned;
* Sets event text.
*
* @param string $description
- * @param boolean $isRawHtml
+ * @param bool $isRawHtml
*/
public function setDescription($description, $isRawHtml = false) {
$this->description = $description;
/**
* Returns true if event description contains raw html.
*
- * @return boolean
+ * @return bool
* @since 3.1
*/
public function isRawHtml() {
* Returns the number of authentication failures caused by given ip address.
*
* @param string $ipAddress
- * @return boolean
+ * @return bool
*/
public static function countIPFailures($ipAddress) {
$sql = "SELECT COUNT(*)
* Returns the number of authentication failures for given user account.
*
* @param int $userID
- * @return boolean
+ * @return bool
*/
public static function countUserFailures($userID) {
$sql = "SELECT COUNT(*)
* Checks a given email address for gravatar support.
*
* @param string $email
- * @return boolean
+ * @return bool
*/
public static function test($email) {
$gravatarURL = sprintf(self::GRAVATAR_BASE, md5(mb_strtolower($email)), 80, GRAVATAR_DEFAULT_TYPE);
/**
* Returns true if this avatar can be cropped.
*
- * @return boolean
+ * @return bool
* @deprecated 3.0
*/
public function canCrop();
* given, the active user is used.
*
* @param User $user user object or current user if null
- * @return boolean
+ * @return bool
*/
public function isMember(User $user = null) {
if ($user === null) $user = WCF::getUser();
/**
* Returns true if this is the 'Everyone' group.
*
- * @return boolean
+ * @return bool
* @since 3.0
*/
public function isEveryone() {
/**
* Returns true if this is the 'Users' group.
*
- * @return boolean
+ * @return bool
* @since 3.1
*/
public function isUsers() {
* Returns true if the given groups are accessible for the active user.
*
* @param array $groupIDs
- * @return boolean
+ * @return bool
*/
public static function isAccessibleGroup(array $groupIDs = []) {
if (self::$accessibleGroups === null) {
* b) This is the 'Owner' group.
* c) The group can access all groups (the 'Owner' group does not count).
*
- * @return boolean
+ * @return bool
*/
public function isAdminGroup() {
// WCFSetup
/**
* Returns true if the current group is a moderator-group.
*
- * @return boolean
+ * @return bool
*/
public function isModGroup() {
// workaround for WCF-Setup
/**
* Returns true if this group is accessible for the active user.
*
- * @return boolean
+ * @return bool
*/
public function isAccessible() {
return self::isAccessibleGroup([$this->groupID]);
/**
* Returns true if current user may delete this group.
*
- * @return boolean
+ * @return bool
*/
public function isDeletable() {
// insufficient permissions
/**
* Returns true if current user may edit this group.
*
- * @return boolean
+ * @return bool
*/
public function isEditable() {
// insufficient permissions
* Updates the value from the accessiblegroups option.
*
* @param int $groupID this group is added or deleted in the value
- * @param boolean $delete flag for group deletion
+ * @param bool $delete flag for group deletion
* @throws SystemException
*/
protected static function updateAccessibleGroups($groupID, $delete = false) {
/**
* Marks all notifications of current user as confirmed.
*
- * @return boolean[]
+ * @return bool[]
*/
public function markAllAsConfirmed() {
// remove notifications for this user
* automatically determine the location.
*
* @param string|null $location
- * @return boolean `true` if the location has been successfully set, otherwise `false`
+ * @return bool `true` if the location has been successfully set, otherwise `false`
*/
public function setLocation($location = null) {
if ($location === null) {
*
* @param int $userID
* @param int $canViewOnlineStatus
- * @return boolean
+ * @return bool
* @deprecated 5.3 Use `isVisibleUser` instead
*/
public static function isVisible($userID, $canViewOnlineStatus) {
* Checks the 'canViewOnlineStatus' setting for the given user.
*
* @param UserOnline $userOnline
- * @return boolean
+ * @return bool
* @since 5.3
*/
public static function isVisibleUser(UserOnline $userOnline) {
/**
* Returns true iff this option is editable.
*
- * @param boolean $inRegistration True iff the user currently is in registration.
- * @return boolean
+ * @param bool $inRegistration True iff the user currently is in registration.
+ * @return bool
*/
public function isEditable($inRegistration = false) {
// check admin permissions
/**
* Returns true iff this user option can be deleted.
*
- * @return boolean
+ * @return bool
*/
public function canDelete() {
if ($this->originIsSystem) {
/**
* Enables this option.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enable($enable = true) {
$value = intval(!$enable);
/**
* Returns true if the generic rank title should be displayed.
*
- * @return boolean
+ * @return bool
*/
public function showTitle() {
return !$this->rankImage || !$this->hideTitle;
* Returns a user trophy list for a certain users.
*
* @param int[] $userIDs
- * @param boolean $includeDisabled
+ * @param bool $includeDisabled
* @return UserTrophy[][]
*/
public static function getUserTrophies(array $userIDs, $includeDisabled = false) {
/**
* true if captcha is used
- * @var boolean
+ * @var bool
*/
public $useCaptcha = true;
/**
* true to force captcha usage
- * @var boolean
+ * @var bool
*/
public $forceCaptcha = false;
/**
* user has confirmed the privacy policy
- * @var boolean
+ * @var bool
*/
public $privacyPolicyConfirmed = 0;
class DisclaimerForm extends AbstractForm {
/**
* true, if the user has accepted the disclaimer
- * @var boolean
+ * @var bool
*/
public $accept = false;
/**
* enables multilingualism
- * @var boolean
+ * @var bool
*/
public $enableMultilingualism = false;
public $token = '';
/**
- * @var boolean
+ * @var bool
*/
public $isOneClick = false;
/**
* enable recaptcha
- * @var boolean
+ * @var bool
*/
public $useCaptcha = true;
class RegisterForm extends UserAddForm {
/**
* true if external authentication is used
- * @var boolean
+ * @var bool
*/
public $isExternalAuthentication = false;
/**
* true if captcha is used
- * @var boolean
+ * @var bool
*/
public $useCaptcha = REGISTER_USE_CAPTCHA;
/**
* true, if search should be modified
- * @var boolean
+ * @var bool
*/
public $modifySearch = null;
/**
* mark as submitted form if modifying search
- * @var boolean
+ * @var bool
*/
public $submit = false;
/**
* is true if canonical URL will be enforced even if POST data is represent
- * @var boolean
+ * @var bool
*/
public $forceCanonicalURL = false;
/**
* is true if the redirect should use a 307 instead of the default 301, not recommended in general
- * @var boolean
+ * @var bool
*/
public $softRedirectCanonicalURL = false;
/**
* indicates if you need to be logged in to access this page
- * @var boolean
+ * @var bool
*/
public $loginRequired = false;
/**
* shows the tiny thumbnail
- * @var boolean
+ * @var bool
*/
public $tiny = 0;
/**
* shows the standard thumbnail
- * @var boolean
+ * @var bool
*/
public $thumbnail = 0;
/**
* Returns true if this page should be tracked.
*
- * @return boolean
+ * @return bool
*/
public function isTracked();
/**
* Returns true if current page is the first page.
*
- * @return boolean
+ * @return bool
*/
public function isFirstPage() {
return ($this->pageNo == 1);
/**
* Returns true if current page is the last page.
*
- * @return boolean
+ * @return bool
*/
public function isLastPage() {
return ($this->items == $this->endIndex);
class UserPage extends AbstractPage {
/**
* edit profile on page load
- * @var boolean
+ * @var bool
*/
public $editOnInit = false;
* @param string $identifier
* @param string $name
* @param string $value
- * @param boolean $isProperty
+ * @param bool $isProperty
*/
public function addTag($identifier, $name, $value, $isProperty = false) {
if (!isset($this->objects[$identifier])) {
/**
* Checks whether the regex is syntactically correct.
*
- * @return boolean
+ * @return bool
*/
public function isValid() {
try {
* Checks whether the regex matches the given string.
*
* @param string $string string to match
- * @param boolean $all indicates if all matches are collected
+ * @param bool $all indicates if all matches are collected
* @param int $flags match flags
* @return int return value of preg_match(_all)
*/
/**
* Returns whether this singleton is already initialized.
*
- * @return boolean
+ * @return bool
*/
public static final function isInitialized() {
$className = get_called_class();
/**
* overrides disabled debug mode
- * @var boolean
+ * @var bool
*/
protected static $overrideDebugMode = false;
/**
* true if Zend Opcache is loaded and enabled
- * @var boolean
+ * @var bool
*/
protected static $zendOpcacheEnabled;
/**
* force logout during destructor call
- * @var boolean
+ * @var bool
*/
protected static $forceLogout = false;
* Loads an application.
*
* @param Application $application
- * @param boolean $isDependentApplication
+ * @param bool $isDependentApplication
* @return IApplication
* @throws SystemException
*/
/**
* Returns true if current application (WCF) is treated as active and was invoked directly.
*
- * @return boolean
+ * @return bool
*/
public function isActiveApplication() {
return (ApplicationHandler::getInstance()->getActiveApplication()->packageID == 1);
/**
* Returns true if the debug mode is enabled, otherwise false.
*
- * @param boolean $ignoreACP
- * @return boolean
+ * @param bool $ignoreACP
+ * @return bool
*/
public static function debugModeIsEnabled($ignoreACP = false) {
// ACP override
/**
* Returns true if benchmarking is enabled, otherwise false.
*
- * @return boolean
+ * @return bool
*/
public static function benchmarkIsEnabled() {
// benchmarking is enabled by default
/**
* Returns true if the desktop notifications should be enabled.
*
- * @return boolean
+ * @return bool
*/
public function useDesktopNotifications() {
if (!ENABLE_DESKTOP_NOTIFICATIONS) {
/**
* Returns true if currently active request represents the landing page.
*
- * @return boolean
+ * @return bool
*/
public static function isLandingPage() {
if (self::getActiveRequest() === null) {
* Returns true if the given API version is currently supported.
*
* @param int $apiVersion
- * @return boolean
+ * @return bool
* @deprecated 5.2
*/
public static function isSupportedApiVersion($apiVersion) {
class WCFACP extends WCF {
/**
* rescue mode
- * @var boolean
+ * @var bool
*/
protected static $inRescueMode;
/**
* Returns true if ACP is currently in rescue mode.
*
- * @return boolean
+ * @return bool
*/
public static function inRescueMode() {
if (self::$inRescueMode === null) {
/**
* indicates if developer mode is used to install
- * @var boolean
+ * @var bool
*/
protected static $developerMode = 0;
/**
* Returns true if memory_limit is set to at least 128 MB
*
- * @return boolean
+ * @return bool
*/
protected function compareMemoryLimit() {
$memoryLimit = ini_get('memory_limit');
* @param int $objectTypeID
* @param array $objectIDs
* @param string $categoryName
- * @param boolean $settingsView
+ * @param bool $settingsView
* @return array
*/
public function getPermissions($objectTypeID, array $objectIDs, $categoryName = '', $settingsView = false) {
* @param string $type
* @param array $objectIDs
* @param array $data
- * @param boolean $settingsView
+ * @param bool $settingsView
*/
protected function getValues(ACLOptionList $optionList, $type, array $objectIDs, array &$data, $settingsView) {
$data[$type] = [];
* @param string $objectType object type name
* @param int $objectID object id
* @param User|null $user user object, if `null` uses current user
- * @return boolean false if user is not allowed
+ * @return bool false if user is not allowed
*/
public function canAccess($objectType, $objectID, User $user = null) {
if ($user === null) $user = WCF::getUser();
/**
* true, if current application is active (directly invoked, not dependent)
- * @var boolean
+ * @var bool
*/
protected $isActiveApplication = false;
/**
* true for multi-domain setups
- * @var boolean
+ * @var bool
*/
protected $isMultiDomain;
* Returns true if given $url is an internal URL.
*
* @param string $url
- * @return boolean
+ * @return bool
*/
public function isInternalURL($url) {
$protocolRegex = new Regex('^https(?=://)');
/**
* Returns true if this is a multi-domain setup.
*
- * @return boolean
+ * @return bool
* @since 3.1
*/
public function isMultiDomainSetup() {
/**
* Returns true if current application is treated as active and was invoked directly.
*
- * @return boolean
+ * @return bool
*/
public function isActiveApplication();
/**
* Returns true if the active user has the permission to upload attachments.
*
- * @return boolean
+ * @return bool
*/
public function canUpload() {
return $this->processor->canUpload($this->objectID, $this->parentObjectID);
* Returns true if the active user has the permission to download attachments.
*
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function canDownload($objectID);
* previews (thumbnails).
*
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function canViewPreview($objectID);
*
* @param int $objectID
* @param int $parentObjectID
- * @return boolean
+ * @return bool
*/
public function canUpload($objectID, $parentObjectID = 0);
* Returns true if the active user has the permission to delete attachments.
*
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function canDelete($objectID);
* queue.
*
* @param AbstractBackgroundJob $job The job to perform.
- * @param boolean $debugSynchronousExecution Disables fail-safe mechanisms, errors will no longer be suppressed.
+ * @param bool $debugSynchronousExecution Disables fail-safe mechanisms, errors will no longer be suppressed.
* @throws \Throwable
*/
public function performJob(AbstractBackgroundJob $job, $debugSynchronousExecution = false) {
* Performs the (single) job that is due next.
* This method automatically handles requeuing in case of failure.
*
- * @return boolean true if this call attempted to execute a job regardless of its result
+ * @return bool true if this call attempted to execute a job regardless of its result
*/
public function performNextJob() {
WCF::getDB()->beginTransaction();
* Returns true if the BBCode with the given tag is available in the WYSIWYG editor.
*
* @param string $bbCodeTag
- * @return boolean
+ * @return bool
*/
public function isAvailableBBCode($bbCodeTag) {
return !in_array($bbCodeTag, $this->disallowedBBCodes);
/**
* Returns a list of BBCodes displayed as buttons.
*
- * @param boolean $excludeCoreBBCodes do not return bbcodes that are available by default
+ * @param bool $excludeCoreBBCodes do not return bbcodes that are available by default
* @return BBCode[]
*/
public function getButtonBBCodes($excludeCoreBBCodes = false) {
* Validates the attributes of a tag.
*
* @param array $tag
- * @return boolean
+ * @return bool
*/
protected function isValidTag(array $tag) {
if (isset($tag['attributes']) && count($tag['attributes']) > count($this->bbcodes[$tag['name']]->getAttributes())) {
*
* @param array $tagAttributes
* @param BBCodeAttribute $definedTagAttribute
- * @return boolean
+ * @return bool
*/
protected function isValidTagAttribute(array $tagAttributes, BBCodeAttribute $definedTagAttribute) {
if ($definedTagAttribute->validationPattern && isset($tagAttributes[$definedTagAttribute->attributeNo])) {
* Returns true if the text inside the given text needs to be buffered.
*
* @param array $tag
- * @return boolean
+ * @return bool
*/
protected function needBuffering(array $tag) {
// check for special bbcode class
*
* @param array $openTags
* @param string $tag
- * @param boolean $closing
- * @return boolean
+ * @param bool $closing
+ * @return bool
*/
protected function isAllowed(array $openTags, $tag, $closing = false) {
foreach ($openTags as $openTag) {
/**
* Builds the tag array from the given text.
*
- * @param boolean $ignoreSourceCodes
+ * @param bool $ignoreSourceCodes
*/
public function buildTagArray($ignoreSourceCodes = true) {
// build tag pattern
/**
* Google AMP support
- * @var boolean
+ * @var bool
*/
protected $isGoogleAmp = false;
/**
* Enables or disables Google AMP support.
*
- * @param boolean $isGoogleAmp
+ * @param bool $isGoogleAmp
* @since 3.1
*/
public function setIsGoogleAmp($isGoogleAmp) {
/**
* Returns true if Google AMP support is enabled.
*
- * @return boolean
+ * @return bool
* @since 3.1
*/
public function getIsGoogleAmp() {
*
* @param string $name bbcode identifier
* @param array $attributes list of attributes
- * @param boolean $openingTagOnly only render the opening tag
+ * @param bool $openingTagOnly only render the opening tag
* @return string
*/
public function buildBBCodeTag($name, $attributes, $openingTagOnly = false) {
* Returns true if provided name is a valid bbcode identifier.
*
* @param string $name bbcode identifier
- * @return boolean true if provided name is a valid bbcode identifier
+ * @return bool true if provided name is a valid bbcode identifier
*/
protected function isValidBBCodeName($name) {
return preg_match($this->validBBCodePattern, $name) === 1;
* Parses a message.
*
* @param string $message
- * @param boolean $enableSmilies
- * @param boolean $enableHtml
- * @param boolean $enableBBCodes
- * @param boolean $doKeywordHighlighting
+ * @param bool $enableSmilies
+ * @param bool $enableHtml
+ * @param bool $enableBBCodes
+ * @param bool $doKeywordHighlighting
* @return string parsed message
*/
public function parse($message, $enableSmilies = true, $enableHtml = false, $enableBBCodes = true, $doKeywordHighlighting = true) {
* Parses smiley codes.
*
* @param string $text
- * @param boolean $enableHtml
+ * @param bool $enableHtml
* @return string
*/
protected function parseSmilies($text, $enableHtml = false) {
* Parses the given message and returns the parsed message.
*
* @param string $message
- * @param boolean $parseURLs
- * @param boolean $parseSmilies
+ * @param bool $parseURLs
+ * @param bool $parseSmilies
* @return string
*/
public function parse($message, $parseURLs = true, $parseSmilies = true) {
/**
* forces media links to be linked to the frontend
* after it has been set to `true`, it should be set to `false` again as soon as possible
- * @var boolean
+ * @var bool
*/
public static $forceFrontendLinks = false;
abstract class Highlighter extends SingletonFactory {
/**
* allow multiline quotes
- * @var boolean
+ * @var bool
*/
protected $allowsNewslinesInQuotes = false;
* with the box conditions.
*
* @param Box $box box object
- * @param boolean $setConditionData if true, the condition object types are populated with the box conditions' data
+ * @param bool $setConditionData if true, the condition object types are populated with the box conditions' data
*/
public function setBox(Box $box, $setConditionData = true) {
parent::setBox($box);
protected $boxesByPosition = [];
/**
- * @var boolean
+ * @var bool
*/
protected static $disablePageLayout = false;
*
* @param string $boxIdentifier
* @param string[] $pageIdentifiers
- * @param boolean $visible
+ * @param bool $visible
* @throws \InvalidArgumentException
*/
public function addBoxToPageAssignments($boxIdentifier, array $pageIdentifiers, $visible = true) {
/**
* Returns true if the left sidebar contains at least one visible menu.
*
- * @return boolean
+ * @return bool
* @since 3.1
*/
public function sidebarLeftHasMenu() {
* Returns the list of boxes sorted by their global and page-local show order.
*
* @param int $pageID page id
- * @param boolean $forDisplay enables content loading and removes inaccessible boxes from view
+ * @param bool $forDisplay enables content loading and removes inaccessible boxes from view
* @return Box[][]
*/
public static function loadBoxes($pageID, $forDisplay) {
* Returns true if provided page id uses a custom box show order.
*
* @param int $pageID page id
- * @return boolean true if there is a custom show order for boxes
+ * @return bool true if there is a custom show order for boxes
*/
public static function hasCustomShowOrder($pageID) {
$sql = "SELECT COUNT(*) AS count
/**
* Returns false if this box has no content.
*
- * @return boolean
+ * @return bool
*/
public function hasContent();
/**
* Returns true if this box has a title link.
*
- * @return boolean
+ * @return bool
*/
public function hasLink();
/**
* is true if the list of recent activity can be filtered to only include
* activities by followed users
- * @var boolean
+ * @var bool
*/
public $canFilterByFollowedUsers = false;
/**
* is true if the list of recent activity is filtered to only include
* activities by followed users
- * @var boolean
+ * @var bool
*/
public $filteredByFollowedUsers = false;
/**
* is true if filtering by followed users yielded no results
- * @var boolean
+ * @var bool
*/
public $filteredByFollowedUsersOverride = false;
/**
* enables the display of the user online record
- * @var boolean
+ * @var bool
*/
public $showRecord = true;
* May be left empty to disable url functionality.
*
* @param string $url
- * @param boolean $appendSession This parameter is unused as of version 3.0
+ * @param bool $appendSession This parameter is unused as of version 3.0
*/
public function setURL($url, $appendSession = false) {
$this->url = $url;
/**
* Returns true if the action is available for the active user.
*
- * @return boolean
+ * @return bool
*/
public function isAvailable();
/**
* indicates whether output was generated (i.e. executeAction was called)
- * @var boolean
+ * @var bool
*/
private $executed = false;
* options.
*
* @param OptionCategory $topCategory
- * @return boolean
+ * @return bool
*/
protected function containsOptions(OptionCategory $topCategory) {
// check if category directly contains options
/**
* if `true`, only positive values of the database column will be considered
- * @var boolean
+ * @var bool
*/
protected $positiveValuesOnly = false;
*
* @param string $filename
* @param int $maxLifetime
- * @return boolean
+ * @return bool
*/
protected function needRebuild($filename, $maxLifetime) {
// cache does not exist
* Flushes a specific cache, optionally removing caches which share the same name.
*
* @param string $cacheName
- * @param boolean $useWildcard
+ * @param bool $useWildcard
*/
public function flush($cacheName, $useWildcard);
/**
* Returns true if this kind of captcha is available.
*
- * @return boolean
+ * @return bool
*/
public function isAvailable();
/**
* ACP option override
- * @var boolean
+ * @var bool
*/
public static $forceIsAvailable = false;
abstract class AbstractCategoryType extends SingletonFactory implements ICategoryType {
/**
* indicates if categories of this type may have no empty description
- * @var boolean
+ * @var bool
*/
protected $forceDescription = true;
/**
* indicates if categories of this type have descriptions
- * @var boolean
+ * @var bool
*/
protected $hasDescription = true;
/**
* Returns true if the active user can add a category of this type.
*
- * @return boolean
+ * @return bool
*/
public function canAddCategory();
/**
* Returns true if the active user can delete a category of this type.
*
- * @return boolean
+ * @return bool
*/
public function canDeleteCategory();
/**
* Returns true if the active user can edit a category of this type.
*
- * @return boolean
+ * @return bool
*/
public function canEditCategory();
/**
* Returns true if a category of this type may have no empty description.
*
- * @return boolean
+ * @return bool
*/
public function forceDescription();
* is used.
*
* @param string $name
- * @param boolean $optional
+ * @param bool $optional
* @return string
*/
public function getLanguageVariable($name, $optional = false);
/**
* Returns true if categories of this type have descriptions.
*
- * @return boolean
+ * @return bool
*/
public function hasDescription();
/**
* Returns `true` if the descriptions of categories of this type support HTML.
*
- * @return boolean
+ * @return bool
* @since 5.2
*/
public function supportsHtmlDescription();
class DatabaseCLICommandHistory extends MemoryHistory {
/**
* should the history automatically be saved
- * @var boolean
+ * @var bool
*/
public $autoSave = true;
/**
* Saves the history.
*
- * @param boolean $append
+ * @param bool $append
*/
public function save($append = false) {
if (!$append) {
/**
* Returns true if the user is allowed to use this command.
*
- * @return boolean
+ * @return bool
*/
public function canAccess();
}
/**
* indicates if the imported will be quit
- * @var boolean
+ * @var bool
*/
protected $quitImport = false;
* Validates accessible groups.
*
* @param int[] $userIDs
- * @param boolean $ignoreOwnUser
+ * @param bool $ignoreOwnUser
* @return int[]
*/
protected function __validateAccessibleGroups(array $userIDs, $ignoreOwnUser = true) {
* @param ICommentManager $commentManager
* @param int $objectTypeID
* @param int $objectID
- * @param boolean $readObjects
+ * @param bool $readObjects
* @return StructuredCommentList
*/
public function getCommentList(ICommentManager $commentManager, $objectTypeID, $objectID, $readObjects = true) {
/**
* Returns true if the current user may edit a comment/response.
*
- * @param boolean $isOwner
- * @return boolean
+ * @param bool $isOwner
+ * @return bool
*/
protected function canEdit($isOwner) {
// disallow guests
/**
* Returns true if the current user may delete a comment/response.
*
- * @param boolean $isOwner
- * @return boolean
+ * @param bool $isOwner
+ * @return bool
*/
protected function canDelete($isOwner) {
// disallow guests
* Returns true if the current user may add comments or responses.
*
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function canAdd($objectID);
* Returns true if a comment requires approval.
*
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function canAddWithoutApproval($objectID);
* Returns true if the current user may edit given comment.
*
* @param Comment $comment
- * @return boolean
+ * @return bool
*/
public function canEditComment(Comment $comment);
* Returns true if the current user may edit given response.
*
* @param CommentResponse $response
- * @return boolean
+ * @return bool
*/
public function canEditResponse(CommentResponse $response);
* Returns true if the current user may delete given comment.
*
* @param Comment $comment
- * @return boolean
+ * @return bool
*/
public function canDeleteComment(Comment $comment);
*
* @param int $objectTypeID
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function canModerate($objectTypeID, $objectID);
*
* @param int $objectTypeID
* @param int $objectID
- * @param boolean $isResponse
+ * @param bool $isResponse
* @return string
*/
public function getTitle($objectTypeID, $objectID, $isResponse = false);
* by current user.
*
* @param int $objectID
- * @param boolean $validateWritePermission
- * @return boolean
+ * @param bool $validateWritePermission
+ * @return bool
*/
public function isAccessible($objectID, $validateWritePermission = false);
/**
* Returns true if this comment type supports likes.
*
- * @return boolean
+ * @return bool
*/
public function supportsLike();
/**
* Returns true if this comment type supports reports.
*
- * @return boolean
+ * @return bool
*/
public function supportsReport();
* the content's author.
*
* @param Comment|CommentResponse $commentOrResponse
- * @return boolean
+ * @return bool
*/
public function isContentAuthor($commentOrResponse);
}
/**
* is true if the entered value should be split by commas to search for
* multiple values
- * @var boolean
+ * @var bool
*/
protected $supportsMultipleValues = false;
* like the active user object via WCF::getUser().
*
* @param Condition $condition
- * @return boolean
+ * @return bool
*/
public function showContent(Condition $condition);
}
*
* @param DatabaseObject $object
* @param array $conditionData
- * @return boolean
+ * @return bool
*/
public function checkObject(DatabaseObject $object, array $conditionData);
}
*
* @param Condition $condition
* @param User $user
- * @return boolean
+ * @return bool
*/
public function checkUser(Condition $condition, User $user);
}
/**
* enables failsafe connection
- * @var boolean
+ * @var bool
*/
protected $failsafeTest = false;
/**
* attempts to create the database after the connection has been established
- * @var boolean
+ * @var bool
*/
protected $tryToCreateDatabase = false;
* @param string $password SQL database server password
* @param string $database SQL database server database name
* @param int $port SQL database server port
- * @param boolean $failsafeTest
- * @param boolean $tryToCreateDatabase
+ * @param bool $failsafeTest
+ * @param bool $tryToCreateDatabase
* @param array $defaultDriverOptions
*/
public function __construct($host, $user, $password, $database, $port, $failsafeTest = false, $tryToCreateDatabase = false, $defaultDriverOptions = []) {
/**
* Initiates a transaction.
*
- * @return boolean true on success
+ * @return bool true on success
* @throws DatabaseTransactionException
*/
public function beginTransaction() {
/**
* Commits a transaction and returns true if the transaction was successful.
*
- * @return boolean
+ * @return bool
* @throws DatabaseTransactionException
*/
public function commitTransaction() {
/**
* Rolls back a transaction and returns true if the rollback was successful.
*
- * @return boolean
+ * @return bool
* @throws DatabaseTransactionException
*/
public function rollBackTransaction() {
/**
* Returns true if this database type is supported.
*
- * @return boolean
+ * @return bool
*/
public static function isSupported() {
return false;
* @package WoltLabSuite\Core\System\Database
*
* @method int del($key1, $key2 = null, $key3 = null)
- * @method boolean expire($key, $ttl)
+ * @method bool expire($key, $ttl)
* @method string|bool get($key)
* @method int hDel($key, $hashKey1, $hashKey2 = null, $hashKeyN = null)
* @method string hGet($key, $hashKey)
* @method int hSet($key, $hashKey, $value)
* @method int incr($key)
* @method string info($option = null)
- * @method boolean setex($key, $ttl, $value)
- * @method boolean setnx($key, $value)
+ * @method bool setex($key, $ttl, $value)
+ * @method bool setnx($key, $value)
* @method int ttl($key)
*/
class Redis {
*
* @param string $keyColumn name of the key column
* @param string $valueColumn name of the value column
- * @param boolean $uniqueKey if `true`, a one-dimensional array is returned, otherwise, for each key an array of fetched values is returned
+ * @param bool $uniqueKey if `true`, a one-dimensional array is returned, otherwise, for each key an array of fetched values is returned
* @return string[]|string[][]
*/
public function fetchMap($keyColumn, $valueColumn, $uniqueKey = true) {
class ConditionBuilder {
/**
* must be true to add the 'WHERE' keyword automatically
- * @var boolean
+ * @var bool
*/
protected $addWhereKeyword = true;
/**
* Creates a new ConditionBuilder object.
*
- * @param boolean $addWhereKeyword
+ * @param bool $addWhereKeyword
* @param string $concat
*/
public function __construct($addWhereKeyword = true, $concat = 'AND') {
/**
* Enables / disables the where keyword.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableWhereKeyword($enable = true) {
$this->addWhereKeyword = $enable;
* Returns true if the suggested default paths for the Core and, if exists,
* the bundled app should be used.
*
- * @return boolean
+ * @return bool
*/
public function useDefaultInstallPath() {
return (isset($this->configuration['setup']) && isset($this->configuration['setup']['useDefaultInstallPath']) && $this->configuration['setup']['useDefaultInstallPath'] === true);
* Returns true if a static cookie prefix should be used, instead of the randomized
* value used for non-dev-mode installations.
*
- * @return boolean
+ * @return bool
*/
public function forceStaticCookiePrefix() {
return (isset($this->configuration['setup']) && isset($this->configuration['setup']['forceStaticCookiePrefix']) && $this->configuration['setup']['forceStaticCookiePrefix'] === true);
* section or `false`, otherwise.
*
* @param string $string
- * @return boolean
+ * @return bool
*/
protected function requiresCdata($string) {
return strpos($string, '<') !== false ||
/**
* Returns true if the PIP class can be found.
*
- * @return boolean
+ * @return bool
*/
public function classExists() {
return class_exists($this->getDecoratedObject()->className);
/**
* Returns true if the PIP is expected to be idempotent.
*
- * @return boolean
+ * @return bool
*/
public function isIdempotent() {
return is_subclass_of($this->getDecoratedObject()->className, IIdempotentPackageInstallationPlugin::class);
/**
* Returns true if the PIP exists, has a default filename and is idempotent.
*
- * @return boolean
+ * @return bool
*/
public function isSupported() {
return $this->classExists() && $this->getDefaultFilename() && $this->isIdempotent();
/**
* Returns `true` if this pip supports adding and editing entries via a gui.
*
- * @return boolean
+ * @return bool
* @since 5.2
*/
public function supportsGui() {
* Returns `true` if this package installation plugin supports delete
* instructions.
*
- * @return boolean
+ * @return bool
*/
public function supportsDeleteInstruction();
}
/**
* Returns the xml objects for this pip.
*
- * @param boolean $createXmlFiles if `true` and if a relevant XML file does not exist, it is created
+ * @param bool $createXmlFiles if `true` and if a relevant XML file does not exist, it is created
* @return XML[]
*/
abstract protected function getProjectXmls($createXmlFiles = false);
* on the value of `$addDeleteInstruction`, adds a delete instruction.
*
* @param string $identifier
- * @param boolean $addDeleteInstruction
+ * @param bool $addDeleteInstruction
*/
public function deleteEntry($identifier, $addDeleteInstruction) {
$xml = $this->getProjectXml();
* because there is no content left.
*
* @param \DOMDocument $document sanitized document
- * @return boolean
+ * @return bool
*/
protected function sanitizeXmlFileAfterDeleteEntry(\DOMDocument $document) {
$data = $document->getElementsByTagName('data')->item(0);
* Returns `true` if this package installation plugin supports delete
* instructions.
*
- * @return boolean
+ * @return bool
*/
public function supportsDeleteInstruction() {
return true;
/**
* Whether the listUnsubscribe URI has One-Click support
- * @var boolean
+ * @var bool
* @since 5.3
*/
protected $listUnsubscribeOneClick = false;
* with the value 'List-Unsubscribe=One-Click' is added.
*
* @param string $uri
- * @param boolean $supportsOneClick
+ * @param bool $supportsOneClick
* @since 5.3
*/
public function setListUnsubscribe($uri, $supportsOneClick = false) {
/**
* Validates given file system path. Returns false on failure.
*
- * @return boolean
+ * @return bool
*/
public function validateFileAccess();
* Validates the selected data types. Returns false on failure.
*
* @param array $selectedData
- * @return boolean
+ * @return bool
*/
public function validateSelectedData(array $selectedData);
/**
* This flag indicates whether only images can uploaded via this field.
- * @var boolean
+ * @var bool
*/
public $imageOnly = false;
* This flag indicates whether only images can uploaded via this field.
* <strong>Heads up:</strong> SVG images can contain bad code, therefore do not
* use this option, outside the acp or check the file whether remote code is contained.
- * @var boolean
+ * @var bool
*/
public $allowSvgImage = false;
/**
* Indicates the support of multiple files.
*
- * @return boolean
+ * @return bool
*/
public function supportMultipleFiles() {
return $this->maxFiles === null || $this->maxFiles > 1;
/**
* Returns `true` if only images can be uploaded via this field and returns `false` otherwise.
*
- * @return boolean
+ * @return bool
*/
public function isImageOnly() {
return $this->imageOnly;
/**
* Returns true, if the field can contain svg images in the image only mode.
*
- * @return boolean
+ * @return bool
*/
public function svgImageAllowed() {
return $this->allowSvgImage;
* If set to `true` will also set the acceptable types to `image/*`. If set to
* false it will clear the acceptable types if they are `image/*`.
*
- * @param boolean $imageOnly
+ * @param bool $imageOnly
*/
public function setImageOnly($imageOnly) {
$this->imageOnly = $imageOnly;
* <strong>Heads up:</strong> SVG images can contain bad code, therefore do not
* use this option, outside the acp or check the file whether remote code is contained.
*
- * @param boolean $allowSvgImage
+ * @param bool $allowSvgImage
*
* @throws \BadMethodCallException if the imageOnly flag isn't set to true
*/
/**
* Indicator, whether the file is already processed.
- * @var boolean
+ * @var bool
*/
private $processed;
/**
* Indicator, whether the file is an image.
- * @var boolean
+ * @var bool
*/
private $isImage;
/**
* Indicator, whether the file can be displayed as an image.
- * @var boolean
+ * @var bool
*/
public $viewableImage;
*
* @param string $location
* @param string $filename
- * @param boolean $viewableImage
- * @param boolean $processed
- * @param boolean $detectSvgAsImage
+ * @param bool $viewableImage
+ * @param bool $processed
+ * @param bool $detectSvgAsImage
*/
public function __construct($location, $filename, $viewableImage = true, $processed = false, $detectSvgAsImage = false) {
if (!file_exists($location)) {
/**
* Returns true, whether this file is an image.
*
- * @return boolean
+ * @return bool
*/
public function isImage() {
return $this->isImage;
/**
* Returns true, if the file is already processed.
*
- * @return boolean
+ * @return bool
*/
public function isProcessed() {
return $this->processed;
* Returns the removed but previosly proccessed files for a specific fieldId.
*
* @param string $fieldId
- * @param boolean $processFiles
+ * @param bool $processFiles
* @return UploadFile[]
*
* @throws \InvalidArgumentException if the given fieldId is unknown
* Returns the removed but previosly proccessed files for a specific internalId.
*
* @param string $internalId
- * @param boolean $processFiles
+ * @param bool $processFiles
* @return UploadFile[]
*/
public function getRemovedFiledByInternalId($internalId, $processFiles = true) {
* Returns true, if the given internalId is valid.
*
* @param string $internalId
- * @return boolean
+ * @return bool
*/
public function isValidInternalId($internalId) {
return isset($this->getStorage()[$internalId]);
*
* @param string $internalId
* @param string $uniqueFileId
- * @return boolean
+ * @return bool
*/
public function isValidUniqueFileId($internalId, $uniqueFileId) {
return $this->getFileByUniqueFileId($internalId, $uniqueFileId) !== null;
* Returns true, iff a field with the given fieldId is already registered.
*
* @param string $fieldId
- * @return boolean
+ * @return bool
*/
public function isRegisteredFieldId($fieldId) {
return isset($this->fields[$fieldId]);
/**
* `true` if the default button is added and `false` otherwise
- * @var boolean
+ * @var bool
*/
protected $addDefaultButton = true;
/**
* `true` if form is requested via an AJAX request or processes data via an AJAX request
* and `false` otherwise
- * @var boolean
+ * @var bool
*/
protected $ajax = false;
/**
* indicates if the form data has been read via `readData()`
- * @var boolean
+ * @var bool
*/
protected $didReadValues = false;
/**
* is `true` if form document is in invalid due to external factors and is `false` otherwise
- * @var boolean
+ * @var bool
*/
protected $invalid = false;
/**
* is `true` if global form error message will be shown if there are validation errors and
* is `false` otherwise
- * @var boolean
+ * @var bool
*/
protected $showErrorMessage = true;
/**
* is `true` if global form success message will be shown and is `false` otherwise
- * @var boolean
+ * @var bool
*/
protected $showSuccessMessage = false;
/**
* Sets whether the default button is added to the form during in the `build()` method.
*
- * @param boolean $addDefaultButton
+ * @param bool $addDefaultButton
* @return static this document
* @throws \BadMethodCallException if the form has already been built
*/
* Sets whether this form is requested via an AJAX request or processes data via an AJAX
* request and returns his document.
*
- * @param boolean $ajax
+ * @param bool $ajax
* @return static this document
*/
public function ajax($ajax = true);
/**
* Returns `true` if the form data has been read via `readData()` and `false` otherwise.
*
- * @return boolean
+ * @return bool
*/
public function didReadValues();
* Returns `true` if a button with the given id exists and `false` otherwise.
*
* @param string $buttonId id of checked button
- * @return boolean
+ * @return bool
*/
public function hasButton($buttonId);
* By default, the default button is added.
* Each implementing class can define itself what it considers its default button.
*
- * @return boolean
+ * @return bool
*/
public function hasDefaultButton();
*
* By default, this method returns `false`.
*
- * @return boolean
+ * @return bool
*/
public function isAjax();
*
* By default, the form document is not invalid.
*
- * @return boolean
+ * @return bool
*/
public function isInvalid();
/**
* Sets if the form document is in invalid due to external factors.
*
- * @param boolean $invalid
+ * @param bool $invalid
* @return static this document
*/
public function invalid($invalid = true);
* This method automatically sets the form mode to `self::FORM_MODE_UPDATE`.
*
* @param IStorableObject $object updated object
- * @param boolean $loadValues indicates if the object's values are loaded
+ * @param bool $loadValues indicates if the object's values are loaded
* @return static this document
*/
public function updatedObject(IStorableObject $object, $loadValues = true);
/**
* Sets if the global form error message should be shown if the form has validation errors.
*
- * @param boolean $showErrorMessage
+ * @param bool $showErrorMessage
* @return static this document
*/
public function showErrorMessage($showErrorMessage = true);
/**
* Sets if the global form success message should be shown.
*
- * @param boolean $showSuccessMessage
+ * @param bool $showSuccessMessage
* @return static this document
*/
public function showSuccessMessage($showSuccessMessage = true);
*
* By default, the global form error message is shown.
*
- * @return boolean
+ * @return bool
*/
public function showsErrorMessage();
*
* By default, the global form error message is not shown.
*
- * @return boolean
+ * @return bool
*/
public function showsSuccessMessage();
/**
* `true` this button is an `input[type=submit]` element and `false` if it is a `button` element
- * @var boolean
+ * @var bool
*/
protected $submit = false;
* Returns `true` this button is an `input[type=submit]` element and `false` if it is a `button`
* element.
*
- * @return boolean
+ * @return bool
*/
public function isSubmit();
/**
* Sets whether this button is an `input[type=submit]` element or a `button` element.
*
- * @param boolean $submitButton
+ * @param bool $submitButton
* @return static this form button
*/
public function submit($submitButton = true);
/**
* is `true` if the links in the tab menu have anchors
- * @var boolean
+ * @var bool
*/
protected $useAnchors = true;
/**
* Sets if the links in the tab menu have anchors and returns this form container.
*
- * @param boolean $useAnchors
+ * @param bool $useAnchors
* @return TabMenuFormContainer this form container
*/
public function useAnchors($useAnchors = true) {
*
* By default, the links in the tab menu have anchors.
*
- * @return boolean
+ * @return bool
*/
public function usesAnchors() {
return $this->useAnchors;
/**
* is `true` if the wysiwyg form field will support mentions, otherwise `false`
- * @var boolean
+ * @var bool
*/
protected $supportMentions = false;
/**
* is `true` if quotes are supported for this container, otherwise `false`
- * @var boolean
+ * @var bool
*/
protected $supportQuotes = false;
/**
* is `true` if smilies are supported for this container, otherwise `false`
- * @var boolean
+ * @var bool
*/
protected $supportSmilies = true;
*
* By default, mentions are not supported.
*
- * @param boolean $supportMentions
+ * @param bool $supportMentions
* @return WysiwygFormContainer this form container
*/
public function supportMentions($supportMentions = true) {
*
* By default, quotes are not supported.
*
- * @param boolean $supportQuotes
+ * @param bool $supportQuotes
* @return WysiwygFormContainer this form container
*/
public function supportQuotes($supportQuotes = true) {
*
* By default, smilies are supported.
*
- * @param boolean $supportSmilies
+ * @param bool $supportSmilies
* @return WysiwygFormContainer this form container
*/
public function supportSmilies($supportSmilies = true) {
* This flag indicates whether only images can uploaded via this field.
* <strong>Heads up:</strong> SVG images can contain bad code, therefore do not
* use this option, outside the acp or check the file whether remote code is contained.
- * @var boolean
+ * @var bool
*/
protected $imageOnly = false;
/**
* This flag indicates whether SVG images are treated as image in the image only mode.
- * @var boolean
+ * @var bool
*/
protected $allowSvgImage = false;
/**
* Returns true, iff the current field is already registered.
*
- * @return boolean
+ * @return bool
*/
private function isRegistered() {
return $this->isPopulated;
* If set to `true` will also set the acceptable types to `image/*`. If set to
* false it will clear the acceptable types if they are `image/*`.
*
- * @param boolean $imageOnly
+ * @param bool $imageOnly
* @return static this field
*
* @throws \InvalidArgumentException if the field is not set to images only and a minimum/maximum width/height is set
* <strong>Heads up:</strong> SVG images can contain bad code, therefore do not
* use this option, outside the acp or check the file whether remote code is contained.
*
- * @param boolean $allowSvgImages
+ * @param bool $allowSvgImages
* @return static this field
*
* @throws \BadMethodCallException if the imageOnly flag isn't set to true
/**
* Returns `true` if only images can be uploaded via this field and returns `false` otherwise.
*
- * @return boolean
+ * @return bool
*/
public function isImageOnly() {
return $this->imageOnly;
/**
* Returns true, if the field can contain svg images in the image only mode.
*
- * @return boolean
+ * @return bool
*/
public function svgImageAllowed() {
return $this->allowSvgImage;
/**
* is `true` if only images can be selected and `false` otherwise
- * @var boolean
+ * @var bool
*/
protected $imageOnly = false;
/**
* Sets if only images can be selected and returns this field.
*
- * @param boolean $imageOnly
+ * @param bool $imageOnly
* @return static this field
*/
public function imageOnly($imageOnly = true) {
*
* By default, all images can be selected.
*
- * @return boolean
+ * @return bool
*/
public function isImageOnly() {
return $this->imageOnly;
/**
* is `true` if this form field supports attachments, otherwise `false`
- * @var boolean
+ * @var bool
*/
protected $supportAttachments = false;
/**
* is `true` if this form field supports mentions, otherwise `false`
- * @var boolean
+ * @var bool
*/
protected $supportMentions = false;
/**
* is `true` if this form field supports quotes, otherwise `false`
- * @var boolean
+ * @var bool
*/
protected $supportQuotes = false;
/**
* Sets if the form field supports attachments and returns this field.
*
- * @param boolean $supportAttachments
+ * @param bool $supportAttachments
* @return WysiwygFormField this field
*/
public function supportAttachments($supportAttachments = true) {
/**
* Sets if the form field supports mentions and returns this field.
*
- * @param boolean $supportMentions
+ * @param bool $supportMentions
* @return WysiwygFormField this field
*/
public function supportMentions($supportMentions = true) {
/**
* Sets if the form field supports quotes and returns this field.
*
- * @param boolean $supportQuotes
+ * @param bool $supportQuotes
* @return WysiwygFormField this field
*/
public function supportQuotes($supportQuotes = true) {
*
* By default, attachments are not supported.
*
- * @return boolean
+ * @return bool
*/
public function supportsAttachments() {
return $this->supportAttachments;
*
* By default, mentions are not supported.
*
- * @return boolean
+ * @return bool
*/
public function supportsMentions() {
return $this->supportMentions;
*
* By default, quotes are not supported.
*
- * @return boolean
+ * @return bool
*/
public function supportsQuotes() {
return $this->supportQuotes;
/**
* skip the HTML filter during message reprocessing
- * @var boolean
+ * @var bool
*/
protected $skipFilter = false;
* @param string $html html string
* @param string $objectType object type identifier
* @param int $objectID object id
- * @param boolean $convertFromBBCode interpret input as bbcode
+ * @param bool $convertFromBBCode interpret input as bbcode
*/
public function process($html, $objectType, $objectID = 0, $convertFromBBCode = false) {
$this->reset();
/**
* Returns true if the message appears to be empty.
*
- * @return boolean true if message appears to be empty
+ * @return bool true if message appears to be empty
*/
public function appearsToBeEmpty() {
return $this->getHtmlInputNodeProcessor()->appearsToBeEmpty();
/**
* Returns true if the message appears to be empty.
*
- * @return boolean true if message appears to be empty
+ * @return bool true if message appears to be empty
*/
public function appearsToBeEmpty() {
if ($this->getTextContent() !== '') {
*
* @param \DOMText $text text node
* @param string $value node value
- * @param boolean $allowURL url bbcode is allowed
- * @param boolean $allowMedia media bbcode is allowed
+ * @param bool $allowURL url bbcode is allowed
+ * @param bool $allowMedia media bbcode is allowed
* @return string modified node value with replacement placeholders
*/
protected function parseURL(\DOMText $text, $value, $allowURL, $allowMedia) {
* auto-detection of content.
*
* @param \DOMText $text text node
- * @return boolean true if text node is inside a code element
+ * @return bool true if text node is inside a code element
*/
protected function hasCodeParent(\DOMText $text) {
$parent = $text;
* being recognized as a link again.
*
* @param \DOMText $text text node
- * @return boolean true if text node is inside a link
+ * @return bool true if text node is inside a link
*/
protected function hasLinkParent(\DOMText $text) {
$parent = $text;
* colons, that have been incorrectly matched.
*
* @param string $match matched username
- * @param boolean $trimTrailingSpecialCharacters true to strip special characters found at the end of the match
+ * @param bool $trimTrailingSpecialCharacters true to strip special characters found at the end of the match
* @return string sanitized username
*/
public function getUsername($match, $trimTrailingSpecialCharacters = true) {
* Returns `true` if the given element is inside a code element.
*
* @param \DOMElement $element
- * @return boolean
+ * @return bool
*/
protected function isInsideCode(\DOMElement $element) {
$parent = $element;
* Returns true if provided node is a block element.
*
* @param \DOMNode $node node
- * @return boolean true for certain block elements
+ * @return bool true for certain block elements
*/
protected function isBlockElement(\DOMNode $node) {
switch ($node->nodeName) {
* Validates attributes before any DOM modification occurs.
*
* @param array $attributes list of attributes
- * @return boolean false if attributes did not match the converter's expectation
+ * @return bool false if attributes did not match the converter's expectation
*/
public function validateAttributes(array $attributes);
}
* with nested lists handled in the wrong order.
*
* @param \DOMNode $node target node
- * @return boolean true if provided node is within another list
+ * @return bool true if provided node is within another list
*/
protected function isInsideList(\DOMNode $node) {
/** @var \DOMElement $parent */
* with nested tables handled in the wrong order.
*
* @param \DOMNode $node target node
- * @return boolean true if provided node is within another table
+ * @return bool true if provided node is within another table
*/
protected function isInsideTable(\DOMNode $node) {
/** @var \DOMElement $parent */
*
* @param \DOMElement $element target element
* @param string $text text used to replace target
- * @param boolean $isBlockElement true if element is a block element
+ * @param bool $isBlockElement true if element is a block element
*/
public function replaceElementWithText(\DOMElement $element, $text, $isBlockElement) {
$textNode = $element->ownerDocument->createTextNode($text);
* @param string $html html string
* @param string $objectType object type identifier
* @param int $objectID object id
- * @param boolean $doKeywordHighlighting enable keyword highlighting
+ * @param bool $doKeywordHighlighting enable keyword highlighting
* @param int $languageID content language id
*/
public function process($html, $objectType, $objectID, $doKeywordHighlighting = true, $languageID = null) {
* and whitelisted ones with wildcard support.
*
* @param string $hostname
- * @return boolean
+ * @return bool
*/
protected function bypassProxy($hostname) {
static $matcher = null;
/**
* enables keyword highlighting
- * @var boolean
+ * @var bool
*/
protected $keywordHighlighting = true;
/**
* Enables the keyword highlighting.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableKeywordHighlighting($enable = true) {
$this->keywordHighlighting = $enable;
* auto-detection of content.
*
* @param \DOMText $text text node
- * @return boolean true if text node is inside a code element
+ * @return bool true if text node is inside a code element
*/
protected function hasCodeParent(\DOMText $text) {
$parent = $text;
* @param string $objectType object type identifier
* @param int $objectID object id
* @param string $message message content
- * @return boolean true if there is at least one embedded content found
+ * @return bool true if there is at least one embedded content found
*/
public function parse($objectType, $objectID, $message) {
preg_match_all($this->regexHandlers, $message, $matches);
/**
* Returns whether the given image is a valid GD resource / GD object
*
- * @return boolean
+ * @return bool
*/
public function isImage($image) {
return (is_resource($image) && get_resource_type($image) === 'gd') || (is_object($image) && $image instanceof \GdImage);
* @param int $src_w source width
* @param int $src_h source height
* @param int $pct opacity percent
- * @return boolean
+ * @return bool
*/
private function imagecopymerge_alpha($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct) { // phpcs:ignore
if (!isset($pct)) {
*
* @param int $maxWidth
* @param int $maxHeight
- * @param boolean $preserveAspectRatio
+ * @param bool $preserveAspectRatio
* @return mixed
*/
public function createThumbnail($maxWidth, $maxHeight, $preserveAspectRatio = true);
* @param string $font path to TrueType font file
* @param int $size font size
* @return int
- * @return boolean
+ * @return bool
*/
public function textFitsImage($text, $margin, $font, $size);
/**
* Returns true if a color has been set.
*
- * @return boolean
+ * @return bool
*/
public function hasColor();
/**
* Determines if an image adapter is supported.
*
- * @return boolean
+ * @return bool
*/
public static function isSupported();
}
* @param int $width
* @param int $height
* @param string $mimeType
- * @return boolean
+ * @return bool
*/
public function checkMemoryLimit($width, $height, $mimeType);
}
/**
* is true if the used configuration can write animated GIF files if the
* PHP Imagick API version is 3.1.0 RC 1
- * @var boolean
+ * @var bool
*/
protected $supportsWritingAnimatedGIF = true;
* @param string $message
* @param int $oldID
* @param int $newID
- * @return string|boolean
+ * @return string|bool
*/
protected function fixEmbeddedAttachments($message, $oldID, $newID) {
if (mb_strripos($message, '[attach]'.$oldID.'[/attach]') !== false || mb_strripos($message, '[attach='.$oldID.']') !== false || mb_strripos($message, '[attach='.$oldID.',') !== false) {
/**
* AtomicWriter will be unusable, once this flag is true.
- * @var boolean
+ * @var bool
*/
protected $isFlushed = false;
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package WoltLabSuite\Core\System\Io
*
- * @method boolean close()
- * @method boolean eof()
+ * @method bool close()
+ * @method bool eof()
* @method int filesize()
* @method string gets($length = null)
* @method resource open($mode, $use_include_path = false, $context = null)
* @method int seek($offset, $whence = SEEK_SET)
* @method array stat()
* @method int tell()
- * @method boolean touch($time = 0, $atime = 0) note: default value of `$time` actually is `time()`
+ * @method bool touch($time = 0, $atime = 0) note: default value of `$time` actually is `time()`
* @method int write($string, $length = null)
*/
class File {
* @package WoltLabSuite\Core\System\Io
*
* @method resource open($mode, $use_include_path = 0)
- * @method boolean rewind()
+ * @method bool rewind()
*/
class GZipFile extends File {
/**
* checks if gz*64 functions are available instead of gz*
* https://bugs.php.net/bug.php?id=53829
- * @var boolean
+ * @var bool
*/
protected static $gzopen64 = null;
*
* @param mixed $index index or name of the requested file
* @param string $destination
- * @return boolean $success
+ * @return bool $success
*/
public function extract($index, $destination);
/**
* true if PHP supports SSL/TLS
- * @var boolean
+ * @var bool
*/
private static $hasSSLSupport = null;
* Switches TLS support for this connection.
* Usually used in combination with 'STARTTLS'
*
- * @param boolean $enable Whether TLS support should be enabled
- * @return boolean True on success, false otherwise
+ * @param bool $enable Whether TLS support should be enabled
+ * @return bool True on success, false otherwise
*/
public function setTLS($enable) {
if (!$this->hasTLSSupport()) return false;
/**
* Returns whether TLS support is available.
*
- * @return boolean
+ * @return bool
*/
public function hasTLSSupport() {
return function_exists('stream_socket_enable_crypto');
/**
* Returns true if PHP supports SSL/TLS.
*
- * @return boolean
+ * @return bool
*/
public static function supportsSSL() {
if (static::$hasSSLSupport === null) {
/**
* indicates if tar file is opened
- * @var boolean
+ * @var bool
*/
protected $opened = false;
/**
* indicates if file content has been read
- * @var boolean
+ * @var bool
*/
protected $read = false;
/**
* indicates if the tar file is (g)zipped
- * @var boolean
+ * @var bool
*/
protected $isZipped = false;
* Unpacks file header for one file entry.
*
* @param string $binaryData
- * @return array|boolean
+ * @return array|bool
*/
protected function readHeader($binaryData) {
if (strlen($binaryData) != 512) {
/**
* Returns true if this tar is (g)zipped.
*
- * @return boolean
+ * @return bool
*/
public function isZipped() {
return $this->isZipped;
* Creates a new TarWriter object.
*
* @param string $archiveName
- * @param boolean $compress enables gzip compression
+ * @param bool $compress enables gzip compression
*/
public function __construct($archiveName, $compress = false) {
$this->archiveName = $archiveName;
*
* @param string $filename
* @param string $string file content
- * @return boolean result
+ * @return bool result
*/
public function addString($filename, $string) {
if (empty($filename)) return false;
* @param mixed $files
* @param string $addDir
* @param string $removeDir
- * @return boolean result
+ * @return bool result
* @throws SystemException
*/
public function add($files, $addDir = '', $removeDir = '') {
* @param string $filename
* @param string $addDir
* @param string $removeDir
- * @return boolean result
+ * @return bool result
*/
protected function addFile($filename, $addDir, $removeDir) {
$filename = FileUtil::unifyDirSeparator($filename);
*
* @param string $filename
* @param string $storedFilename
- * @return boolean result
+ * @return bool result
*/
protected function writeFileHeader($filename, $storedFilename) {
$fileInfo = stat($filename);
* @param string $typeFlag
* @param int $uid
* @param int $gid
- * @return boolean
+ * @return bool
*/
public function writeHeaderBlock($filename, $size, $mtime = 0, $permissions = 0, $typeFlag = '', $uid = 0, $gid = 0) {
if (strlen($filename) > 99) {
* Writes a long header block.
*
* @param string $filename
- * @return boolean
+ * @return bool
*/
protected function writeLongHeaderBlock($filename) {
$size = sprintf("%11s ", decoct(strlen($filename)));
* This does not change the position of the file-pointer.
*
* @param int $offset where to start reading
- * @return boolean
+ * @return bool
* @throws SystemException
*/
public function isFile($offset = null) {
* @param int[] $labelIDs
* @param int $objectTypeID
* @param int $objectID
- * @param boolean $validatePermissions
+ * @param bool $validatePermissions
*/
public function setLabels(array $labelIDs, $objectTypeID, $objectID, $validatePermissions = true) {
// get accessible label ids to prevent inaccessible ones to be removed
*
* @param int $objectTypeID
* @param int[] $objectIDs
- * @param boolean $validatePermissions
+ * @param bool $validatePermissions
* @return Label[][]
*/
public function getAssignedLabels($objectTypeID, array $objectIDs, $validatePermissions = true) {
* Returns given label groups by id.
*
* @param int[] $groupIDs
- * @param boolean $validatePermissions
+ * @param bool $validatePermissions
* @param string $permission
* @return ViewableLabelGroup[]
* @throws SystemException
*
* @param int[] $labelIDs
* @param string $optionName
- * @param boolean $legacyReturnValue
+ * @param bool $legacyReturnValue
* @return mixed
*/
public function validateLabelIDs(array $labelIDs, $optionName = '', $legacyReturnValue = true);
*
* @param int[] $labelIDs
* @param int $objectID
- * @param boolean $validatePermissions
+ * @param bool $validatePermissions
* @see \wcf\system\label\LabelHandler::setLabels()
*/
public function setLabels(array $labelIDs, $objectID, $validatePermissions = true);
* Removes all assigned labels.
*
* @param int $objectID
- * @param boolean $validatePermissions
+ * @param bool $validatePermissions
* @see \wcf\system\label\LabelHandler::removeLabels()
*/
public function removeLabels($objectID, $validatePermissions = true);
* Returns a list of assigned labels.
*
* @param int[] $objectIDs
- * @param boolean $validatePermissions
+ * @param bool $validatePermissions
* @return Label[]
*/
public function getAssignedLabels(array $objectIDs, $validatePermissions = true);
/**
* object type is a category
- * @var boolean
+ * @var bool
*/
public $isCategory = false;
* @param string $label
* @param int $objectID
* @param int $depth
- * @param boolean $isCategory
+ * @param bool $isCategory
*/
public function __construct($label, $objectID = 0, $depth = 0, $isCategory = false) {
$this->depth = $depth;
/**
* Returns true, if object type is a category.
*
- * @return boolean
+ * @return bool
*/
public function isCategory() {
return $this->isCategory;
* Registers a new element id, returns false if element id is already set.
*
* @param string $elementID
- * @return boolean
+ * @return bool
*/
public function register($elementID) {
if (in_array($elementID, $this->elementIDs)) {
* Returns true if given element has disabled i18n functionality.
*
* @param string $elementID
- * @return boolean
+ * @return bool
*/
public function isPlainValue($elementID) {
if (isset($this->plainValues[$elementID])) {
* Returns true if given element has enabled i18n functionality.
*
* @param string $elementID
- * @return boolean
+ * @return bool
*/
public function hasI18nValues($elementID) {
if (isset($this->i18nValues[$elementID])) {
*
* @param string $elementID
* @param string $plainValue
- * @param boolean $forceAsPlainValue if `true`, the value is added as a plain value in any case
+ * @param bool $forceAsPlainValue if `true`, the value is added as a plain value in any case
* @throws SystemException
*/
public function setValue($elementID, $plainValue, $forceAsPlainValue = false) {
* Returns true if the value with the given id is valid.
*
* @param string $elementID
- * @param boolean $requireI18n
- * @param boolean $permitEmptyValue
- * @return boolean
+ * @param bool $requireI18n
+ * @param bool $permitEmptyValue
+ * @return bool
*/
public function validateValue($elementID, $requireI18n = false, $permitEmptyValue = false) {
// do not force i18n if only one language is available
* Assigns element values to template. Using request data once reading
* initial database data is explicitly disallowed.
*
- * @param boolean $useRequestData
+ * @param bool $useRequestData
*/
public function assignVariables($useRequestData = true) {
$elementValues = [];
* Returns true if given string equals a language variable.
*
* @param string $string
- * @return boolean
+ * @return bool
*/
protected function isLanguageVariable($string) {
if ($this->regex === null) {
* Returns true if given flag is set.
*
* @param int $flag
- * @return boolean
+ * @return bool
*/
public function getFlag($flag) {
return (($this->flags & $flag) === $flag);
* Returns true if the language category with the given name exists.
*
* @param string $categoryName
- * @return boolean
+ * @return bool
*/
public function isValidCategory($categoryName) {
return isset($this->cache['categories'][$categoryName]);
/**
* Returns true if multilingualism is enabled.
*
- * @return boolean
+ * @return bool
*/
public function multilingualismEnabled() {
return $this->cache['multilingualismEnabled'];
* Checks the options and permissions of given menu item.
*
* @param ITreeMenuItem $item
- * @return boolean
+ * @return bool
*/
protected function checkMenuItem(ITreeMenuItem $item) {
// check the options of this item
/**
* Returns true if the associated menu item should be visible for the active user.
*
- * @return boolean
+ * @return bool
*/
public function isVisible();
* Checks the options and permissions of given menu item.
*
* @param UserProfileMenuItem $item
- * @return boolean
+ * @return bool
*/
protected function checkMenuItem(UserProfileMenuItem $item) {
return $item->validateOptions() && $item->validatePermissions();
* Sets active menu item.
*
* @param string $menuItem
- * @return boolean
+ * @return bool
*/
public function setActiveMenuItem($menuItem) {
foreach ($this->menuItems as $item) {
* Returns true if the associated menu item should be visible for the active user.
*
* @param int $userID
- * @return boolean
+ * @return bool
*/
public function isVisible($userID);
}
*
* @param int $index
* @param string $search
- * @return boolean
+ * @return bool
*/
protected function lookBehind($index, $search) {
if (isset($this->words[$index])) {
* Registers the embedded objects found in given message.
*
* @param HtmlInputProcessor $htmlInputProcessor html input processor instance holding embedded object data
- * @param boolean $isBulk true for bulk operations
- * @return boolean true if at least one embedded object was found
+ * @param bool $isBulk true for bulk operations
+ * @return bool true if at least one embedded object was found
*/
public function registerObjects(HtmlInputProcessor $htmlInputProcessor, $isBulk = false) {
$context = $htmlInputProcessor->getContext();
* @param string $messageObjectType object type identifier
* @param int $messageID object id
* @param int[][] $embeddedContent list of object ids for embedded objects by object type id
- * @return boolean true if at least one embedded object was found
+ * @return bool true if at least one embedded object was found
*/
public function registerSimpleObjects($messageObjectType, $messageID, array $embeddedContent) {
$messageObjectTypeID = ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message', $messageObjectType);
* Renders a template for given quotes.
*
* @param array $data
- * @param boolean $supportPaste
+ * @param bool $supportPaste
* @return string
*/
public function render(array $data, $supportPaste = false);
* Renders a list of quotes for insertation.
*
* @param mixed[][] $data
- * @param boolean $render
+ * @param bool $render
* @return string[]
*/
public function renderQuotes(array $data, $render = true);
* @param int $objectID
* @param string $message
* @param string $fullQuote
- * @param boolean $returnFalseIfExists
+ * @param bool $returnFalseIfExists
* @return mixed
* @throws SystemException
*/
* Removes a quote from storage and returns true if the quote has successfully been removed.
*
* @param string $quoteID
- * @return boolean
+ * @return bool
*/
public function removeQuote($quoteID) {
if (!isset($this->quoteData[$quoteID])) {
/**
* Returns a list of quotes.
*
- * @param boolean $supportPaste
+ * @param bool $supportPaste
* @return string
*/
public function getQuotes($supportPaste = false) {
*
* @param string $objectType
* @param int[] $objectIDs
- * @param boolean $markForRemoval
+ * @param bool $markForRemoval
* @return string[]
*/
public function getQuotesByObjectIDs($objectType, array $objectIDs, $markForRemoval = true) {
*
* @param string $objectType
* @param int $parentObjectID
- * @param boolean $markForRemoval
+ * @param bool $markForRemoval
* @return string[]
*/
public function getQuotesByParentObjectID($objectType, $parentObjectID, $markForRemoval = true) {
* Returns a quote by id.
*
* @param string $quoteID
- * @param boolean $useFullQuote
+ * @param bool $useFullQuote
* @return string
*/
public function getQuote($quoteID, $useFullQuote = true) {
*
* @param IMessage $message
* @param string $text
- * @param boolean $renderAsString
+ * @param bool $renderAsString
* @return array|string
*/
public function renderQuote(IMessage $message, $text, $renderAsString = true) {
* Returns true if a quote id represents a full quote.
*
* @param string $quoteID
- * @return boolean
+ * @return bool
*/
public function isFullQuote($quoteID) {
return isset($this->quoteData[$quoteID . '_fq']);
* @method string getTitle()
* @method int getUserID()
* @method string getUsername()
- * @method boolean isVisible()
+ * @method bool isVisible()
*/
class QuotedMessage implements \Countable, \Iterator {
/**
/**
* overrides full quote flag
- * @var boolean[]
+ * @var bool[]
*/
public $overrideIsFullQuote = [];
* Overrides the full quote flag.
*
* @param string $quoteID
- * @param boolean $overrideIsFullQuote
+ * @param bool $overrideIsFullQuote
*/
public function setOverrideIsFullQuote($quoteID, $overrideIsFullQuote) {
$this->overrideIsFullQuote[$quoteID] = $overrideIsFullQuote;
* Returns true if given quote id represents a full quote.
*
* @param string $quoteID
- * @return boolean
+ * @return bool
*/
public function isFullQuote($quoteID) {
if (isset($this->overrideIsFullQuote[$quoteID])) {
* Returns true if given object id is valid.
*
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function isValid($objectID);
* Returns true if the affected content may be removed.
*
* @param ModerationQueue $queue
- * @return boolean
+ * @return bool
*/
public function canRemoveContent(ModerationQueue $queue);
*
* @param ModerationQueue $queue
* @param int $userID
- * @return boolean
+ * @return bool
*/
public function isAffectedUser(ModerationQueue $queue, $userID);
*
* @param string $objectType
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function isValid($objectType, $objectID = null);
* Returns whether the affected content may be removed.
*
* @param ModerationQueue $queue
- * @return boolean
+ * @return bool
*/
public function canRemoveContent(ModerationQueue $queue);
*
* @param string $definitionName
* @param string $objectType
- * @return boolean
+ * @return bool
*/
public function isValid($definitionName, $objectType) {
if (!isset($this->objectTypeNames[$definitionName])) {
/**
* Returns the count of unread moderation queue items.
*
- * @param boolean $skipCache
+ * @param bool $skipCache
* @return int
*/
public function getUnreadModerationCount($skipCache = false) {
/**
* Saves moderation queue assignments.
*
- * @param boolean[] $assignments
+ * @param bool[] $assignments
*/
public function setAssignment(array $assignments) {
$sql = "INSERT IGNORE INTO wcf".WCF_N."_moderation_queue_to_user
*
* @param string $objectType
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function isAlreadyReported($objectType, $objectID) {
$objectTypeID = $this->getObjectTypeID($objectType);
*
* @param string $objectType
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function hasPendingReport($objectType, $objectID) {
$objectTypeID = $this->getObjectTypeID($objectType);
*
* @param string $objectType
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function canReport($objectType, $objectID) {
return $this->getProcessor($objectType)->canReport($objectID);
* Returns true if current user can report given content.
*
* @param int $objectID
- * @return boolean
+ * @return bool
*/
public function canReport($objectID);
/**
* suppresses display of notices
- * @var boolean
+ * @var bool
*/
protected static $disableNotices = false;
abstract class AbstractOptionType implements IOptionType {
/**
* internationalization support
- * @var boolean
+ * @var bool
*/
protected $supportI18n = false;
/**
* Creates a new option handler instance.
*
- * @param boolean $supportI18n
+ * @param bool $supportI18n
* @param string $languageItemPattern
* @param string $categoryName
*/
* Returns a list with the options of a specific option category.
*
* @param string $categoryName
- * @param boolean $inherit
+ * @param bool $inherit
* @return array
*/
public function getCategoryOptions($categoryName = '', $inherit = true);
/**
* Returns true if options supports internationalization.
*
- * @return boolean
+ * @return bool
*/
public function supportI18n();
/**
* Returns true if option's label is hidden in search form.
*
- * @return boolean
+ * @return bool
*/
public function hideLabelInSearch();
* @param User $user
* @param Option $option
* @param mixed $value
- * @return boolean
+ * @return bool
*/
public function checkUser(User $user, Option $option, $value);
* @param PreparedStatementConditionBuilder $conditions
* @param Option $option
* @param mixed $value
- * @return boolean
+ * @return bool
*/
public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value);
}
/**
* true, if options support i18n
- * @var boolean
+ * @var bool
*/
public $supportI18n = false;
/**
* cache initialization state
- * @var boolean
+ * @var bool
*/
public $didInit = false;
* Checks the required permissions and options of a category.
*
* @param OptionCategory $category
- * @return boolean
+ * @return bool
*/
protected function checkCategory(OptionCategory $category) {
if (!$category->validateOptions() || !$category->validatePermissions()) {
* Checks the required permissions and options of an option.
*
* @param Option $option
- * @return boolean
+ * @return bool
*/
protected function checkOption(Option $option) {
return $option->validateOptions() && $option->validatePermissions() && $this->checkVisibility($option);
* Checks visibility of an option.
*
* @param Option $option
- * @return boolean
+ * @return bool
*/
protected function checkVisibility(Option $option) {
if (!$option->isVisible()) {
/**
* true if within registration process
- * @var boolean
+ * @var bool
*/
public $inRegistration = false;
/**
* true if within edit mode
- * @var boolean
+ * @var bool
*/
public $editMode = true;
/**
* true if within search mode
- * @var boolean
+ * @var bool
*/
public $searchMode = false;
/**
* true if empty options should be removed
- * @var boolean
+ * @var bool
*/
public $removeEmptyOptions = false;
/**
* true if the condition mode during search mode is enabled
- * @var boolean
+ * @var bool
*/
public $conditionMode = false;
/**
* Shows empty options.
*
- * @param boolean $show
+ * @param bool $show
*/
public function showEmptyOptions($show = true) {
$this->removeEmptyOptions = !$show;
/**
* Sets registration mode.
*
- * @param boolean $inRegistration
+ * @param bool $inRegistration
*/
public function setInRegistration($inRegistration = true) {
$this->inRegistration = $inRegistration;
/**
* Enables edit mode.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableEditMode($enable = true) {
$this->editMode = $enable;
/**
* Enables search mode.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableSearchMode($enable = true) {
$this->searchMode = $enable;
* are considered. Furthermore, the visibility setting of the option is disregarded to ensure that
* during automatic cronjob execution (always done as a guest), the conditions are properly set.
*
- * @param boolean $enable
+ * @param bool $enable
*/
public function enableConditionMode($enable = true) {
if (!$this->searchMode) {
/**
* true if current user can edit every user group
- * @var boolean
+ * @var bool
*/
protected $isAdmin = null;
/**
* Returns true if current user has the permissions to edit every user group.
*
- * @return boolean
+ * @return bool
*/
protected function isAdmin() {
if ($this->isAdmin === null) {
class ACPTemplatesFileHandler extends PackageInstallationFileHandler {
/**
* template type supports template groups
- * @var boolean
+ * @var bool
*/
protected $supportsTemplateGroups = false;
/**
* Returns true if the package archive supports a new installation.
*
- * @return boolean
+ * @return bool
*/
public function isValidInstall() {
return !empty($this->instructions['install']);
* the package that is about to be updated.
*
* @param Package $package
- * @return boolean isValidUpdate
+ * @return bool isValidUpdate
*/
public function isValidUpdate(Package $package = null) {
if ($this->package === null && $package !== null) {
* possible to install non-applications multiple times within the
* same environment.
*
- * @return boolean
+ * @return bool
*/
public function isAlreadyInstalled() {
$sql = "SELECT COUNT(*)
/**
* Returns true if the package is an application and has an unique abbreviation.
*
- * @return boolean
+ * @return bool
*/
public function hasUniqueAbbreviation() {
if (!$this->packageInfo['isApplication']) {
* Validates if an function exists and is not blacklisted by suhosin extension.
*
* @param string $function
- * @return boolean
+ * @return bool
* @see http://de.php.net/manual/en/function.function-exists.php#77980
*/
protected static function functionExists($function) {
* @param string $setting
* @param string $value
* @param mixed $compareValue
- * @return boolean
+ * @return bool
*/
protected static function compareSetting($setting, $value, $compareValue) {
if ($compareValue === false) return false;
*
* @param PackageInstallationQueue $queue
* @param string $formName
- * @return boolean
+ * @return bool
*/
public static function findForm(PackageInstallationQueue $queue, $formName) {
$sql = "SELECT COUNT(*)
class PackageInstallationNodeBuilder {
/**
* true if current node is empty
- * @var boolean
+ * @var bool
*/
public $emptyNode = true;
/**
* activates the testing mode
- * @var boolean
+ * @var bool
*/
protected $test = false;
/**
* Builds the stack of package installations / updates.
*
- * @param boolean $validateInstallInstructions
+ * @param bool $validateInstallInstructions
*/
public function buildPackageInstallationStack($validateInstallInstructions = false) {
foreach ($this->selectedPackages as $package => $version) {
*
* @param string $package package identifier
* @param string $minversion preferred package version
- * @param boolean $installOldVersion true, if you want to install the package in the given minversion and not in the newest version
- * @param boolean $validateInstallInstructions
+ * @param bool $installOldVersion true, if you want to install the package in the given minversion and not in the newest version
+ * @param bool $validateInstallInstructions
*/
protected function tryToInstallPackage($package, $minversion = '', $installOldVersion = false, $validateInstallInstructions = false) {
// check virtual package version
* @param string $package package identifier
* @param string $version package version
* @param int $stackPosition
- * @param boolean $validateInstallInstructions
+ * @param bool $validateInstallInstructions
*/
protected function installPackage($package, $version = '', $stackPosition = -1, $validateInstallInstructions = false) {
// get package update versions
*
* @param string $package package identifier
* @param array $packageUpdateVersions package update versions
- * @param boolean $validateInstallInstructions
+ * @param bool $validateInstallInstructions
* @return string tmp filename of a downloaded package
* @throws PackageUpdateUnauthorizedException
* @throws SystemException
*
* @param string $package package identifier
* @param string $version package version
- * @return string|boolean
+ * @return string|bool
*/
protected function getCachedDownload($package, $version) {
$cachedDownloads = WCF::getSession()->getVar('cachedPackageUpdateDownloads');
/**
* indicates if current current node should be splitted
- * @var boolean
+ * @var bool
*/
protected $splitNode = false;
/**
* Returns true if current step holds a form document object.
*
- * @return boolean
+ * @return bool
*/
public function hasDocument() {
return ($this->document !== null);
/**
* Returns true if node should be splitted.
*
- * @return boolean
+ * @return bool
*/
public function splitNode() {
return $this->splitNode;
/**
* is true if the package's uninstall script has been executed or if no
* such script exists
- * @var boolean
+ * @var bool
*/
protected $didExecuteUninstallScript = false;
*
* @param string $targetDir
* @param string[] $files
- * @param boolean $deleteEmptyDirectories
- * @param boolean $deleteEmptyTargetDir
+ * @param bool $deleteEmptyDirectories
+ * @param bool $deleteEmptyTargetDir
*/
public function deleteFiles($targetDir, $files, $deleteEmptyTargetDir = false, $deleteEmptyDirectories = true) {
new Uninstaller($targetDir, $files, $deleteEmptyTargetDir, $deleteEmptyDirectories);
* Refreshes the package database.
*
* @param int[] $packageUpdateServerIDs
- * @param boolean $ignoreCache
+ * @param bool $ignoreCache
*/
public function refreshPackageDatabase(array $packageUpdateServerIDs = [], $ignoreCache = false) {
// get update server data
* Fetches the package_update.xml from an update server.
*
* @param PackageUpdateServer $updateServer
- * @param boolean $forceHTTP
+ * @param bool $forceHTTP
* @throws PackageUpdateUnauthorizedException
* @throws SystemException
*/
/**
* Returns a list of available updates for installed packages.
*
- * @param boolean $removeRequirements
- * @param boolean $removeOlderMinorReleases
+ * @param bool $removeRequirements
+ * @param bool $removeOlderMinorReleases
* @return array
* @throws SystemException
*/
* languages, optionally returning only the best matching value.
*
* @param string[] $values list of values by language code
- * @param boolean $singleValueOnly true to return only the best matching value
+ * @param bool $singleValueOnly true to return only the best matching value
* @return string[]|string matching i18n values controller by `$singleValueOnly`
* @since 3.0
*/
* Returns true if the uninstallation of the given package should execute
* this plugin.
*
- * @return boolean
+ * @return bool
*/
public function hasUninstall();
*
* @param PackageArchive $packageArchive
* @param string $instruction
- * @return boolean
+ * @return bool
*/
public static function isValid(PackageArchive $packageArchive, $instruction);
}
/**
* Returns the xml objects for this pip.
*
- * @param boolean $createXmlFiles if `true` and if a relevant XML file does not exist, it is created
+ * @param bool $createXmlFiles if `true` and if a relevant XML file does not exist, it is created
* @return XML[]
*/
protected function getProjectXmls($createXmlFiles = false) {
*
* @param int $validationMode
* @param string $requiredVersion
- * @return boolean
+ * @return bool
*/
public function validate($validationMode, $requiredVersion = '') {
if ($validationMode !== PackageValidationManager::VALIDATION_EXCLUSION) {
* be performed afterwards.
*
* @param string $archive
- * @param boolean $deepInspection
- * @return boolean
+ * @param bool $deepInspection
+ * @return bool
*/
public function validate($archive, $deepInspection) {
$this->virtualPackageList = [];
*
* @param string $package
* @param string $packageVersion
- * @return boolean
+ * @return bool
*/
public function addVirtualPackage($package, $packageVersion) {
if (isset($this->virtualPackageList[$package])) {
* @param PackageArchive $archive
* @param string $pip
* @param string $instruction
- * @return boolean
+ * @return bool
*/
public function validatePackageInstallationPluginInstruction(PackageArchive $archive, $pip, $instruction) {
if (isset($this->packageInstallationPlugins[$pip])) {
class PageLocationManager extends SingletonFactory {
/**
* true if all parents of the highest page have been added
- * @var boolean
+ * @var bool
*/
protected $addedParentLocations = false;
* @param string $identifier internal page identifier
* @param int $pageObjectID page object id
* @param ITitledLinkObject $locationObject optional label for breadcrumbs usage
- * @param boolean $useAsParentLocation
+ * @param bool $useAsParentLocation
* @throws SystemException
*/
public function addParentLocation($identifier, $pageObjectID = 0, ITitledLinkObject $locationObject = null, $useAsParentLocation = false) {
* Returns true if provided object id exists and is valid.
*
* @param int $objectID page object id
- * @return boolean true if object id is valid
+ * @return bool true if object id is valid
*/
public function isValid($objectID);
* of the page itself. The visibility can optionally be scoped to the given object id.
*
* @param int|null $objectID optional page object id
- * @return boolean false if the page should be hidden from menus
+ * @return bool false if the page should be hidden from menus
*/
public function isVisible($objectID = null);
}
* Returns true if provided object id exists and is valid.
*
* @param int $objectID page object id
- * @return boolean true if object id is valid
+ * @return bool true if object id is valid
* @see ILookupPageHandler::isValid()
*/
public function isValid($objectID = null) {
* of the page itself. The visibility can optionally be scoped to the given object id.
*
* @param int|null $objectID optional page object id
- * @return boolean false if the page should be hidden from menus
+ * @return bool false if the page should be hidden from menus
* @see IMenuPageHandler::isVisible()
*/
public function isVisible($objectID = null) {
* Returns true if provided object id exists and is valid.
*
* @param int $objectID page object id
- * @return boolean true if object id is valid
+ * @return bool true if object id is valid
* @see ILookupPageHandler::isValid()
*/
public function isValid($objectID) {
/**
* Returns true, if this payment method supports recurring payments.
*
- * @return boolean
+ * @return bool
*/
public function supportsRecurringPayments();
* @param string $token custom token
* @param string $returnURL
* @param string $cancelReturnURL
- * @param boolean $isRecurring
+ * @param bool $isRecurring
* @param int $subscriptionLength
* @param string $subscriptionLengthUnit
*
/**
* Returns true if current user may start a public poll.
*
- * @return boolean
+ * @return bool
*/
public function canStartPublicPoll();
/**
* Returns true if current user may vote.
*
- * @return boolean
+ * @return bool
*/
public function canVote();
* @param string $objectType
* @param int $objectID
* @param int $pollID
- * @return boolean
+ * @return bool
* @throws SystemException
*/
public function setObject($objectType, $objectID, $pollID = 0) {
/**
* Returns true if current user can start a public poll.
*
- * @return boolean
+ * @return bool
*/
public function canStartPublicPoll() {
$handler = $this->getHandler(null, $this->objectType);
*
* @param string $application application identifier
* @param string $controller url controller
- * @param boolean $isAcpRequest true if this is an ACP request
- * @param boolean $skipCustomUrls true if custom url resolution should be suppressed, is always true for ACP requests
+ * @param bool $isAcpRequest true if this is an ACP request
+ * @param bool $skipCustomUrls true if custom url resolution should be suppressed, is always true for ACP requests
* @return mixed array containing className, controller and pageType or a string containing the controller name for aliased controllers
* @throws SystemException
*/
*
* @param string $application application identifier
* @param string $controller controller class, e.g. 'MembersList'
- * @param boolean $forceFrontend force transformation for frontend
+ * @param bool $forceFrontend force transformation for frontend
* @return string url representation of controller, e.g. 'members-list'
*/
public function lookup($application, $controller, $forceFrontend = null) {
*
* @param string $application application identifier
* @param string $controller url controller name
- * @return boolean true if controller is the application's default
+ * @return bool true if controller is the application's default
*/
public function isDefaultController($application, $controller) {
// lookup custom urls first
*
* @param string[] $classData
* @param array $metaData
- * @return boolean
+ * @return bool
*/
public function isLandingPage(array $classData, array $metaData) {
if ($classData['className'] !== $this->landingPages['wcf'][2]) {
*
* @param string $application application identifier
* @param string $controller controller name
- * @param boolean $isAcpRequest true if this is an ACP request
+ * @param bool $isAcpRequest true if this is an ACP request
* @return string[]|null className, controller and pageType, or null if this is not a legacy controller name
*/
protected function getLegacyClassData($application, $controller, $isAcpRequest) {
*
* @param string $application application identifier
* @param string $controller controller name
- * @param boolean $isAcpRequest true if this is an ACP request
+ * @param bool $isAcpRequest true if this is an ACP request
* @param string $pageType page type, e.g. 'form' or 'action'
* @return string[]|null className, controller and pageType
*/
protected $className = '';
/**
- * @var boolean
+ * @var bool
*/
protected $isLandingPage = false;
/**
* Returns true if this request has already been executed.
*
- * @return boolean
+ * @return bool
*/
public function isExecuted() {
return ($this->requestObject !== null);
/**
* Returns true if this request represents the landing page.
*
- * @return boolean
+ * @return bool
*/
public function isLandingPage() {
return $this->isLandingPage;
/**
* Returns true if the requested page is available during the offline mode.
*
- * @return boolean
+ * @return bool
*/
public function isAvailableDuringOfflineMode() {
if (defined($this->className . '::AVAILABLE_DURING_OFFLINE_MODE') && constant($this->className . '::AVAILABLE_DURING_OFFLINE_MODE')) {
/**
* true, if current domain mismatch any known domain
- * @var boolean
+ * @var bool
*/
protected $inRescueMode = false;
/**
* indicates if the request is an acp request
- * @var boolean
+ * @var bool
*/
protected $isACPRequest = false;
* Handles a http request.
*
* @param string $application
- * @param boolean $isACPRequest
+ * @param bool $isACPRequest
* @throws AJAXException
* @throws IllegalLinkException
* @throws SystemException
/**
* Returns true if the request is an acp request.
*
- * @return boolean
+ * @return bool
*/
public function isACPRequest() {
return $this->isACPRequest;
/**
* Returns true, if current host mismatches any known domain.
*
- * @return boolean
+ * @return bool
*/
public function inRescueMode() {
return $this->inRescueMode;
/**
* HTTP encryption
- * @var boolean
+ * @var bool
*/
protected static $secure;
/**
* true if the default controller is used (support for custom landing page)
- * @var boolean
+ * @var bool
*/
protected $isDefaultController = false;
/**
* true if the controller was renamed and has already been transformed
- * @var boolean
+ * @var bool
*/
protected $isRenamedController = false;
* first route that is able to consume all path components is used,
* even if other routes may fit better. Route order is crucial!
*
- * @return boolean
+ * @return bool
*/
public function matches() {
foreach ($this->routes as $route) {
/**
* Returns true if route uses default controller.
*
- * @return boolean
+ * @return bool
*/
public function isDefaultController() {
return $this->isDefaultController;
/**
* Returns true if the controller was renamed and has already been transformed.
*
- * @return boolean
+ * @return bool
*/
public function isRenamedController() {
return $this->isRenamedController;
*
* @param string $application application identifier
* @param array $components
- * @param boolean $isACP
+ * @param bool $isACP
* @return string
* @throws SystemException
*/
/**
* Returns true if this is a secure connection.
*
- * @return boolean
+ * @return bool
*/
public static function secureConnection() {
if (self::$secure === null) {
/**
* route is restricted to ACP
- * @var boolean
+ * @var bool
*/
protected $isACP = false;
*
* @param string[] $components
* @param string $application
- * @param boolean $useBuildSchema
+ * @param bool $useBuildSchema
* @return string
*/
protected function buildRoute(array $components, $application, $useBuildSchema) {
* Returns true if current route can handle the build request.
*
* @param array $components
- * @return boolean
+ * @return bool
*/
public function canHandle(array $components);
/**
* Returns true if route applies for ACP.
*
- * @return boolean
+ * @return bool
*/
public function isACP();
* Returns true if given request url matches this route.
*
* @param string $requestURL
- * @return boolean
+ * @return bool
*/
public function matches($requestURL);
/**
* Configures this route to handle either ACP or frontend requests.
*
- * @param boolean $isACP true if route handles ACP requests
+ * @param bool $isACP true if route handles ACP requests
*/
public function setIsACP($isACP);
}
class StaticRequestRoute extends DynamicRequestRoute {
/**
* controller must be present and match the static controller
- * @var boolean
+ * @var bool
*/
protected $matchController = false;
* Controller must be part of the url and match the static controller, useful
* for controllers requiring a custom set of additional parameters.
*
- * @param boolean $matchController
+ * @param bool $matchController
*/
public function setMatchController($matchController) {
$this->matchController = $matchController;
* index was created, otherwise false.
*
* @param ObjectType $objectType
- * @return boolean
+ * @return bool
*/
abstract protected function createSearchIndex(ObjectType $objectType);
*
* @param string $objectTypeName
* @param string $q
- * @param boolean $subjectOnly
+ * @param bool $subjectOnly
* @param PreparedStatementConditionBuilder $searchIndexCondition
* @param string $orderBy
* @param int $limit
*
* @param string $q
* @param array $objectTypes
- * @param boolean $subjectOnly
+ * @param bool $subjectOnly
* @param PreparedStatementConditionBuilder $searchIndexCondition
* @param array $additionalConditions
* @param string $orderBy
/**
* Returns true if the current user can use this searchable object type.
*
- * @return boolean
+ * @return bool
*/
public function isAccessible();
* @param DatabaseObject $object
* @param string $optionsColumnName
* @param string $permissionsColumnName
- * @return boolean
+ * @return bool
*/
protected function validate(DatabaseObject $object, $optionsColumnName = 'options', $permissionsColumnName = 'permissions') {
// check the options of this item
* Returns true if given category is valid and accessible.
*
* @param string $categoryName
- * @return boolean
+ * @return bool
*/
protected function isValid($categoryName) {
return isset($this->categories[$categoryName]);
final class SessionHandler extends SingletonFactory {
/**
* prevents update on shutdown
- * @var boolean
+ * @var bool
*/
protected $doNotUpdate = false;
/**
* disables page tracking
- * @var boolean
+ * @var bool
*/
protected $disableTracking = false;
/**
* true if within ACP or WCFSetup
- * @var boolean
+ * @var bool
*/
protected $isACP = false;
/**
* indicates if session variables changed and must be saved upon shutdown
- * @var boolean
+ * @var bool
*/
protected $variablesChanged = false;
/**
* true if this is a new session
- * @var boolean
+ * @var bool
*/
protected $firstVisit = false;
/**
* Returns true if client provided a valid session cookie.
*
- * @return boolean
+ * @return bool
* @since 3.0
*/
public function hasValidCookie(): bool {
* given token is invalid.
*
* @param string $token
- * @return boolean
+ * @return bool
*/
public function checkSecurityToken($token) {
// The output of CryptoUtil::createSignedString() is not url-safe. For compatibility
* compatibility, while preventing ACLs from overruling a 'Never' setting.
*
* @param string $permission
- * @return boolean
+ * @return bool
*/
public function getNeverPermission($permission) {
$this->loadGroupData();
* logged in, after the login his old session is used to store his full data.
*
* @param User $user
- * @param boolean $hideSession if true, database won't be updated
+ * @param bool $hideSession if true, database won't be updated
*/
public function changeUser(User $user, $hideSession = false) {
$eventParameters = ['user' => $user, 'hideSession' => $hideSession];
/**
* Returns true if this is a new session.
*
- * @return boolean
+ * @return bool
*/
public function isFirstVisit() {
return $this->firstVisit;
/**
* indicates if target directory will be deleted if empty
- * @var boolean
+ * @var bool
*/
protected $deleteEmptyTargetDir;
/**
* indicates if sub directory will be deleted if empty
- * @var boolean
+ * @var bool
*/
protected $deleteEmptyDirectories;
*
* @param string $targetDir
* @param string[] $files
- * @param boolean $deleteEmptyTargetDir
- * @param boolean $deleteEmptyDirectories
+ * @param bool $deleteEmptyTargetDir
+ * @param bool $deleteEmptyDirectories
*/
public function __construct($targetDir, $files, $deleteEmptyTargetDir, $deleteEmptyDirectories) {
$this->targetDir = $targetDir;
* Returns true if a directory is emtpy.
*
* @param string $dir
- * @return boolean
+ * @return bool
*/
protected function isEmpty($dir) {
if (is_dir($dir)) {
* Returns the permission for a guest to view a certain object for this object type.
*
* @param DatabaseObject $object
- * @return boolean
+ * @return bool
*/
public function canView(DatabaseObject $object);
/**
* Checks the requirements (e.g. module options) for this object type.
*
- * @return boolean
+ * @return bool
*/
public function isAvailableType();
}
* Returns whether the family's CSS file exists, implying that
* the family is available.
*
- * @return boolean
+ * @return bool
*/
public function isFamilyDownloaded($family) {
return is_readable($this->getCssFilename($family));
* Changes the active style.
*
* @param int $styleID
- * @param boolean $ignorePermissions
+ * @param bool $ignorePermissions
* @throws SystemException
*/
public function changeStyle($styleID = 0, $ignorePermissions = false) {
/**
* Returns the HTML tag to include current stylesheet.
*
- * @param boolean $isACP indicates if the request is an acp request
+ * @param bool $isACP indicates if the request is an acp request
* @return string
*/
public function getStylesheet($isACP = false) {
/**
* Resets all stylesheets.
*
- * @param boolean $resetACP
+ * @param bool $resetACP
*/
public static function resetStylesheets($resetACP = true) {
// frontend stylesheets
* Returns a style by package name, optionally filtering tainted styles.
*
* @param string $packageName style package name
- * @param boolean $skipTainted ignore tainted styles
+ * @param bool $skipTainted ignore tainted styles
* @return StyleEditor|null
* @since 3.0
*/
/**
* Returns true if there is more than one available style and the changer is to be displayed.
*
- * @return boolean true if style changer should be displayed
+ * @return bool true if style changer should be displayed
*/
public function showStyleChanger() {
return ($this->countStyles() && SHOW_STYLE_CHANGER);
* Returns the list of FontAwesome icons excluding the `fa-`-prefix,
* optionally encoding the list as JSON.
*
- * @param boolean $toJSON encode array as a JSON string
+ * @param bool $toJSON encode array as a JSON string
* @return string|\string[] JSON string or PHP array of strings
*/
public function getIcons($toJSON = false) {
* @param int $objectID
* @param array $tags
* @param int $languageID
- * @param boolean $replace
+ * @param bool $replace
*/
public function addObjectTags($objectType, $objectID, array $tags, $languageID, $replace = true) {
$objectTypeID = $this->getObjectTypeID($objectType);
/**
* forces the template engine to recompile all included templates
- * @var boolean
+ * @var bool
*/
protected $forceCompile = false;
/**
* true, if template listener code was already loaded
- * @var boolean
+ * @var bool
*/
protected $templateListenersLoaded = false;
*
* @param string $templateName
* @param string $application
- * @param boolean $sendHeaders
+ * @param bool $sendHeaders
*/
public function display($templateName, $application = 'wcf', $sendHeaders = true) {
if ($sendHeaders) {
* @param string $compiledFilename
* @param string $application
* @param array $metaData
- * @return boolean
+ * @return bool
*/
protected function isCompiled($templateName, $sourceFilename, $compiledFilename, $application, array $metaData) {
if ($this->forceCompile || !file_exists($compiledFilename)) {
* @param string $templateName
* @param string $application
* @param array $variables
- * @param boolean $sandbox enables execution in sandbox
+ * @param bool $sandbox enables execution in sandbox
* @return string
*/
public function fetch($templateName, $application = 'wcf', array $variables = [], $sandbox = false) {
*
* @param string $compiledSource
* @param array $variables
- * @param boolean $sandbox enables execution in sandbox
+ * @param bool $sandbox enables execution in sandbox
* @return string
*/
public function fetchString($compiledSource, array $variables = [], $sandbox = true) {
* @param string $templateName
* @param string $application
* @param array $variables
- * @param boolean $sandbox enables execution in sandbox
+ * @param bool $sandbox enables execution in sandbox
*/
protected function includeTemplate($templateName, $application, array $variables = [], $sandbox = true) {
// enable sandbox
* @param string $identifier
* @param string $sourceContent
* @param array $metaData
- * @param boolean $isolated
- * @return array|boolean
+ * @param bool $isolated
+ * @return array|bool
* @throws SystemException
*/
public function compileString($identifier, $sourceContent, array $metaData = [], $isolated = false) {
/**
* Compiles a capture tag and returns the compiled PHP code.
*
- * @param boolean $startTag
+ * @param bool $startTag
* @param string $captureTag
* @return string
*/
* Compiles an {if} tag and returns the compiled PHP code.
*
* @param string $tagArgs
- * @param boolean $elseif true, if this tag is an else tag
+ * @param bool $elseif true, if this tag is an else tag
* @return string
* @throws SystemException
*/
*
* @param string $variable
* @param string $type
- * @param boolean $allowConstants
+ * @param bool $allowConstants
* @return string
*/
protected function compileSimpleVariable($variable, $type = '', $allowConstants = true) {
* Compiles a variable tag and returns the compiled PHP code.
*
* @param string $tag
- * @param boolean $replaceQuotes
+ * @param bool $replaceQuotes
* @return string
* @throws SystemException
*/
class HtmlCheckboxesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
/**
* indicates if encoding is disabled
- * @var boolean
+ * @var bool
*/
protected $disableEncoding = false;
* This function is called before every execution of this block function.
*
* @param TemplateEngine $tplObj
- * @return boolean
+ * @return bool
*/
public function next(TemplateEngine $tplObj);
}
* Validates the given file and returns true on success, otherwise false.
*
* @param UploadFile $uploadFile
- * @return boolean
+ * @return bool
*/
public function validate(UploadFile $uploadFile);
}
class MediaUploadFileValidationStrategy implements IUploadFileValidationStrategy {
/**
* if `true`, only images are valid
- * @var boolean
+ * @var bool
*/
protected $imagesOnly = false;
/**
* Creates a new instance of MediaUploadFileValidationStrategy.
*
- * @param boolean $imagesOnly
+ * @param bool $imagesOnly
*/
public function __construct($imagesOnly) {
$this->imagesOnly = $imagesOnly;
* Validates the uploaded files. Returns true on success, otherwise false.
*
* @param IUploadFileValidationStrategy $validationStrategy
- * @return boolean
+ * @return bool
*/
public function validateFiles(IUploadFileValidationStrategy $validationStrategy) {
$result = true;
*
* @param string $objectType
* @param int[] $itemsToUser
- * @param boolean $updateUsers
+ * @param bool $updateUsers
* @throws InvalidObjectTypeException
*/
public function fireEvents($objectType, array $itemsToUser, $updateUsers = true) {
* Returns true if given bcrypt hash uses a different cost factor and should be re-computed.
*
* @param string $hash
- * @return boolean
+ * @return bool
*/
private static function isDifferentBlowfish($hash) {
$currentCost = \intval(self::BCRYPT_COST);
*
* @param string $objectType
* @param string $objectID
- * @return boolean
+ * @return bool
* @throws InvalidObjectTypeException
*/
public function isCollapsed($objectType, $objectID) {
/**
* Returns the number of outstanding notifications for the active user.
*
- * @param boolean $skipCache
+ * @param bool $skipCache
* @return int
*/
public function getNotificationCount($skipCache = false) {
*
* @param int $limit
* @param int $offset
- * @param boolean $showConfirmedNotifications DEPRECATED
+ * @param bool $showConfirmedNotifications DEPRECATED
* @return mixed[]
*/
public function getNotifications($limit = 5, $offset = 0, $showConfirmedNotifications = false) {
/**
* notification stacking support
- * @var boolean
+ * @var bool
*/
protected $stackable = false;
public function setTestCaseDescription($description);
/**
- * @return boolean
+ * @return bool
*/
public static function canBeTriggeredByGuests();
/**
* Returns true if this notification event is visible for the active user.
*
- * @return boolean
+ * @return bool
*/
public function isVisible();
/**
* Returns true if this notification event supports stacking.
*
- * @return boolean
+ * @return bool
*/
public function isStackable();
/**
* Returns true if this notification event supports email notifications.
*
- * @return boolean
+ * @return bool
*/
public function supportsEmailNotification();
* Validates if the related object is still accessible, in case this check fails
* the event should take the appropriate actions to resolve this.
*
- * @return boolean
+ * @return bool
*/
public function checkAccess();
* Returns true if a notification should be deleted if the related object
* is not accessible.
*
- * @return boolean
+ * @return bool
*/
public function deleteNoAccessNotification();
/**
* Returns true if the underlying notification has been marked as confirmed.
*
- * @return boolean
+ * @return bool
*/
public function isConfirmed();
/**
* true if the moderation queue is already loaded
- * @var boolean
+ * @var bool
*/
protected $moderationQueueLoaded = false;
/**
* true if content supports i18n
- * @var boolean
+ * @var bool
*/
public $isI18n = false;
/**
* Returns true if current user can view the stored versions of this type.
*
- * @return boolean
+ * @return bool
*/
public function canAccess();
* payload's array indices represent language ids rather than property values.
*
* @param IVersionTrackerObject $object target object
- * @return boolean
+ * @return bool
*/
public function isI18n(IVersionTrackerObject $object);
* Creates a database table for an object type unless it exists already.
*
* @param ObjectType $objectType target object type
- * @return boolean false if table already exists
+ * @return bool false if table already exists
*/
protected function createStorageTable(ObjectType $objectType) {
$baseTableName = $this->getTableName($objectType);
* is not NULL.
*
* @param string $name
- * @return boolean
+ * @return bool
*/
public function __isset($name) {
return isset($this->data[$name]);
/**
* Writes the sitemap.xml index file and links all sitemaps.
*
- * @param boolean $closeFile Close a previously opened handle.
+ * @param bool $closeFile Close a previously opened handle.
*/
protected function writeIndexFile($closeFile = true) {
$file = new AtomicWriter(self::getSitemapPath() . 'sitemap.xml');
/**
* Generates a new temporary file and appends the sitemap start.
*
- * @param boolean $closeFile Close a previously opened handle.
+ * @param bool $closeFile Close a previously opened handle.
*/
protected function generateTmpFile($closeFile = true) {
if ($closeFile) $this->closeFile();
* Applies StringUtil::trim() to all elements of the given array.
*
* @param array|string $array
- * @param boolean $removeEmptyElements
+ * @param bool $removeEmptyElements
* @return array|string
*/
public static function trim($array, $removeEmptyElements = true) {
* @param array $array1
* @param array $array2
* @param callable $callback
- * @return boolean
+ * @return bool
*/
public static function compare(array $array1, array $array2, callable $callback = null) {
return static::compareHelper('value', $array1, $array2, $callback);
* @param array $array1
* @param array $array2
* @param callable $callback
- * @return boolean
+ * @return bool
*/
public static function compareKey(array $array1, array $array2, callable $callback = null) {
return static::compareHelper('key', $array1, $array2, $callback);
* @param array $array1
* @param array $array2
* @param callable $callback
- * @return boolean
+ * @return bool
*/
public static function compareAssoc(array $array1, array $array2, callable $callback = null) {
return static::compareHelper('assoc', $array1, $array2, $callback);
* @param array $array1
* @param array $array2
* @param callable $callback
- * @return boolean
+ * @return bool
* @throws SystemException
*/
protected static function compareHelper($method, array $array1, array $array2, callable $callback = null) {
*
* @param object $a
* @param object $b
- * @return boolean
+ * @return bool
*/
public static function equals($a, $b) {
if (!is_object($a)) return false;
*
* @param string $className
* @param string $targetClass
- * @return boolean
+ * @return bool
* @throws SystemException
*
* @deprecated use is_subclass_of() instead
final class CronjobUtil {
/**
* indicates if day of month is restricted (not '*')
- * @var boolean
+ * @var bool
*/
protected static $domRestricted = false;
/**
* indicates if day of week is restricted (not '*')
- * @var boolean
+ * @var bool
*/
protected static $dowRestricted = false;
*
* @param array $values
* @param int $timeBase
- * @param boolean $addAnDay
- * @return boolean
+ * @param bool $addAnDay
+ * @return bool
*/
protected static function calculateMinute(array &$values, &$timeBase, $addAnDay) {
$returnValue = false;
*
* @param int $needle
* @param array $haystack
- * @param boolean $continue
+ * @param bool $continue
* @return mixed
*/
protected static function findKey($needle, array &$haystack, $continue = true) {
*
* @param \DOMNode $ancestor ancestor node
* @param \DOMNode $node node
- * @return boolean true if `$ancestor` contains the node `$node`
+ * @return bool true if `$ancestor` contains the node `$node`
*/
public static function contains(\DOMNode $ancestor, \DOMNode $node) {
// nodes cannot contain themselves
* Returns all ancestors nodes for given node.
*
* @param \DOMNode $node node
- * @param boolean $reverseOrder reversing the order causes the most top ancestor to appear first
+ * @param bool $reverseOrder reversing the order causes the most top ancestor to appear first
* @return \DOMElement[] list of ancestor nodes
*/
public static function getParents(\DOMNode $node, $reverseOrder = false) {
*
* @param \DOMElement $element start element
* @param string $tagName tag name to match
- * @return boolean
+ * @return bool
*/
public static function hasParent(\DOMElement $element, $tagName) {
while ($element = $element->parentNode) {
* Returns true if this node is empty.
*
* @param \DOMNode $node node
- * @return boolean true if node is empty
+ * @return bool true if node is empty
*/
public static function isEmpty(\DOMNode $node) {
if ($node->nodeType === XML_TEXT_NODE) {
*
* @param \DOMNode $node node
* @param \DOMElement $ancestor ancestor element
- * @return boolean true if `$node` is the first node of its given ancestor
+ * @return bool true if `$node` is the first node of its given ancestor
*/
public static function isFirstNode(\DOMNode $node, \DOMElement $ancestor) {
if ($node->previousSibling === null) {
*
* @param \DOMNode $node node
* @param \DOMElement $ancestor ancestor element
- * @return boolean true if `$node` is the last node of its given ancestor
+ * @return bool true if `$node` is the last node of its given ancestor
*/
public static function isLastNode(\DOMNode $node, \DOMElement $ancestor) {
if ($node->nextSibling === null) {
* body is gone, including the `nodeType` attribute.
*
* @param \DOMNode $node node
- * @return boolean true if node has been destroyed
+ * @return bool true if node has been destroyed
*/
public static function isRemoved(\DOMNode $node) {
return !isset($node->nodeType);
* that neither contain content nor have a closing tag, such as `<br>`.
*
* @param \DOMElement $element element
- * @return boolean true if provided element is a void element
+ * @return bool true if provided element is a void element
*/
public static function isVoidElement(\DOMElement $element) {
if (preg_match('~^(area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$~', $element->nodeName)) {
* Removes a node, optionally preserves the child nodes if `$node` is an element.
*
* @param \DOMNode $node target node
- * @param boolean $preserveChildNodes preserve child nodes, only supported for elements
+ * @param bool $preserveChildNodes preserve child nodes, only supported for elements
*/
public static function removeNode(\DOMNode $node, $preserveChildNodes = false) {
if ($preserveChildNodes) {
*
* @param \DOMElement $oldElement old element
* @param \DOMElement $newElement new element
- * @param boolean $preserveChildNodes true if child nodes should be moved, otherwise they'll be implicitly removed
+ * @param bool $preserveChildNodes true if child nodes should be moved, otherwise they'll be implicitly removed
*/
public static function replaceElement(\DOMElement $oldElement, \DOMElement $newElement, $preserveChildNodes = true) {
self::insertBefore($newElement, $oldElement);
*
* @param \DOMNode $node reference node
* @param \DOMElement $ancestor ancestor element that should not be split
- * @param boolean $splitBefore true if nodes before `$node` should be moved into a new node, false to split nodes after `$node`
+ * @param bool $splitBefore true if nodes before `$node` should be moved into a new node, false to split nodes after `$node`
* @return \DOMNode parent node containing `$node`, direct child of `$ancestor`
*/
public static function splitParentsUntil(\DOMNode $node, \DOMElement $ancestor, $splitBefore = true) {
* Returns a formatted date interval.
*
* @param \DateInterval $interval interval to be formatted
- * @param boolean $fullInterval if `true`, the complete interval is returned, otherwise a rounded interval is used
+ * @param bool $fullInterval if `true`, the complete interval is returned, otherwise a rounded interval is used
* @param int $formatType format type for the interval, use the class constant FORMAT_DEFAULT, FORMAT_SENTENCE or FORMAT_PLAIN
* @return string
*/
* @param int $timestamp target timestamp
* @param string $date localized date
* @param string $time localized time
- * @param boolean $isFutureDate true if timestamp is in the future
+ * @param bool $isFutureDate true if timestamp is in the future
* @return string relative time
*/
public static function getRelativeTime(\DateTime $dateTimeObject, $timestamp, $date, $time, $isFutureDate) {
/**
* determines whether scan should be recursive
- * @var boolean
+ * @var bool
*/
protected $recursive = true;
* Creates a new instance of DirectoryUtil.
*
* @param string $directory directory path
- * @param boolean $recursive created a recursive directory iterator
+ * @param bool $recursive created a recursive directory iterator
* @see \wcf\util\DirectoryUtil::getInstance()
*/
public function __construct($directory, $recursive = true) {
* Returns an instance of DirectoryUtil (or child).
*
* @param string $tmpDirectory path
- * @param boolean $recursive walk through sub-directories too
+ * @param bool $recursive walk through sub-directories too
* @return DirectoryUtil
* @throws SystemException
*/
*
* @param int $order sort-order
* @param Regex $pattern pattern to match
- * @param boolean $negativeMatch true if the pattern should be inversed
+ * @param bool $negativeMatch true if the pattern should be inversed
* @return string[]
* @throws SystemException
*/
*
* @param int $order sort order
* @param Regex $pattern pattern to match
- * @param boolean $negativeMatch should the pattern be inversed
+ * @param bool $negativeMatch should the pattern be inversed
* @return \DirectoryIterator[]
* @throws SystemException
*/
*
* @param callable $callback
* @param Regex $pattern callback is only applied to files matching the given pattern
- * @return boolean
+ * @return bool
*/
public function executeCallback(callable $callback, Regex $pattern = null) {
if ($pattern !== null) $files = $this->getFileObjects(self::SORT_NONE, $pattern);
* Removes all files that match the given pattern.
*
* @param Regex $pattern pattern to match
- * @param boolean $negativeMatch should the pattern be inversed
+ * @param bool $negativeMatch should the pattern be inversed
* @throws SystemException
*/
public function removePattern(Regex $pattern, $negativeMatch = false) {
/**
* True if http range is invalid.
- * @var boolean
+ * @var bool
*/
protected $invalidRange = false;
* necessary.
*
* @param string $path
- * @return boolean
+ * @return bool
*/
public static function makePath($path) {
// directory already exists, abort
*
* @param string $folder
* @param string $searchfile
- * @param boolean $recursive
+ * @param bool $recursive
* @return mixed
*/
public static function scanFolder($folder, $searchfile, $recursive = true) {
* Returns true if the given filename is an url (http or ftp).
*
* @param string $filename
- * @return boolean
+ * @return bool
*/
public static function isURL($filename) {
return preg_match('!^(https?|ftp)://!', $filename);
* otherwise it considers the file to be binary.
*
* @param string $file
- * @return boolean
+ * @return bool
*/
public static function isBinary($file) {
// open file
*
* @param string $gzipped
* @param string $destination
- * @return boolean
+ * @return bool
*/
public static function uncompressFile($gzipped, $destination) {
if (!@is_file($gzipped)) {
/**
* Returns true if php is running as apache module.
*
- * @return boolean
+ * @return bool
*/
public static function isApacheModule() {
return function_exists('apache_get_version');
* Returns true if the given amount of memory is available.
*
* @param int $neededMemory
- * @return boolean
+ * @return bool
*/
public static function checkMemoryLimit($neededMemory) {
return self::getMemoryLimit() == -1 || self::getMemoryLimit() > (memory_get_usage() + $neededMemory);
*
* @param string $name
* @param string $value
- * @param boolean $append
+ * @param bool $append
*/
public function addHeader($name, $value, $append = false) {
// 4.2 Field names are case-insensitive.
* Redirects the user agent to given location.
*
* @param string $location
- * @param boolean $sendStatusCode
- * @param boolean $temporaryRedirect
+ * @param bool $sendStatusCode
+ * @param bool $temporaryRedirect
*/
public static function redirect($location, $sendStatusCode = false, $temporaryRedirect = true) {
// https://github.com/WoltLab/WCF/issues/2568
* and returns false if any bad stuff was found.
*
* @param string $file
- * @return boolean
+ * @return bool
*/
public static function checkImageContent($file) {
// get file content
* @param string $filename
* @param int $maxWidth
* @param int $maxHeight
- * @param boolean $obtainDimensions
+ * @param bool $obtainDimensions
* @return string new filename if file was changed, otherwise old filename
* @since 5.2
*/
* Decodes a JSON string.
*
* @param string $json
- * @param boolean $asArray
+ * @param bool $asArray
* @return array
* @throws SystemException
*/
* Returns true if given encryption type is supported.
*
* @param string $type
- * @return boolean
+ * @return bool
*/
public static function isSupported($type) {
if (in_array($type, self::$supportedEncryptionTypes)) {
* @param string $username
* @param string $password
* @param string $dbHash
- * @return boolean
+ * @return bool
* @throws SystemException
*/
public static function checkPassword($username, $password, $dbHash) {
*
* @param string $haystack The string to be checked for starting with $needle
* @param string $needle The string to be found at the start of $haystack
- * @param boolean $ci Case insensitive or not. Default = false.
+ * @param bool $ci Case insensitive or not. Default = false.
*
- * @return boolean True, if $haystack starts with $needle, false otherwise.
+ * @return bool True, if $haystack starts with $needle, false otherwise.
*/
public static function startsWith($haystack, $needle, $ci = false) {
if ($ci) {
*
* @param string $haystack
* @param string $needle
- * @param boolean $ci case insensitive
- * @return boolean
+ * @param bool $ci case insensitive
+ * @return bool
*/
public static function endsWith($haystack, $needle, $ci = false) {
if ($ci) {
* Returns true if the given string contains only ASCII characters.
*
* @param string $string
- * @return boolean
+ * @return bool
*/
public static function isASCII($string) {
return preg_match('/^[\x00-\x7F]*$/', $string);
* @see http://www.w3.org/International/questions/qa-forms-utf-8
*
* @param string $string
- * @return boolean
+ * @return bool
*/
public static function isUTF8($string) {
return preg_match('/^(
*
* @param string $word
* @param string $filter
- * @return boolean
+ * @return bool
*/
public static function executeWordFilter($word, $filter) {
$filter = self::trim($filter);
* @param string $string string which shall be truncated
* @param int $length string length after truncating
* @param string $etc string to append when $string is truncated
- * @param boolean $breakWords should words be broken in the middle
+ * @param bool $breakWords should words be broken in the middle
* @return string truncated string
*/
public static function truncate($string, $length = 80, $etc = self::HELLIP, $breakWords = false) {
* @param string $string string which shall be truncated
* @param int $length string length after truncating
* @param string $etc ending string which will be appended after truncating
- * @param boolean $breakWords if false words will not be split and the return string might be shorter than $length
+ * @param bool $breakWords if false words will not be split and the return string might be shorter than $length
* @return string truncated string
*/
public static function truncateHTML($string, $length = 500, $etc = self::HELLIP, $breakWords = false) {
*
* @param string $url
* @param string $title
- * @param boolean $encodeTitle
- * @param boolean $isUgc true to add rel=ugc to the anchor tag
+ * @param bool $encodeTitle
+ * @param bool $isUgc true to add rel=ugc to the anchor tag
* @return string anchor tag
*/
public static function getAnchorTag($url, $title = '', $encodeTitle = true, $isUgc = false) {
* Generates the attributes for an anchor tag from given URL.
*
* @param string $url
- * @param boolean $isUgc true to add rel=ugc to the attributes
+ * @param bool $isUgc true to add rel=ugc to the attributes
* @return string attributes
* @since 5.3
*/
* This method is a wrapper around filter_var with FILTER_VALIDATE_URL.
*
* @param string $url
- * @return boolean
+ * @return bool
*/
public static function is($url) {
return filter_var($url, FILTER_VALIDATE_URL) !== false;
*
* @param string $url
* @param int[] $components
- * @return boolean
+ * @return bool
*/
public static function contains($url, array $components) {
$result = self::parse($url);
* Returns true if the given name is a valid username.
*
* @param string $name username
- * @return boolean
+ * @return bool
*/
public static function isValidUsername($name) {
if (!UserUtil::isValidUsername($name)) return false;
* Returns true if the given e-mail is a valid address.
*
* @param string $email
- * @return boolean
+ * @return bool
*/
public static function isValidEmail($email) {
return (UserUtil::isValidEmail($email) && self::checkForbiddenEmails($email));
* Returns false if the given name is a forbidden username.
*
* @param string $name
- * @return boolean
+ * @return bool
*/
public static function checkForbiddenUsernames($name) {
return StringUtil::executeWordFilter($name, REGISTER_FORBIDDEN_USERNAMES);
* Returns false if the given email is a forbidden email.
*
* @param string $email
- * @return boolean
+ * @return bool
*/
public static function checkForbiddenEmails($email) {
return (StringUtil::executeWordFilter($email, REGISTER_FORBIDDEN_EMAILS) && (!StringUtil::trim(REGISTER_ALLOWED_EMAILS) || !StringUtil::executeWordFilter($email, REGISTER_ALLOWED_EMAILS)));
* Returns true if the given name is a valid username.
*
* @param string $name
- * @return boolean
+ * @return bool
*/
public static function isValidUsername($name) {
// minimum length is 3 characters, maximum length is 100 characters
* Returns true if the given username is available.
*
* @param string $name
- * @return boolean
+ * @return bool
*/
public static function isAvailableUsername($name) {
$sql = "SELECT COUNT(username)
* @see http://www.faqs.org/rfcs/rfc821.html
*
* @param string $email
- * @return boolean
+ * @return bool
*/
public static function isValidEmail($email) {
if (mb_strlen($email) > 191) {
* Returns true if the given email address is available.
*
* @param string $email
- * @return boolean
+ * @return bool
*/
public static function isAvailableEmail($email) {
$sql = "SELECT COUNT(email)
* Returns true if the active user uses a mobile browser.
* @see http://detectmobilebrowser.com
*
- * @return boolean
+ * @return bool
*/
public static function usesMobileBrowser() {
return (new UserAgent(self::getUserAgent()))->isMobileBrowser();
class XMLWriter {
/**
* true, if a document is still processed
- * @var boolean
+ * @var bool
*/
protected $activeDocument = false;