Replace old array syntax with new syntax
authorMatthias Schmidt <gravatronics@live.com>
Sat, 21 May 2016 08:54:22 +0000 (10:54 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 21 May 2016 12:19:38 +0000 (14:19 +0200)
647 files changed:
wcfsetup/install.php
wcfsetup/install/files/font/getFont.php
wcfsetup/install/files/lib/acp/action/CacheClearAction.class.php
wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php
wcfsetup/install/files/lib/acp/action/UninstallPackageAction.class.php
wcfsetup/install/files/lib/acp/action/UserQuickSearchAction.class.php
wcfsetup/install/files/lib/acp/action/WorkerProxyAction.class.php
wcfsetup/install/files/lib/acp/form/AbstractBulkProcessingForm.class.php
wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php
wcfsetup/install/files/lib/acp/form/AdAddForm.class.php
wcfsetup/install/files/lib/acp/form/AdEditForm.class.php
wcfsetup/install/files/lib/acp/form/ApplicationEditForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeMediaProviderAddForm.class.php
wcfsetup/install/files/lib/acp/form/BBCodeMediaProviderEditForm.class.php
wcfsetup/install/files/lib/acp/form/CaptchaQuestionAddForm.class.php
wcfsetup/install/files/lib/acp/form/CaptchaQuestionEditForm.class.php
wcfsetup/install/files/lib/acp/form/CronjobAddForm.class.php
wcfsetup/install/files/lib/acp/form/CronjobEditForm.class.php
wcfsetup/install/files/lib/acp/form/DataImportForm.class.php
wcfsetup/install/files/lib/acp/form/LabelEditForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/LabelGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/LanguageAddForm.class.php
wcfsetup/install/files/lib/acp/form/LanguageEditForm.class.php
wcfsetup/install/files/lib/acp/form/LanguageExportForm.class.php
wcfsetup/install/files/lib/acp/form/LanguageImportForm.class.php
wcfsetup/install/files/lib/acp/form/LanguageMultilingualismForm.class.php
wcfsetup/install/files/lib/acp/form/LoginForm.class.php
wcfsetup/install/files/lib/acp/form/MasterPasswordForm.class.php
wcfsetup/install/files/lib/acp/form/MasterPasswordInitForm.class.php
wcfsetup/install/files/lib/acp/form/MenuAddForm.class.php
wcfsetup/install/files/lib/acp/form/MenuEditForm.class.php
wcfsetup/install/files/lib/acp/form/MenuItemEditForm.class.php
wcfsetup/install/files/lib/acp/form/NoticeAddForm.class.php
wcfsetup/install/files/lib/acp/form/NoticeEditForm.class.php
wcfsetup/install/files/lib/acp/form/NotificationPresetSettingsForm.class.php
wcfsetup/install/files/lib/acp/form/OptionForm.class.php
wcfsetup/install/files/lib/acp/form/PackageStartInstallForm.class.php
wcfsetup/install/files/lib/acp/form/PackageUpdateServerAddForm.class.php
wcfsetup/install/files/lib/acp/form/PackageUpdateServerEditForm.class.php
wcfsetup/install/files/lib/acp/form/PaidSubscriptionAddForm.class.php
wcfsetup/install/files/lib/acp/form/PaidSubscriptionEditForm.class.php
wcfsetup/install/files/lib/acp/form/PaidSubscriptionUserAddForm.class.php
wcfsetup/install/files/lib/acp/form/SmileyAddForm.class.php
wcfsetup/install/files/lib/acp/form/SmileyCategoryAddForm.class.php
wcfsetup/install/files/lib/acp/form/SmileyCategoryEditForm.class.php
wcfsetup/install/files/lib/acp/form/SmileyEditForm.class.php
wcfsetup/install/files/lib/acp/form/StyleEditForm.class.php
wcfsetup/install/files/lib/acp/form/StyleExportForm.class.php
wcfsetup/install/files/lib/acp/form/StyleImportForm.class.php
wcfsetup/install/files/lib/acp/form/TagAddForm.class.php
wcfsetup/install/files/lib/acp/form/TagEditForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateAddForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateEditForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateGroupAddForm.class.php
wcfsetup/install/files/lib/acp/form/TemplateGroupEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserActivityPointOptionForm.class.php
wcfsetup/install/files/lib/acp/form/UserAssignToGroupForm.class.php
wcfsetup/install/files/lib/acp/form/UserContentRevertChangesForm.class.php
wcfsetup/install/files/lib/acp/form/UserEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserEmailAddressExportForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupAssignmentAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupAssignmentEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserGroupOptionForm.class.php
wcfsetup/install/files/lib/acp/form/UserMailForm.class.php
wcfsetup/install/files/lib/acp/form/UserMergeForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionCategoryAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionCategoryEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionListForm.class.php
wcfsetup/install/files/lib/acp/form/UserOptionSetDefaultsForm.class.php
wcfsetup/install/files/lib/acp/form/UserRankAddForm.class.php
wcfsetup/install/files/lib/acp/form/UserRankEditForm.class.php
wcfsetup/install/files/lib/acp/form/UserSearchForm.class.php
wcfsetup/install/files/lib/acp/page/ACPSessionLogListPage.class.php
wcfsetup/install/files/lib/acp/page/ACPSessionLogPage.class.php
wcfsetup/install/files/lib/acp/page/AbstractCategoryListPage.class.php
wcfsetup/install/files/lib/acp/page/AdListPage.class.php
wcfsetup/install/files/lib/acp/page/ApplicationManagementPage.class.php
wcfsetup/install/files/lib/acp/page/AttachmentListPage.class.php
wcfsetup/install/files/lib/acp/page/AttachmentPage.class.php
wcfsetup/install/files/lib/acp/page/BBCodeListPage.class.php
wcfsetup/install/files/lib/acp/page/BBCodeMediaProviderListPage.class.php
wcfsetup/install/files/lib/acp/page/BoxListPage.class.php
wcfsetup/install/files/lib/acp/page/CacheListPage.class.php
wcfsetup/install/files/lib/acp/page/CaptchaQuestionListPage.class.php
wcfsetup/install/files/lib/acp/page/CronjobListPage.class.php
wcfsetup/install/files/lib/acp/page/CronjobLogListPage.class.php
wcfsetup/install/files/lib/acp/page/ExceptionLogViewPage.class.php
wcfsetup/install/files/lib/acp/page/LabelGroupListPage.class.php
wcfsetup/install/files/lib/acp/page/LanguageItemListPage.class.php
wcfsetup/install/files/lib/acp/page/LanguageListPage.class.php
wcfsetup/install/files/lib/acp/page/MenuItemListPage.class.php
wcfsetup/install/files/lib/acp/page/NoticeListPage.class.php
wcfsetup/install/files/lib/acp/page/PHPInfoPage.class.php
wcfsetup/install/files/lib/acp/page/PackageInstallationConfirmPage.class.php
wcfsetup/install/files/lib/acp/page/PackageListPage.class.php
wcfsetup/install/files/lib/acp/page/PackagePage.class.php
wcfsetup/install/files/lib/acp/page/PackageUpdatePage.class.php
wcfsetup/install/files/lib/acp/page/PackageUpdateServerListPage.class.php
wcfsetup/install/files/lib/acp/page/PaidSubscriptionListPage.class.php
wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogListPage.class.php
wcfsetup/install/files/lib/acp/page/PaidSubscriptionTransactionLogPage.class.php
wcfsetup/install/files/lib/acp/page/PaidSubscriptionUserListPage.class.php
wcfsetup/install/files/lib/acp/page/PluginStorePurchasedItemsPage.class.php
wcfsetup/install/files/lib/acp/page/RebuildDataPage.class.php
wcfsetup/install/files/lib/acp/page/SmileyCategoryListPage.class.php
wcfsetup/install/files/lib/acp/page/SmileyListPage.class.php
wcfsetup/install/files/lib/acp/page/StatPage.class.php
wcfsetup/install/files/lib/acp/page/StyleListPage.class.php
wcfsetup/install/files/lib/acp/page/TagListPage.class.php
wcfsetup/install/files/lib/acp/page/TemplateGroupListPage.class.php
wcfsetup/install/files/lib/acp/page/TemplateListPage.class.php
wcfsetup/install/files/lib/acp/page/UserAuthenticationFailureListPage.class.php
wcfsetup/install/files/lib/acp/page/UserGroupAssignmentListPage.class.php
wcfsetup/install/files/lib/acp/page/UserGroupListPage.class.php
wcfsetup/install/files/lib/acp/page/UserOptionCategoryListPage.class.php
wcfsetup/install/files/lib/acp/page/UserOptionListPage.class.php
wcfsetup/install/files/lib/acp/page/UserRankListPage.class.php
wcfsetup/install/files/lib/action/AJAXProxyAction.class.php
wcfsetup/install/files/lib/action/AbstractAction.class.php
wcfsetup/install/files/lib/action/AbstractDialogAction.class.php
wcfsetup/install/files/lib/action/FacebookAuthAction.class.php
wcfsetup/install/files/lib/action/GithubAuthAction.class.php
wcfsetup/install/files/lib/action/GoogleAuthAction.class.php
wcfsetup/install/files/lib/action/GravatarDownloadAction.class.php
wcfsetup/install/files/lib/action/MessageQuoteAction.class.php
wcfsetup/install/files/lib/action/NotificationConfirmAction.class.php
wcfsetup/install/files/lib/action/NotificationDisableAction.class.php
wcfsetup/install/files/lib/action/PaypalCallbackAction.class.php
wcfsetup/install/files/lib/action/PollAction.class.php
wcfsetup/install/files/lib/action/TwitterAuthAction.class.php
wcfsetup/install/files/lib/data/AbstractDatabaseObjectAction.class.php
wcfsetup/install/files/lib/data/DatabaseObjectDecorator.class.php
wcfsetup/install/files/lib/data/DatabaseObjectEditor.class.php
wcfsetup/install/files/lib/data/DatabaseObjectList.class.php
wcfsetup/install/files/lib/data/IEditableObject.class.php
wcfsetup/install/files/lib/data/ProcessibleDatabaseObject.class.php
wcfsetup/install/files/lib/data/TMultiCategoryObject.class.php
wcfsetup/install/files/lib/data/acl/option/ACLOption.class.php
wcfsetup/install/files/lib/data/acl/option/ACLOptionAction.class.php
wcfsetup/install/files/lib/data/acp/menu/item/ACPMenuItem.class.php
wcfsetup/install/files/lib/data/acp/search/provider/ACPSearchProviderAction.class.php
wcfsetup/install/files/lib/data/acp/session/virtual/ACPSessionVirtual.class.php
wcfsetup/install/files/lib/data/acp/session/virtual/ACPSessionVirtualAction.class.php
wcfsetup/install/files/lib/data/acp/template/ACPTemplateAction.class.php
wcfsetup/install/files/lib/data/ad/AdAction.class.php
wcfsetup/install/files/lib/data/ad/AdEditor.class.php
wcfsetup/install/files/lib/data/application/Application.class.php
wcfsetup/install/files/lib/data/attachment/GroupedAttachmentList.class.php
wcfsetup/install/files/lib/data/bbcode/BBCode.class.php
wcfsetup/install/files/lib/data/bbcode/BBCodeAction.class.php
wcfsetup/install/files/lib/data/bbcode/BBCodeCache.class.php
wcfsetup/install/files/lib/data/bbcode/MessagePreviewAction.class.php
wcfsetup/install/files/lib/data/bbcode/attribute/BBCodeAttribute.class.php
wcfsetup/install/files/lib/data/bbcode/media/provider/BBCodeMediaProviderAction.class.php
wcfsetup/install/files/lib/data/captcha/question/CaptchaQuestionAction.class.php
wcfsetup/install/files/lib/data/category/CategoryAction.class.php
wcfsetup/install/files/lib/data/category/CategoryNode.class.php
wcfsetup/install/files/lib/data/category/UncachedCategoryNodeTree.class.php
wcfsetup/install/files/lib/data/clipboard/item/ClipboardItemAction.class.php
wcfsetup/install/files/lib/data/comment/response/CommentResponseAction.class.php
wcfsetup/install/files/lib/data/condition/Condition.class.php
wcfsetup/install/files/lib/data/cronjob/CronjobAction.class.php
wcfsetup/install/files/lib/data/cronjob/log/CronjobLogAction.class.php
wcfsetup/install/files/lib/data/label/LabelAction.class.php
wcfsetup/install/files/lib/data/label/group/LabelGroupAction.class.php
wcfsetup/install/files/lib/data/label/group/ViewableLabelGroup.class.php
wcfsetup/install/files/lib/data/language/Language.class.php
wcfsetup/install/files/lib/data/language/LanguageAction.class.php
wcfsetup/install/files/lib/data/language/SetupLanguage.class.php
wcfsetup/install/files/lib/data/language/category/LanguageCategoryAction.class.php
wcfsetup/install/files/lib/data/language/item/LanguageItemAction.class.php
wcfsetup/install/files/lib/data/like/Like.class.php
wcfsetup/install/files/lib/data/like/LikeAction.class.php
wcfsetup/install/files/lib/data/like/ViewableLikeList.class.php
wcfsetup/install/files/lib/data/like/object/LikeObject.class.php
wcfsetup/install/files/lib/data/menu/item/MenuItemAction.class.php
wcfsetup/install/files/lib/data/menu/item/MenuItemNodeTree.class.php
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueAction.class.php
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueActivationAction.class.php
wcfsetup/install/files/lib/data/moderation/queue/ModerationQueueReportAction.class.php
wcfsetup/install/files/lib/data/modification/log/ModificationLog.class.php
wcfsetup/install/files/lib/data/notice/Notice.class.php
wcfsetup/install/files/lib/data/notice/NoticeAction.class.php
wcfsetup/install/files/lib/data/object/type/AbstractObjectTypeProvider.class.php
wcfsetup/install/files/lib/data/object/type/ObjectTypeCache.class.php
wcfsetup/install/files/lib/data/option/Option.class.php
wcfsetup/install/files/lib/data/option/OptionAction.class.php
wcfsetup/install/files/lib/data/option/category/OptionCategoryAction.class.php
wcfsetup/install/files/lib/data/package/Package.class.php
wcfsetup/install/files/lib/data/package/PackageAction.class.php
wcfsetup/install/files/lib/data/package/PackageCache.class.php
wcfsetup/install/files/lib/data/package/installation/queue/PackageInstallationQueueAction.class.php
wcfsetup/install/files/lib/data/package/update/PackageUpdateAction.class.php
wcfsetup/install/files/lib/data/package/update/server/PackageUpdateServerAction.class.php
wcfsetup/install/files/lib/data/paid/subscription/PaidSubscription.class.php
wcfsetup/install/files/lib/data/paid/subscription/PaidSubscriptionAction.class.php
wcfsetup/install/files/lib/data/paid/subscription/transaction/log/PaidSubscriptionTransactionLog.class.php
wcfsetup/install/files/lib/data/paid/subscription/user/PaidSubscriptionUser.class.php
wcfsetup/install/files/lib/data/paid/subscription/user/PaidSubscriptionUserAction.class.php
wcfsetup/install/files/lib/data/poll/Poll.class.php
wcfsetup/install/files/lib/data/poll/PollAction.class.php
wcfsetup/install/files/lib/data/search/keyword/SearchKeywordAction.class.php
wcfsetup/install/files/lib/data/session/SessionAction.class.php
wcfsetup/install/files/lib/data/sitemap/SitemapAction.class.php
wcfsetup/install/files/lib/data/smiley/Smiley.class.php
wcfsetup/install/files/lib/data/smiley/SmileyAction.class.php
wcfsetup/install/files/lib/data/smiley/SmileyCache.class.php
wcfsetup/install/files/lib/data/smiley/category/SmileyCategoryAction.class.php
wcfsetup/install/files/lib/data/stat/daily/StatDailyAction.class.php
wcfsetup/install/files/lib/data/style/Style.class.php
wcfsetup/install/files/lib/data/tag/Tag.class.php
wcfsetup/install/files/lib/data/tag/TagAction.class.php
wcfsetup/install/files/lib/data/template/Template.class.php
wcfsetup/install/files/lib/data/template/TemplateAction.class.php
wcfsetup/install/files/lib/data/template/group/TemplateGroup.class.php
wcfsetup/install/files/lib/data/template/group/TemplateGroupAction.class.php
wcfsetup/install/files/lib/data/user/TeamList.class.php
wcfsetup/install/files/lib/data/user/UserBirthdayAction.class.php
wcfsetup/install/files/lib/data/user/UserProfileAction.class.php
wcfsetup/install/files/lib/data/user/UserRegistrationAction.class.php
wcfsetup/install/files/lib/data/user/activity/event/UserActivityEvent.class.php
wcfsetup/install/files/lib/data/user/activity/event/UserActivityEventAction.class.php
wcfsetup/install/files/lib/data/user/authentication/failure/UserAuthenticationFailure.class.php
wcfsetup/install/files/lib/data/user/avatar/Gravatar.class.php
wcfsetup/install/files/lib/data/user/avatar/UserAvatar.class.php
wcfsetup/install/files/lib/data/user/avatar/UserAvatarAction.class.php
wcfsetup/install/files/lib/data/user/avatar/UserAvatarEditor.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollow.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowAction.class.php
wcfsetup/install/files/lib/data/user/follow/UserFollowingAction.class.php
wcfsetup/install/files/lib/data/user/group/UserGroup.class.php
wcfsetup/install/files/lib/data/user/group/UserGroupAction.class.php
wcfsetup/install/files/lib/data/user/group/assignment/UserGroupAssignmentAction.class.php
wcfsetup/install/files/lib/data/user/group/option/UserGroupOptionAction.class.php
wcfsetup/install/files/lib/data/user/ignore/UserIgnore.class.php
wcfsetup/install/files/lib/data/user/menu/item/UserMenuItem.class.php
wcfsetup/install/files/lib/data/user/notification/UserNotification.class.php
wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatch.class.php
wcfsetup/install/files/lib/data/user/object/watch/UserObjectWatchAction.class.php
wcfsetup/install/files/lib/data/user/online/UsersOnlineList.class.php
wcfsetup/install/files/lib/data/user/option/UserOptionAction.class.php
wcfsetup/install/files/lib/data/user/option/ViewableUserOption.class.php
wcfsetup/install/files/lib/data/user/option/category/UserOptionCategory.class.php
wcfsetup/install/files/lib/data/user/option/category/UserOptionCategoryAction.class.php
wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItem.class.php
wcfsetup/install/files/lib/data/user/profile/menu/item/UserProfileMenuItemAction.class.php
wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitor.class.php
wcfsetup/install/files/lib/data/user/profile/visitor/UserProfileVisitorAction.class.php
wcfsetup/install/files/lib/data/user/rank/UserRankAction.class.php
wcfsetup/install/files/lib/form/AbstractCaptchaForm.class.php
wcfsetup/install/files/lib/form/AbstractForm.class.php
wcfsetup/install/files/lib/form/AccountManagementForm.class.php
wcfsetup/install/files/lib/form/AvatarEditForm.class.php
wcfsetup/install/files/lib/form/EmailActivationForm.class.php
wcfsetup/install/files/lib/form/EmailNewActivationCodeForm.class.php
wcfsetup/install/files/lib/form/LostPasswordForm.class.php
wcfsetup/install/files/lib/form/MessageForm.class.php
wcfsetup/install/files/lib/form/ModerationActivationForm.class.php
wcfsetup/install/files/lib/form/ModerationReportForm.class.php
wcfsetup/install/files/lib/form/NewPasswordForm.class.php
wcfsetup/install/files/lib/form/NotificationSettingsForm.class.php
wcfsetup/install/files/lib/form/RecaptchaForm.class.php
wcfsetup/install/files/lib/form/RegisterActivationForm.class.php
wcfsetup/install/files/lib/form/RegisterNewActivationCodeForm.class.php
wcfsetup/install/files/lib/form/SearchForm.class.php
wcfsetup/install/files/lib/form/SettingsForm.class.php
wcfsetup/install/files/lib/form/SignatureEditForm.class.php
wcfsetup/install/files/lib/page/AbstractFeedPage.class.php
wcfsetup/install/files/lib/page/AbstractPage.class.php
wcfsetup/install/files/lib/page/AttachmentPage.class.php
wcfsetup/install/files/lib/page/DeletedContentListPage.class.php
wcfsetup/install/files/lib/page/FollowingPage.class.php
wcfsetup/install/files/lib/page/IgnoredUsersPage.class.php
wcfsetup/install/files/lib/page/ModerationListPage.class.php
wcfsetup/install/files/lib/page/MultipleLinkPage.class.php
wcfsetup/install/files/lib/page/NotificationListPage.class.php
wcfsetup/install/files/lib/page/PaidSubscriptionListPage.class.php
wcfsetup/install/files/lib/page/PaidSubscriptionReturnPage.class.php
wcfsetup/install/files/lib/page/SearchResultPage.class.php
wcfsetup/install/files/lib/page/SortablePage.class.php
wcfsetup/install/files/lib/page/TaggedPage.class.php
wcfsetup/install/files/lib/system/CLIWCF.class.php
wcfsetup/install/files/lib/system/MetaTagHandler.class.php
wcfsetup/install/files/lib/system/Regex.class.php
wcfsetup/install/files/lib/system/SingletonFactory.class.php
wcfsetup/install/files/lib/system/WCF.class.php
wcfsetup/install/files/lib/system/WCFACP.class.php
wcfsetup/install/files/lib/system/acl/ACLHandler.class.php
wcfsetup/install/files/lib/system/ad/AdHandler.class.php
wcfsetup/install/files/lib/system/application/AbstractApplication.class.php
wcfsetup/install/files/lib/system/attachment/AbstractAttachmentObjectType.class.php
wcfsetup/install/files/lib/system/attachment/AttachmentHandler.class.php
wcfsetup/install/files/lib/system/bbcode/AttachmentBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/BBCodeHandler.class.php
wcfsetup/install/files/lib/system/bbcode/BBCodeParser.class.php
wcfsetup/install/files/lib/system/bbcode/CodeBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/HtmlBBCodeParser.class.php
wcfsetup/install/files/lib/system/bbcode/KeywordHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/MessageParser.class.php
wcfsetup/install/files/lib/system/bbcode/PreParser.class.php
wcfsetup/install/files/lib/system/bbcode/QuoteBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/SimpleMessageParser.class.php
wcfsetup/install/files/lib/system/bbcode/SpoilerBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/TableBBCode.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/BashHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/BrainfuckHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/CHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/CssHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/DiffHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/Highlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/JavaHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/JsHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/PerlHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/PhpHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/PythonHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/SqlHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/TexHighlighter.class.php
wcfsetup/install/files/lib/system/bbcode/highlighter/XmlHighlighter.class.php
wcfsetup/install/files/lib/system/benchmark/Benchmark.class.php
wcfsetup/install/files/lib/system/box/BoxHandler.class.php
wcfsetup/install/files/lib/system/box/StatisticsBoxController.class.php
wcfsetup/install/files/lib/system/bulk/processing/user/DeleteUserBulkProcessingAction.class.php
wcfsetup/install/files/lib/system/bulk/processing/user/RemoveFromUserGroupsUserBulkProcessingAction.class.php
wcfsetup/install/files/lib/system/bulk/processing/user/SendMailUserBulkProcessingAction.class.php
wcfsetup/install/files/lib/system/cache/CacheHandler.class.php
wcfsetup/install/files/lib/system/cache/builder/ACLOptionCategoryCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ACPMenuCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/AbstractCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/AdCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/BBCodeCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CaptchaQuestionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CategoryACLOptionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CategoryCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ClipboardPageCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ConditionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CoreObjectCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/CronjobCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/EventListenerCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/LanguageCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/NoticeCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/ObjectTypeCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/PackageCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/PackageUpdateCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/PaidSubscriptionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/SmileyCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/StyleCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/TagCloudCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/TemplateListenerCodeCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserBirthdayCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserGroupAssignmentCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserGroupCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserGroupOptionCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserMenuCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserNotificationEventCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/builder/UserStatsCacheBuilder.class.php
wcfsetup/install/files/lib/system/cache/source/MemcachedCacheSource.class.php
wcfsetup/install/files/lib/system/captcha/CaptchaHandler.class.php
wcfsetup/install/files/lib/system/captcha/RecaptchaHandler.class.php
wcfsetup/install/files/lib/system/category/AbstractCategoryType.class.php
wcfsetup/install/files/lib/system/category/CategoryHandler.class.php
wcfsetup/install/files/lib/system/cli/DatabaseCLICommandHistory.class.php
wcfsetup/install/files/lib/system/cli/command/CLICommandHandler.class.php
wcfsetup/install/files/lib/system/cli/command/CLICommandNameCompleter.class.php
wcfsetup/install/files/lib/system/cli/command/CronjobCLICommand.class.php
wcfsetup/install/files/lib/system/cli/command/HelpCLICommand.class.php
wcfsetup/install/files/lib/system/cli/command/ImportCLICommand.class.php
wcfsetup/install/files/lib/system/cli/command/WorkerCLICommand.class.php
wcfsetup/install/files/lib/system/clipboard/ClipboardEditorItem.class.php
wcfsetup/install/files/lib/system/clipboard/ClipboardHandler.class.php
wcfsetup/install/files/lib/system/clipboard/action/AbstractClipboardAction.class.php
wcfsetup/install/files/lib/system/clipboard/action/TagClipboardAction.class.php
wcfsetup/install/files/lib/system/clipboard/action/UserClipboardAction.class.php
wcfsetup/install/files/lib/system/clipboard/action/UserContentClipboardAction.class.php
wcfsetup/install/files/lib/system/comment/manager/ModerationQueueCommentManager.class.php
wcfsetup/install/files/lib/system/comment/manager/UserProfileCommentManager.class.php
wcfsetup/install/files/lib/system/condition/ConditionHandler.class.php
wcfsetup/install/files/lib/system/cronjob/AttachmentCleanUpCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/CronjobScheduler.class.php
wcfsetup/install/files/lib/system/cronjob/DailyCleanUpCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/DailyMailNotificationCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/HourlyCleanUpCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/ModerationQueueCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/RefreshSearchRobotsCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/StatDailyBuilderCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/UserBanCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/UserGroupAssignmentCronjob.class.php
wcfsetup/install/files/lib/system/cronjob/UserQuitCronjob.class.php
wcfsetup/install/files/lib/system/database/MySQLDatabase.class.php
wcfsetup/install/files/lib/system/database/PostgreSQLDatabase.class.php
wcfsetup/install/files/lib/system/database/editor/DatabaseEditor.class.php
wcfsetup/install/files/lib/system/database/editor/MySQLDatabaseEditor.class.php
wcfsetup/install/files/lib/system/database/editor/PostgreSQLDatabaseEditor.class.php
wcfsetup/install/files/lib/system/database/util/ConditionBuilder.class.php
wcfsetup/install/files/lib/system/database/util/PreparedStatementConditionBuilder.class.php
wcfsetup/install/files/lib/system/database/util/SQLParser.class.php
wcfsetup/install/files/lib/system/edit/EditHistoryManager.class.php
wcfsetup/install/files/lib/system/event/EventHandler.class.php
wcfsetup/install/files/lib/system/event/listener/SessionAccessLogListener.class.php
wcfsetup/install/files/lib/system/exception/AJAXException.class.php
wcfsetup/install/files/lib/system/exception/NamedUserException.class.php
wcfsetup/install/files/lib/system/exception/PermissionDeniedException.class.php
wcfsetup/install/files/lib/system/exception/UserInputException.class.php
wcfsetup/install/files/lib/system/exception/ValidateActionException.class.php
wcfsetup/install/files/lib/system/exporter/AbstractExporter.class.php
wcfsetup/install/files/lib/system/form/FormDocument.class.php
wcfsetup/install/files/lib/system/form/container/AbstractFormElementContainer.class.php
wcfsetup/install/files/lib/system/form/container/MultipleSelectionFormElementContainer.class.php
wcfsetup/install/files/lib/system/form/element/MultipleSelectionFormElement.class.php
wcfsetup/install/files/lib/system/image/ImageHandler.class.php
wcfsetup/install/files/lib/system/image/adapter/GDImageAdapter.class.php
wcfsetup/install/files/lib/system/image/adapter/ImageAdapter.class.php
wcfsetup/install/files/lib/system/importer/AbstractACLImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractAttachmentImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractCategoryImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractCommentImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractCommentResponseImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractLikeImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractPollImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractPollOptionImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractPollOptionVoteImporter.class.php
wcfsetup/install/files/lib/system/importer/AbstractWatchedObjectImporter.class.php
wcfsetup/install/files/lib/system/importer/IImporter.class.php
wcfsetup/install/files/lib/system/importer/ImportHandler.class.php
wcfsetup/install/files/lib/system/importer/LabelGroupImporter.class.php
wcfsetup/install/files/lib/system/importer/LabelImporter.class.php
wcfsetup/install/files/lib/system/importer/SmileyImporter.class.php
wcfsetup/install/files/lib/system/importer/UserAvatarImporter.class.php
wcfsetup/install/files/lib/system/importer/UserCommentImporter.class.php
wcfsetup/install/files/lib/system/importer/UserFollowerImporter.class.php
wcfsetup/install/files/lib/system/importer/UserGroupImporter.class.php
wcfsetup/install/files/lib/system/importer/UserImporter.class.php
wcfsetup/install/files/lib/system/importer/UserOptionImporter.class.php
wcfsetup/install/files/lib/system/importer/UserRankImporter.class.php
wcfsetup/install/files/lib/system/io/File.class.php
wcfsetup/install/files/lib/system/io/RemoteFile.class.php
wcfsetup/install/files/lib/system/io/Tar.class.php
wcfsetup/install/files/lib/system/io/TarWriter.class.php
wcfsetup/install/files/lib/system/io/Zip.class.php
wcfsetup/install/files/lib/system/io/ZipWriter.class.php
wcfsetup/install/files/lib/system/label/LabelHandler.class.php
wcfsetup/install/files/lib/system/label/object/AbstractLabelObjectHandler.class.php
wcfsetup/install/files/lib/system/label/object/ILabelObjectHandler.class.php
wcfsetup/install/files/lib/system/label/object/type/LabelObjectTypeContainer.class.php
wcfsetup/install/files/lib/system/language/LanguageFactory.class.php
wcfsetup/install/files/lib/system/like/LikeHandler.class.php
wcfsetup/install/files/lib/system/log/modification/ModificationLogHandler.class.php
wcfsetup/install/files/lib/system/mail/Mail.class.php
wcfsetup/install/files/lib/system/mail/SMTPMailSender.class.php
wcfsetup/install/files/lib/system/menu/TreeMenu.class.php
wcfsetup/install/files/lib/system/menu/user/profile/content/AboutUserProfileMenuContent.class.php
wcfsetup/install/files/lib/system/menu/user/profile/content/CommentUserProfileMenuContent.class.php
wcfsetup/install/files/lib/system/menu/user/profile/content/LikesUserProfileMenuContent.class.php
wcfsetup/install/files/lib/system/menu/user/profile/content/RecentActivityUserProfileMenuContent.class.php
wcfsetup/install/files/lib/system/message/MessageFormSettingsHandler.class.php
wcfsetup/install/files/lib/system/message/QuickReplyManager.class.php
wcfsetup/install/files/lib/system/message/censorship/Censorship.class.php
wcfsetup/install/files/lib/system/message/embedded/object/AttachmentMessageEmbeddedObjectHandler.class.php
wcfsetup/install/files/lib/system/message/embedded/object/MessageEmbeddedObjectManager.class.php
wcfsetup/install/files/lib/system/message/quote/AbstractMessageQuoteHandler.class.php
wcfsetup/install/files/lib/system/message/quote/QuotedMessage.class.php
wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueHandler.class.php
wcfsetup/install/files/lib/system/moderation/queue/AbstractModerationQueueManager.class.php
wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueActivationManager.class.php
wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueManager.class.php
wcfsetup/install/files/lib/system/moderation/queue/ModerationQueueReportManager.class.php
wcfsetup/install/files/lib/system/notice/NoticeHandler.class.php
wcfsetup/install/files/lib/system/option/AbstractCategoryMultiSelectOptionType.class.php
wcfsetup/install/files/lib/system/option/BirthdayOptionType.class.php
wcfsetup/install/files/lib/system/option/BooleanOptionType.class.php
wcfsetup/install/files/lib/system/option/CaptchaSelectOptionType.class.php
wcfsetup/install/files/lib/system/option/FileOptionType.class.php
wcfsetup/install/files/lib/system/option/IntegerOptionType.class.php
wcfsetup/install/files/lib/system/option/MessageOptionType.class.php
wcfsetup/install/files/lib/system/option/MultiSelectOptionType.class.php
wcfsetup/install/files/lib/system/option/OptionHandler.class.php
wcfsetup/install/files/lib/system/option/PaymentMethodSelectOptionType.class.php
wcfsetup/install/files/lib/system/option/RadioButtonOptionType.class.php
wcfsetup/install/files/lib/system/option/SelectOptionType.class.php
wcfsetup/install/files/lib/system/option/TextI18nOptionType.class.php
wcfsetup/install/files/lib/system/option/TextOptionType.class.php
wcfsetup/install/files/lib/system/option/TextareaI18nOptionType.class.php
wcfsetup/install/files/lib/system/option/TextareaIpAddressOptionType.class.php
wcfsetup/install/files/lib/system/option/TextareaOptionType.class.php
wcfsetup/install/files/lib/system/option/TimezoneOptionType.class.php
wcfsetup/install/files/lib/system/option/user/DateUserOptionOutput.class.php
wcfsetup/install/files/lib/system/option/user/MessageUserOptionOutput.class.php
wcfsetup/install/files/lib/system/option/user/SelectOptionsUserOptionOutput.class.php
wcfsetup/install/files/lib/system/option/user/UserOptionHandler.class.php
wcfsetup/install/files/lib/system/option/user/group/BBCodeSelectUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/TextUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/TextareaUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/option/user/group/UserGroupsUserGroupOptionType.class.php
wcfsetup/install/files/lib/system/package/ACPTemplatesFileHandler.class.php
wcfsetup/install/files/lib/system/package/FilesFileHandler.class.php
wcfsetup/install/files/lib/system/package/PackageArchive.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationFormManager.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationNodeBuilder.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationSQLParser.class.php
wcfsetup/install/files/lib/system/package/PackageInstallationScheduler.class.php
wcfsetup/install/files/lib/system/package/PackageUninstallationNodeBuilder.class.php
wcfsetup/install/files/lib/system/package/PackageUpdateDispatcher.class.php
wcfsetup/install/files/lib/system/package/PackageUpdateUnauthorizedException.class.php
wcfsetup/install/files/lib/system/package/TemplatesFileHandler.class.php
wcfsetup/install/files/lib/system/package/plugin/ACLOptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPSearchProviderPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ACPTemplatePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractMenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractOptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/AbstractXMLPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ClipboardActionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/CoreObjectPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/CronjobPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/EventListenerPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/FilePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/LanguagePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/MenuItemPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/MenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ObjectTypeDefinitionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ObjectTypePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/OptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/PIPPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/SQLPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/ScriptPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/SitemapPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/SmileyPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/StylePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/TemplateListenerPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/TemplatePackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserGroupOptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserNotificationEventPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserOptionPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/plugin/UserProfileMenuPackageInstallationPlugin.class.php
wcfsetup/install/files/lib/system/package/validation/PackageValidationArchive.class.php
wcfsetup/install/files/lib/system/package/validation/PackageValidationException.class.php
wcfsetup/install/files/lib/system/package/validation/PackageValidationManager.class.php
wcfsetup/install/files/lib/system/page/PageManager.class.php
wcfsetup/install/files/lib/system/payment/method/PaymentMethodHandler.class.php
wcfsetup/install/files/lib/system/payment/method/PaypalPaymentMethod.class.php
wcfsetup/install/files/lib/system/payment/method/SofortUeberweisungPaymentMethod.class.php
wcfsetup/install/files/lib/system/payment/type/PaidSubscriptionPaymentType.class.php
wcfsetup/install/files/lib/system/poll/PollManager.class.php
wcfsetup/install/files/lib/system/recaptcha/RecaptchaHandlerV2.class.php
wcfsetup/install/files/lib/system/request/FlexibleRoute.class.php
wcfsetup/install/files/lib/system/request/RequestHandler.class.php
wcfsetup/install/files/lib/system/request/Route.class.php
wcfsetup/install/files/lib/system/request/RouteHandler.class.php
wcfsetup/install/files/lib/system/search/AbstractSearchIndexManager.class.php
wcfsetup/install/files/lib/system/search/ISearchEngine.class.php
wcfsetup/install/files/lib/system/search/SearchEngine.class.php
wcfsetup/install/files/lib/system/search/SearchIndexManager.class.php
wcfsetup/install/files/lib/system/search/SearchKeywordManager.class.php
wcfsetup/install/files/lib/system/search/SearchResultTextParser.class.php
wcfsetup/install/files/lib/system/search/acp/ACPSearchHandler.class.php
wcfsetup/install/files/lib/system/search/acp/ACPSearchResultList.class.php
wcfsetup/install/files/lib/system/search/acp/AbstractCategorizedACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/MenuItemACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/OptionACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/PackageACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/UserACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/acp/UserGroupOptionACPSearchResultProvider.class.php
wcfsetup/install/files/lib/system/search/mysql/MysqlSearchEngine.class.php
wcfsetup/install/files/lib/system/search/mysql/MysqlSearchIndexManager.class.php
wcfsetup/install/files/lib/system/session/SessionHandler.class.php
wcfsetup/install/files/lib/system/setup/Installer.class.php
wcfsetup/install/files/lib/system/setup/Uninstaller.class.php
wcfsetup/install/files/lib/system/sitemap/SitemapHandler.class.php
wcfsetup/install/files/lib/system/stat/AbstractCommentStatDailyHandler.class.php
wcfsetup/install/files/lib/system/stat/AbstractDiskUsageStatDailyHandler.class.php
wcfsetup/install/files/lib/system/stat/AbstractStatDailyHandler.class.php
wcfsetup/install/files/lib/system/stat/AttachmentDiskUsageStatDailyHandler.class.php
wcfsetup/install/files/lib/system/stat/AttachmentStatDailyHandler.class.php
wcfsetup/install/files/lib/system/stat/LikeStatDailyHandler.class.php
wcfsetup/install/files/lib/system/stat/UserStatDailyHandler.class.php
wcfsetup/install/files/lib/system/style/StyleHandler.class.php
wcfsetup/install/files/lib/system/tagging/TagCloud.class.php
wcfsetup/install/files/lib/system/tagging/TagEngine.class.php
wcfsetup/install/files/lib/system/tagging/TypedTagCloud.class.php
wcfsetup/install/files/lib/system/template/ACPTemplateEngine.class.php
wcfsetup/install/files/lib/system/template/TemplateEngine.class.php
wcfsetup/install/files/lib/system/template/TemplateScriptingCompiler.class.php
wcfsetup/install/files/lib/system/template/plugin/CounterFunctionTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/CycleFunctionTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/HascontentPrefilterTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/HtmlCheckboxesFunctionTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/HtmlOptionsFunctionTemplatePlugin.class.php
wcfsetup/install/files/lib/system/template/plugin/ImplodeCompilerTemplatePlugin.class.php
wcfsetup/install/files/lib/system/upload/DefaultUploadFileValidationStrategy.class.php
wcfsetup/install/files/lib/system/upload/UploadFile.class.php
wcfsetup/install/files/lib/system/upload/UploadHandler.class.php
wcfsetup/install/files/lib/system/user/GroupedUserList.class.php
wcfsetup/install/files/lib/system/user/UserBirthdayCache.class.php
wcfsetup/install/files/lib/system/user/activity/event/FollowUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/activity/event/ProfileCommentUserActivityEvent.class.php
wcfsetup/install/files/lib/system/user/activity/event/UserActivityEventHandler.class.php
wcfsetup/install/files/lib/system/user/activity/point/UserActivityPointHandler.class.php
wcfsetup/install/files/lib/system/user/authentication/UserAuthenticationFactory.class.php
wcfsetup/install/files/lib/system/user/collapsible/content/UserCollapsibleContentHandler.class.php
wcfsetup/install/files/lib/system/user/collapsible/content/UserCollapsibleSidebarHandler.class.php
wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php
wcfsetup/install/files/lib/system/user/notification/UserNotificationHandler.class.php
wcfsetup/install/files/lib/system/user/notification/event/AbstractSharedUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/IUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserFollowFollowingUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/event/UserProfileCommentUserNotificationEvent.class.php
wcfsetup/install/files/lib/system/user/notification/object/type/AbstractUserNotificationObjectType.class.php
wcfsetup/install/files/lib/system/user/notification/object/type/UserProfileCommentUserNotificationObjectType.class.php
wcfsetup/install/files/lib/system/user/object/watch/UserObjectWatchHandler.class.php
wcfsetup/install/files/lib/system/user/online/location/UserLocation.class.php
wcfsetup/install/files/lib/system/user/signature/SignatureCache.class.php
wcfsetup/install/files/lib/system/user/storage/UserStorageHandler.class.php
wcfsetup/install/files/lib/system/visitTracker/VisitTracker.class.php
wcfsetup/install/files/lib/system/worker/AbstractRebuildDataWorker.class.php
wcfsetup/install/files/lib/system/worker/AbstractWorker.class.php
wcfsetup/install/files/lib/system/worker/AttachmentRebuildDataWorker.class.php
wcfsetup/install/files/lib/system/worker/ImportWorker.class.php
wcfsetup/install/files/lib/system/worker/LikeRebuildDataWorker.class.php
wcfsetup/install/files/lib/system/worker/LikeUserRebuildDataWorker.class.php
wcfsetup/install/files/lib/system/worker/MailWorker.class.php
wcfsetup/install/files/lib/system/worker/SendNewPasswordWorker.class.php
wcfsetup/install/files/lib/system/worker/StatDailyRebuildDataWorker.class.php
wcfsetup/install/files/lib/system/worker/UserActivityPointUpdateEventsWorker.class.php
wcfsetup/install/files/lib/system/worker/UserRebuildDataWorker.class.php
wcfsetup/install/files/lib/util/ArrayUtil.class.php
wcfsetup/install/files/lib/util/CLIUtil.class.php
wcfsetup/install/files/lib/util/CronjobUtil.class.php
wcfsetup/install/files/lib/util/DateUtil.class.php
wcfsetup/install/files/lib/util/Diff.class.php
wcfsetup/install/files/lib/util/DirectoryUtil.class.php
wcfsetup/install/files/lib/util/ExifUtil.class.php
wcfsetup/install/files/lib/util/FileReader.class.php
wcfsetup/install/files/lib/util/HTTPRequest.class.php
wcfsetup/install/files/lib/util/HeaderUtil.class.php
wcfsetup/install/files/lib/util/MathUtil.class.php
wcfsetup/install/files/lib/util/MessageUtil.class.php
wcfsetup/install/files/lib/util/OptionUtil.class.php
wcfsetup/install/files/lib/util/PasswordUtil.class.php
wcfsetup/install/files/lib/util/StringStack.class.php
wcfsetup/install/files/lib/util/StringUtil.class.php
wcfsetup/install/files/lib/util/UserUtil.class.php
wcfsetup/install/files/lib/util/XML.class.php
wcfsetup/install/files/lib/util/XMLWriter.class.php

index 3da6367ac2f0579245f224e0cd689df90f56fc69..622b83f699a7b401342c11b0f222b8a0dd238c18 100644 (file)
@@ -19,7 +19,7 @@ set_exception_handler('handleException');
 set_error_handler('handleError', E_ALL);
 
 // define list of needed file
-$neededFilesPattern = array(
+$neededFilesPattern = [
        '!^setup/.*!',
        '!^install/files/acp/images/wcfLogo.*!',
        '!^install/files/acp/style/setup/.*!',
@@ -29,7 +29,7 @@ $neededFilesPattern = array(
        '!^install/files/lib/system/.*!',
        '!^install/files/lib/util/.*!',
        '!^install/lang/.*!',
-       '!^install/packages/.*!');
+       '!^install/packages/.*!'];
        
 // define needed functions and classes
 /**
@@ -383,7 +383,7 @@ class BasicFileUtil {
  */
 class Tar {
        protected $archiveName = '';
-       protected $contentList = array();
+       protected $contentList = [];
        protected $opened = false;
        protected $read = false;
        protected $file = null;
@@ -588,7 +588,7 @@ class Tar {
         * This does not get the entire to memory but only parts of it.
         */
        protected function readContent() {
-               $this->contentList = array();
+               $this->contentList = [];
                $this->read = true;
                $i = 0;
                
@@ -636,7 +636,7 @@ class Tar {
                        return false;
                }
                
-               $header = array();
+               $header = [];
                $checksum = 0;
                // First part of the header
                for ($i = 0; $i < 148; $i++) {
index 94ccf37e8e42c054ff528fc16551695eabd15cf4..5d8af3ff74faebd85e2ab42ccb611224c6e94ec3 100644 (file)
  */
 
 // list of known font types
-$types = array(
+$types = [
        'eot' => 'application/vnd.ms-fontobject',
        'ttf' => 'application/octet-stream',
        'woff' => 'application/x-woff', // best supported, but this is not the right one according to http://www.w3.org/TR/WOFF/#appendix-b
        'woff2' => 'font/woff2' // the specs at http://dev.w3.org/webfonts/WOFF2/spec/ are not perfectly clear, but font/woff2 seems to be the most sane one and is currently used by Google Fonts
-);
+];
 
 // get parameters
 $type = $_GET['type'];
index 4358363adb1091a3e9cdb47c74c05f391db9761c..a7059a561955b1243d9cd2b97573efeca1bbca39 100644 (file)
@@ -21,7 +21,7 @@ class CacheClearAction extends AbstractAction {
        /**
         * @see \wcf\action\AbstractAction::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canViewLog');
+       public $neededPermissions = ['admin.management.canViewLog'];
        
        /**
         * @see \wcf\action\IAction::execute()
index 02e79e386c921e3470e1f38ca8d7c1a6bc1e5d27..46620c15a7790f925a5ecfd3f51936d8f0ddf2e0 100755 (executable)
@@ -74,14 +74,14 @@ class InstallPackageAction extends AbstractDialogAction {
                $queueID = $this->installation->nodeBuilder->getQueueByNode($this->installation->queue->processNo, $step->getNode());
                
                if ($step->hasDocument()) {
-                       $this->data = array(
+                       $this->data = [
                                'currentAction' => $this->getCurrentAction($queueID),
                                'innerTemplate' => $step->getTemplate(),
                                'node' => $step->getNode(),
                                'progress' => $this->installation->nodeBuilder->calculateProgress($this->node),
                                'step' => 'install',
                                'queueID' => $queueID
-                       );
+                       ];
                }
                else {
                        if ($step->getNode() == '') {
@@ -115,7 +115,7 @@ class InstallPackageAction extends AbstractDialogAction {
                                        FROM    wcf".WCF_N."_application
                                        WHERE   packageID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array($packageID));
+                               $statement->execute([$packageID]);
                                $application = $statement->fetchObject('wcf\data\application\Application');
                                
                                // build redirect location
@@ -124,25 +124,25 @@ class InstallPackageAction extends AbstractDialogAction {
                                WCF::resetZendOpcache();
                                
                                // show success
-                               $this->data = array(
+                               $this->data = [
                                        'currentAction' => $this->getCurrentAction(null),
                                        'progress' => 100,
                                        'redirectLocation' => $location,
                                        'step' => 'success'
-                               );
+                               ];
                                return;
                        }
                        
                        WCF::resetZendOpcache();
                        
                        // continue with next node
-                       $this->data = array(
+                       $this->data = [
                                'currentAction' => $this->getCurrentAction($queueID),
                                'step' => 'install',
                                'node' => $step->getNode(),
                                'progress' => $this->installation->nodeBuilder->calculateProgress($this->node),
                                'queueID' => $queueID
-                       );
+                       ];
                }
        }
        
@@ -161,19 +161,19 @@ class InstallPackageAction extends AbstractDialogAction {
                $nextNode = $this->installation->nodeBuilder->getNextNode();
                $queueID = $this->installation->nodeBuilder->getQueueByNode($this->installation->queue->processNo, $nextNode);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'installationType' => $this->queue->action,
                        'packageName' => $this->installation->queue->packageName
-               ));
+               ]);
                
-               $this->data = array(
+               $this->data = [
                        'template' => WCF::getTPL()->fetch($this->templateName),
                        'step' => 'install',
                        'node' => $nextNode,
                        'currentAction' => $this->getCurrentAction($queueID),
                        'progress' => 0,
                        'queueID' => $queueID
-               );
+               ];
        }
        
        /**
@@ -182,10 +182,10 @@ class InstallPackageAction extends AbstractDialogAction {
         * @return      array
         */
        protected function stepRollback() {
-               $this->data = array(
+               $this->data = [
                        'packageID' => $this->queue->packageID,
                        'step' => 'rollback'
-               );
+               ];
        }
        
        /**
@@ -220,7 +220,7 @@ class InstallPackageAction extends AbstractDialogAction {
                        // build package name
                        $packageName = $this->installation->nodeBuilder->getPackageNameByQueue($queueID);
                        $installationType = $this->installation->nodeBuilder->getInstallationTypeByQueue($queueID);
-                       $currentAction = WCF::getLanguage()->getDynamicVariable('wcf.acp.package.installation.step.'.$installationType, array('packageName' => $packageName));
+                       $currentAction = WCF::getLanguage()->getDynamicVariable('wcf.acp.package.installation.step.'.$installationType, ['packageName' => $packageName]);
                }
                
                return $currentAction;
index 7993a3f8c9aac3f2e2160e5611c9eac1d41f0779..b3a7b3fb7af4425cf6a6ca841e1bb83932afd9f6 100644 (file)
@@ -67,13 +67,13 @@ class UninstallPackageAction extends InstallPackageAction {
                $processNo = PackageInstallationQueue::getNewProcessNo();
                        
                // create queue
-               $queue = PackageInstallationQueueEditor::create(array(
+               $queue = PackageInstallationQueueEditor::create([
                        'processNo' => $processNo,
                        'userID' => WCF::getUser()->userID,
                        'packageName' => $package->getName(),
                        'packageID' => $package->packageID,
                        'action' => 'uninstall'
-               ));
+               ]);
                
                // initialize uninstallation
                $this->installation = new PackageUninstallationDispatcher($queue);
@@ -81,19 +81,19 @@ class UninstallPackageAction extends InstallPackageAction {
                $this->installation->nodeBuilder->purgeNodes();
                $this->installation->nodeBuilder->buildNodes();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'queue' => $queue
-               ));
+               ]);
                
                $queueID = $this->installation->nodeBuilder->getQueueByNode($queue->processNo, $this->installation->nodeBuilder->getNextNode());
-               $this->data = array(
+               $this->data = [
                        'template' => WCF::getTPL()->fetch($this->templateName),
                        'step' => 'uninstall',
                        'node' => $this->installation->nodeBuilder->getNextNode(),
                        'currentAction' => $this->getCurrentAction($queueID),
                        'progress' => 0,
                        'queueID' => $queueID
-               );
+               ];
        }
        
        /**
@@ -131,30 +131,30 @@ class UninstallPackageAction extends InstallPackageAction {
                                FROM    wcf".WCF_N."_application
                                WHERE   packageID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($packageID));
+                       $statement->execute([$packageID]);
                        $application = $statement->fetchObject('wcf\data\application\Application');
                        
                        // build redirect location
                        $location = $application->getPageURL() . 'acp/index.php?package-list/';
                        
                        // show success
-                       $this->data = array(
+                       $this->data = [
                                'currentAction' => WCF::getLanguage()->get('wcf.acp.package.uninstallation.step.success'),
                                'progress' => 100,
                                'redirectLocation' => $location,
                                'step' => 'success'
-                       );
+                       ];
                        return;
                }
                
                // continue with next node
                $queueID = $this->installation->nodeBuilder->getQueueByNode($this->installation->queue->processNo, $this->installation->nodeBuilder->getNextNode($this->node));
-               $this->data = array(
+               $this->data = [
                        'step' => 'uninstall',
                        'node' => $node,
                        'progress' => $this->installation->nodeBuilder->calculateProgress($this->node),
                        'queueID' => $queueID
-               );
+               ];
        }
        
        /**
@@ -185,7 +185,7 @@ class UninstallPackageAction extends InstallPackageAction {
                        // build package name
                        $packageName = $this->installation->nodeBuilder->getPackageNameByQueue($queueID);
                        $installationType = $this->installation->nodeBuilder->getInstallationTypeByQueue($queueID);
-                       $currentAction = WCF::getLanguage()->getDynamicVariable('wcf.acp.package.uninstallation.step.'.$installationType, array('packageName' => $packageName));
+                       $currentAction = WCF::getLanguage()->getDynamicVariable('wcf.acp.package.uninstallation.step.'.$installationType, ['packageName' => $packageName]);
                }
                
                return $currentAction;
index 4acc62fcde7eb23cc9f9d4da0e58addebb4e90ff..04314614d08bb5768d08584334ea1a96cf390530 100644 (file)
@@ -22,7 +22,7 @@ class UserQuickSearchAction extends AbstractAction {
        /**
         * @see \wcf\action\AbstractAction::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canEditUser');
+       public $neededPermissions = ['admin.user.canEditUser'];
        
        /**
         * search mode
@@ -34,7 +34,7 @@ class UserQuickSearchAction extends AbstractAction {
         * matches
         * @var integer[]
         */
-       public $matches = array();
+       public $matches = [];
        
        /**
         * results per page
@@ -46,7 +46,7 @@ class UserQuickSearchAction extends AbstractAction {
         * shown columns
         * @var string[]
         */
-       public $columns = array('registrationDate', 'lastActivityTime');
+       public $columns = ['registrationDate', 'lastActivityTime'];
        
        /**
         * sort field
@@ -96,7 +96,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        ON              (option_value.userID = user_table.userID)
                                        WHERE           banned = ?";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
-                               $statement->execute(array(1));
+                               $statement->execute([1]);
                                $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                                
@@ -124,7 +124,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        WHERE           activationCode <> ?
                                        ORDER BY        user_table.registrationDate DESC";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
-                               $statement->execute(array(0));
+                               $statement->execute([0]);
                                $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                        
@@ -135,7 +135,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        ON              (option_value.userID = user_table.userID)
                                        WHERE           disableAvatar = ?";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
-                               $statement->execute(array(1));
+                               $statement->execute([1]);
                                $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                                        
@@ -146,7 +146,7 @@ class UserQuickSearchAction extends AbstractAction {
                                        ON              (option_value.userID = user_table.userID)
                                        WHERE           disableSignature = ?";
                                $statement = WCF::getDB()->prepareStatement($sql, $this->maxResults);
-                               $statement->execute(array(1));
+                               $statement->execute([1]);
                                $this->matches = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                break;
                }
@@ -156,22 +156,22 @@ class UserQuickSearchAction extends AbstractAction {
                }
                
                // store search result in database
-               $data = serialize(array(
+               $data = serialize([
                        'matches' => $this->matches,
                        'itemsPerPage' => $this->itemsPerPage,
                        'columns' => $this->columns
-               ));
+               ]);
                
-               $search = SearchEditor::create(array(
+               $search = SearchEditor::create([
                        'userID' => WCF::getUser()->userID,
                        'searchData' => $data,
                        'searchTime' => TIME_NOW,
                        'searchType' => 'users'
-               ));
+               ]);
                $this->executed();
                
                // forward to result page
-               $url = LinkHandler::getInstance()->getLink('UserList', array('id' => $search->searchID), 'sortField='.rawurlencode($this->sortField).'&sortOrder='.rawurlencode($this->sortOrder));
+               $url = LinkHandler::getInstance()->getLink('UserList', ['id' => $search->searchID], 'sortField='.rawurlencode($this->sortField).'&sortOrder='.rawurlencode($this->sortOrder));
                HeaderUtil::redirect($url);
                exit;
        }
index 401a65400f00477ca48fb8527e1a89e2286b1768..0e6a84a9281e43c15852d2e218a088090df5587c 100644 (file)
@@ -32,7 +32,7 @@ class WorkerProxyAction extends AJAXInvokeAction {
         * parameters for worker action
         * @var array
         */
-       protected $parameters = array();
+       protected $parameters = [];
        
        /**
         * worker object
@@ -40,7 +40,7 @@ class WorkerProxyAction extends AJAXInvokeAction {
         */
        protected $worker = null;
        
-       public static $allowInvoke = array();
+       public static $allowInvoke = [];
        
        /**
         * @see \wcf\action\IAction::readParameters()
@@ -108,13 +108,13 @@ class WorkerProxyAction extends AJAXInvokeAction {
                if ($parameters === null) $parameters = $this->parameters;
                
                // build return values
-               $returnValues = array(
+               $returnValues = [
                        'className' => $this->className,
                        'loopCount' => ($this->loopCount + 1),
                        'parameters' => $parameters,
                        'proceedURL' => $proceedURL,
                        'progress' => $progress
-               );
+               ];
                
                // include template on startup
                if ($this->loopCount == -1) {
index 8574c0d7095f6a9f1e8672b94649ca4a759b7054..e94fc780902ecafcedf92e0e2926a5b5c22d70b5 100644 (file)
@@ -24,7 +24,7 @@ abstract class AbstractBulkProcessingForm extends AbstractForm {
         * object action object type types
         * @var ObjectType[]
         */
-       public $actions = array();
+       public $actions = [];
        
        /**
         * number of objects affected by bulk processing
@@ -36,7 +36,7 @@ abstract class AbstractBulkProcessingForm extends AbstractForm {
         * object condition object type types
         * @var ObjectType[]
         */
-       public $conditions = array();
+       public $conditions = [];
        
        /**
         * list with bulk processed objects
index 56c5cf8a13b4b8094f19c23926290f5fb2cefe72..e0a7f786d105abc757632624af2aaf83545c6cd3 100755 (executable)
@@ -17,12 +17,12 @@ abstract class AbstractOptionListForm extends AbstractForm {
        /**
         * @see \wcf\form\AbstractForm::$errorField
         */
-       public $errorField = array();
+       public $errorField = [];
        
        /**
         * @see \wcf\form\AbstractForm::$errorType
         */
-       public $errorType = array();
+       public $errorType = [];
        
        /**
         * name of the active option category
index 44ac49b26c70fbd0104520fdda895ba6b8c72591..cbdf84488cb915d6f35f480fb0680365bebde9dd 100644 (file)
@@ -29,12 +29,12 @@ class AdAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.ad.canManageAd');
+       public $neededPermissions = ['admin.ad.canManageAd'];
        
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_WCF_AD');
+       public $neededModules = ['MODULE_WCF_AD'];
        
        /**
         * html code of the ad
@@ -52,7 +52,7 @@ class AdAddForm extends AbstractForm {
         * grouped ad condition object types
         * @var array
         */
-       public $groupedConditionObjectTypes = array();
+       public $groupedConditionObjectTypes = [];
        
        /**
         * 1 if the ad is disabled
@@ -64,13 +64,13 @@ class AdAddForm extends AbstractForm {
         * list of available location object types
         * @var ObjectType[]
         */
-       public $locationObjectTypes = array();
+       public $locationObjectTypes = [];
        
        /**
         * list of available locations
         * @var string[]
         */
-       public $locations = array();
+       public $locations = [];
        
        /**
         * id of the selected location's object type
@@ -90,7 +90,7 @@ class AdAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'ad' => $this->ad,
                        'adName' => $this->adName,
@@ -100,7 +100,7 @@ class AdAddForm extends AbstractForm {
                        'groupedConditionObjectTypes' => $this->groupedConditionObjectTypes,
                        'objectTypeID' => $this->objectTypeID,
                        'showOrder' => $this->showOrder
-               ));
+               ]);
        }
        
        /**
@@ -112,12 +112,12 @@ class AdAddForm extends AbstractForm {
                        if (!$objectType->conditionobject) continue;
                        
                        if (!isset($this->groupedConditionObjectTypes[$objectType->conditionobject])) {
-                               $this->groupedConditionObjectTypes[$objectType->conditionobject] = array();
+                               $this->groupedConditionObjectTypes[$objectType->conditionobject] = [];
                        }
                        
                        if ($objectType->conditiongroup) {
                                if (!isset($this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup])) {
-                                       $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup] = array();
+                                       $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup] = [];
                                }
                                
                                $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup][$objectType->objectTypeID] = $objectType;
@@ -167,19 +167,19 @@ class AdAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new AdAction(array(), 'create', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new AdAction([], 'create', [
+                       'data' => array_merge($this->additionalFields, [
                                'ad' => $this->ad,
                                'adName' => $this->adName,
                                'isDisabled' => $this->isDisabled,
                                'objectTypeID' => $this->objectTypeID,
                                'showOrder' => $this->showOrder
-                       ))
-               ));
+                       ])
+               ]);
                $returnValues = $this->objectAction->executeAction();
                
                // transform conditions array into one-dimensional array
-               $conditions = array();
+               $conditions = [];
                foreach ($this->groupedConditionObjectTypes as $groupedObjectTypes) {
                        foreach ($groupedObjectTypes as $objectTypes) {
                                if (is_array($objectTypes)) {
index 2bccc3fa3bbcfb0efaa5332ec558c3b9effc7125..b35033cffe33f451eb304b5fef04ef9fa8e8daee 100644 (file)
@@ -41,10 +41,10 @@ class AdEditForm extends AdAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'adObject' => $this->adObject
-               ));
+               ]);
        }
        
        /**
@@ -61,7 +61,7 @@ class AdEditForm extends AdAddForm {
                        $this->showOrder = $this->adObject->showOrder;
                        
                        $conditions = $this->adObject->getConditions();
-                       $conditionsByObjectTypeID = array();
+                       $conditionsByObjectTypeID = [];
                        foreach ($conditions as $condition) {
                                $conditionsByObjectTypeID[$condition->objectTypeID] = $condition;
                        }
@@ -102,19 +102,19 @@ class AdEditForm extends AdAddForm {
        public function save() {
                AbstractForm::save();
                
-               $this->objectAction = new AdAction(array($this->adObject), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new AdAction([$this->adObject], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'ad' => $this->ad,
                                'adName' => $this->adName,
                                'isDisabled' => $this->isDisabled,
                                'objectTypeID' => $this->objectTypeID,
                                'showOrder' => $this->showOrder
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                
                // transform conditions array into one-dimensional array
-               $conditions = array();
+               $conditions = [];
                foreach ($this->groupedConditionObjectTypes as $groupedObjectTypes) {
                        foreach ($groupedObjectTypes as $objectTypes) {
                                if (is_array($objectTypes)) {
index 7f949879be792b04a324885443a5e2a40d459703..d8099c5e32c0f9c30d5357e2736c7440a4e7f58c 100644 (file)
@@ -56,7 +56,7 @@ class ApplicationEditForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.canManageApplication');
+       public $neededPermissions = ['admin.configuration.canManageApplication'];
        
        /**
         * application package id
@@ -149,11 +149,11 @@ class ApplicationEditForm extends AbstractForm {
                                AND domainPath = ?
                                AND packageID <> ?";
                $statement = WCF::getDB()->prepareStatement($sql, 1);
-               $statement->execute(array(
+               $statement->execute([
                        $this->domainName,
                        $this->domainPath,
                        $this->application->packageID
-               ));
+               ]);
                $row = $statement->fetchArray();
                if ($row) {
                        WCF::getTPL()->assign('conflictApplication', PackageCache::getInstance()->getPackage($row['packageID']));
@@ -168,11 +168,11 @@ class ApplicationEditForm extends AbstractForm {
                parent::save();
                
                // save application
-               $this->objectAction = new ApplicationAction(array($this->application->getDecoratedObject()), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new ApplicationAction([$this->application->getDecoratedObject()], 'update', ['data' => array_merge($this->additionalFields, [
                        'cookieDomain' => $this->cookieDomain,
                        'domainName' => $this->domainName,
                        'domainPath' => $this->domainPath
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                
                $this->saved();
@@ -181,9 +181,9 @@ class ApplicationEditForm extends AbstractForm {
                ApplicationHandler::rebuild();
                
                // show success.
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -192,12 +192,12 @@ class ApplicationEditForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'application' => $this->application,
                        'cookieDomain' => $this->cookieDomain,
                        'domainName' => $this->domainName,
                        'domainPath' => $this->domainPath,
                        'packageID' => $this->packageID
-               ));
+               ]);
        }
 }
index cd0af3a3b3a2d97dc0d0dcca85fdd1f1e4e8acf0..b696f50ca13803a411bbf186c68d14f16cb9636b 100644 (file)
@@ -32,7 +32,7 @@ class BBCodeMediaProviderAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.bbcode.canManageBBCode');
+       public $neededPermissions = ['admin.content.bbcode.canManageBBCode'];
        
        /**
         * @see \wcf\page\AbstractPage::$templateName
@@ -93,11 +93,11 @@ class BBCodeMediaProviderAddForm extends AbstractForm {
                parent::save();
                
                // save media provider
-               $this->objectAction = new BBCodeMediaProviderAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new BBCodeMediaProviderAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'title' => $this->title,
                        'regex' => $this->regex,
                        'html' => $this->html
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -105,9 +105,9 @@ class BBCodeMediaProviderAddForm extends AbstractForm {
                $this->title = $this->regex = $this->html = '';
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -116,11 +116,11 @@ class BBCodeMediaProviderAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'title' => $this->title,
                        'regex' => $this->regex,
                        'html' => $this->html
-               ));
+               ]);
        }
 }
index 8e8d8a849556b10a7b7d0e049ed912a8f2bd7468..f3a696eab80f19ef52ecbc47131ad494255b5fae 100644 (file)
@@ -25,7 +25,7 @@ class BBCodeMediaProviderEditForm extends BBCodeMediaProviderAddForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.bbcode.canManageBBCode');
+       public $neededPermissions = ['admin.content.bbcode.canManageBBCode'];
        
        /**
         * id of the edited media provider
@@ -59,19 +59,19 @@ class BBCodeMediaProviderEditForm extends BBCodeMediaProviderAddForm {
                AbstractForm::save();
                
                // update media-provider
-               $this->objectAction = new BBCodeMediaProviderAction(array($this->providerID), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new BBCodeMediaProviderAction([$this->providerID], 'update', ['data' => array_merge($this->additionalFields, [
                        'title' => $this->title,
                        'regex' => $this->regex,
                        'html' => $this->html
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -93,9 +93,9 @@ class BBCodeMediaProviderEditForm extends BBCodeMediaProviderAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'mediaProvider' => $this->mediaProvider,
                        'action' => 'edit'
-               ));
+               ]);
        }
 }
index 74d48972af072f36c6b00f6bb0bfc16fc68e80e4..70b82ae817b8327ffe08ff087ca7251a341376c6 100644 (file)
@@ -40,7 +40,7 @@ class CaptchaQuestionAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.captcha.canManageCaptchaQuestion');
+       public $neededPermissions = ['admin.captcha.canManageCaptchaQuestion'];
        
        /**
         * @see \wcf\page\IPage::assignVariables()
@@ -50,11 +50,11 @@ class CaptchaQuestionAddForm extends AbstractForm {
                
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'isDisabled' => $this->isDisabled,
                        'invalidRegex' => $this->invalidRegex
-               ));
+               ]);
        }
        
        /**
@@ -84,18 +84,18 @@ class CaptchaQuestionAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new CaptchaQuestionAction(array(), 'create', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new CaptchaQuestionAction([], 'create', [
+                       'data' => array_merge($this->additionalFields, [
                                'answers' => I18nHandler::getInstance()->isPlainValue('answers') ? I18nHandler::getInstance()->getValue('answers') : '',
                                'isDisabled' => $this->isDisabled,
                                'question' => I18nHandler::getInstance()->isPlainValue('question') ? I18nHandler::getInstance()->getValue('question') : ''
-                       ))
-               ));
+                       ])
+               ]);
                $returnValues = $this->objectAction->executeAction();
                $questionID = $returnValues['returnValues']->questionID;
                
                // set i18n values
-               $questionUpdates = array();
+               $questionUpdates = [];
                if (!I18nHandler::getInstance()->isPlainValue('question')) {
                        I18nHandler::getInstance()->save('question', 'wcf.captcha.question.question.question'.$questionID, 'wcf.captcha.question', 1);
                        
index f0ad07675a10088c1050ac555ce91b236b790d23..6b61974fc6c719d4617c4c640cad975646df2ddd 100644 (file)
@@ -43,10 +43,10 @@ class CaptchaQuestionEditForm extends CaptchaQuestionAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'captchaQuestion' => $this->captchaQuestion
-               ));
+               ]);
        }
        
        /**
@@ -100,13 +100,13 @@ class CaptchaQuestionEditForm extends CaptchaQuestionAddForm {
                        I18nHandler::getInstance()->save('answers', 'wcf.captcha.question.question.answers'.$this->captchaQuestion->questionID, 'wcf.captcha.question', 1);
                }
                
-               $this->objectAction = new CaptchaQuestionAction(array($this->captchaQuestion), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new CaptchaQuestionAction([$this->captchaQuestion], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'answers' => I18nHandler::getInstance()->isPlainValue('answers') ? I18nHandler::getInstance()->getValue('answers') : 'wcf.captcha.question.question.answers'.$this->captchaQuestion->questionID,
                                'isDisabled' => $this->isDisabled,
                                'question' => I18nHandler::getInstance()->isPlainValue('question') ? I18nHandler::getInstance()->getValue('question') : 'wcf.captcha.question.question.question'.$this->captchaQuestion->questionID
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                
                $this->saved();
index d724baffe3114e6586073d0548a8e735a0071279..316e79cfe1aa61ae298fa1581d02419922f0c0d3 100755 (executable)
@@ -29,7 +29,7 @@ class CronjobAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canManageCronjob');
+       public $neededPermissions = ['admin.management.canManageCronjob'];
        
        /**
         * cronjob class name
@@ -151,7 +151,7 @@ class CronjobAddForm extends AbstractForm {
                parent::save();
                
                // save cronjob
-               $data = array_merge($this->additionalFields, array(
+               $data = array_merge($this->additionalFields, [
                        'className' => $this->className,
                        'packageID' => $this->packageID,
                        'description' => $this->description,
@@ -160,9 +160,9 @@ class CronjobAddForm extends AbstractForm {
                        'startDom' => $this->startDom,
                        'startMonth' => $this->startMonth,
                        'startDow' => $this->startDow
-               ));
+               ]);
                
-               $this->objectAction = new CronjobAction(array(), 'create', array('data' => $data));
+               $this->objectAction = new CronjobAction([], 'create', ['data' => $data]);
                $this->objectAction->executeAction();
                
                if (!I18nHandler::getInstance()->isPlainValue('description')) {
@@ -172,9 +172,9 @@ class CronjobAddForm extends AbstractForm {
                        
                        // update group name
                        $cronjobEditor = new CronjobEditor($returnValues['returnValues']);
-                       $cronjobEditor->update(array(
+                       $cronjobEditor->update([
                                'description' => 'wcf.acp.cronjob.description.cronjob'.$cronjobID
-                       ));
+                       ]);
                }
                
                $this->saved();
@@ -185,9 +185,9 @@ class CronjobAddForm extends AbstractForm {
                I18nHandler::getInstance()->reset();
                
                // show success.
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -198,7 +198,7 @@ class CronjobAddForm extends AbstractForm {
                
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'className' => $this->className,
                        'description' => $this->description,
                        'startMinute' => $this->startMinute,
@@ -207,6 +207,6 @@ class CronjobAddForm extends AbstractForm {
                        'startMonth' => $this->startMonth,
                        'startDow' => $this->startDow,
                        'action' => 'add'
-               ));
+               ]);
        }
 }
index f0734791cab75e609fe67341f1d8bcc8c7e643b5..dc10e890edfa5065f5a4905cb0b018067adf3f5f 100755 (executable)
@@ -66,7 +66,7 @@ class CronjobEditForm extends CronjobAddForm {
                }
                
                // update cronjob
-               $data = array_merge($this->additionalFields, array(
+               $data = array_merge($this->additionalFields, [
                        'className' => $this->className,
                        'description' => $this->description,
                        'startMinute' => $this->startMinute,
@@ -74,17 +74,17 @@ class CronjobEditForm extends CronjobAddForm {
                        'startDom' => $this->startDom,
                        'startMonth' => $this->startMonth,
                        'startDow' => $this->startDow
-               ));
+               ]);
                
-               $this->objectAction = new CronjobAction(array($this->cronjobID), 'update', array('data' => $data));
+               $this->objectAction = new CronjobAction([$this->cronjobID], 'update', ['data' => $data]);
                $this->objectAction->executeAction();
                
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -114,9 +114,9 @@ class CronjobEditForm extends CronjobAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'cronjobID' => $this->cronjobID,
                        'action' => 'edit'
-               ));
+               ]);
        }
 }
index 25806aa3a134232388fa6099ac6339a2b8a80dce..4987a9d9b5a32c1bc13a60aff3a227b31241faa6 100644 (file)
@@ -25,7 +25,7 @@ class DataImportForm extends AbstractForm {
         * additional data
         * @var array
         */
-       public $additionalData = array();
+       public $additionalData = [];
        
        /**
         * @see \wcf\page\AbstractPage::$activeMenuItem
@@ -35,13 +35,13 @@ class DataImportForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canImportData');
+       public $neededPermissions = ['admin.management.canImportData'];
        
        /**
         * list of available exporters
         * @var array
         */
-       public $exporters = array();
+       public $exporters = [];
        
        /**
         * exporter name
@@ -59,19 +59,19 @@ class DataImportForm extends AbstractForm {
         * list of available importers
         * @var string[]
         */
-       public $importers = array();
+       public $importers = [];
        
        /**
         * list of supported data types
         * @var array
         */
-       public $supportedData = array();
+       public $supportedData = [];
        
        /**
         * selected data types
         * @var array
         */
-       public $selectedData = array();
+       public $selectedData = [];
        
        /**
         * database host name
@@ -247,7 +247,7 @@ class DataImportForm extends AbstractForm {
                $queue = $this->exporter->getQueue();
                
                // save import data
-               WCF::getSession()->register('importData', array(
+               WCF::getSession()->register('importData', [
                        'exporterName' => $this->exporterName,
                        'dbHost' => $this->dbHost,
                        'dbUser' => $this->dbUser,
@@ -257,7 +257,7 @@ class DataImportForm extends AbstractForm {
                        'fileSystemPath' => $this->fileSystemPath,
                        'userMergeMode' => $this->userMergeMode,
                        'additionalData' => $this->additionalData
-               ));
+               ]);
                
                WCF::getTPL()->assign('queue', $queue);
        }
@@ -298,7 +298,7 @@ class DataImportForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'exporter' => $this->exporter,
                        'importers' => $this->importers,
                        'exporterName' => $this->exporterName,
@@ -315,6 +315,6 @@ class DataImportForm extends AbstractForm {
                        'showInnoDBWarning' => $this->showInnoDBWarning,
                        'showMappingNotice' => $this->showMappingNotice,
                        'additionalData' => $this->additionalData
-               ));
+               ]);
        }
 }
index 5e0234cc3a5b2cc05bab5d6ba8debabb65885639..a5547d1cb4a303dad8e5bdb3d8deb5bf1ecd6cbf 100644 (file)
@@ -27,7 +27,7 @@ class LabelEditForm extends LabelAddForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.label.canManageLabel');
+       public $neededPermissions = ['admin.content.label.canManageLabel'];
        
        /**
         * label id
@@ -70,12 +70,12 @@ class LabelEditForm extends LabelAddForm {
                }
                
                // update label
-               $this->objectAction = new LabelAction(array($this->labelID), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new LabelAction([$this->labelID], 'update', ['data' => array_merge($this->additionalFields, [
                        'label' => $this->label,
                        'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName),
                        'groupID' => $this->groupID,
                        'showOrder' => $this->showOrder
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                
                $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.label.objectType');
@@ -89,9 +89,9 @@ class LabelEditForm extends LabelAddForm {
                if ($this->cssClassName != 'custom') $this->customCssClassName = '';
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -123,9 +123,9 @@ class LabelEditForm extends LabelAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'label' => $this->labelObj,
                        'action' => 'edit'
-               ));
+               ]);
        }
 }
index 2a75f9ccdcd568dc3f07b344699ffe092b4b2a2f..2a632e23ea9cda1d810321a558f7c6c4673d605d 100644 (file)
@@ -31,7 +31,7 @@ class LabelGroupAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.label.canManageLabel');
+       public $neededPermissions = ['admin.content.label.canManageLabel'];
        
        /**
         * force users to select a label
@@ -55,19 +55,19 @@ class LabelGroupAddForm extends AbstractForm {
         * list of label object type handlers
         * @var ILabelObjectTypeHandler[]
         */
-       public $labelObjectTypes = array();
+       public $labelObjectTypes = [];
        
        /**
         * list of label object type containers
         * @var LabelObjectTypeContainer[]
         */
-       public $labelObjectTypeContainers = array();
+       public $labelObjectTypeContainers = [];
        
        /**
         * list of label group to object type relations
         * @var array<array>
         */
-       public $objectTypes = array();
+       public $objectTypes = [];
        
        /**
         * object type id
@@ -160,12 +160,12 @@ class LabelGroupAddForm extends AbstractForm {
                parent::save();
                
                // save label
-               $this->objectAction = new LabelGroupAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new LabelGroupAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'forceSelection' => ($this->forceSelection ? 1 : 0),
                        'groupName' => $this->groupName,
                        'groupDescription' => $this->groupDescription,
                        'showOrder' => $this->showOrder
-               ))));
+               ])]);
                $returnValues = $this->objectAction->executeAction();
                
                if (!I18nHandler::getInstance()->isPlainValue('groupName')) {
@@ -173,9 +173,9 @@ class LabelGroupAddForm extends AbstractForm {
                                
                        // update group name
                        $groupEditor = new LabelGroupEditor($returnValues['returnValues']);
-                       $groupEditor->update(array(
+                       $groupEditor->update([
                                'groupName' => 'wcf.acp.label.group'.$returnValues['returnValues']->groupID
-                       ));
+                       ]);
                }
                
                // save acl
@@ -194,14 +194,14 @@ class LabelGroupAddForm extends AbstractForm {
                // reset values
                $this->forceSelection = false;
                $this->groupName = $this->groupDescription = '';
-               $this->objectTypes = array();
+               $this->objectTypes = [];
                $this->showOrder = 0;
                $this->setObjectTypeRelations();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
                
                I18nHandler::getInstance()->reset();
        }
@@ -215,7 +215,7 @@ class LabelGroupAddForm extends AbstractForm {
                ACLHandler::getInstance()->assignVariables($this->objectTypeID);
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'forceSelection' => $this->forceSelection,
                        'groupName' => $this->groupName,
@@ -223,7 +223,7 @@ class LabelGroupAddForm extends AbstractForm {
                        'labelObjectTypeContainers' => $this->labelObjectTypeContainers,
                        'objectTypeID' => $this->objectTypeID,
                        'showOrder' => $this->showOrder
-               ));
+               ]);
        }
        
        /**
@@ -239,7 +239,7 @@ class LabelGroupAddForm extends AbstractForm {
                        $sql = "DELETE FROM     wcf".WCF_N."_label_group_to_object
                                WHERE           groupID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($groupID));
+                       $statement->execute([$groupID]);
                }
                
                // insert new relations
@@ -254,11 +254,11 @@ class LabelGroupAddForm extends AbstractForm {
                                        // use "0" (stored as NULL) for simple true/false states
                                        if (!$objectID) $objectID = null;
                                        
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                $groupID,
                                                $objectTypeID,
                                                $objectID
-                                       ));
+                                       ]);
                                }
                        }
                }
index 0a4e4b13819552d554573ef8f8d430a50179835f..179c0697a967a01cc1fe7cf78a2942fa28306b8d 100644 (file)
@@ -27,7 +27,7 @@ class LabelGroupEditForm extends LabelGroupAddForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.label.canManageLabel');
+       public $neededPermissions = ['admin.content.label.canManageLabel'];
        
        /**
         * group id
@@ -70,12 +70,12 @@ class LabelGroupEditForm extends LabelGroupAddForm {
                }
                
                // update label
-               $this->objectAction = new LabelGroupAction(array($this->groupID), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new LabelGroupAction([$this->groupID], 'update', ['data' => array_merge($this->additionalFields, [
                        'forceSelection' => ($this->forceSelection ? 1 : 0),
                        'groupName' => $this->groupName,
                        'groupDescription' => $this->groupDescription,
                        'showOrder' => $this->showOrder
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                
                // update acl
@@ -92,9 +92,9 @@ class LabelGroupEditForm extends LabelGroupAddForm {
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -121,11 +121,11 @@ class LabelGroupEditForm extends LabelGroupAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'groupID' => $this->groupID,
                        'labelGroup' => $this->group
-               ));
+               ]);
        }
        
        /**
@@ -138,12 +138,12 @@ class LabelGroupEditForm extends LabelGroupAddForm {
                                FROM    wcf".WCF_N."_label_group_to_object
                                WHERE   groupID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->groupID));
+                       $statement->execute([$this->groupID]);
                        
-                       $data = array();
+                       $data = [];
                        while ($row = $statement->fetchArray()) {
                                if (!isset($data[$row['objectTypeID']])) {
-                                       $data[$row['objectTypeID']] = array();
+                                       $data[$row['objectTypeID']] = [];
                                }
                                
                                // prevent NULL values which confuse isset()
index 3af0c507b46a6e52e430d183936317894d7d0a18..0d406c4f81df908e1a584cdd30c4999ef3cc7a0d 100644 (file)
@@ -33,7 +33,7 @@ class LanguageAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.language.canManageLanguage');
+       public $neededPermissions = ['admin.language.canManageLanguage'];
        
        /**
         * language object
@@ -57,7 +57,7 @@ class LanguageAddForm extends AbstractForm {
         * list of available languages
         * @var Language[]
         */
-       public $languages = array();
+       public $languages = [];
        
        /**
         * source language object
@@ -139,11 +139,11 @@ class LanguageAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->language = LanguageEditor::create(array(
+               $this->language = LanguageEditor::create([
                        'countryCode' => mb_strtolower($this->countryCode),
                        'languageName' => $this->languageName,
                        'languageCode' => mb_strtolower($this->languageCode)
-               ));
+               ]);
                $languageEditor = new LanguageEditor($this->sourceLanguage);
                $languageEditor->copy($this->language);
                
@@ -171,13 +171,13 @@ class LanguageAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'countryCode' => $this->countryCode,
                        'languageName' => $this->languageName,
                        'languageCode' => $this->languageCode,
                        'sourceLanguageID' => $this->sourceLanguageID,
                        'languages' => $this->languages,
                        'action' => 'add'
-               ));
+               ]);
        }
 }
index 70fe6aeff002f44442a923c82241b2ea980d8721..5566ebc6271164df1f8995d7e326d44f196078e4 100644 (file)
@@ -58,11 +58,11 @@ class LanguageEditForm extends LanguageAddForm {
                AbstractForm::save();
                
                $editor = new LanguageEditor($this->language);
-               $editor->update(array(
+               $editor->update([
                        'countryCode' => mb_strtolower($this->countryCode),
                        'languageName' => $this->languageName,
-                       'languageCode' => mb_strtolower($this->languageCode)            
-               ));
+                       'languageCode' => mb_strtolower($this->languageCode)
+               ]);
                LanguageFactory::getInstance()->clearCache();
                $this->saved();
                
@@ -89,10 +89,10 @@ class LanguageEditForm extends LanguageAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'languageID' => $this->languageID,
                        'language' => $this->language,
                        'action' => 'edit'
-               ));
+               ]);
        }
 }
index 58ba4eaf34217acc20e7d54f29c7dd52b3681fcb..d28c2dda12b9e02f7cd9bbe3d4431e9a3ddad4d0 100644 (file)
@@ -28,7 +28,7 @@ class LanguageExportForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.language.canManageLanguage');
+       public $neededPermissions = ['admin.language.canManageLanguage'];
        
        /**
         * language id
@@ -46,13 +46,13 @@ class LanguageExportForm extends AbstractForm {
         * selected packages
         * @var string[]
         */
-       public $selectedPackages = array();
+       public $selectedPackages = [];
        
        /**
         * available packages
         * @var string[]
         */
-       public $packages = array();
+       public $packages = [];
        
        /**
         * true to export custom variables
@@ -140,14 +140,14 @@ class LanguageExportForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'languageID' => $this->languageID,
                        'languages' => LanguageFactory::getInstance()->getLanguages(),
                        'selectedPackages' => $this->selectedPackages,
                        'packages' => $this->packages,
                        'selectAllPackages' => true,
                        'packageNameLength' => $this->packageNameLength
-               ));
+               ]);
        }
        
        /**
index 3e71883f6f236805abd236082631dfbea6d8adad..dbe22c35eaea8102a5f96db2e1700e7484ce85c2 100644 (file)
@@ -29,7 +29,7 @@ class LanguageImportForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.language.canManageLanguage');
+       public $neededPermissions = ['admin.language.canManageLanguage'];
        
        /**
         * file name
@@ -59,7 +59,7 @@ class LanguageImportForm extends AbstractForm {
         * list of available languages
         * @var Language[]
         */
-       public $languages = array();
+       public $languages = [];
        
        /**
         * @see \wcf\form\IForm::readFormParameters()
@@ -123,10 +123,10 @@ class LanguageImportForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'languages' => $this->languages,
                        'languageFile' => $this->languageFile
-               ));
+               ]);
        }
        
        /**
index 9f2b31a4c0d68f8ec726e4b387aca874b10a7d76..f2feddf7667a57b5008a599494bdbd55c0d70d02 100644 (file)
@@ -29,7 +29,7 @@ class LanguageMultilingualismForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.language.canManageLanguage');
+       public $neededPermissions = ['admin.language.canManageLanguage'];
        
        /**
         * indicates if multilingualism is enabled
@@ -41,13 +41,13 @@ class LanguageMultilingualismForm extends AbstractForm {
         * ids of selected available languages
         * @var integer[]
         */
-       public $languageIDs = array();
+       public $languageIDs = [];
        
        /**
         * list of available content languages
         * @var Language[]
         */
-       public $languages = array();
+       public $languages = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -101,7 +101,7 @@ class LanguageMultilingualismForm extends AbstractForm {
                parent::save();
                
                // save
-               LanguageEditor::enableMultilingualism(($this->enable == 1 ? $this->languageIDs : array()));
+               LanguageEditor::enableMultilingualism(($this->enable == 1 ? $this->languageIDs : []));
                
                // clear cache
                LanguageCacheBuilder::getInstance()->reset();
@@ -144,12 +144,12 @@ class LanguageMultilingualismForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'defaultLanguageID' => LanguageFactory::getInstance()->getDefaultLanguageID(),
                        'enable' => $this->enable,
                        'languageIDs' => $this->languageIDs,
                        'languages' => $this->languages
-               ));
+               ]);
        }
        
        /**
index abd3d3596f6fa7c2806056323b3b894eaf4d0b86..5bf8d8d19c3c344f11c1ab166e1d3b91ad86acae 100755 (executable)
@@ -150,16 +150,16 @@ class LoginForm extends AbstractCaptchaForm {
                // save authentication failure
                if (ENABLE_USER_AUTHENTICATION_FAILURE) {
                        if ($this->errorField == 'username' || $this->errorField == 'password') {
-                               $action = new UserAuthenticationFailureAction(array(), 'create', array(
-                                       'data' => array(
+                               $action = new UserAuthenticationFailureAction([], 'create', [
+                                       'data' => [
                                                'environment' => (RequestHandler::getInstance()->isACPRequest() ? 'admin' : 'user'),
                                                'userID' => ($this->user !== null ? $this->user->userID : null),
                                                'username' => $this->username,
                                                'time' => TIME_NOW,
                                                'ipAddress' => UserUtil::getIpAddress(),
                                                'userAgent' => UserUtil::getUserAgent()
-                                       )
-                               ));
+                                       ]
+                               ]);
                                $action->executeAction();
                                
                                if ($this->captchaObjectType) {
@@ -239,10 +239,10 @@ class LoginForm extends AbstractCaptchaForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'username' => $this->username,
                        'password' => $this->password,
                        'url' => $this->url
-               ));
+               ]);
        }
 }
index 01e1bcc1eb9b39f0b40f3d97951bc594bd26069a..79c6d8d17c10cf01f5e30a62402bc695a7d60f26 100755 (executable)
@@ -107,10 +107,10 @@ class MasterPasswordForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'masterPassword' => $this->masterPassword,
                        'relativeWcfDir' => RELATIVE_WCF_DIR,
                        'url' => $this->url
-               ));
+               ]);
        }
 }
index 8cd9d4df3e2b895579cb67bdf4c98d760dd6f08e..9f26b3c130463fe57b2b6c8a96c3da260601eca4 100755 (executable)
@@ -115,10 +115,10 @@ define('MASTER_PASSWORD', '".PasswordUtil::getDoubleSaltedHash($this->masterPass
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'confirmMasterPassword' => $this->confirmMasterPassword,
                        'exampleMasterPassword' => PasswordUtil::getRandomPassword(16),
                        'relativeWcfDir' => RELATIVE_WCF_DIR
-               ));
+               ]);
        }
 }
index 7112dc66465f5394835fdf09e06391f0c2da7ecd..c87ed8df1aed21330c507b2020a0b39c1040aa90 100644 (file)
@@ -154,11 +154,11 @@ class MenuAddForm extends AbstractForm {
                parent::save();
                
                // save label
-               $this->objectAction = new MenuAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new MenuAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'title' => $this->title,
                        'packageID' => 1,
                        'identifier' => ''
-               )), 'boxData' => array(
+               ]), 'boxData' => [
                        'name' => $this->title,
                        'boxType' => 'menu',
                        'position' => $this->position,
@@ -167,21 +167,21 @@ class MenuAddForm extends AbstractForm {
                        'showOrder' => $this->showOrder,
                        'cssClassName' => $this->cssClassName,
                        'packageID' => 1
-               ), 'pageIDs' => $this->pageIDs));
+               ], 'pageIDs' => $this->pageIDs]);
                $returnValues = $this->objectAction->executeAction();
                // set generic identifier
                $menuEditor = new MenuEditor($returnValues['returnValues']);
-               $menuEditor->update(array(
+               $menuEditor->update([
                        'identifier' => 'com.woltlab.wcf.genericMenu'.$menuEditor->menuID
-               ));
+               ]);
                // save i18n
                if (!I18nHandler::getInstance()->isPlainValue('title')) {
                        I18nHandler::getInstance()->save('title', 'wcf.menu.menu'.$menuEditor->menuID, 'wcf.menu', 1);
                                
                        // update title
-                       $menuEditor->update(array(
+                       $menuEditor->update([
                                'title' => 'wcf.menu.menu'.$menuEditor->menuID
-                       ));
+                       ]);
                }
                $this->saved();
                
@@ -189,9 +189,9 @@ class MenuAddForm extends AbstractForm {
                $this->title = '';
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
                
                I18nHandler::getInstance()->reset();
        }
@@ -204,7 +204,7 @@ class MenuAddForm extends AbstractForm {
                
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'title' => 'title',
                        'position' => $this->position,
@@ -215,6 +215,6 @@ class MenuAddForm extends AbstractForm {
                        'pageIDs' => $this->pageIDs,
                        'availablePositions' => Box::$availableMenuPositions,
                        'pageNodeList' => (new PageNodeTree())->getNodeList()
-               ));
+               ]);
        }
 }
index 11e8e86b47a1882d0d867471069c121065fc3568..9d66828f22d148fbb2d4bdf0fca8b70959f2060c 100644 (file)
@@ -75,29 +75,29 @@ class MenuEditForm extends MenuAddForm {
                }
        
                // update menu
-               $this->objectAction = new MenuAction(array($this->menuID), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new MenuAction([$this->menuID], 'update', ['data' => array_merge($this->additionalFields, [
                        'title' => $this->title
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                
                // update box
                if ($this->menu->identifier != 'com.woltlab.wcf.MainMenu') {
-                       $boxAction = new BoxAction(array($this->menu->getBox()->boxID), 'update', array('data' => array_merge($this->additionalFields, array(
+                       $boxAction = new BoxAction([$this->menu->getBox()->boxID], 'update', ['data' => array_merge($this->additionalFields, [
                                'position' => $this->position,
                                'visibleEverywhere' => ($this->visibleEverywhere) ? 1 : 0,
                                'showHeader' => ($this->showHeader) ? 1 : 0,
                                'showOrder' => $this->showOrder,
                                'cssClassName' => $this->cssClassName
-                       )), 'pageIDs' => $this->pageIDs));
+                       ]), 'pageIDs' => $this->pageIDs]);
                        $boxAction->executeAction();
                }
                
                $this->saved();
        
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -127,10 +127,10 @@ class MenuEditForm extends MenuAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'menuID' => $this->menuID,
                        'menu' => $this->menu
-               ));
+               ]);
        }
 }
index 7b132741709eaef1d3c49824c979770916aa1db9..207f38b00b2df22759b16104d822a62867033d02 100644 (file)
@@ -89,7 +89,7 @@ class MenuItemEditForm extends MenuItemAddForm {
                }
                
                // update menu
-               $this->objectAction = new MenuItemAction(array($this->itemID), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new MenuItemAction([$this->itemID], 'update', ['data' => array_merge($this->additionalFields, [
                        'isDisabled' => ($this->isDisabled) ? 1 : 0,
                        'title' => $this->title,
                        'pageID' => $this->pageID,
@@ -97,14 +97,14 @@ class MenuItemEditForm extends MenuItemAddForm {
                        'externalURL' => $this->externalURL,
                        'parentItemID' => $this->parentItemID,
                        'showOrder' => $this->showOrder
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -138,10 +138,10 @@ class MenuItemEditForm extends MenuItemAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'itemID' => $this->itemID,
                        'menuItem' => $this->menuItem
-               ));
+               ]);
        }
 }
index 28a56d3b30f0b41f131494829ee4f8a694bd9bba..f39506e9d10b6340080a4a1fa931f283078ec008 100644 (file)
@@ -31,14 +31,14 @@ class NoticeAddForm extends AbstractForm {
         * list pf pre-defined CSS class names
         * @var string[]
         */
-       public $availableCssClassNames = array(
+       public $availableCssClassNames = [
                'info',
                'success',
                'warning',
                'error',
                
                'custom'
-       );
+       ];
        
        /**
         * name of the chosen CSS class name
@@ -56,7 +56,7 @@ class NoticeAddForm extends AbstractForm {
         * grouped notice condition object types
         * @var array
         */
-       public $groupedConditionObjectTypes = array();
+       public $groupedConditionObjectTypes = [];
        
        /**
         * 1 if the notice is disabled
@@ -73,7 +73,7 @@ class NoticeAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.notice.canManageNotice');
+       public $neededPermissions = ['admin.notice.canManageNotice'];
        
        /**
         * name of the notice
@@ -101,7 +101,7 @@ class NoticeAddForm extends AbstractForm {
                
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'availableCssClassNames' => $this->availableCssClassNames,
                        'cssClassName' => $this->cssClassName,
@@ -112,7 +112,7 @@ class NoticeAddForm extends AbstractForm {
                        'noticeName' => $this->noticeName,
                        'noticeUseHtml' => $this->noticeUseHtml,
                        'showOrder' => $this->showOrder
-               ));
+               ]);
        }
        
        /**
@@ -124,12 +124,12 @@ class NoticeAddForm extends AbstractForm {
                        if (!$objectType->conditionobject) continue;
                        
                        if (!isset($this->groupedConditionObjectTypes[$objectType->conditionobject])) {
-                               $this->groupedConditionObjectTypes[$objectType->conditionobject] = array();
+                               $this->groupedConditionObjectTypes[$objectType->conditionobject] = [];
                        }
                        
                        if ($objectType->conditiongroup) {
                                if (!isset($this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup])) {
-                                       $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup] = array();
+                                       $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup] = [];
                                }
                                
                                $this->groupedConditionObjectTypes[$objectType->conditionobject][$objectType->conditiongroup][$objectType->objectTypeID] = $objectType;
@@ -187,8 +187,8 @@ class NoticeAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new NoticeAction(array(), 'create', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new NoticeAction([], 'create', [
+                       'data' => array_merge($this->additionalFields, [
                                'cssClassName' => $this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName,
                                'isDisabled' => $this->isDisabled,
                                'isDismissible' => $this->isDismissible,
@@ -196,8 +196,8 @@ class NoticeAddForm extends AbstractForm {
                                'noticeName' => $this->noticeName,
                                'noticeUseHtml' => $this->noticeUseHtml,
                                'showOrder' => $this->showOrder
-                       ))
-               ));
+                       ])
+               ]);
                $returnValues = $this->objectAction->executeAction();
                
                if (!I18nHandler::getInstance()->isPlainValue('notice')) {
@@ -205,13 +205,13 @@ class NoticeAddForm extends AbstractForm {
                        
                        // update notice name
                        $noticeEditor = new NoticeEditor($returnValues['returnValues']);
-                       $noticeEditor->update(array(
+                       $noticeEditor->update([
                                'notice' => 'wcf.notice.notice.notice'.$returnValues['returnValues']->noticeID
-                       ));
+                       ]);
                }
                
                // transform conditions array into one-dimensional array
-               $conditions = array();
+               $conditions = [];
                foreach ($this->groupedConditionObjectTypes as $groupedObjectTypes) {
                        foreach ($groupedObjectTypes as $objectTypes) {
                                if (is_array($objectTypes)) {
index 535b18f01dd4d62c99005aa77b3be91171115bf8..c499e65d5709f6f2a19ca3c2bfc65b36e5a05211 100644 (file)
@@ -51,11 +51,11 @@ class NoticeEditForm extends NoticeAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'notice' => $this->notice,
                        'resetIsDismissed' => $this->resetIsDismissed
-               ));
+               ]);
        }
        
        /**
@@ -80,7 +80,7 @@ class NoticeEditForm extends NoticeAddForm {
                        $this->showOrder = $this->notice->showOrder;
                        
                        $conditions = $this->notice->getConditions();
-                       $conditionsByObjectTypeID = array();
+                       $conditionsByObjectTypeID = [];
                        foreach ($conditions as $condition) {
                                $conditionsByObjectTypeID[$condition->objectTypeID] = $condition;
                        }
@@ -130,8 +130,8 @@ class NoticeEditForm extends NoticeAddForm {
        public function save() {
                AbstractForm::save();
                
-               $this->objectAction = new NoticeAction(array($this->notice), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new NoticeAction([$this->notice], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'cssClassName' => $this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName,
                                'isDisabled' => $this->isDisabled,
                                'isDismissible' => $this->isDismissible,
@@ -139,8 +139,8 @@ class NoticeEditForm extends NoticeAddForm {
                                'noticeName' => $this->noticeName,
                                'noticeUseHtml' => $this->noticeUseHtml,
                                'showOrder' => $this->showOrder
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                
                if (I18nHandler::getInstance()->isPlainValue('notice')) {
@@ -153,7 +153,7 @@ class NoticeEditForm extends NoticeAddForm {
                }
                
                // transform conditions array into one-dimensional array
-               $conditions = array();
+               $conditions = [];
                foreach ($this->groupedConditionObjectTypes as $groupedObjectTypes) {
                        foreach ($groupedObjectTypes as $objectTypes) {
                                if (is_array($objectTypes)) {
@@ -171,9 +171,9 @@ class NoticeEditForm extends NoticeAddForm {
                        $sql = "DELETE FROM     wcf".WCF_N."_notice_dismissed
                                WHERE           noticeID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->notice->noticeID
-                       ));
+                       ]);
                        
                        $this->resetIsDismissed = 0;
                        
index ecc3691ea9fee3f7928164aab31e5309b9ea2dd1..b036fce85cf2f5d8a058f720d5f98437f8b7be97 100644 (file)
@@ -29,7 +29,7 @@ class NotificationPresetSettingsForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canEditUser');
+       public $neededPermissions = ['admin.user.canEditUser'];
        
        /**
         * list of notification events
@@ -41,7 +41,7 @@ class NotificationPresetSettingsForm extends AbstractForm {
         * list of settings by event
         * @var mixed[][]
         */
-       public $settings = array();
+       public $settings = [];
        
        /**
         * true to apply change to existing users
@@ -53,7 +53,7 @@ class NotificationPresetSettingsForm extends AbstractForm {
         * list of valid options for the mail notification type.
         * @var string[]
         */
-       protected static $validMailNotificationTypes = array('none', 'instant', 'daily');
+       protected static $validMailNotificationTypes = ['none', 'instant', 'daily'];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -81,7 +81,7 @@ class NotificationPresetSettingsForm extends AbstractForm {
                parent::validate();
                
                // valid event ids
-               $validEventIDs = array();
+               $validEventIDs = [];
                foreach ($this->events as $events) {
                        foreach ($events as $event) {
                                $validEventIDs[] = $event->eventID;
@@ -119,14 +119,14 @@ class NotificationPresetSettingsForm extends AbstractForm {
                
                // default values
                if (empty($_POST)) {
-                       $eventIDs = array();
+                       $eventIDs = [];
                        foreach ($this->events as $events) {
                                foreach ($events as $event) {
                                        $eventIDs[] = $event->eventID;
-                                       $this->settings[$event->eventID] = array(
+                                       $this->settings[$event->eventID] = [
                                                'enabled' => $event->preset,
                                                'mailNotificationType' => $event->presetMailNotificationType
-                                       );
+                                       ];
                                }
                        }
                }
@@ -138,13 +138,13 @@ class NotificationPresetSettingsForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               $groupedEvents = array();
+               $groupedEvents = [];
                foreach ($this->events as $objectType => $events) {
                        $objectTypeObj = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.notification.objectType', $objectType);
                        $category = ($objectTypeObj->category ?: $objectType);
                        
                        if (!isset($groupedEvents[$category])) {
-                               $groupedEvents[$category] = array();
+                               $groupedEvents[$category] = [];
                        }
                        
                        foreach ($events as $event) $groupedEvents[$category][] = $event;
@@ -152,11 +152,11 @@ class NotificationPresetSettingsForm extends AbstractForm {
                
                ksort($groupedEvents);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'events' => $groupedEvents,
                        'settings' => $this->settings,
                        'applyChangesToExistingUsers' => $this->applyChangesToExistingUsers
-               ));
+               ]);
        }
        
        /**
@@ -178,18 +178,18 @@ class NotificationPresetSettingsForm extends AbstractForm {
                                }
                                
                                if ($event->preset != $preset || $event->presetMailNotificationType != $presetMailNotificationType) {
-                                       $editor = new UserNotificationEventEditor(new UserNotificationEvent(null, array('eventID' => $event->eventID)));
-                                       $editor->update(array(
+                                       $editor = new UserNotificationEventEditor(new UserNotificationEvent(null, ['eventID' => $event->eventID]));
+                                       $editor->update([
                                                'preset' => $preset,
                                                'presetMailNotificationType' => $presetMailNotificationType
-                                       ));
+                                       ]);
                                        
                                        if ($this->applyChangesToExistingUsers) {
                                                if (!$preset) {
                                                        $sql = "DELETE FROM     wcf".WCF_N."_user_notification_event_to_user
                                                                WHERE           eventID = ?";
                                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                                       $statement->execute(array($event->eventID));
+                                                       $statement->execute([$event->eventID]);
                                                }
                                                else {
                                                        $sql = "REPLACE INTO    wcf".WCF_N."_user_notification_event_to_user
@@ -197,7 +197,7 @@ class NotificationPresetSettingsForm extends AbstractForm {
                                                                SELECT          userID, ?, ?
                                                                FROM            wcf".WCF_N."_user";
                                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                                       $statement->execute(array($event->eventID, $presetMailNotificationType));
+                                                       $statement->execute([$event->eventID, $presetMailNotificationType]);
                                                }
                                        }
                                }
index 92e4ee75c94b1b3028d921472fb69b096684888e..d6fec4346c3eaf67ecb49aa5f9e0a6069c12b485 100644 (file)
@@ -42,7 +42,7 @@ class OptionForm extends AbstractOptionListForm {
         * the option tree
         * @var array
         */
-       public $optionTree = array();
+       public $optionTree = [];
        
        /**
         * @see \wcf\acp\form\AbstractOptionListForm::$languageItemPattern
@@ -73,7 +73,7 @@ class OptionForm extends AbstractOptionListForm {
                
                // save options
                $saveOptions = $this->optionHandler->save('wcf.acp.option', 'wcf.acp.option.option');
-               $this->objectAction = new OptionAction(array(), 'updateAll', array('data' => $saveOptions));
+               $this->objectAction = new OptionAction([], 'updateAll', ['data' => $saveOptions]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -107,11 +107,11 @@ class OptionForm extends AbstractOptionListForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'category' => $this->category,
                        'optionName' => $this->optionName,
                        'optionTree' => $this->optionTree
-               ));
+               ]);
        }
        
        /**
@@ -122,7 +122,7 @@ class OptionForm extends AbstractOptionListForm {
                ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.option.category.'.$this->category->categoryName);
                
                // check permission
-               WCF::getSession()->checkPermissions(array('admin.configuration.canEditOption'));
+               WCF::getSession()->checkPermissions(['admin.configuration.canEditOption']);
                
                if ($this->category->categoryName == 'module') {
                        // check master password
index 9ae5931c4eabcd908b1e9c1857218d94cd7d8f64..f5611501ee2b8fa2b4fff5cfe6a65cc9efe404d2 100755 (executable)
@@ -165,7 +165,7 @@ class PackageStartInstallForm extends AbstractForm {
                
                // insert queue
                $isApplication = PackageValidationManager::getInstance()->getPackageValidationArchive()->getArchive()->getPackageInfo('isApplication');
-               $this->queue = PackageInstallationQueueEditor::create(array(
+               $this->queue = PackageInstallationQueueEditor::create([
                        'processNo' => $processNo,
                        'userID' => WCF::getUser()->userID,
                        'package' => PackageValidationManager::getInstance()->getPackageValidationArchive()->getArchive()->getPackageInfo('name'),
@@ -174,7 +174,7 @@ class PackageStartInstallForm extends AbstractForm {
                        'archive' => $archive,
                        'action' => ($this->package != null ? 'update' : 'install'),
                        'isApplication' => (!$isApplication ? '0' : '1')
-               ));
+               ]);
                
                $this->saved();
                
@@ -188,10 +188,10 @@ class PackageStartInstallForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'package' => $this->package,
                        'installingImportedStyle' => $this->stylePackageImportLocation != ''
-               ));
+               ]);
        }
        
        /**
index ff25a166f13b2f90e31de25803626e73ecfd0fe9..3c5a1fe1707aa2c323f3d8240b5eab70ba8286f7 100755 (executable)
@@ -27,7 +27,7 @@ class PackageUpdateServerAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.package.canEditServer');
+       public $neededPermissions = ['admin.configuration.package.canEditServer'];
        
        /**
         * server url
@@ -80,11 +80,11 @@ class PackageUpdateServerAddForm extends AbstractForm {
                parent::save();
                
                // save server
-               $this->objectAction = new PackageUpdateServerAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new PackageUpdateServerAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'serverURL' => $this->serverURL,
                        'loginUsername' => $this->loginUsername,
                        'loginPassword' => $this->loginPassword
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -101,12 +101,12 @@ class PackageUpdateServerAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'serverURL' => $this->serverURL,
                        'loginUsername' => $this->loginUsername,
                        'loginPassword' => $this->loginPassword,
                        'action' => 'add'
-               ));
+               ]);
        }
        
        /**
index 07398d7513df2d9652e8a6e0c732c76ddbadeba3..834c73d9e6ee4a6b7d43e713156fbbaabc875174 100755 (executable)
@@ -49,11 +49,11 @@ class PackageUpdateServerEditForm extends PackageUpdateServerAddForm {
                AbstractForm::save();
                
                // save server
-               $this->objectAction = new PackageUpdateServerAction(array($this->packageUpdateServerID), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new PackageUpdateServerAction([$this->packageUpdateServerID], 'update', ['data' => array_merge($this->additionalFields, [
                        'serverURL' => $this->serverURL,
                        'loginUsername' => $this->loginUsername,
                        'loginPassword' => $this->loginPassword
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -80,10 +80,10 @@ class PackageUpdateServerEditForm extends PackageUpdateServerAddForm {
        public function assignVariables() {
                parent::assignVariables();
                        
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'packageUpdateServerID' => $this->packageUpdateServerID,
                        'packageUpdateServer' => $this->updateServer,
                        'action' => 'edit'
-               ));
+               ]);
        }
 }
index f200282bd3a1ccdff1122173bcfdbc2d990d41dd..dd71cce4126525952aff36f097da07799a81a063 100644 (file)
@@ -32,12 +32,12 @@ class PaidSubscriptionAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_PAID_SUBSCRIPTION');
+       public $neededModules = ['MODULE_PAID_SUBSCRIPTION'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.paidSubscription.canManageSubscription');
+       public $neededPermissions = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * @see \wcf\page\AbstractPage::$templateName
@@ -108,31 +108,31 @@ class PaidSubscriptionAddForm extends AbstractForm {
         * list of group ids
         * @var integer[]
         */
-       public $groupIDs = array();
+       public $groupIDs = [];
        
        /**
         * list of excluded subscriptions
         * @var integer[]
         */
-       public $excludedSubscriptionIDs = array();
+       public $excludedSubscriptionIDs = [];
        
        /**
         * available user groups
         * @var array
         */
-       public $availableUserGroups = array();
+       public $availableUserGroups = [];
        
        /**
         * list of available currencies
         * @var string[]
         */
-       public $availableCurrencies = array();
+       public $availableCurrencies = [];
        
        /**
         * list of available subscriptions
         * @var array
         */
-       public $availableSubscriptions = array();
+       public $availableSubscriptions = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -144,7 +144,7 @@ class PaidSubscriptionAddForm extends AbstractForm {
                I18nHandler::getInstance()->register('title');
                
                // get available user groups
-               $this->availableUserGroups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS));
+               $this->availableUserGroups = UserGroup::getAccessibleGroups([], [UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS]);
                
                if (!count(PaymentMethodHandler::getInstance()->getPaymentMethods())) {
                        throw new NamedUserException(WCF::getLanguage()->get('wcf.acp.paidSubscription.error.noPaymentMethods'));
@@ -257,7 +257,7 @@ class PaidSubscriptionAddForm extends AbstractForm {
                parent::save();
                
                // save subscription
-               $this->objectAction = new PaidSubscriptionAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new PaidSubscriptionAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'title' => $this->title,
                        'description' => $this->description,
                        'isDisabled' => $this->isDisabled,      
@@ -269,7 +269,7 @@ class PaidSubscriptionAddForm extends AbstractForm {
                        'isRecurring' => $this->isRecurring,
                        'groupIDs' => implode(',', $this->groupIDs),
                        'excludedSubscriptionIDs' => implode(',', $this->excludedSubscriptionIDs)
-               ))));
+               ])]);
                $returnValues = $this->objectAction->executeAction();
                
                // save i18n values
@@ -281,13 +281,13 @@ class PaidSubscriptionAddForm extends AbstractForm {
                $this->title = $this->description = '';
                $this->isDisabled = $this->showOrder = $this->cost = $this->subscriptionLength = $this->isRecurring = 0;
                $this->currency = 'EUR';
-               $this->groupIDs = array();
+               $this->groupIDs = [];
                I18nHandler::getInstance()->reset();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -302,9 +302,9 @@ class PaidSubscriptionAddForm extends AbstractForm {
                        
                        // update database
                        $editor = new PaidSubscriptionEditor($subscription);
-                       $editor->update(array(
+                       $editor->update([
                                $columnName => 'wcf.paidSubscription.subscription'.$subscription->subscriptionID.($columnName == 'description' ? '.description' : '')
-                       ));
+                       ]);
                }
        }
        
@@ -316,7 +316,7 @@ class PaidSubscriptionAddForm extends AbstractForm {
                
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'isDisabled' => $this->isDisabled,
                        'showOrder' => $this->showOrder,
@@ -330,6 +330,6 @@ class PaidSubscriptionAddForm extends AbstractForm {
                        'availableCurrencies' => $this->availableCurrencies,
                        'availableUserGroups' => $this->availableUserGroups,
                        'availableSubscriptions' => $this->availableSubscriptions
-               ));
+               ]);
        }
 }
index 6d1186be9eee970a50ba30dc49e9f30b5adf7d7c..68d7af761d511f78ad4d7836a76344cb88bb5a66 100644 (file)
@@ -47,7 +47,7 @@ class PaidSubscriptionEditForm extends PaidSubscriptionAddForm {
        
        protected function getAvailableSubscriptions() {
                $subscriptionList = new PaidSubscriptionList();
-               $subscriptionList->getConditionBuilder()->add('subscriptionID <> ?', array($this->subscriptionID));
+               $subscriptionList->getConditionBuilder()->add('subscriptionID <> ?', [$this->subscriptionID]);
                $subscriptionList->sqlOrderBy = 'title';
                $subscriptionList->readObjects();
                $this->availableSubscriptions = $subscriptionList->getObjects();
@@ -128,7 +128,7 @@ class PaidSubscriptionEditForm extends PaidSubscriptionAddForm {
                }
                
                // save subscription
-               $this->objectAction = new PaidSubscriptionAction(array($this->subscription), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new PaidSubscriptionAction([$this->subscription], 'update', ['data' => array_merge($this->additionalFields, [
                        'title' => $this->title,
                        'description' => $this->description,
                        'isDisabled' => $this->isDisabled,      
@@ -140,14 +140,14 @@ class PaidSubscriptionEditForm extends PaidSubscriptionAddForm {
                        'isRecurring' => $this->isRecurring,
                        'groupIDs' => implode(',', $this->groupIDs),
                        'excludedSubscriptionIDs' => implode(',', $this->excludedSubscriptionIDs)
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -159,10 +159,10 @@ class PaidSubscriptionEditForm extends PaidSubscriptionAddForm {
                $useRequestData = (empty($_POST)) ? false : true;
                I18nHandler::getInstance()->assignVariables($useRequestData);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'subscriptionID' => $this->subscriptionID,
                        'subscription' => $this->subscription
-               ));
+               ]);
        }
 }
index 12289ab2341b5ca5dbe23c09b8a317ba8f87a5c0..b571df7535755cc02b8eeae9e157a360bd540fb8 100644 (file)
@@ -30,12 +30,12 @@ class PaidSubscriptionUserAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_PAID_SUBSCRIPTION');
+       public $neededModules = ['MODULE_PAID_SUBSCRIPTION'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.paidSubscription.canManageSubscription');
+       public $neededPermissions = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * subscription id
@@ -125,23 +125,23 @@ class PaidSubscriptionUserAddForm extends AbstractForm {
                parent::save();
                
                $userSubscription = PaidSubscriptionUser::getSubscriptionUser($this->subscriptionID, $this->user->userID);
-               $data = array();
+               $data = [];
                if ($this->subscription->subscriptionLength) {
                        $data['endDate'] = $this->endDateTime->getTimestamp();
                }
                if ($userSubscription === null) {
                        // create new subscription
-                       $action = new PaidSubscriptionUserAction(array(), 'create', array(
+                       $action = new PaidSubscriptionUserAction([], 'create', [
                                'user' => $this->user,
                                'subscription' => $this->subscription,
                                'data' => $data
-                       ));
+                       ]);
                        $returnValues = $action->executeAction();
                        $userSubscription = $returnValues['returnValues'];
                }
                else {
                        // extend existing subscription
-                       $action = new PaidSubscriptionUserAction(array($userSubscription), 'extend', array('data' => $data));
+                       $action = new PaidSubscriptionUserAction([$userSubscription], 'extend', ['data' => $data]);
                        $action->executeAction();
                }
                $this->saved();
@@ -150,9 +150,9 @@ class PaidSubscriptionUserAddForm extends AbstractForm {
                $this->username = $this->endDate = '';
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -176,11 +176,11 @@ class PaidSubscriptionUserAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'subscriptionID' => $this->subscriptionID,
                        'subscription' => $this->subscription,
                        'username' => $this->username,
                        'endDate' => $this->endDate
-               ));
+               ]);
        }
 }
index 774dd9abc57b2f11295189d0213a07173d7f0a81..87e02e111e254c5c4fba369fd44163d1a26b5905 100644 (file)
@@ -36,12 +36,12 @@ class SmileyAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.smiley.canManageSmiley');
+       public $neededPermissions = ['admin.content.smiley.canManageSmiley'];
        
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_SMILEY');
+       public $neededModules = ['MODULE_SMILEY'];
        
        /**
         * primary smiley code
@@ -89,7 +89,7 @@ class SmileyAddForm extends AbstractForm {
         * data of the uploaded smiley file
         * @var array()
         */
-       public $fileUpload = array();
+       public $fileUpload = [];
        
        /**
         * temporary name of the uploaded smiley file
@@ -105,7 +105,7 @@ class SmileyAddForm extends AbstractForm {
                
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'smileyTitle' => $this->smileyTitle,
                        'showOrder' => $this->showOrder,
@@ -115,7 +115,7 @@ class SmileyAddForm extends AbstractForm {
                        'smileyPath' => $this->smileyPath,
                        'categoryNodeList' => $this->categoryNodeTree->getIterator(),
                        'uploadedFilename' => $this->uploadedFilename
-               ));
+               ]);
        }
        
        /**
@@ -161,8 +161,8 @@ class SmileyAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new SmileyAction(array(), 'create', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new SmileyAction([], 'create', [
+                       'data' => array_merge($this->additionalFields, [
                                'smileyTitle' => $this->smileyTitle,
                                'smileyCode' => $this->smileyCode,
                                'aliases' => $this->aliases,
@@ -170,9 +170,9 @@ class SmileyAddForm extends AbstractForm {
                                'showOrder' => $this->showOrder,
                                'categoryID' => $this->categoryID ?: null,
                                'packageID' => 1
-                       )),
+                       ]),
                        'fileLocation' => $this->uploadedFilename ? WCF_DIR.'images/smilies/'.$this->uploadedFilename : ''
-               ));
+               ]);
                $this->objectAction->executeAction();
                $returnValues = $this->objectAction->getReturnValues();
                $smileyEditor = new SmileyEditor($returnValues['returnValues']);
@@ -182,9 +182,9 @@ class SmileyAddForm extends AbstractForm {
                        I18nHandler::getInstance()->save('smileyTitle', 'wcf.smiley.title'.$smileyID, 'wcf.smiley', 1);
                        
                        // update title
-                       $smileyEditor->update(array(
+                       $smileyEditor->update([
                                'smileyTitle' => 'wcf.smiley.title'.$smileyID
-                       ));
+                       ]);
                }
                
                // reset values
@@ -265,7 +265,7 @@ class SmileyAddForm extends AbstractForm {
                // validate smiley code and aliases against existing smilies
                $conditionBuilder = new PreparedStatementConditionBuilder();
                if (isset($this->smiley)) {
-                       $conditionBuilder->add('smileyID <> ?', array($this->smiley->smileyID));
+                       $conditionBuilder->add('smileyID <> ?', [$this->smiley->smileyID]);
                }
                $sql = "SELECT  smileyCode, aliases
                        FROM    wcf".WCF_N."_smiley
@@ -275,7 +275,7 @@ class SmileyAddForm extends AbstractForm {
                
                $aliases = explode("\n", $this->aliases);
                while ($row = $statement->fetchArray()) {
-                       $known = array();
+                       $known = [];
                        if (!empty($row['aliases'])) {
                                $known = explode("\n", $row['aliases']);
                        }
index ec1058683666b29a2f037096fa7cebcd226438a5..1ecaf8d46e77abf648392520547f353b5756e5c9 100644 (file)
@@ -30,5 +30,5 @@ class SmileyCategoryAddForm extends AbstractCategoryAddForm {
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_SMILEY');
+       public $neededModules = ['MODULE_SMILEY'];
 }
index c9a05d0c583d25731c5e78f3ffbd2c256f34a493..4ff69ee3b7bed6ff3728f69c282f5ea56cb85eb0 100644 (file)
@@ -30,5 +30,5 @@ class SmileyCategoryEditForm extends AbstractCategoryEditForm {
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_SMILEY');
+       public $neededModules = ['MODULE_SMILEY'];
 }
index 732bed0127aa57d46b8ef3e245eb7b477ead4ee6..d7eae25d8b733aedba3f5607f65f774f2124e74f 100644 (file)
@@ -26,7 +26,7 @@ class SmileyEditForm extends SmileyAddForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.smiley.canManageSmiley');
+       public $neededPermissions = ['admin.content.smiley.canManageSmiley'];
        
        /**
         * smiley id
@@ -69,17 +69,17 @@ class SmileyEditForm extends SmileyAddForm {
                }
                
                // update bbcode
-               $this->objectAction = new SmileyAction(array($this->smileyID), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new SmileyAction([$this->smileyID], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'smileyTitle' => $this->smileyTitle,
                                'smileyCode' => $this->smileyCode,
                                'aliases' => $this->aliases,
                                'smileyPath' => $this->smileyPath,
                                'showOrder' => $this->showOrder,
                                'categoryID' => $this->categoryID ?: null
-                       )),
+                       ]),
                        'fileLocation' => $this->uploadedFilename ? WCF_DIR.'images/smilies/'.$this->uploadedFilename : ''
-               ));
+               ]);
                $this->objectAction->executeAction();
                
                $this->uploadedFilename = '';
@@ -87,9 +87,9 @@ class SmileyEditForm extends SmileyAddForm {
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -118,9 +118,9 @@ class SmileyEditForm extends SmileyAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'smiley' => $this->smiley,
                        'action' => 'edit'
-               ));
+               ]);
        }
 }
index b73b34ef8bfe868827a257bc77f53183902140d9..6f730db6b894c542978cbdd6b4619152dad9d339 100644 (file)
@@ -124,8 +124,8 @@ class StyleEditForm extends StyleAddForm {
                        unset($this->variables['overrideScssCustom']);
                }*/
                
-               $this->objectAction = new StyleAction(array($this->style), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new StyleAction([$this->style], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'styleName' => $this->styleName,
                                'templateGroupID' => $this->templateGroupID,
                                'styleVersion' => $this->styleVersion,
@@ -136,10 +136,10 @@ class StyleEditForm extends StyleAddForm {
                                'license' => $this->license,
                                'authorName' => $this->authorName,
                                'authorURL' => $this->authorURL
-                       )),
+                       ]),
                        'tmpHash' => $this->tmpHash,
                        'variables' => $this->variables
-               ));
+               ]);
                $this->objectAction->executeAction();
                
                // save description
@@ -162,10 +162,10 @@ class StyleEditForm extends StyleAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'style' => $this->style,
                        'styleID' => $this->styleID
-               ));
+               ]);
        }
 }
index 9dc6190ac253b0f603164f8ce047ae3ee7e70b3d..fa0b0cc1ff13c8a0783534e427cc2a581969d576 100644 (file)
@@ -58,7 +58,7 @@ class StyleExportForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.style.canManageStyle');
+       public $neededPermissions = ['admin.style.canManageStyle'];
        
        /**
         * package identifier
@@ -167,7 +167,7 @@ class StyleExportForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'canExportImages' => $this->canExportImages,
                        'canExportTemplates' => $this->canExportTemplates,
                        'exportAsPackage' => $this->exportAsPackage,
@@ -176,6 +176,6 @@ class StyleExportForm extends AbstractForm {
                        'packageName' => $this->packageName,
                        'style' => $this->style,
                        'styleID' => $this->styleID
-               ));
+               ]);
        }
 }
index afbfbf3af66012e1068a607e810de123546d0f48..a83f4ef608dbef1632f415de475d4cfe00354e7a 100644 (file)
@@ -30,13 +30,13 @@ class StyleImportForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.style.canManageStyle');
+       public $neededPermissions = ['admin.style.canManageStyle'];
        
        /**
         * upload data
         * @var string[]
         */
-       public $source = array();
+       public $source = [];
        
        /**
         * style editor object
@@ -99,9 +99,9 @@ class StyleImportForm extends AbstractForm {
                        
                        WCF::getSession()->register('stylePackageImportLocation', $filename);
                        
-                       HeaderUtil::redirect(LinkHandler::getInstance()->getLink('PackageStartInstall', array(
+                       HeaderUtil::redirect(LinkHandler::getInstance()->getLink('PackageStartInstall', [
                                'action' => 'install'
-                       )));
+                       ]));
                        exit;
                }
                catch (SystemException $e) {
index f803adeb6f0aa0c4eb8a5380d48544a6bf385b6a..8b0d87c921cca404b9d99a3d680a9346567a8cd3 100644 (file)
@@ -29,18 +29,18 @@ class TagAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.tag.canManageTag');
+       public $neededPermissions = ['admin.content.tag.canManageTag'];
        
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_TAGGING');
+       public $neededModules = ['MODULE_TAGGING'];
        
        /**
         * list of available languages
         * @var array
         */
-       public $availableLanguages = array();
+       public $availableLanguages = [];
        
        /**
         * name value
@@ -58,7 +58,7 @@ class TagAddForm extends AbstractForm {
         * synonyms
         * @var string[]
         */
-       public $synonyms = array();
+       public $synonyms = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -148,10 +148,10 @@ class TagAddForm extends AbstractForm {
                parent::save();
                
                // save tag
-               $this->objectAction = new TagAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new TagAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'name' => $this->name,
                        'languageID' => $this->languageID
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $returnValues = $this->objectAction->getReturnValues();
                $editor = new TagEditor($returnValues['returnValues']);
@@ -162,11 +162,11 @@ class TagAddForm extends AbstractForm {
                        // find existing tag
                        $synonymObj = Tag::getTag($synonym, $this->languageID);
                        if ($synonymObj === null) {
-                               $synonymAction = new TagAction(array(), 'create', array('data' => array(
+                               $synonymAction = new TagAction([], 'create', ['data' => [
                                        'name' => $synonym,
                                        'languageID' => $this->languageID,
                                        'synonymFor' => $editor->tagID
-                               )));
+                               ]]);
                                $synonymAction->executeAction();
                        }
                        else {
@@ -178,12 +178,12 @@ class TagAddForm extends AbstractForm {
                
                // reset values
                $this->name = '';
-               $this->synonyms = array();
+               $this->synonyms = [];
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -192,12 +192,12 @@ class TagAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'availableLanguages' => $this->availableLanguages,
                        'name' => $this->name,
                        'languageID' => $this->languageID,
                        'synonyms' => $this->synonyms
-               ));
+               ]);
        }
 }
index 8144f1a4281e9b4955eac766b612c3c198fbb110..a92be411433314f312022890e3de9b5be05cf2ec 100644 (file)
@@ -27,7 +27,7 @@ class TagEditForm extends TagAddForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.tag.canManageTag');
+       public $neededPermissions = ['admin.content.tag.canManageTag'];
        
        /**
         * tag id
@@ -61,9 +61,9 @@ class TagEditForm extends TagAddForm {
                AbstractForm::save();
                
                // update tag
-               $this->objectAction = new TagAction(array($this->tagID), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new TagAction([$this->tagID], 'update', ['data' => array_merge($this->additionalFields, [
                        'name' => $this->name
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                
                if ($this->tagObj->synonymFor === null) {
@@ -72,10 +72,10 @@ class TagEditForm extends TagAddForm {
                                SET     synonymFor = ?
                                WHERE   synonymFor = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                null,
                                $this->tagID
-                       ));
+                       ]);
                        
                        $editor = new TagEditor($this->tagObj);
                        foreach ($this->synonyms as $synonym) {
@@ -84,11 +84,11 @@ class TagEditForm extends TagAddForm {
                                // find existing tag
                                $synonymObj = Tag::getTag($synonym, $this->tagObj->languageID);
                                if ($synonymObj === null) {
-                                       $synonymAction = new TagAction(array(), 'create', array('data' => array(
+                                       $synonymAction = new TagAction([], 'create', ['data' => [
                                                'name' => $synonym,
                                                'languageID' => $this->tagObj->languageID,
                                                'synonymFor' => $this->tagID
-                                       )));
+                                       ]]);
                                        $synonymAction->executeAction();
                                }
                                else {
@@ -100,9 +100,9 @@ class TagEditForm extends TagAddForm {
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -119,9 +119,9 @@ class TagEditForm extends TagAddForm {
                }
                
                $synonymList = new TagList();
-               $synonymList->getConditionBuilder()->add('synonymFor = ?', array($this->tagObj->tagID));
+               $synonymList->getConditionBuilder()->add('synonymFor = ?', [$this->tagObj->tagID]);
                $synonymList->readObjects();
-               $this->synonyms = array();
+               $this->synonyms = [];
                foreach ($synonymList as $synonym) {
                        $this->synonyms[] = $synonym->name;
                }
@@ -133,10 +133,10 @@ class TagEditForm extends TagAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'tagObj' => $this->tagObj,
                        'action' => 'edit',
                        'synonym' => (($this->tagObj !== null && $this->tagObj->synonymFor) ? new Tag($this->tagObj->synonymFor) : null)
-               ));
+               ]);
        }
 }
index da113ae9cb094568600dad8e1ff524becccaa000..8bfcddf394e4fc7b56fd29e46ac7fd5b94d4799d 100644 (file)
@@ -31,7 +31,7 @@ class TemplateAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.template.canManageTemplate');
+       public $neededPermissions = ['admin.template.canManageTemplate'];
        
        /**
         * template name
@@ -55,7 +55,7 @@ class TemplateAddForm extends AbstractForm {
         * available template groups
         * @var array
         */
-       public $availableTemplateGroups = array();
+       public $availableTemplateGroups = [];
        
        /**
         * template's package id
@@ -116,7 +116,7 @@ class TemplateAddForm extends AbstractForm {
                                WHERE   templateName = ?
                                        AND templateGroupID IS NULL";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->tplName));
+                       $statement->execute([$this->tplName]);
                        $row = $statement->fetchArray();
                        if ($row !== false) {
                                $this->packageID = $row['packageID'];
@@ -147,14 +147,14 @@ class TemplateAddForm extends AbstractForm {
                }
                
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add('templateName = ?', array($this->tplName));
-               $conditionBuilder->add('templateGroupID = ?', array($this->templateGroupID));
+               $conditionBuilder->add('templateName = ?', [$this->tplName]);
+               $conditionBuilder->add('templateGroupID = ?', [$this->templateGroupID]);
                
                if ($this->copiedTemplate !== null) {
-                       $conditionBuilder->add('(packageID = ? OR application = ?)', array($this->packageID, $this->copiedTemplate->application));
+                       $conditionBuilder->add('(packageID = ? OR application = ?)', [$this->packageID, $this->copiedTemplate->application]);
                }
                else {
-                       $conditionBuilder->add('packageID = ?', array($this->packageID));
+                       $conditionBuilder->add('packageID = ?', [$this->packageID]);
                }
                
                $sql = "SELECT  COUNT(*)
@@ -192,12 +192,12 @@ class TemplateAddForm extends AbstractForm {
                        $this->application = Package::getAbbreviation(PackageCache::getInstance()->getPackage($this->packageID)->package);
                }
                
-               $this->objectAction = new TemplateAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new TemplateAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'application' => $this->application,
                        'templateName' => $this->tplName,
                        'packageID' => $this->packageID,
                        'templateGroupID' => $this->templateGroupID
-               )), 'source' => $this->templateSource));
+               ]), 'source' => $this->templateSource]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -206,9 +206,9 @@ class TemplateAddForm extends AbstractForm {
                $this->templateGroupID = 0;
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -231,13 +231,13 @@ class TemplateAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'tplName' => $this->tplName,
                        'templateGroupID' => $this->templateGroupID,
                        'templateSource' => $this->templateSource,
                        'availableTemplateGroups' => $this->availableTemplateGroups,
                        'copy' => $this->copy
-               ));
+               ]);
        }
 }
index 79c24e9f61b33f24614a492eca683e27f55c977c..e6c6c945a57fddee0ea155cbf9d06b9b96680e0a 100644 (file)
@@ -72,18 +72,18 @@ class TemplateEditForm extends TemplateAddForm {
        public function save() {
                AbstractForm::save();
                
-               $this->objectAction = new TemplateAction(array($this->template), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new TemplateAction([$this->template], 'update', ['data' => array_merge($this->additionalFields, [
                        'templateName' => $this->tplName,
                        'templateGroupID' => $this->templateGroupID,
                        'lastModificationTime' => TIME_NOW
-               )), 'source' => $this->templateSource));
+               ]), 'source' => $this->templateSource]);
                $this->objectAction->executeAction();
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -105,10 +105,10 @@ class TemplateEditForm extends TemplateAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'templateID' => $this->templateID,
                        'template' => $this->template
-               ));
+               ]);
        }
 }
index 769bf8fba20e0a3d999404266a85a8c19189ec24..99a02e28606320ded6baec0c2ccf589b2833ab63 100644 (file)
@@ -27,7 +27,7 @@ class TemplateGroupAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.template.canManageTemplate');
+       public $neededPermissions = ['admin.template.canManageTemplate'];
        
        /**
         * template group name
@@ -51,7 +51,7 @@ class TemplateGroupAddForm extends AbstractForm {
         * available template groups
         * @var array
         */
-       public $availableTemplateGroups = array();
+       public $availableTemplateGroups = [];
        
        /**
         * @see \wcf\form\IForm::readFormParameters()
@@ -93,7 +93,7 @@ class TemplateGroupAddForm extends AbstractForm {
                        FROM    wcf".WCF_N."_template_group
                        WHERE   templateGroupName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->templateGroupName));
+               $statement->execute([$this->templateGroupName]);
                
                if ($statement->fetchSingleColumn()) {
                        throw new UserInputException('templateGroupName', 'notUnique');
@@ -116,7 +116,7 @@ class TemplateGroupAddForm extends AbstractForm {
                        FROM    wcf".WCF_N."_template_group
                        WHERE   templateGroupFolderName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->templateGroupFolderName));
+               $statement->execute([$this->templateGroupFolderName]);
                
                if ($statement->fetchSingleColumn()) {
                        throw new UserInputException('templateGroupFolderName', 'notUnique');
@@ -129,11 +129,11 @@ class TemplateGroupAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new TemplateGroupAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new TemplateGroupAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'templateGroupName' => $this->templateGroupName,
                        'templateGroupFolderName' => $this->templateGroupFolderName,
                        'parentTemplateGroupID' => ($this->parentTemplateGroupID ?: null)
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -142,16 +142,16 @@ class TemplateGroupAddForm extends AbstractForm {
                $this->parentTemplateGroupID = 0;
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
         * @see \wcf\page\IPage::readData()
         */
        public function readData() {
-               $this->availableTemplateGroups = TemplateGroup::getSelectList(array(), 1);
+               $this->availableTemplateGroups = TemplateGroup::getSelectList([], 1);
 
                parent::readData();
        }
@@ -162,12 +162,12 @@ class TemplateGroupAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'templateGroupName' => $this->templateGroupName,
                        'templateGroupFolderName' => $this->templateGroupFolderName,
                        'parentTemplateGroupID' => $this->parentTemplateGroupID,
                        'availableTemplateGroups' => $this->availableTemplateGroups
-               ));
+               ]);
        }
 }
index ba3d48c2d05e531d278c7a3de61cc54eb1ca10e3..95c6fad78c1707ba6778e440885ce6194447ffb9 100644 (file)
@@ -71,25 +71,25 @@ class TemplateGroupEditForm extends TemplateGroupAddForm {
        public function save() {
                AbstractForm::save();
                
-               $this->objectAction = new TemplateGroupAction(array($this->templateGroup), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new TemplateGroupAction([$this->templateGroup], 'update', ['data' => array_merge($this->additionalFields, [
                        'templateGroupName' => $this->templateGroupName,
                        'templateGroupFolderName' => $this->templateGroupFolderName,
                        'parentTemplateGroupID' => ($this->parentTemplateGroupID ?: null)
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
         * @see \wcf\page\IPage::readData()
         */
        public function readData() {
-               $this->availableTemplateGroups = TemplateGroup::getSelectList(array($this->templateGroupID), 1);
+               $this->availableTemplateGroups = TemplateGroup::getSelectList([$this->templateGroupID], 1);
                
                AbstractForm::readData();
                
@@ -107,10 +107,10 @@ class TemplateGroupEditForm extends TemplateGroupAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'templateGroupID' => $this->templateGroupID,
                        'templateGroup' => $this->templateGroup
-               ));
+               ]);
        }
 }
index a6431970d0f989d219aa303dce0860a0bccd8602..fae2261813400be6842cfd0759a24bb10f14ae02 100644 (file)
@@ -27,19 +27,19 @@ class UserActivityPointOptionForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canEditActivityPoints');
+       public $neededPermissions = ['admin.user.canEditActivityPoints'];
        
        /**
         * points to objectType
         * @var integer[]
         */
-       public $points = array();
+       public $points = [];
        
        /**
         * valid object types
         * @var ObjectType[]
         */
-       public $objectTypes = array();
+       public $objectTypes = [];
        
        /**
         * @see \wcf\form\IForm::readFormParameters()
@@ -86,7 +86,7 @@ class UserActivityPointOptionForm extends AbstractForm {
                        $editor = new ObjectTypeEditor($objectType);
                        $data = $objectType->additionalData;
                        $data['points'] = $this->points[$objectType->objectTypeID];
-                       $editor->update(array('additionalData' => serialize($data)));
+                       $editor->update(['additionalData' => serialize($data)]);
                }
                
                ObjectTypeEditor::resetCache();
@@ -102,9 +102,9 @@ class UserActivityPointOptionForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'objectTypes' => $this->objectTypes,
                        'points' => $this->points
-               ));
+               ]);
        }
 }
index 538af5542a1b58345a1bbf98596d9d18fb5a017f..913c61588b962124a68dec8e17b34e827e862222 100755 (executable)
@@ -29,7 +29,7 @@ class UserAssignToGroupForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canEditUser');
+       public $neededPermissions = ['admin.user.canEditUser'];
        
        /**
         * @see \wcf\page\AbstractPage::$activeMenuItem
@@ -40,25 +40,25 @@ class UserAssignToGroupForm extends AbstractForm {
         * ids of the relevant users
         * @var integer[]
         */
-       public $userIDs = array();
+       public $userIDs = [];
        
        /**
         * ids of the assigned user groups
         * @var integer[]
         */
-       public $groupIDs = array();
+       public $groupIDs = [];
        
        /**
         * relevant users
         * @var User[]
         */
-       public $users = array();
+       public $users = [];
        
        /**
         * assigned user groups
         * @var UserGroup[]
         */
-       public $groups = array();
+       public $groups = [];
        
        /**
         * id of the user clipboard item object type
@@ -121,7 +121,7 @@ class UserAssignToGroupForm extends AbstractForm {
                parent::save();
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->userIDs));
+               $conditions->add("userID IN (?)", [$this->userIDs]);
                
                $sql = "SELECT  userID, groupID
                        FROM    wcf".WCF_N."_user_to_group
@@ -129,7 +129,7 @@ class UserAssignToGroupForm extends AbstractForm {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
                
-               $groups = array();
+               $groups = [];
                while ($row = $statement->fetchArray()) {
                        $groups[$row['userID']][] = $row['groupID'];
                }
@@ -142,10 +142,10 @@ class UserAssignToGroupForm extends AbstractForm {
                        $groupsIDs = array_merge($groups[$user->userID], $this->groupIDs);
                        $groupsIDs = array_unique($groupsIDs);
                        
-                       $action = new UserAction(array(new UserEditor($user)), 'addToGroups', array(
+                       $action = new UserAction([new UserEditor($user)], 'addToGroups', [
                                'groups' => $groupsIDs,
                                'addDefaultGroups' => false
-                       ));
+                       ]);
                        $action->executeAction();
                }
                
@@ -154,11 +154,11 @@ class UserAssignToGroupForm extends AbstractForm {
                
                $this->saved();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'groupIDs' => $this->groupIDs,
                        'message' => 'wcf.acp.user.assignToGroup.success',
                        'users' => $this->users
-               ));
+               ]);
                WCF::getTPL()->display('success');
                exit;
        }
@@ -178,18 +178,18 @@ class UserAssignToGroupForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'users' => $this->users,
                        'userIDs' => $this->userIDs,
                        'groupIDs' => $this->groupIDs,
                        'groups' => $this->groups
-               ));
+               ]);
        }
        
        /**
         * Get a list of available groups.
         */
        protected function readGroups() {
-               $this->groups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS));
+               $this->groups = UserGroup::getAccessibleGroups([], [UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS]);
        }
 }
index 112c3aa6a7fcdc9932a4cec689abce48904572a8..abfa1dc191c4d549bc010048a3a567c2c35e8ed1 100644 (file)
@@ -22,12 +22,12 @@ class UserContentRevertChangesForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_EDIT_HISTORY');
+       public $neededModules = ['MODULE_EDIT_HISTORY'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.canBulkRevertContentChanges');
+       public $neededPermissions = ['admin.content.canBulkRevertContentChanges'];
        
        /**
         * @see \wcf\page\AbstractPage::$activeMenuItem
@@ -38,13 +38,13 @@ class UserContentRevertChangesForm extends AbstractForm {
         * ids of the relevant users
         * @var integer[]
         */
-       public $userIDs = array();
+       public $userIDs = [];
        
        /**
         * relevant users
         * @var User[]
         */
-       public $users = array();
+       public $users = [];
        
        /**
         * timeframe to consider
@@ -118,10 +118,10 @@ class UserContentRevertChangesForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'users' => $this->users,
                        'userIDs' => $this->userIDs,
                        'timeframe' => $this->timeframe
-               ));
+               ]);
        }
 }
index 8d5c7ea756e1597a872bc920007f946da06d8eac..7dd0eb68b6fc486c63c665858dc8b5dbcb8198ab 100755 (executable)
@@ -35,7 +35,7 @@ class UserEditForm extends UserAddForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canEditUser');
+       public $neededPermissions = ['admin.user.canEditUser'];
        
        /**
         * user id
@@ -215,7 +215,7 @@ class UserEditForm extends UserAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'userID' => $this->user->userID,
                        'action' => 'edit',
                        'url' => '',
@@ -229,7 +229,7 @@ class UserEditForm extends UserAddForm {
                        'disableAvatarExpires' => $this->disableAvatarExpires,
                        'userAvatar' => $this->userAvatar,
                        'banExpires' => $this->banExpires
-               ));
+               ]);
        }
        
        /**
@@ -242,36 +242,36 @@ class UserEditForm extends UserAddForm {
                if ($this->avatarType != 'custom') {
                        // delete custom avatar
                        if ($this->user->avatarID) {
-                               $action = new UserAvatarAction(array($this->user->avatarID), 'delete');
+                               $action = new UserAvatarAction([$this->user->avatarID], 'delete');
                                $action->executeAction();
                        }
                }
                switch ($this->avatarType) {
                        case 'none':
-                               $avatarData = array(
+                               $avatarData = [
                                        'avatarID' => null,
                                        'enableGravatar' => 0
-                               );
+                               ];
                        break;
                        
                        case 'custom':
-                               $avatarData = array(
+                               $avatarData = [
                                        'enableGravatar' => 0
-                               );
+                               ];
                        break;
                        
                        case 'gravatar':
-                               $avatarData = array(
+                               $avatarData = [
                                        'avatarID' => null,
                                        'enableGravatar' => 1
-                               );
+                               ];
                        break;
                }
                
                $this->additionalFields = array_merge($this->additionalFields, $avatarData);
                
                // add default groups
-               $defaultGroups = UserGroup::getAccessibleGroups(array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS));
+               $defaultGroups = UserGroup::getAccessibleGroups([UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS]);
                $oldGroupIDs = $this->user->getGroupIDs();
                foreach ($oldGroupIDs as $oldGroupID) {
                        if (isset($defaultGroups[$oldGroupID])) {
@@ -283,8 +283,8 @@ class UserEditForm extends UserAddForm {
                // save user
                $saveOptions = $this->optionHandler->save();
 
-               $data = array(
-                       'data' => array_merge($this->additionalFields, array(
+               $data = [
+                       'data' => array_merge($this->additionalFields, [
                                'username' => $this->username,
                                'email' => $this->email,
                                'password' => $this->password,
@@ -294,11 +294,11 @@ class UserEditForm extends UserAddForm {
                                'signatureEnableBBCodes' => $this->signatureEnableBBCodes,
                                'signatureEnableSmilies' => $this->signatureEnableSmilies,
                                'signatureEnableHtml' => $this->signatureEnableHtml
-                       )),
+                       ]),
                        'groups' => $this->groupIDs,
                        'languageIDs' => $this->visibleLanguages,
                        'options' => $saveOptions
-               );
+               ];
 
                // handle ban
                if (WCF::getSession()->getPermission('admin.user.canBanUser')) {
@@ -342,17 +342,17 @@ class UserEditForm extends UserAddForm {
                        $data['data']['disableAvatarExpires'] = $this->disableAvatarExpires;
                }
                
-               $this->objectAction = new UserAction(array($this->userID), 'update', $data);
+               $this->objectAction = new UserAction([$this->userID], 'update', $data);
                $this->objectAction->executeAction();
                
                // update user rank
                $editor = new UserEditor(new User($this->userID));
                if (MODULE_USER_RANK) {
-                       $action = new UserProfileAction(array($editor), 'updateUserRank');
+                       $action = new UserProfileAction([$editor], 'updateUserRank');
                        $action->executeAction();
                }
                if (MODULE_USERS_ONLINE) {
-                       $action = new UserProfileAction(array($editor), 'updateUserOnlineMarking');
+                       $action = new UserProfileAction([$editor], 'updateUserOnlineMarking');
                        $action->executeAction();
                }
                
@@ -360,7 +360,7 @@ class UserEditForm extends UserAddForm {
                $sql = "DELETE FROM     wcf".WCF_N."_moderation_queue_to_user
                        WHERE           userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->user->userID));
+               $statement->execute([$this->user->userID]);
                
                // reset moderation count
                ModerationQueueManager::getInstance()->resetModerationCount($this->user->userID);
index 9f417217a5594f0b82324e3d86822b0820f7fa0c..1c3000350165f23f605ab97dd0d1044854eacf7f 100755 (executable)
@@ -28,7 +28,7 @@ class UserEmailAddressExportForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canMailUser');
+       public $neededPermissions = ['admin.user.canMailUser'];
        
        /**
         * type of the file containg the exported email addresses
@@ -40,7 +40,7 @@ class UserEmailAddressExportForm extends AbstractForm {
         * ids of the users whose email addresses are exported
         * @var integer[]
         */
-       public $userIDs = array();
+       public $userIDs = [];
        
        /**
         * string used to separate email adresses
@@ -58,7 +58,7 @@ class UserEmailAddressExportForm extends AbstractForm {
         * users whose email addresses are exported
         * @var User[]
         */
-       public $users = array();
+       public $users = [];
        
        /**
         * clipboard item type id
@@ -115,7 +115,7 @@ class UserEmailAddressExportForm extends AbstractForm {
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->userIDs));
+               $conditions->add("userID IN (?)", [$this->userIDs]);
                
                // count users
                $sql = "SELECT  COUNT(*)
@@ -162,11 +162,11 @@ class UserEmailAddressExportForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'users' => $this->users,
                        'separator' => $this->separator,
                        'textSeparator' => $this->textSeparator,
                        'fileType' => $this->fileType
-               ));
+               ]);
        }
 }
index bbf64b89c83ee9e58e7f4a3e1f43f5b8fdd67af6..8bffe5b36d5780204c8170a92e585282452a99d1 100644 (file)
@@ -29,7 +29,7 @@ class UserGroupAssignmentAddForm extends AbstractForm {
         * list of grouped user group assignment condition object types
         * @var array
         */
-       public $conditions = array();
+       public $conditions = [];
        
        /**
         * id of the selected user group
@@ -46,7 +46,7 @@ class UserGroupAssignmentAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canManageGroupAssignment');
+       public $neededPermissions = ['admin.user.canManageGroupAssignment'];
        
        /**
         * title of the user group assignment
@@ -58,7 +58,7 @@ class UserGroupAssignmentAddForm extends AbstractForm {
         * list of selectable user groups
         * @var UserGroup[]
         */
-       public $userGroups = array();
+       public $userGroups = [];
        
        /**
         * @see \wcf\page\IPage::assignVariables()
@@ -66,25 +66,25 @@ class UserGroupAssignmentAddForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'groupedObjectTypes' => $this->conditions,
                        'groupID' => $this->groupID,
                        'isDisabled' => $this->isDisabled,
                        'title' => $this->title,
                        'userGroups' => $this->userGroups
-               ));
+               ]);
        }
        
        /**
         * @see \wcf\page\IPage::readData()
         */
        public function readData() {
-               $this->userGroups = UserGroup::getGroupsByType(array(), array(
+               $this->userGroups = UserGroup::getGroupsByType([], [
                        UserGroup::EVERYONE,
                        UserGroup::GUESTS,
                        UserGroup::USERS
-               ));
+               ]);
                foreach ($this->userGroups as $key => $userGroup) {
                        if (!$userGroup->isAccessible()) {
                                unset($this->userGroups[$key]);
@@ -123,17 +123,17 @@ class UserGroupAssignmentAddForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new UserGroupAssignmentAction(array(), 'create', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserGroupAssignmentAction([], 'create', [
+                       'data' => array_merge($this->additionalFields, [
                                'groupID' => $this->groupID,
                                'isDisabled' => $this->isDisabled,
                                'title' => $this->title
-                       ))
-               ));
+                       ])
+               ]);
                $returnValues = $this->objectAction->executeAction();
                
                // transform conditions array into one-dimensional array
-               $conditions = array();
+               $conditions = [];
                foreach ($this->conditions as $groupedObjectTypes) {
                        $conditions = array_merge($conditions, $groupedObjectTypes);
                }
index 0629a52c585c5693cc94f2dc1212838d467dd415..0f28ef33e0c70280464e37330834c0e9eaf876ed 100644 (file)
@@ -36,10 +36,10 @@ class UserGroupAssignmentEditForm extends UserGroupAssignmentAddForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'assignment' => $this->assignment
-               ));
+               ]);
        }
        
        /**
@@ -78,17 +78,17 @@ class UserGroupAssignmentEditForm extends UserGroupAssignmentAddForm {
        public function save() {
                AbstractForm::save();
                
-               $this->objectAction = new UserGroupAssignmentAction(array($this->assignment), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserGroupAssignmentAction([$this->assignment], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'groupID' => $this->groupID,
                                'isDisabled' => $this->isDisabled,
                                'title' => $this->title
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                
                // transform conditions array into one-dimensional array
-               $conditions = array();
+               $conditions = [];
                foreach ($this->conditions as $groupedObjectTypes) {
                        $conditions = array_merge($conditions, $groupedObjectTypes);
                }
index 0aa8d47e2246800ce4905c6499131505f7d32337..ef40e0dea0aee8de1f60ef02fa2af601155e8a52 100644 (file)
@@ -34,18 +34,18 @@ class UserGroupOptionForm extends AbstractForm {
         * list of parsed form elements per group
         * @var string[]
         */
-       public $formElements = array();
+       public $formElements = [];
        
        /**
         * list of accessible groups
         * @var UserGroup[]
         */
-       public $groups = array();
+       public $groups = [];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canEditGroup');
+       public $neededPermissions = ['admin.user.canEditGroup'];
        
        /**
         * user group option type object
@@ -57,13 +57,13 @@ class UserGroupOptionForm extends AbstractForm {
         * list of parent categories
         * @var UserGroupOptionCategory[]
         */
-       public $parentCategories = array();
+       public $parentCategories = [];
        
        /**
         * list of values per user group
         * @var array
         */
-       public $values = array();
+       public $values = [];
        
        /**
         * user group option object
@@ -95,7 +95,7 @@ class UserGroupOptionForm extends AbstractForm {
                        $categoryList = new UserGroupOptionCategoryList();
                        $categoryList->readObjects();
                        
-                       $categories = array();
+                       $categories = [];
                        foreach ($categoryList as $category) {
                                $categories[$category->categoryName] = $category;
                        }
@@ -201,8 +201,8 @@ class UserGroupOptionForm extends AbstractForm {
                if (empty($_POST)) {
                        // read values of accessible user groups
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("groupID IN (?)", array(array_keys($this->groups)));
-                       $conditions->add("optionID = ?", array($this->userGroupOption->optionID));
+                       $conditions->add("groupID IN (?)", [array_keys($this->groups)]);
+                       $conditions->add("optionID = ?", [$this->userGroupOption->optionID]);
                        
                        $sql = "SELECT  groupID, optionValue
                                FROM    wcf".WCF_N."_user_group_option_value
@@ -227,7 +227,7 @@ class UserGroupOptionForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new UserGroupOptionAction(array($this->userGroupOption), 'updateValues', array('values' => $this->values));
+               $this->objectAction = new UserGroupOptionAction([$this->userGroupOption], 'updateValues', ['values' => $this->values]);
                $this->objectAction->executeAction();
                
                // fire saved event
@@ -242,13 +242,13 @@ class UserGroupOptionForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'formElements' => $this->formElements,
                        'groups' => $this->groups,
                        'parentCategories' => $this->parentCategories,
                        'userGroupOption' => $this->userGroupOption,
                        'values' => $this->values
-               ));
+               ]);
        }
        
        /**
index fea1aa49192b5162ddec1dbd7570a1f54063b7eb..a9d7ead2346905b0e6687e7966b016d43e444493 100755 (executable)
@@ -38,18 +38,18 @@ class UserMailForm extends AbstractForm {
         * list of group ids
         * @var integer[]
         */
-       public $groupIDs = array();
+       public $groupIDs = [];
        
        /**
         * list of groups
         * @var UserGroup[]
         */
-       public $groups = array();
+       public $groups = [];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canMailUser');
+       public $neededPermissions = ['admin.user.canMailUser'];
        
        /**
         * message subject
@@ -67,7 +67,7 @@ class UserMailForm extends AbstractForm {
         * list of user ids
         * @var integer[]
         */
-       public $userIDs = array();
+       public $userIDs = [];
        
        /**
         * list of users
@@ -132,9 +132,9 @@ class UserMailForm extends AbstractForm {
                
                // save config in session
                $userMailData = WCF::getSession()->getVar('userMailData');
-               if ($userMailData === null) $userMailData = array();
+               if ($userMailData === null) $userMailData = [];
                $mailID = count($userMailData);
-               $userMailData[$mailID] = array(
+               $userMailData[$mailID] = [
                        'action' => $this->action,
                        'userIDs' => $this->userIDs,
                        'groupIDs' => implode(',', $this->groupIDs),
@@ -142,7 +142,7 @@ class UserMailForm extends AbstractForm {
                        'text' => $this->text,
                        'from' => $this->from,
                        'enableHTML' => $this->enableHTML
-               );
+               ];
                WCF::getSession()->register('userMailData', $userMailData);
                $this->saved();
                
@@ -179,12 +179,12 @@ class UserMailForm extends AbstractForm {
                
                if (!empty($this->userIDs)) {
                        $this->userList = new UserList();
-                       $this->userList->getConditionBuilder()->add("user_table.userID IN (?)", array($this->userIDs));
+                       $this->userList->getConditionBuilder()->add("user_table.userID IN (?)", [$this->userIDs]);
                        $this->userList->sqlOrderBy = "user_table.username ASC";
                        $this->userList->readObjects();
                }
                
-               $this->groups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE));
+               $this->groups = UserGroup::getAccessibleGroups([], [UserGroup::GUESTS, UserGroup::EVERYONE]);
        }
        
        /**
@@ -193,7 +193,7 @@ class UserMailForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'enableHTML' => $this->enableHTML,
                        'from' => $this->from,
                        'groupIDs' => $this->groupIDs,
@@ -202,6 +202,6 @@ class UserMailForm extends AbstractForm {
                        'text' => $this->text,
                        'userIDs' => $this->userIDs,
                        'userList' => $this->userList
-               ));
+               ]);
        }
 }
index e44eeaca0f98dc15a7e381c6078ba70b70f771b8..46db2f097fe63373a8b13affc0d2bb134e9a2692 100644 (file)
@@ -25,7 +25,7 @@ class UserMergeForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canEditUser');
+       public $neededPermissions = ['admin.user.canEditUser'];
        
        /**
         * @see \wcf\page\AbstractPage::$activeMenuItem
@@ -36,13 +36,13 @@ class UserMergeForm extends AbstractForm {
         * ids of the relevant users
         * @var integer[]
         */
-       public $userIDs = array();
+       public $userIDs = [];
        
        /**
         * relevant users
         * @var User[]
         */
-       public $users = array();
+       public $users = [];
        
        /**
         * destination user id
@@ -54,7 +54,7 @@ class UserMergeForm extends AbstractForm {
         * ids of merge users (without destination user)
         * @var integer[]
         */
-       public $mergedUserIDs = array();
+       public $mergedUserIDs = [];
        
        /**
         * id of the user clipboard item object type
@@ -110,141 +110,141 @@ class UserMergeForm extends AbstractForm {
                
                // poll_option_vote
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE IGNORE   wcf".WCF_N."_poll_option_vote
                        SET             userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // comment
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE  wcf".WCF_N."_comment
                        SET     userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // comment_response
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE  wcf".WCF_N."_comment_response
                        SET     userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // profile comments
                $objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.comment.commentableContent', 'com.woltlab.wcf.user.profileComment');
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectTypeID = ?", array($objectType->objectTypeID));
-               $conditions->add("objectID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("objectTypeID = ?", [$objectType->objectTypeID]);
+               $conditions->add("objectID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE  wcf".WCF_N."_comment
                        SET     objectID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // like (userID)
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE IGNORE   wcf".WCF_N."_like
                        SET             userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                // like (objectUserID)
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectUserID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("objectUserID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE  wcf".WCF_N."_like
                        SET     objectUserID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // like_object
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectUserID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("objectUserID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE  wcf".WCF_N."_like_object
                        SET     objectUserID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // user_follow (userID)
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
-               $conditions->add("followUserID <> ?", array($this->destinationUserID));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
+               $conditions->add("followUserID <> ?", [$this->destinationUserID]);
                $sql = "UPDATE IGNORE   wcf".WCF_N."_user_follow
                        SET             userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                // user_follow (followUserID)
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("followUserID IN (?)", array($this->mergedUserIDs));
-               $conditions->add("userID <> ?", array($this->destinationUserID));
+               $conditions->add("followUserID IN (?)", [$this->mergedUserIDs]);
+               $conditions->add("userID <> ?", [$this->destinationUserID]);
                $sql = "UPDATE IGNORE   wcf".WCF_N."_user_follow
                        SET             followUserID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // user_ignore (userID)
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
-               $conditions->add("ignoreUserID <> ?", array($this->destinationUserID));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
+               $conditions->add("ignoreUserID <> ?", [$this->destinationUserID]);
                $sql = "UPDATE IGNORE   wcf".WCF_N."_user_ignore
                        SET             userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                // user_ignore (ignoreUserID)
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("ignoreUserID IN (?)", array($this->mergedUserIDs));
-               $conditions->add("userID <> ?", array($this->destinationUserID));
+               $conditions->add("ignoreUserID IN (?)", [$this->mergedUserIDs]);
+               $conditions->add("userID <> ?", [$this->destinationUserID]);
                $sql = "UPDATE IGNORE   wcf".WCF_N."_user_ignore
                        SET             ignoreUserID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // user_object_watch
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE IGNORE   wcf".WCF_N."_user_object_watch
                        SET             userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // user_activity_event
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE  wcf".WCF_N."_user_activity_event
                        SET     userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // attachments
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE  wcf".WCF_N."_attachment
                        SET     userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // modification_log
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($this->mergedUserIDs));
+               $conditions->add("userID IN (?)", [$this->mergedUserIDs]);
                $sql = "UPDATE  wcf".WCF_N."_modification_log
                        SET     userID = ?
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array($this->destinationUserID), $conditions->getParameters()));
+               $statement->execute(array_merge([$this->destinationUserID], $conditions->getParameters()));
                
                // delete merged users
                $action = new UserAction($this->mergedUserIDs, 'delete');
@@ -267,10 +267,10 @@ class UserMergeForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'users' => $this->users,
                        'userIDs' => $this->userIDs,
                        'destinationUserID' => $this->destinationUserID
-               ));
+               ]);
        }
 }
index b88715fba0a8e862222370bff270c1a271e6d142..f917a8a0b58b88b2cf30ccf5e69c2a0b3b117258 100644 (file)
@@ -26,7 +26,7 @@ class UserOptionCategoryAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canManageUserOption');
+       public $neededPermissions = ['admin.user.canManageUserOption'];
        
        /**
         * category name
@@ -79,11 +79,11 @@ class UserOptionCategoryAddForm extends AbstractForm {
                parent::save();
                
                // save label
-               $this->objectAction = new UserOptionCategoryAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserOptionCategoryAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'parentCategoryName' => 'profile',
                        'categoryName' => $this->categoryName,
                        'showOrder' => $this->showOrder
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                
                // update name
@@ -91,9 +91,9 @@ class UserOptionCategoryAddForm extends AbstractForm {
                $categoryID = $returnValues['returnValues']->categoryID;
                I18nHandler::getInstance()->save('categoryName', 'wcf.user.option.category.category'.$categoryID, 'wcf.user.option');
                $categoryEditor = new UserOptionCategoryEditor($returnValues['returnValues']);
-               $categoryEditor->update(array(
+               $categoryEditor->update([
                        'categoryName' => 'category'.$categoryID
-               ));
+               ]);
                $this->saved();
                
                // reset values
@@ -103,9 +103,9 @@ class UserOptionCategoryAddForm extends AbstractForm {
                I18nHandler::getInstance()->reset();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -116,10 +116,10 @@ class UserOptionCategoryAddForm extends AbstractForm {
                
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'categoryName' => $this->categoryName,
                        'showOrder' => $this->showOrder
-               ));
+               ]);
        }
 }
index d32c3721c4c07698cd2655ce552d85d80ddaa2d8..8d501276840fc3409b96efb19439a9029b4a16a6 100644 (file)
@@ -56,9 +56,9 @@ class UserOptionCategoryEditForm extends UserOptionCategoryAddForm {
                
                I18nHandler::getInstance()->save('categoryName', 'wcf.user.option.category.'.$this->category->categoryName, 'wcf.user.option');
                
-               $this->objectAction = new UserOptionCategoryAction(array($this->category), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserOptionCategoryAction([$this->category], 'update', ['data' => array_merge($this->additionalFields, [
                        'showOrder' => $this->showOrder
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -86,10 +86,10 @@ class UserOptionCategoryEditForm extends UserOptionCategoryAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'categoryID' => $this->categoryID,
                        'category' => $this->category
-               ));
+               ]);
        }
 }
index 3d7f15e4ba50f6591f086a79a93d59ed2bc8f08a..4831d6bccae9f20168746927aa363b245db2bc7f 100644 (file)
@@ -57,7 +57,7 @@ class UserOptionEditForm extends UserOptionAddForm {
                I18nHandler::getInstance()->save('optionName', 'wcf.user.option.'.$this->userOption->optionName, 'wcf.user.option');
                I18nHandler::getInstance()->save('optionDescription', 'wcf.user.option.'.$this->userOption->optionName.'.description', 'wcf.user.option');
                
-               $this->objectAction = new UserOptionAction(array($this->userOption), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserOptionAction([$this->userOption], 'update', ['data' => array_merge($this->additionalFields, [
                        'categoryName' => $this->categoryName,
                        'optionType' => $this->optionType,
                        'defaultValue' => $this->defaultValue,
@@ -70,7 +70,7 @@ class UserOptionEditForm extends UserOptionAddForm {
                        'searchable' => $this->searchable,
                        'editable' => $this->editable,
                        'visible' => $this->visible
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -110,10 +110,10 @@ class UserOptionEditForm extends UserOptionAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'edit',
                        'optionID' => $this->optionID,
                        'userOption' => $this->userOption
-               ));
+               ]);
        }
 }
index a10acc28281b3d5d9783b67bd652d4f24b9e3440..6a8de2cd2fb4637f721cd04ff7e8a010585e900d 100644 (file)
@@ -30,7 +30,7 @@ abstract class UserOptionListForm extends AbstractOptionListForm {
         * @return      array
         */
        protected function getAvailableGroups() {
-               $userGroups = UserGroup::getAccessibleGroups(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS));
+               $userGroups = UserGroup::getAccessibleGroups([], [UserGroup::GUESTS, UserGroup::EVERYONE, UserGroup::USERS]);
                
                // work-around for PHP 5.3.3 randomly failing in uasort()
                foreach ($userGroups as $userGroup) {
index e2d1e865f521f8e4f452e9a3d5508f32218977b9..54aeeb21c11815aea8393fbf64461564fa4d53c4 100644 (file)
@@ -24,7 +24,7 @@ class UserOptionSetDefaultsForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canManageUserOption');
+       public $neededPermissions = ['admin.user.canManageUserOption'];
        
        /**
         * user option handler
@@ -87,7 +87,7 @@ class UserOptionSetDefaultsForm extends AbstractForm {
                                WHERE   optionID IN (?".str_repeat(', ?', count($optionIDs) - 1).")";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($optionIDs);
-                       $optionIDs = $optionValues = array();
+                       $optionIDs = $optionValues = [];
                        while ($row = $statement->fetchArray()) {
                                if ($row['defaultValue'] != $saveOptions[$row['optionID']]) {
                                        $optionIDs[] = $row['optionID'];
@@ -109,7 +109,7 @@ class UserOptionSetDefaultsForm extends AbstractForm {
                        WHERE   optionID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($saveOptions as $optionID => $value) {
-                       $statement->execute(array($value, $optionID));
+                       $statement->execute([$value, $optionID]);
                }
                
                // reset cache
@@ -136,9 +136,9 @@ class UserOptionSetDefaultsForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'optionTree' => $this->optionHandler->getOptionTree(),
                        'applyChangesToExistingUsers' => $this->applyChangesToExistingUsers
-               ));
+               ]);
        }
 }
index a5d508a31925af6511acd1ab70538d47a9454133..db075e30ab6898081629e00c487f2ff1a733adaa 100644 (file)
@@ -29,12 +29,12 @@ class UserRankAddForm extends AbstractForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.rank.canManageRank');
+       public $neededPermissions = ['admin.user.rank.canManageRank'];
        
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_USER_RANK');
+       public $neededModules = ['MODULE_USER_RANK'];
        
        /**
         * rank group id
@@ -88,7 +88,7 @@ class UserRankAddForm extends AbstractForm {
         * list of pre-defined css class names
         * @var string[]
         */
-       public $availableCssClassNames = array(
+       public $availableCssClassNames = [
                'yellow',
                'orange',
                'brown',
@@ -101,7 +101,7 @@ class UserRankAddForm extends AbstractForm {
                
                'none', /* not a real value */
                'custom' /* not a real value */
-       );
+       ];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -181,7 +181,7 @@ class UserRankAddForm extends AbstractForm {
                parent::save();
                
                // save label
-               $this->objectAction = new UserRankAction(array(), 'create', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserRankAction([], 'create', ['data' => array_merge($this->additionalFields, [
                        'rankTitle' => $this->rankTitle,
                        'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName),
                        'groupID' => $this->groupID,
@@ -189,7 +189,7 @@ class UserRankAddForm extends AbstractForm {
                        'rankImage' => $this->rankImage,
                        'repeatImage' => $this->repeatImage,
                        'requiredGender' => $this->requiredGender
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                
                if (!I18nHandler::getInstance()->isPlainValue('rankTitle')) {
@@ -199,9 +199,9 @@ class UserRankAddForm extends AbstractForm {
                        
                        // update name
                        $rankEditor = new UserRankEditor($returnValues['returnValues']);
-                       $rankEditor->update(array(
+                       $rankEditor->update([
                                'rankTitle' => 'wcf.user.rank.userRank'.$rankID
-                       ));
+                       ]);
                }
                $this->saved();
                
@@ -213,9 +213,9 @@ class UserRankAddForm extends AbstractForm {
                I18nHandler::getInstance()->reset();
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -226,18 +226,18 @@ class UserRankAddForm extends AbstractForm {
                
                I18nHandler::getInstance()->assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => 'add',
                        'availableCssClassNames' => $this->availableCssClassNames,
                        'cssClassName' => $this->cssClassName,
                        'customCssClassName' => $this->customCssClassName,
                        'groupID' => $this->groupID,
                        'rankTitle' => $this->rankTitle,
-                       'availableGroups' => UserGroup::getGroupsByType(array(), array(UserGroup::GUESTS, UserGroup::EVERYONE)),
+                       'availableGroups' => UserGroup::getGroupsByType([], [UserGroup::GUESTS, UserGroup::EVERYONE]),
                        'requiredPoints' => $this->requiredPoints,
                        'rankImage' => $this->rankImage,
                        'repeatImage' => $this->repeatImage,
                        'requiredGender' => $this->requiredGender
-               ));
+               ]);
        }
 }
index 585ade4ac5f830a3b88ed68edf58f793402458ab..3ba24f7a9a7a3e23ee485c7e05dd22ffd430f838 100644 (file)
@@ -64,7 +64,7 @@ class UserRankEditForm extends UserRankAddForm {
                }
                
                // update label
-               $this->objectAction = new UserRankAction(array($this->rank), 'update', array('data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserRankAction([$this->rank], 'update', ['data' => array_merge($this->additionalFields, [
                        'rankTitle' => $this->rankTitle,
                        'cssClassName' => ($this->cssClassName == 'custom' ? $this->customCssClassName : $this->cssClassName),
                        'groupID' => $this->groupID,
@@ -72,7 +72,7 @@ class UserRankEditForm extends UserRankAddForm {
                        'rankImage' => $this->rankImage,
                        'repeatImage' => $this->repeatImage,
                        'requiredGender' => $this->requiredGender
-               ))));
+               ])]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -80,9 +80,9 @@ class UserRankEditForm extends UserRankAddForm {
                if ($this->cssClassName != 'custom') $this->customCssClassName = '';
                
                // show success
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'success' => true
-               ));
+               ]);
        }
        
        /**
@@ -115,10 +115,10 @@ class UserRankEditForm extends UserRankAddForm {
                
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'rankID' => $this->rankID,
                        'rank' => $this->rank,
                        'action' => 'edit'
-               ));
+               ]);
        }
 }
index c3b916eb6e7871ace58a302f30f92c6dc4b09488..54d0b662faf432181c8cdc47999aef894cb0cb4f 100755 (executable)
@@ -33,13 +33,13 @@ class UserSearchForm extends UserOptionListForm {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canSearchUser');
+       public $neededPermissions = ['admin.user.canSearchUser'];
        
        /**
         * list of grouped user group assignment condition object types
         * @var array
         */
-       public $conditions = array();
+       public $conditions = [];
        
        /**
         * list with searched users
@@ -75,7 +75,7 @@ class UserSearchForm extends UserOptionListForm {
         * shown columns
         * @var string[]
         */
-       public $columns = array('registrationDate', 'lastActivityTime');
+       public $columns = ['registrationDate', 'lastActivityTime'];
        
        /**
         * number of results
@@ -163,14 +163,14 @@ class UserSearchForm extends UserOptionListForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'groupedObjectTypes' => $this->conditions,
                        'sortField' => $this->sortField,
                        'sortOrder' => $this->sortOrder,
                        'itemsPerPage' => $this->itemsPerPage,
                        'columns' => $this->columns,
                        'columnOptions' => $this->optionHandler->getCategoryOptions('profile')
-               ));
+               ]);
        }
        
        /**
@@ -186,12 +186,12 @@ class UserSearchForm extends UserOptionListForm {
                        'columns' => $this->columns
                ]);
                
-               $search = SearchEditor::create(array(
+               $search = SearchEditor::create([
                        'userID' => WCF::getUser()->userID,
                        'searchData' => $data,
                        'searchTime' => TIME_NOW,
                        'searchType' => 'users'
-               ));
+               ]);
                
                // get new search id
                $this->searchID = $search->searchID;
index b46b3d9522996b1569c244650a71e13c00ddf6ae..9a64783ff30ea7b4022f1e4dd8b022d178b7053a 100755 (executable)
@@ -26,7 +26,7 @@ class ACPSessionLogListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canViewLog');
+       public $neededPermissions = ['admin.management.canViewLog'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -41,7 +41,7 @@ class ACPSessionLogListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('sessionLogID', 'username', 'ipAddress', 'userAgent', 'time', 'lastActivityTime', 'accesses');
+       public $validSortFields = ['sessionLogID', 'username', 'ipAddress', 'userAgent', 'time', 'lastActivityTime', 'accesses'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index e94bd44523e27949dc679c3aec037d5ccfec71df..67e51a86d56822f4a0519aaba04d50fc8b6270d5 100755 (executable)
@@ -29,7 +29,7 @@ class ACPSessionLogPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canViewLog');
+       public $neededPermissions = ['admin.management.canViewLog'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -39,7 +39,7 @@ class ACPSessionLogPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('sessionAccessLogID', 'ipAddress', 'time', 'requestURI', 'requestMethod', 'className');
+       public $validSortFields = ['sessionAccessLogID', 'ipAddress', 'time', 'requestURI', 'requestMethod', 'className'];
        
        /**
         * session log id
@@ -78,7 +78,7 @@ class ACPSessionLogPage extends SortablePage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               $this->objectList->getConditionBuilder()->add('sessionLogID = ?', array($this->sessionLogID));
+               $this->objectList->getConditionBuilder()->add('sessionLogID = ?', [$this->sessionLogID]);
        }
        
        /**
@@ -96,9 +96,9 @@ class ACPSessionLogPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'sessionLogID' => $this->sessionLogID,
                        'sessionLog' => $this->sessionLog
-               ));
+               ]);
        }
 }
index 4da4b69fe668df80516c4c472d01a24c7ffa4622..8387146d179187ad8e11aad2d90d42ab9bf0bfb1 100644 (file)
@@ -98,14 +98,14 @@ abstract class AbstractCategoryListPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'addController' => $this->addController,
                        'categoryNodeList' => $this->categoryNodeTree->getIterator(),
                        'collapsedCategoryIDs' => $this->collapsedCategoryIDs,
                        'collapsibleObjectTypeID' => $this->collapsibleObjectTypeID,
                        'editController' => $this->editController,
                        'objectType' => $this->objectType
-               ));
+               ]);
                
                if ($this->pageTitle) {
                        WCF::getTPL()->assign('pageTitle', $this->pageTitle);
index 44d0707b83708f9b1e27512074e6e02fac69db24..42d58d16797677370b1d8fa5c37563142b95e94b 100644 (file)
@@ -21,12 +21,12 @@ class AdListPage extends MultipleLinkPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.ad.canManageAd');
+       public $neededPermissions = ['admin.ad.canManageAd'];
        
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_WCF_AD');
+       public $neededModules = ['MODULE_WCF_AD'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index f809e1e1eea84deffadcffb1549db8a8ef453e8c..83983ae6ba0513ba226663ea5819d3b7b70bbbb7 100644 (file)
@@ -29,7 +29,7 @@ class ApplicationManagementPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.canManageApplication');
+       public $neededPermissions = ['admin.configuration.canManageApplication'];
        
        /**
         * @see \wcf\page\IPage::readData()
@@ -47,8 +47,8 @@ class ApplicationManagementPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'applicationList' => $this->applicationList
-               ));
+               ]);
        }
 }
index ae057582d18f7668ff10de9b6ccad21801054895..b49f0a5d2fc75ed846f22e733b95174ecb65500a 100644 (file)
@@ -25,7 +25,7 @@ class AttachmentListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.attachment.canManageAttachment');
+       public $neededPermissions = ['admin.attachment.canManageAttachment'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -40,7 +40,7 @@ class AttachmentListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('attachmentID', 'filename', 'filesize', 'downloads', 'uploadTime', 'lastDownloadTime');
+       public $validSortFields = ['attachmentID', 'filename', 'filesize', 'downloads', 'uploadTime', 'lastDownloadTime'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -69,13 +69,13 @@ class AttachmentListPage extends SortablePage {
         * available file types
         * @var string[]
         */
-       public $availableFileTypes = array();
+       public $availableFileTypes = [];
        
        /**
         * attachment stats
         * @var array
         */
-       public $stats = array();
+       public $stats = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -94,14 +94,14 @@ class AttachmentListPage extends SortablePage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               $objectTypeIDs = array();
+               $objectTypeIDs = [];
                foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.attachment.objectType') as $objectType) {
                        if (!$objectType->private) {
                                $objectTypeIDs[] = $objectType->objectTypeID;
                        }
                }
                
-               if (!empty($objectTypeIDs)) $this->objectList->getConditionBuilder()->add('attachment.objectTypeID IN (?)', array($objectTypeIDs));
+               if (!empty($objectTypeIDs)) $this->objectList->getConditionBuilder()->add('attachment.objectTypeID IN (?)', [$objectTypeIDs]);
                else $this->objectList->getConditionBuilder()->add('1 = 0');
                $this->objectList->getConditionBuilder()->add("attachment.tmpHash = ''");
                
@@ -113,14 +113,14 @@ class AttachmentListPage extends SortablePage {
                if (!empty($this->username)) {
                        $user = User::getUserByUsername($this->username);
                        if ($user->userID) {
-                               $this->objectList->getConditionBuilder()->add('attachment.userID = ?', array($user->userID));
+                               $this->objectList->getConditionBuilder()->add('attachment.userID = ?', [$user->userID]);
                        }
                }
                if (!empty($this->filename)) {
-                       $this->objectList->getConditionBuilder()->add('attachment.filename LIKE ?', array($this->filename.'%'));
+                       $this->objectList->getConditionBuilder()->add('attachment.filename LIKE ?', [$this->filename.'%']);
                }
                if (!empty($this->fileType)) {
-                       $this->objectList->getConditionBuilder()->add('attachment.fileType LIKE ?', array($this->fileType));
+                       $this->objectList->getConditionBuilder()->add('attachment.fileType LIKE ?', [$this->fileType]);
                }
        }
        
@@ -130,12 +130,12 @@ class AttachmentListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'stats' => $this->stats,
                        'username' => $this->username,
                        'filename' => $this->filename,
                        'fileType' => $this->fileType,
                        'availableFileTypes' => $this->availableFileTypes
-               ));
+               ]);
        }
 }
index a7e9d0bba5f44a9c1c44097b36910438cb25a6ef..2c2ceabf5e74412dac71d378b2b24abfb902ff81 100644 (file)
@@ -18,7 +18,7 @@ class AttachmentPage extends \wcf\page\AttachmentPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.attachment.canManageAttachment');
+       public $neededPermissions = ['admin.attachment.canManageAttachment'];
        
        /**
         * @see \wcf\page\IPage::checkPermissions()
index 4beb985fbc9cb478fe715eecac088e695bc4aec1..341abc5df70be302e1dd95e046e40f5b71ecce32 100644 (file)
@@ -26,7 +26,7 @@ class BBCodeListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.bbcode.canManageBBCode');
+       public $neededPermissions = ['admin.content.bbcode.canManageBBCode'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -41,5 +41,5 @@ class BBCodeListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('bbcodeID', 'bbcodeTag', 'className');
+       public $validSortFields = ['bbcodeID', 'bbcodeTag', 'className'];
 }
index 665f6529769c364d4dbcf625f15c441368c1d027..7fd63d178550f854377a5e1648d3d95c8ee6742f 100644 (file)
@@ -26,7 +26,7 @@ class BBCodeMediaProviderListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.bbcode.canManageBBCode');
+       public $neededPermissions = ['admin.content.bbcode.canManageBBCode'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -41,5 +41,5 @@ class BBCodeMediaProviderListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('providerID', 'title');
+       public $validSortFields = ['providerID', 'title'];
 }
index 954737dceded324df4d27c93876a74fb904e3955..5fd8461a520bea6faf2d318a1ea56f7b88e8e574 100644 (file)
@@ -30,7 +30,7 @@ class BoxListPage extends SortablePage {
        /**
         * @inheritdoc
         */
-       public $neededPermissions = array('admin.content.cms.canManageBox');
+       public $neededPermissions = ['admin.content.cms.canManageBox'];
        
        /**
         * @inheritdoc
@@ -40,7 +40,7 @@ class BoxListPage extends SortablePage {
        /**
         * @inheritdoc
         */
-       public $validSortFields = array('boxID', 'name', 'boxType', 'position', 'showOrder');
+       public $validSortFields = ['boxID', 'name', 'boxType', 'position', 'showOrder'];
        
        /**
         * name
@@ -92,25 +92,25 @@ class BoxListPage extends SortablePage {
                parent::initObjectList();
                
                // hide menu boxes
-               $this->objectList->getConditionBuilder()->add('box.boxType <> ?', array('menu'));
+               $this->objectList->getConditionBuilder()->add('box.boxType <> ?', ['menu']);
                
                if (!empty($this->name)) {
-                       $this->objectList->getConditionBuilder()->add('box.name LIKE ?', array('%'.$this->name.'%'));
+                       $this->objectList->getConditionBuilder()->add('box.name LIKE ?', ['%'.$this->name.'%']);
                }
                if (!empty($this->title)) {
-                       $this->objectList->getConditionBuilder()->add('box.boxID IN (SELECT boxID FROM wcf'.WCF_N.'_box_content WHERE title LIKE ?)', array('%'.$this->title.'%'));
+                       $this->objectList->getConditionBuilder()->add('box.boxID IN (SELECT boxID FROM wcf'.WCF_N.'_box_content WHERE title LIKE ?)', ['%'.$this->title.'%']);
                }
                if (!empty($this->content)) {
-                       $this->objectList->getConditionBuilder()->add('box.boxID IN (SELECT boxID FROM wcf'.WCF_N.'_box_content WHERE content LIKE ?)', array('%'.$this->content.'%'));
+                       $this->objectList->getConditionBuilder()->add('box.boxID IN (SELECT boxID FROM wcf'.WCF_N.'_box_content WHERE content LIKE ?)', ['%'.$this->content.'%']);
                }
                if (!empty($this->position)) {
-                       $this->objectList->getConditionBuilder()->add('box.position = ?', array($this->position));
+                       $this->objectList->getConditionBuilder()->add('box.position = ?', [$this->position]);
                }
                if ($this->boxType == 'static') {
-                       $this->objectList->getConditionBuilder()->add('box.boxType IN (?, ?, ?)', array('text', 'html', 'tpl'));
+                       $this->objectList->getConditionBuilder()->add('box.boxType IN (?, ?, ?)', ['text', 'html', 'tpl']);
                }
                else if ($this->boxType == 'system') {
-                       $this->objectList->getConditionBuilder()->add('box.boxType IN (?)', array('system'));
+                       $this->objectList->getConditionBuilder()->add('box.boxType IN (?)', ['system']);
                }
        }
        
@@ -120,13 +120,13 @@ class BoxListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'name' => $this->name,
                        'title' => $this->title,
                        'content' => $this->content,
                        'boxType' => $this->boxType,
                        'position' => $this->position,
                        'availablePositions' => Box::$availablePositions
-               ));
+               ]);
        }
 }
index b405c900bcff0d344b01535188ebe7531941dbd0..ee589eab74384ff7df7791ed46ad8c1d7b56a7e4 100755 (executable)
@@ -27,7 +27,7 @@ class CacheListPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.canManageApplication');
+       public $neededPermissions = ['admin.configuration.canManageApplication'];
        
        /**
         * indicates if cache was cleared
@@ -39,13 +39,13 @@ class CacheListPage extends AbstractPage {
         * contains a list of cache resources
         * @var array
         */
-       public $caches = array();
+       public $caches = [];
        
        /**
         * contains general cache information
         * @var array
         */
-       public $cacheData = array();
+       public $cacheData = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -63,12 +63,12 @@ class CacheListPage extends AbstractPage {
                parent::readData();
                
                // init cache data
-               $this->cacheData = array(
+               $this->cacheData = [
                        'source' => get_class(CacheHandler::getInstance()->getCacheSource()),
                        'version' => '',
                        'size' => 0,
                        'files' => 0
-               );
+               ];
                
                switch ($this->cacheData['source']) {
                        case 'wcf\system\cache\source\DiskCacheSource':
@@ -105,7 +105,7 @@ class CacheListPage extends AbstractPage {
         */
        protected function readCacheFiles($cacheType, $cacheDir, Regex $ignore = null, $extension = 'php') {
                if (!isset($this->cacheData[$cacheType])) {
-                       $this->cacheData[$cacheType] = array();
+                       $this->cacheData[$cacheType] = [];
                }
                
                // get files in cache directory
@@ -119,7 +119,7 @@ class CacheListPage extends AbstractPage {
                $files = $directoryUtil->getFileObjects(SORT_ASC, new Regex('\.'.$extension.'$'));
                
                // get additional file information
-               $data = array();
+               $data = [];
                if (is_array($files)) {
                        /** @var \SplFileInfo $file */
                        foreach ($files as $file) {
@@ -127,13 +127,13 @@ class CacheListPage extends AbstractPage {
                                        continue;
                                }
                                
-                               $data[] = array(
+                               $data[] = [
                                        'filename' => $file->getBasename(),
                                        'filesize' => $file->getSize(),
                                        'mtime' => $file->getMTime(),
                                        'perm' => substr(sprintf('%o', $file->getPerms()), -3),
                                        'writable' => $file->isWritable()
-                               );
+                               ];
                                
                                $this->cacheData['files']++;
                                $this->cacheData['size'] += $file->getSize();
@@ -149,10 +149,10 @@ class CacheListPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'caches' => $this->caches,
                        'cacheData' => $this->cacheData,
                        'cleared' => $this->cleared
-               ));
+               ]);
        }
 }
index be00c0d61119503cf4f4c119cae9a6ddbfc273ab..ba0e5ed9fc3e56800c9a77153c7849fdbb71d611 100644 (file)
@@ -21,7 +21,7 @@ class CaptchaQuestionListPage extends MultipleLinkPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.captcha.canManageCaptchaQuestion');
+       public $neededPermissions = ['admin.captcha.canManageCaptchaQuestion'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index 197c8ca4da420b796eb6dc4efc6bac4f0c22ffb2..154953a3d2313dae596558dcf8c9266306cf2ce9 100755 (executable)
@@ -21,7 +21,7 @@ class CronjobListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canManageCronjob');
+       public $neededPermissions = ['admin.management.canManageCronjob'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -31,7 +31,7 @@ class CronjobListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('cronjobID', 'nextExec', 'startMinute', 'startHour', 'startDom', 'startMonth', 'startDow');
+       public $validSortFields = ['cronjobID', 'nextExec', 'startMinute', 'startHour', 'startDom', 'startMonth', 'startDow'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index aee3b8efe4854338d647433f76df3f935b624352..c55cfd9062723b85a49a27f5342a7a1eb998adf2 100755 (executable)
@@ -21,7 +21,7 @@ class CronjobLogListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canManageCronjob');
+       public $neededPermissions = ['admin.management.canManageCronjob'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$itemsPerPage
@@ -41,7 +41,7 @@ class CronjobLogListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('cronjobID', 'className', 'description', 'execTime', 'success');
+       public $validSortFields = ['cronjobID', 'className', 'description', 'execTime', 'success'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index 750b034a879c2e713f4c76eb86d0648f67262d62..5e0dd73f9ea495fbf25aef3c93453003147da904 100644 (file)
@@ -28,7 +28,7 @@ class ExceptionLogViewPage extends MultipleLinkPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canViewLog');
+       public $neededPermissions = ['admin.management.canViewLog'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$itemsPerPage
@@ -51,13 +51,13 @@ class ExceptionLogViewPage extends MultipleLinkPage {
         * available logfiles
         * @var string[]
         */
-       public $logFiles = array();
+       public $logFiles = [];
        
        /**
         * exceptions shown
         * @var array
         */
-       public $exceptions = array();
+       public $exceptions = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -119,7 +119,7 @@ class ExceptionLogViewPage extends MultipleLinkPage {
                try {
                        $this->exceptions = call_user_func_array('array_merge', array_map(
                                function($v) {
-                                       return array($v[0] => $v[1]);
+                                       return [$v[0] => $v[1]];
                                },
                                array_chunk($contents, 2)
                        ));
@@ -212,11 +212,11 @@ Stack Trace: (?P<stack>[a-zA-Z0-9+/]+={0,2})', Regex::DOT_ALL);
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'exceptionID' => $this->exceptionID,
                        'logFiles' => array_flip(array_map('basename', $this->logFiles)),
                        'logFile' => $this->logFile,
                        'exceptions' => $this->exceptions
-               ));
+               ]);
        }
 }
index dd3b915fe19b849a18620d67dd42f5a5eb6cc01d..8568e7ea0bc9a07f6a8de633235c4d4682b1cf74 100644 (file)
@@ -26,12 +26,12 @@ class LabelGroupListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('groupID', 'groupName', 'groupDescription', 'showOrder');
+       public $validSortFields = ['groupID', 'groupName', 'groupDescription', 'showOrder'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.label.canManageLabel');
+       public $neededPermissions = ['admin.content.label.canManageLabel'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index 8be8ec16c721e41143430088af08a9733c12a05b..33ba0250b5be6c3bbb08485f89367561ea3e0799 100644 (file)
@@ -32,7 +32,7 @@ class LanguageItemListPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.language.canManageLanguage');
+       public $neededPermissions = ['admin.language.canManageLanguage'];
        
        /**
         * language item list
@@ -74,13 +74,13 @@ class LanguageItemListPage extends AbstractPage {
         * available languages
         * @var array
         */
-       public $availableLanguages = array();
+       public $availableLanguages = [];
        
        /**
         * available language categories
         * @var array
         */
-       public $availableLanguageCategories = array();
+       public $availableLanguageCategories = [];
        
        /**
         * current page no
@@ -126,10 +126,10 @@ class LanguageItemListPage extends AbstractPage {
                
                // get items
                $this->languageItemList = new LanguageItemList();
-               $this->languageItemList->getConditionBuilder()->add('languageID = ?', array($this->languageID));
-               if ($this->languageCategoryID) $this->languageItemList->getConditionBuilder()->add('languageCategoryID = ?', array($this->languageCategoryID));
-               if ($this->languageItem) $this->languageItemList->getConditionBuilder()->add('languageItem LIKE ?', array('%'.$this->languageItem.'%'));
-               if ($this->languageItemValue) $this->languageItemList->getConditionBuilder()->add('((languageUseCustomValue = 0 AND languageItemValue LIKE ?) OR languageCustomItemValue LIKE ?)', array('%'.$this->languageItemValue.'%', '%'.$this->languageItemValue.'%'));
+               $this->languageItemList->getConditionBuilder()->add('languageID = ?', [$this->languageID]);
+               if ($this->languageCategoryID) $this->languageItemList->getConditionBuilder()->add('languageCategoryID = ?', [$this->languageCategoryID]);
+               if ($this->languageItem) $this->languageItemList->getConditionBuilder()->add('languageItem LIKE ?', ['%'.$this->languageItem.'%']);
+               if ($this->languageItemValue) $this->languageItemList->getConditionBuilder()->add('((languageUseCustomValue = 0 AND languageItemValue LIKE ?) OR languageCustomItemValue LIKE ?)', ['%'.$this->languageItemValue.'%', '%'.$this->languageItemValue.'%']);
                if ($this->hasCustomValue) $this->languageItemList->getConditionBuilder()->add("languageCustomItemValue IS NOT NULL");
                $this->languageItemList->sqlLimit = 100;
                
@@ -152,7 +152,7 @@ class LanguageItemListPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'objects' => $this->languageItemList,
                        'count' => $this->count,
                        'pageNo' => $this->pageNo,
@@ -163,6 +163,6 @@ class LanguageItemListPage extends AbstractPage {
                        'hasCustomValue' => $this->hasCustomValue,
                        'availableLanguages' => $this->availableLanguages,
                        'availableLanguageCategories' => $this->availableLanguageCategories
-               ));
+               ]);
        }
 }
index 72966e9d848908a2c2e08f301c300b439b3e3f3c..d948e604c5cd0df9759c131038df4650bded8d16 100644 (file)
@@ -27,7 +27,7 @@ class LanguageListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.language.canManageLanguage');
+       public $neededPermissions = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -37,7 +37,7 @@ class LanguageListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('languageID', 'languageCode', 'languageName', 'users', 'variables', 'customVariables');
+       public $validSortFields = ['languageID', 'languageCode', 'languageName', 'users', 'variables', 'customVariables'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::initObjectList()
@@ -56,8 +56,8 @@ class LanguageListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'languages' => $this->objectList->getObjects()
-               ));
+               ]);
        }
 }
index 8b97f4104c7d9c7a5546855fedcf523a227f06a2..20d6982fc76c0ea6d5cda1164e7008d179519337 100644 (file)
@@ -26,7 +26,7 @@ class MenuItemListPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.cms.canManageMenu');
+       public $neededPermissions = ['admin.content.cms.canManageMenu'];
        
        /**
         * menu item list
@@ -80,10 +80,10 @@ class MenuItemListPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'menuID' => $this->menuID,
                        'menu' => $this->menu,
                        'menuItemNodeList' => $this->menuItems->getNodeList()
-               ));
+               ]);
        }
 }
index 769ecba81fa1b070d14e8216ecde404f9aa56fa9..2c9513aa5f6ead1d5c8b1b2c2019c3871c858e4f 100644 (file)
@@ -26,7 +26,7 @@ class NoticeListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.notice.canManageNotice');
+       public $neededPermissions = ['admin.notice.canManageNotice'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -36,5 +36,5 @@ class NoticeListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$objectListClassName
         */
-       public $validSortFields = array('noticeID', 'noticeName', 'showOrder');
+       public $validSortFields = ['noticeID', 'noticeName', 'showOrder'];
 }
index 4bc394d97cec665478b46d06003487a3f4519a87..280319e9e81dc68f9e533124e7d01a4ec6b89e41 100644 (file)
@@ -22,7 +22,7 @@ class PHPInfoPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.package.canInstallPackage', 'admin.configuration.package.canUpdatePackage');
+       public $neededPermissions = ['admin.configuration.package.canInstallPackage', 'admin.configuration.package.canUpdatePackage'];
        
        /**
         * @see \wcf\page\IPage::assignVariables()
@@ -60,8 +60,8 @@ class PHPInfoPage extends AbstractPage {
                        return $ret;
                }, $info);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'phpInfo' => $info
-               ));
+               ]);
        }
 }
index 4016ad56da099196d1a13032bfaf071e79d6d160..29afe5674133d8eb9228120faef36ff8e59bd2fa 100644 (file)
@@ -68,10 +68,10 @@ class PackageInstallationConfirmPage extends AbstractPage {
                }
                
                if ($this->queue->action == 'install') {
-                       WCF::getSession()->checkPermissions(array('admin.configuration.package.canInstallPackage'));
+                       WCF::getSession()->checkPermissions(['admin.configuration.package.canInstallPackage']);
                }
                else {
-                       WCF::getSession()->checkPermissions(array('admin.configuration.package.canUpdatePackage'));
+                       WCF::getSession()->checkPermissions(['admin.configuration.package.canUpdatePackage']);
                }
                
                $this->installingImportedStyle = WCF::getSession()->getVar('stylePackageImportLocation') !== null;
@@ -98,13 +98,13 @@ class PackageInstallationConfirmPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'archive' => $this->packageInstallationDispatcher->getArchive(),
                        'packageValidationArchives' => PackageValidationManager::getInstance()->getPackageValidationArchiveList(),
                        'queue' => $this->queue,
                        'validationPassed' => $this->validationPassed,
                        'installingImportedStyle' => $this->installingImportedStyle
-               ));
+               ]);
        }
        
        /**
index bf0bd55b34381f1725fd1eec623b3b302ec278fc..6c7553a82b4f866c748d24ef74c5c779ff0026ca 100644 (file)
@@ -22,7 +22,7 @@ class PackageListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.package.canUpdatePackage', 'admin.configuration.package.canUninstallPackage');
+       public $neededPermissions = ['admin.configuration.package.canUpdatePackage', 'admin.configuration.package.canUninstallPackage'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$itemsPerPage
@@ -48,7 +48,7 @@ class PackageListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('packageID', 'package', 'packageDir', 'packageName', 'packageDescription', 'packageDate', 'packageURL', 'isApplication', 'author', 'authorURL', 'installDate', 'updateDate');
+       public $validSortFields = ['packageID', 'package', 'packageDir', 'packageName', 'packageDescription', 'packageDate', 'packageURL', 'isApplication', 'author', 'authorURL', 'installDate', 'updateDate'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -70,9 +70,9 @@ class PackageListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'packageID' => $this->packageID
-               ));
+               ]);
        }
        
        /**
index 01cdbe2736967df1f5631d1b3b7e827faa84475a..0f60f9111521686f9762f5c5a0ce3f0951e714ef 100755 (executable)
@@ -24,7 +24,7 @@ class PackagePage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.package.canUpdatePackage', 'admin.configuration.package.canUninstallPackage');
+       public $neededPermissions = ['admin.configuration.package.canUpdatePackage', 'admin.configuration.package.canUninstallPackage'];
        
        /**
         * id of the package
index 2c9694a15abed1394cef07e9a069a39f9f97cfce..a16f47ca75d1f05a5435d757fef2fc39557a07a8 100644 (file)
@@ -25,12 +25,12 @@ class PackageUpdatePage extends AbstractPage {
         * list of available updates
         * @var array
         */
-       public $availableUpdates = array();
+       public $availableUpdates = [];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.package.canUpdatePackage');
+       public $neededPermissions = ['admin.configuration.package.canUpdatePackage'];
        
        /**
         * @see \wcf\page\IPage::readData()
@@ -47,9 +47,9 @@ class PackageUpdatePage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'availableUpdates' => $this->availableUpdates
-               ));
+               ]);
        }
        
        /**
index e3aa3b80f47abab727b237081d5c3af38601832c..de5c68b35bf7e04dcff373ee43362b6abaf4d981 100755 (executable)
@@ -21,7 +21,7 @@ class PackageUpdateServerListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.package.canEditServer');
+       public $neededPermissions = ['admin.configuration.package.canEditServer'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -31,7 +31,7 @@ class PackageUpdateServerListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('packageUpdateServerID', 'serverURL', 'status', 'errorMessage', 'lastUpdateTime', 'packages');
+       public $validSortFields = ['packageUpdateServerID', 'serverURL', 'status', 'errorMessage', 'lastUpdateTime', 'packages'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index 3961ea3600bc8bc1ceb24f6d6605ad1cc4a64e30..9e5abd5f5c7a38616bb53f05c2a20b1bd4befdda 100644 (file)
@@ -21,12 +21,12 @@ class PaidSubscriptionListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_PAID_SUBSCRIPTION');
+       public $neededModules = ['MODULE_PAID_SUBSCRIPTION'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.paidSubscription.canManageSubscription');
+       public $neededPermissions = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -36,7 +36,7 @@ class PaidSubscriptionListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('subscriptionID', 'title', 'showOrder', 'cost', 'subscriptionLength');
+       public $validSortFields = ['subscriptionID', 'title', 'showOrder', 'cost', 'subscriptionLength'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index 3b89567d5ee55238e33594f1cf3d07039a0c9e22..8bd6a76ee13babe5a0456ae46acf6650e5b32af0 100644 (file)
@@ -24,12 +24,12 @@ class PaidSubscriptionTransactionLogListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_PAID_SUBSCRIPTION');
+       public $neededModules = ['MODULE_PAID_SUBSCRIPTION'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.paidSubscription.canManageSubscription');
+       public $neededPermissions = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -44,7 +44,7 @@ class PaidSubscriptionTransactionLogListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('logID', 'subscriptionUserID', 'userID', 'subscriptionID', 'paymentMethodObjectTypeID', 'logTime', 'transactionID', 'logMessage');
+       public $validSortFields = ['logID', 'subscriptionUserID', 'userID', 'subscriptionID', 'paymentMethodObjectTypeID', 'logTime', 'transactionID', 'logMessage'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -87,13 +87,13 @@ class PaidSubscriptionTransactionLogListPage extends SortablePage {
                parent::initObjectList();
                
                if ($this->transactionID) {
-                       $this->objectList->getConditionBuilder()->add('paid_subscription_transaction_log.transactionID LIKE ?', array('%' . $this->transactionID . '%'));
+                       $this->objectList->getConditionBuilder()->add('paid_subscription_transaction_log.transactionID LIKE ?', ['%' . $this->transactionID . '%']);
                }
                if ($this->username) {
-                       $this->objectList->getConditionBuilder()->add('paid_subscription_transaction_log.userID IN (SELECT userID FROM wcf'.WCF_N.'_user WHERE username LIKE ?)', array('%' . $this->username . '%'));
+                       $this->objectList->getConditionBuilder()->add('paid_subscription_transaction_log.userID IN (SELECT userID FROM wcf'.WCF_N.'_user WHERE username LIKE ?)', ['%' . $this->username . '%']);
                }
                if ($this->subscriptionID) {
-                       $this->objectList->getConditionBuilder()->add('paid_subscription_transaction_log.subscriptionID = ?', array($this->subscriptionID));
+                       $this->objectList->getConditionBuilder()->add('paid_subscription_transaction_log.subscriptionID = ?', [$this->subscriptionID]);
                }
                
                $this->objectList->sqlSelects = 'user_table.username, paid_subscription.title';
@@ -107,11 +107,11 @@ class PaidSubscriptionTransactionLogListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'transactionID' => $this->transactionID,
                        'username' => $this->username,
                        'subscriptionID' => $this->subscriptionID,
                        'availableSubscriptions' => PaidSubscriptionCacheBuilder::getInstance()->getData()
-               ));
+               ]);
        }
 }
index 8b74371fb361ecc2bf053a52815c3dddef0199cd..800b1694553c51d3475dabc133097bbed17336d1 100644 (file)
@@ -24,12 +24,12 @@ class PaidSubscriptionTransactionLogPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_PAID_SUBSCRIPTION');
+       public $neededModules = ['MODULE_PAID_SUBSCRIPTION'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.paidSubscription.canManageSubscription');
+       public $neededPermissions = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * log entry id
@@ -62,9 +62,9 @@ class PaidSubscriptionTransactionLogPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'logID' => $this->logID,
                        'log' => $this->log
-               ));
+               ]);
        }
 }
index 2f32caf83584188bd2fb3fa79451d127bee21d52..6b867a9645b318fe296459dc2ad5ede989efbe11 100644 (file)
@@ -21,12 +21,12 @@ class PaidSubscriptionUserListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_PAID_SUBSCRIPTION');
+       public $neededModules = ['MODULE_PAID_SUBSCRIPTION'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.paidSubscription.canManageSubscription');
+       public $neededPermissions = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -36,7 +36,7 @@ class PaidSubscriptionUserListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('subscriptionUserID', 'userID', 'subscriptionID', 'startDate', 'endDate');
+       public $validSortFields = ['subscriptionUserID', 'userID', 'subscriptionID', 'startDate', 'endDate'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -49,7 +49,7 @@ class PaidSubscriptionUserListPage extends SortablePage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               $this->objectList->getConditionBuilder()->add('isActive = ?', array(1));
+               $this->objectList->getConditionBuilder()->add('isActive = ?', [1]);
                $this->objectList->sqlSelects = 'user_table.username, paid_subscription.title';
                $this->objectList->sqlJoins = "LEFT JOIN wcf".WCF_N."_user user_table ON (user_table.userID = paid_subscription_user.userID)";
                $this->objectList->sqlJoins .= " LEFT JOIN wcf".WCF_N."_paid_subscription paid_subscription ON (paid_subscription.subscriptionID = paid_subscription_user.subscriptionID)";
index 1204e66a6317c318176a5f5eadce588e0a481195..48872c03343b2c9ff98010ab035e57d783fb50e4 100644 (file)
@@ -27,31 +27,31 @@ class PluginStorePurchasedItemsPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.configuration.package.canUpdatePackage', 'admin.configuration.package.canUninstallPackage');
+       public $neededPermissions = ['admin.configuration.package.canUpdatePackage', 'admin.configuration.package.canUninstallPackage'];
        
        /**
         * list of purchased products grouped by WCF major release
         * @var array<array>
         */
-       public $products = array();
+       public $products = [];
        
        /**
         * list of product data grouped by WCF major release
         * @var array<array>
         */
-       public $productData = array();
+       public $productData = [];
        
        /**
         * list of installed update servers (Plugin-Store only)
         * @var PackageUpdateServer[]
         */
-       public $updateServers = array();
+       public $updateServers = [];
        
        /**
         * list of supported WCF major releases (Plugin-Store)
         * @var string[]
         */
-       public $wcfMajorReleases = array();
+       public $wcfMajorReleases = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -87,24 +87,24 @@ class PluginStorePurchasedItemsPage extends AbstractPage {
                foreach ($this->products as $packageUpdateID => $product) {
                        $wcfMajorRelease = $product['wcfMajorRelease'];
                        if (!isset($this->productData[$wcfMajorRelease])) {
-                               $this->productData[$wcfMajorRelease] = array();
+                               $this->productData[$wcfMajorRelease] = [];
                        }
                        
                        $languageCode = WCF::getLanguage()->languageCode;
                        $packageName = (isset($product['packageName'][$languageCode])) ? $product['packageName'][$languageCode] : $product['packageName']['en'];
                        
-                       $this->productData[$wcfMajorRelease][$packageUpdateID] = array(
+                       $this->productData[$wcfMajorRelease][$packageUpdateID] = [
                                'author' => $product['author'],
                                'authorURL' => $product['authorURL'],
                                'package' => $product['package'],
                                'packageName' => $packageName,
                                'pluginStoreURL' => $product['pluginStoreURL'],
-                               'version' => array(
+                               'version' => [
                                        'available' => $product['lastVersion'],
                                        'installed' => ''
-                               ),
+                               ],
                                'status' => (isset($this->updateServers[$wcfMajorRelease]) ? 'install' : 'unavailable')
-                       );
+                       ];
                        
                        $package = PackageCache::getInstance()->getPackageByIdentifier($product['package']);
                        if ($package !== null) {
@@ -130,10 +130,10 @@ class PluginStorePurchasedItemsPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'productData' => $this->productData,
                        'updateServers' => $this->updateServers,
                        'wcfMajorReleases' => $this->wcfMajorReleases
-               ));
+               ]);
        }
 }
index 1808466230b19742c26e6094f8ad96ab6a7ee949..5dcfd8686ddf0be58d089b75c9f4b9028bd825cf 100644 (file)
@@ -23,13 +23,13 @@ class RebuildDataPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canRebuildData');
+       public $neededPermissions = ['admin.management.canRebuildData'];
        
        /**
         * object types
         * @var array
         */
-       public $objectTypes = array();
+       public $objectTypes = [];
        
        /**
         * display a warning if InnoDB uses a slow configuration
@@ -76,9 +76,9 @@ class RebuildDataPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'objectTypes' => $this->objectTypes,
                        'showInnoDBWarning' => $this->showInnoDBWarning
-               ));
+               ]);
        }
 }
index 511d6f19339d95b490614a1aeaec7ee7a73df60f..2812d6cd59400a6268265a91ddddea47f8aee0ca 100644 (file)
@@ -30,5 +30,5 @@ class SmileyCategoryListPage extends AbstractCategoryListPage {
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_SMILEY');
+       public $neededModules = ['MODULE_SMILEY'];
 }
index 94c595c24d865aac21b914495c46ee526f8c66b9..70eed0b0ec9fb0d1c0b2be8c33976077aadfcece 100644 (file)
@@ -26,12 +26,12 @@ class SmileyListPage extends MultipleLinkPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.smiley.canManageSmiley');
+       public $neededPermissions = ['admin.content.smiley.canManageSmiley'];
        
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_SMILEY');
+       public $neededModules = ['MODULE_SMILEY'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -64,7 +64,7 @@ class SmileyListPage extends MultipleLinkPage {
         * available categories
         * @var SmileyCategory[]
         */
-       public $categories = array();
+       public $categories = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -87,11 +87,11 @@ class SmileyListPage extends MultipleLinkPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'category' => $this->category,
                        'categories' => $this->categories,
                        'smileyCount' => count(SmileyCache::getInstance()->getSmilies())
-               ));
+               ]);
        }
        
        /**
@@ -101,10 +101,10 @@ class SmileyListPage extends MultipleLinkPage {
                parent::initObjectList();
                
                if ($this->categoryID) {
-                       $this->objectList->getConditionBuilder()->add('categoryID = ?', array($this->categoryID));
+                       $this->objectList->getConditionBuilder()->add('categoryID = ?', [$this->categoryID]);
                }
                else {
-                       $this->objectList->getConditionBuilder()->add('categoryID IS NULL', array());
+                       $this->objectList->getConditionBuilder()->add('categoryID IS NULL', []);
                }
        }
        
index 11b8a1f763316b14141ebe2e92e5659a8f10c432..58f9f6fa7335985ef153ecb45f6b0bfd0be28b2b 100644 (file)
@@ -24,7 +24,7 @@ class StatPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canViewLog');
+       public $neededPermissions = ['admin.management.canViewLog'];
        
        /**
         * start date (yyyy-mm-dd)
@@ -42,7 +42,7 @@ class StatPage extends AbstractPage {
         * available object type
         * @var array
         */
-       public $availableObjectTypes = array();
+       public $availableObjectTypes = [];
        
        /**
         * @see \wcf\page\AbstractPage::readData()
@@ -61,7 +61,7 @@ class StatPage extends AbstractPage {
                $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.statDailyHandler');
                foreach ($objectTypes as $objectType) {
                        if (!isset($this->availableObjectTypes[$objectType->categoryname])) {
-                               $this->availableObjectTypes[$objectType->categoryname] = array();
+                               $this->availableObjectTypes[$objectType->categoryname] = [];
                        }
                        
                        $this->availableObjectTypes[$objectType->categoryname][] = $objectType;
@@ -74,10 +74,10 @@ class StatPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'endDate' => $this->endDate,
                        'startDate' => $this->startDate,
                        'availableObjectTypes' => $this->availableObjectTypes
-               ));
+               ]);
        }
 }
index 61a95146efcb58b824acfedd9fe7d5f6dfc5a7ca..432501e44aa7180b2c63b09b31a5119b0065df6f 100644 (file)
@@ -21,7 +21,7 @@ class StyleListPage extends MultipleLinkPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.style.canManageStyle');
+       public $neededPermissions = ['admin.style.canManageStyle'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index 0e9a581bee11290f45cd03bfcd593ed09c947c37..501e1192cdaa8cfa42c113aa45e3825525b89156 100644 (file)
@@ -24,12 +24,12 @@ class TagListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.content.tag.canManageTag');
+       public $neededPermissions = ['admin.content.tag.canManageTag'];
        
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_TAGGING');
+       public $neededModules = ['MODULE_TAGGING'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -39,7 +39,7 @@ class TagListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('tagID', 'languageID', 'name', 'usageCount');
+       public $validSortFields = ['tagID', 'languageID', 'name', 'usageCount'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -58,10 +58,10 @@ class TagListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'hasMarkedItems' => ClipboardHandler::getInstance()->hasMarkedItems(ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.tag')),
                        'search' => $this->search
-               ));
+               ]);
        }
        
        /**
@@ -87,7 +87,7 @@ class TagListPage extends SortablePage {
                $this->objectList->sqlJoins .= " LEFT JOIN wcf".WCF_N."_tag synonym ON tag.synonymFor = synonym.tagID";
                
                if ($this->search !== '') {
-                       $this->objectList->getConditionBuilder()->add('tag.name LIKE ?', array($this->search.'%'));
+                       $this->objectList->getConditionBuilder()->add('tag.name LIKE ?', [$this->search.'%']);
                }
        }
 }
index f8c95a2d37bef9120cec01c43f5cf34c35ac75f9..798d4a30c7d76c1337022d46438272aee925c7c8 100644 (file)
@@ -21,7 +21,7 @@ class TemplateGroupListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.template.canManageTemplate');
+       public $neededPermissions = ['admin.template.canManageTemplate'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -36,7 +36,7 @@ class TemplateGroupListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
         */
-       public $validSortFields = array('templateGroupID', 'templateGroupName', 'templateGroupFolderName', 'templates');
+       public $validSortFields = ['templateGroupID', 'templateGroupName', 'templateGroupFolderName', 'templates'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::initObjectList()
index a5e552dd9040b7bb47063a9a535f8667e8fb3625..da133cade3084372ce793b0b6b7a5efacf95c1db 100644 (file)
@@ -26,7 +26,7 @@ class TemplateListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.template.canManageTemplate');
+       public $neededPermissions = ['admin.template.canManageTemplate'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -46,7 +46,7 @@ class TemplateListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('templateID', 'templateName', 'lastModificationTime');
+       public $validSortFields = ['templateID', 'templateName', 'lastModificationTime'];
        
        /**
         * template group id
@@ -70,13 +70,13 @@ class TemplateListPage extends SortablePage {
         * available template groups
         * @var array
         */
-       public $availableTemplateGroups = array();
+       public $availableTemplateGroups = [];
        
        /**
         * available applications
         * @var array
         */
-       public $availableApplications = array();
+       public $availableApplications = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -95,11 +95,11 @@ class TemplateListPage extends SortablePage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               if ($this->templateGroupID) $this->objectList->getConditionBuilder()->add('template.templateGroupID = ?', array($this->templateGroupID));
+               if ($this->templateGroupID) $this->objectList->getConditionBuilder()->add('template.templateGroupID = ?', [$this->templateGroupID]);
                else $this->objectList->getConditionBuilder()->add('template.templateGroupID IS NULL');
                
-               if ($this->searchTemplateName) $this->objectList->getConditionBuilder()->add('templateName LIKE ?', array('%'.$this->searchTemplateName.'%'));
-               if ($this->application) $this->objectList->getConditionBuilder()->add('application = ?', array($this->application));
+               if ($this->searchTemplateName) $this->objectList->getConditionBuilder()->add('templateName LIKE ?', ['%'.$this->searchTemplateName.'%']);
+               if ($this->application) $this->objectList->getConditionBuilder()->add('application = ?', [$this->application]);
        }
        
        /**
@@ -109,7 +109,7 @@ class TemplateListPage extends SortablePage {
                parent::readData();
                
                // get template groups
-               $this->availableTemplateGroups = TemplateGroup::getSelectList(array(), 1);
+               $this->availableTemplateGroups = TemplateGroup::getSelectList([], 1);
                
                // get applications
                $applications = ApplicationHandler::getInstance()->getApplications();
@@ -134,12 +134,12 @@ class TemplateListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'templateGroupID' => $this->templateGroupID,
                        'searchTemplateName' => $this->searchTemplateName,
                        'application' => $this->application,
                        'availableTemplateGroups' => $this->availableTemplateGroups,
                        'availableApplications' => $this->availableApplications
-               ));
+               ]);
        }
 }
index a91ce91ddc2ae52929d3996e41ba70ef87d021ad..03addba59a0126f97aab8f999a867657ffdebcb7 100644 (file)
@@ -21,12 +21,12 @@ class UserAuthenticationFailureListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.management.canViewLog');
+       public $neededPermissions = ['admin.management.canViewLog'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('ENABLE_USER_AUTHENTICATION_FAILURE');
+       public $neededModules = ['ENABLE_USER_AUTHENTICATION_FAILURE'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -41,7 +41,7 @@ class UserAuthenticationFailureListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('failureID', 'environment', 'userID', 'username', 'time', 'ipAddress', 'userAgent');
+       public $validSortFields = ['failureID', 'environment', 'userID', 'username', 'time', 'ipAddress', 'userAgent'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index baeb1a07e640922c04f45ccd3e7a22bf47efd996..65496a3a808aa61b9250d1746594494d94af280c 100644 (file)
@@ -21,7 +21,7 @@ class UserGroupAssignmentListPage extends MultipleLinkPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canManageGroupAssignment');
+       public $neededPermissions = ['admin.user.canManageGroupAssignment'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
index f1101d0bfaff0549f7d30d663af3ad3f9e1b9162..37f851df47fd71b6c7ad79b334ea8918f5e0f6b0 100755 (executable)
@@ -22,7 +22,7 @@ class UserGroupListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canEditGroup', 'admin.user.canDeleteGroup');
+       public $neededPermissions = ['admin.user.canEditGroup', 'admin.user.canDeleteGroup'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -32,7 +32,7 @@ class UserGroupListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('groupID', 'groupName', 'groupType', 'members', 'priority');
+       public $validSortFields = ['groupID', 'groupName', 'groupType', 'members', 'priority'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -81,8 +81,8 @@ class UserGroupListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'deletedGroups' => $this->deletedGroups
-               ));
+               ]);
        }
 }
index a47d0c4497044e397f31693e7220e2aeb035b63a..4196e482aac299a99c34dca79b9ef132c8c61511 100644 (file)
@@ -21,7 +21,7 @@ class UserOptionCategoryListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canManageUserOption');
+       public $neededPermissions = ['admin.user.canManageUserOption'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -36,7 +36,7 @@ class UserOptionCategoryListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
         */
-       public $validSortFields = array('categoryID', 'categoryName', 'showOrder', 'userOptions');
+       public $validSortFields = ['categoryID', 'categoryName', 'showOrder', 'userOptions'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::initObjectList
@@ -45,6 +45,6 @@ class UserOptionCategoryListPage extends SortablePage {
                parent::initObjectList();
                
                $this->objectList->sqlSelects = "(SELECT COUNT(*) FROM wcf".WCF_N."_user_option WHERE categoryName = user_option_category.categoryName) AS userOptions";
-               $this->objectList->getConditionBuilder()->add('user_option_category.parentCategoryName = ?', array('profile'));
+               $this->objectList->getConditionBuilder()->add('user_option_category.parentCategoryName = ?', ['profile']);
        }
 }
index 05c3e72d6d13408034d6e783253d8896b16deb06..69f8a9cbef9275bde6bcbbb0b49c007761497449 100644 (file)
@@ -21,7 +21,7 @@ class UserOptionListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.canManageUserOption');
+       public $neededPermissions = ['admin.user.canManageUserOption'];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -36,7 +36,7 @@ class UserOptionListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
         */
-       public $validSortFields = array('optionID', 'optionName', 'categoryName', 'optionType', 'showOrder');
+       public $validSortFields = ['optionID', 'optionName', 'categoryName', 'optionType', 'showOrder'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::initObjectList
@@ -44,6 +44,6 @@ class UserOptionListPage extends SortablePage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               $this->objectList->getConditionBuilder()->add("option_table.categoryName IN (SELECT categoryName FROM wcf".WCF_N."_user_option_category WHERE parentCategoryName = ?)", array('profile'));
+               $this->objectList->getConditionBuilder()->add("option_table.categoryName IN (SELECT categoryName FROM wcf".WCF_N."_user_option_category WHERE parentCategoryName = ?)", ['profile']);
        }
 }
index 99cb36a3c6b03cf0cdb3649f2852f191dc57447b..9d1cc9aad77938bd13bd8dc1ac1d4dbb184457e7 100644 (file)
@@ -21,12 +21,12 @@ class UserRankListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('admin.user.rank.canManageRank');
+       public $neededPermissions = ['admin.user.rank.canManageRank'];
        
        /**
         * @see wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_USER_RANK');
+       public $neededModules = ['MODULE_USER_RANK'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -41,7 +41,7 @@ class UserRankListPage extends SortablePage {
        /**
         * @see \wcf\page\MultipleLinkPage::$validSortFields
         */
-       public $validSortFields = array('rankID', 'groupID', 'requiredPoints', 'rankTitle', 'rankImage', 'requiredGender');
+       public $validSortFields = ['rankID', 'groupID', 'requiredPoints', 'rankTitle', 'rankImage', 'requiredGender'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::show()
index 1863fa6b822826378b1df5571c560fb4bdffb3f0..340cb9d62467c868f8593625ab8400368c321290 100644 (file)
@@ -32,13 +32,13 @@ class AJAXProxyAction extends AJAXInvokeAction {
         * list of object ids
         * @var integer[]
         */
-       protected $objectIDs = array();
+       protected $objectIDs = [];
        
        /**
         * additional parameters
         * @var mixed[]
         */
-       protected $parameters = array();
+       protected $parameters = [];
        
        /**
         * @see \wcf\action\IAction::readParameters()
@@ -81,13 +81,13 @@ class AJAXProxyAction extends AJAXInvokeAction {
        protected function sendResponse() {
                // add benchmark and debug data
                if (ENABLE_BENCHMARK) {
-                       $this->response['benchmark'] = array(
+                       $this->response['benchmark'] = [
                                'executionTime' => WCF::getBenchmark()->getExecutionTime().'s',
                                'memoryUsage' => WCF::getBenchmark()->getMemoryUsage(),
                                'phpExecution' => StringUtil::formatNumeric((WCF::getBenchmark()->getExecutionTime() - WCF::getBenchmark()->getQueryExecutionTime()) / WCF::getBenchmark()->getExecutionTime() * 100).'%',
                                'sqlExecution' => StringUtil::formatNumeric(WCF::getBenchmark()->getQueryExecutionTime() / WCF::getBenchmark()->getExecutionTime() * 100).'%',
                                'sqlQueries' => WCF::getBenchmark()->getQueryCount()
-                       );
+                       ];
                        
                        if (ENABLE_DEBUG_MODE) {
                                $this->response['benchmark']['items'] = WCF::getBenchmark()->getItems();
index 445f49583c2f0cc0344080999defe0a117dc9bde..4846b92caa61cbf1ac66f9e74465c7026c48e70f 100644 (file)
@@ -27,13 +27,13 @@ abstract class AbstractAction implements IAction {
         * needed modules to execute this action
         * @var string[]
         */
-       public $neededModules = array();
+       public $neededModules = [];
        
        /**
         * needed permissions to execute this action
         * @var string[]
         */
-       public $neededPermissions = array();
+       public $neededPermissions = [];
        
        /**
         * @see \wcf\form\IAction::__run()
index 919bb021054db167bf869f283760e654dd4eaf8e..f2e0ca82af830d996dfe5c59b24c8c26ec806e6b 100644 (file)
@@ -33,7 +33,7 @@ abstract class AbstractDialogAction extends AbstractSecureAction {
         * response data
         * @var array
         */
-       public $data = array();
+       public $data = [];
        
        /**
         * @see \wcf\action\IAction::readParameters()
index 6afedcd7b5dc67a489f9e260d06e899187135eff..38ae15c8f5989e63106ad27ce04e0d19f920b8bf 100644 (file)
@@ -27,7 +27,7 @@ class FacebookAuthAction extends AbstractAction {
        /**
         * @see \wcf\action\AbstractAction::$neededModules
         */
-       public $neededModules = array('FACEBOOK_PUBLIC_KEY', 'FACEBOOK_PRIVATE_KEY');
+       public $neededModules = ['FACEBOOK_PUBLIC_KEY', 'FACEBOOK_PRIVATE_KEY'];
        
        /**
         * @see \wcf\action\IAction::execute()
@@ -94,7 +94,7 @@ class FacebookAuthAction extends AbstractAction {
                                        if (UserAuthenticationFactory::getInstance()->getUserAuthentication()->supportsPersistentLogins()) {
                                                $password = StringUtil::getRandomID();
                                                $userEditor = new UserEditor($user);
-                                               $userEditor->update(array('password' => $password));
+                                               $userEditor->update(['password' => $password]);
                                                
                                                // reload user to retrieve salt
                                                $user = new User($user->userID);
index 3ff3c2e9e0853284dad8fa227e94f0f684b38638..973dbf80d2428935f3a7c7fc6aae3bbcfc14c5de 100644 (file)
@@ -27,7 +27,7 @@ class GithubAuthAction extends AbstractAction {
        /**
         * @see \wcf\action\AbstractAction::$neededModules
         */
-       public $neededModules = array('GITHUB_PUBLIC_KEY', 'GITHUB_PRIVATE_KEY');
+       public $neededModules = ['GITHUB_PUBLIC_KEY', 'GITHUB_PRIVATE_KEY'];
        
        /**
         * @see \wcf\action\IAction::execute()
@@ -39,11 +39,11 @@ class GithubAuthAction extends AbstractAction {
                if (isset($_GET['code'])) {
                        try {
                                // fetch access_token
-                               $request = new HTTPRequest('https://github.com/login/oauth/access_token', array(), array(
+                               $request = new HTTPRequest('https://github.com/login/oauth/access_token', [], [
                                        'client_id' => StringUtil::trim(GITHUB_PUBLIC_KEY),
                                        'client_secret' => StringUtil::trim(GITHUB_PRIVATE_KEY),
                                        'code' => $_GET['code']
-                               ));
+                               ]);
                                $request->execute();
                                $reply = $request->getReply();
                                
@@ -82,7 +82,7 @@ class GithubAuthAction extends AbstractAction {
                        if (!$user->userID) {
                                $user = $this->getUser($data['access_token']);
                                $userEditor = new UserEditor($user);
-                               $userEditor->update(array('authData' => 'github:'.$userData['id']));
+                               $userEditor->update(['authData' => 'github:'.$userData['id']]);
                        }
                        
                        if ($user->userID) {
@@ -95,7 +95,7 @@ class GithubAuthAction extends AbstractAction {
                                        if (UserAuthenticationFactory::getInstance()->getUserAuthentication()->supportsPersistentLogins()) {
                                                $password = StringUtil::getRandomID();
                                                $userEditor = new UserEditor($user);
-                                               $userEditor->update(array('password' => $password));
+                                               $userEditor->update(['password' => $password]);
                                                
                                                // reload user to retrieve salt
                                                $user = new User($user->userID);
index e6faaee13127f9682469661a4af16c542f128ac8..652278c210e55413eebec616ac753bd36260d197 100644 (file)
@@ -27,7 +27,7 @@ class GoogleAuthAction extends AbstractAction {
        /**
         * @see \wcf\action\AbstractAction::$neededModules
         */
-       public $neededModules = array('GOOGLE_PUBLIC_KEY', 'GOOGLE_PRIVATE_KEY');
+       public $neededModules = ['GOOGLE_PUBLIC_KEY', 'GOOGLE_PRIVATE_KEY'];
        
        /**
         * @see \wcf\action\IAction::execute()
@@ -35,20 +35,20 @@ class GoogleAuthAction extends AbstractAction {
        public function execute() {
                parent::execute();
                
-               $callbackURL = LinkHandler::getInstance()->getLink('GoogleAuth', array(
+               $callbackURL = LinkHandler::getInstance()->getLink('GoogleAuth', [
                        'appendSession' => false
-               ));
+               ]);
                // user accepted the connection
                if (isset($_GET['code'])) {
                        try {
                                // fetch access_token
-                               $request = new HTTPRequest('https://accounts.google.com/o/oauth2/token', array(), array(
+                               $request = new HTTPRequest('https://accounts.google.com/o/oauth2/token', [], [
                                        'code' => $_GET['code'],
                                        'client_id' => StringUtil::trim(GOOGLE_PUBLIC_KEY),
                                        'client_secret' => StringUtil::trim(GOOGLE_PRIVATE_KEY),
                                        'redirect_uri' => $callbackURL,
                                        'grant_type' => 'authorization_code'
-                               ));
+                               ]);
                                $request->execute();
                                $reply = $request->getReply();
                                
@@ -96,7 +96,7 @@ class GoogleAuthAction extends AbstractAction {
                                        if (UserAuthenticationFactory::getInstance()->getUserAuthentication()->supportsPersistentLogins()) {
                                                $password = StringUtil::getRandomID();
                                                $userEditor = new UserEditor($user);
-                                               $userEditor->update(array('password' => $password));
+                                               $userEditor->update(['password' => $password]);
                                                
                                                // reload user to retrieve salt
                                                $user = new User($user->userID);
index 2713f1170b59bbb432fa49839f79fbf75dab7494..527d0cc162ee2e2b61e9551682d19894b129816a 100644 (file)
@@ -106,9 +106,9 @@ class GravatarDownloadAction extends AbstractAction {
                                // update file extension
                                if ($fileExtension != $this->user->gravatarFileExtension) {
                                        $editor = new UserEditor($this->user);
-                                       $editor->update(array(
+                                       $editor->update([
                                                'gravatarFileExtension' => $fileExtension
-                                       ));
+                                       ]);
                                }
                                
                                @header('Content-Type: '.$mimeType);
@@ -118,9 +118,9 @@ class GravatarDownloadAction extends AbstractAction {
                        catch (SystemException $e) {
                                // disable gravatar
                                $editor = new UserEditor($this->user);
-                               $editor->update(array(
+                               $editor->update([
                                        'enableGravatar' => 0
-                               ));
+                               ]);
                        }
                }
                
index 0c9e976c4c2d72bfc5b521fdeda58dcb97c9bb00..c77f2f8f07210fa46c14f0b0e679d3b989ca3959 100644 (file)
@@ -30,13 +30,13 @@ class MessageQuoteAction extends AJAXProxyAction {
         * list of quote ids
         * @var string[]
         */
-       public $quoteIDs = array();
+       public $quoteIDs = [];
        
        /**
         * list of object types
         * @var string[]
         */
-       public $objectTypes = array();
+       public $objectTypes = [];
        
        /**
         * @see \wcf\action\IAction::readParameters()
@@ -68,15 +68,15 @@ class MessageQuoteAction extends AJAXProxyAction {
                $returnValues = null;
                switch ($this->actionName) {
                        case 'count':
-                               $returnValues = array(
+                               $returnValues = [
                                        'count' => $this->count()
-                               );
+                               ];
                        break;
                        
                        case 'getQuotes':
-                               $returnValues = array(
+                               $returnValues = [
                                        'template' => $this->getQuotes()
-                               );
+                               ];
                        break;
                        
                        case 'markForRemoval':
@@ -84,15 +84,15 @@ class MessageQuoteAction extends AJAXProxyAction {
                        break;
                        
                        case 'remove':
-                               $returnValues = array(
+                               $returnValues = [
                                        'count' => $this->remove()
-                               );
+                               ];
                        break;
                        
                        case 'removeMarkedQuotes':
-                               $returnValues = array(
+                               $returnValues = [
                                        'count' => $this->removeMarkedQuotes()
-                               );
+                               ];
                        break;
                        
                        default:
index 446b894601b47f026f7249fb93a0ea9969f0bf2e..e538eca802ffa8c65e395f6560fba074e0f6bc30 100644 (file)
@@ -69,14 +69,14 @@ class NotificationConfirmAction extends AbstractAction {
                
                $event = new UserNotificationEvent($this->notification->eventID);
                $objectType = ObjectTypeCache::getInstance()->getObjectType($event->objectTypeID);
-               $objects = $objectType->getProcessor()->getObjectsByIDs(array($this->notification->objectID));
+               $objects = $objectType->getProcessor()->getObjectsByIDs([$this->notification->objectID]);
                
                $userProfile = null;
                if ($this->notification->authorID) {
                        $userProfile = new UserProfile(new User($this->notification->authorID));
                }
                else {
-                       $userProfile = new UserProfile(new User(null, array('userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest'))));
+                       $userProfile = new UserProfile(new User(null, ['userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest')]));
                }
                
                $className = $event->className;
index f7ed46508dfbe9da443f6e4318f40568aecd012d..643740237a15b932cced258d91123c983ceb36aa 100644 (file)
@@ -89,21 +89,21 @@ class NotificationDisableAction extends AbstractAction {
                                WHERE   userID = ?
                                        AND eventID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                'none',
                                $this->userID,
                                $this->eventID
-                       ));
+                       ]);
                }
                else {
                        $sql = "UPDATE  wcf".WCF_N."_user_notification_event_to_user
                                SET     mailNotificationType = ?
                                WHERE   userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                'none',
                                $this->userID
-                       ));
+                       ]);
                }
                
                $this->executed();
index b2f06bbb4262d23d1b80ba1bb2eec9f2f00f8f10..37960691d0283148e124b465b4bcd4b0612d8b66 100644 (file)
@@ -35,7 +35,7 @@ class PaypalCallbackAction extends AbstractAction {
                                        $url = 'https://www.sandbox.paypal.com/cgi-bin/webscr';
                                }
                                
-                               $request = new HTTPRequest($url, array(), array_merge(array('cmd' => '_notify-validate'), $_POST));
+                               $request = new HTTPRequest($url, [], array_merge(['cmd' => '_notify-validate'], $_POST));
                                $request->execute();
                                $reply = $request->getReply();
                                $content = $reply['body'];
index 738f9e05560e71e3e02d7809ebdab85f18ed6f23..405adcada6dc63127e88b5afec4d06dd7364bcfd 100644 (file)
@@ -30,7 +30,7 @@ class PollAction extends AJAXProxyAction {
         * list of option ids
         * @var integer[]
         */
-       public $optionIDs = array();
+       public $optionIDs = [];
        
        /**
         * poll object
@@ -63,7 +63,7 @@ class PollAction extends AJAXProxyAction {
                if (isset($_POST['actionName'])) $this->actionName = StringUtil::trim($_POST['actionName']);
                if (isset($_POST['pollID'])) $this->pollID = intval($_POST['pollID']);
                
-               $polls = PollManager::getInstance()->getPolls(array($this->pollID));
+               $polls = PollManager::getInstance()->getPolls([$this->pollID]);
                if (!isset($polls[$this->pollID])) {
                        throw new UserInputException('pollID');
                }
@@ -106,7 +106,7 @@ class PollAction extends AJAXProxyAction {
                                throw new PermissionDeniedException();
                        }
                        
-                       $optionIDs = array();
+                       $optionIDs = [];
                        foreach ($this->poll->getOptions() as $option) {
                                $optionIDs[] = $option->optionID;
                        }
@@ -125,10 +125,10 @@ class PollAction extends AJAXProxyAction {
        public function execute() {
                AbstractAction::execute();
                
-               $returnValues = array(
+               $returnValues = [
                        'actionName' => $this->actionName,
                        'pollID' => $this->pollID
-               );
+               ];
                
                switch ($this->actionName) {
                        case 'getResult':
@@ -158,9 +158,9 @@ class PollAction extends AJAXProxyAction {
         * @param       array           $returnValues
         */
        public function getResult(array &$returnValues) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'poll' => $this->poll
-               ));
+               ]);
                
                $returnValues['resultTemplate'] = WCF::getTPL()->fetch('pollResult');
        }
@@ -171,9 +171,9 @@ class PollAction extends AJAXProxyAction {
         * @param       array           $returnValues
         */
        public function getVote(array &$returnValues) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'poll' => $this->poll
-               ));
+               ]);
                
                $returnValues['voteTemplate'] = WCF::getTPL()->fetch('pollVote');
        }
@@ -184,11 +184,11 @@ class PollAction extends AJAXProxyAction {
         * @param       mixed[]         $returnValues
         */
        protected function vote(array &$returnValues) {
-               $pollAction = new \wcf\data\poll\PollAction(array($this->poll), 'vote', array('optionIDs' => $this->optionIDs));
+               $pollAction = new \wcf\data\poll\PollAction([$this->poll], 'vote', ['optionIDs' => $this->optionIDs]);
                $pollAction->executeAction();
                
                // update poll object
-               $polls = PollManager::getInstance()->getPolls(array($this->pollID));
+               $polls = PollManager::getInstance()->getPolls([$this->pollID]);
                $this->poll = $polls[$this->pollID];
                if ($this->relatedObject !== null) {
                        $this->poll->setRelatedObject($this->relatedObject);
index 3e8fb5de56c618c183c9b18ab6560728aa0729fd..a0ab9d1720abd54e15b2c71d3888bbccc234a342 100644 (file)
@@ -26,7 +26,7 @@ class TwitterAuthAction extends AbstractAction {
        /**
         * @see \wcf\action\AbstractAction::$neededModules
         */
-       public $neededModules = array('TWITTER_PUBLIC_KEY', 'TWITTER_PRIVATE_KEY');
+       public $neededModules = ['TWITTER_PUBLIC_KEY', 'TWITTER_PRIVATE_KEY'];
        
        /**
         * @see \wcf\action\IAction::execute()
@@ -46,22 +46,22 @@ class TwitterAuthAction extends AbstractAction {
                        
                        try {
                                // fetch access_token
-                               $oauthHeader = array(
+                               $oauthHeader = [
                                        'oauth_consumer_key' => StringUtil::trim(TWITTER_PUBLIC_KEY),
                                        'oauth_nonce' => StringUtil::getRandomID(),
                                        'oauth_signature_method' => 'HMAC-SHA1',
                                        'oauth_timestamp' => TIME_NOW,
                                        'oauth_version' => '1.0',
                                        'oauth_token' => $initData['oauth_token']
-                               );
-                               $postData = array(
+                               ];
+                               $postData = [
                                        'oauth_verifier' => $_GET['oauth_verifier']
-                               );
+                               ];
                                
                                $signature = $this->createSignature('https://api.twitter.com/oauth/access_token', array_merge($oauthHeader, $postData));
                                $oauthHeader['oauth_signature'] = $signature;
                                
-                               $request = new HTTPRequest('https://api.twitter.com/oauth/access_token', array(), $postData);
+                               $request = new HTTPRequest('https://api.twitter.com/oauth/access_token', [], $postData);
                                $request->addHeader('Authorization', 'OAuth '.$this->buildOAuthHeader($oauthHeader));
                                $request->execute();
                                $reply = $request->getReply();
@@ -88,7 +88,7 @@ class TwitterAuthAction extends AbstractAction {
                                        if (UserAuthenticationFactory::getInstance()->getUserAuthentication()->supportsPersistentLogins()) {
                                                $password = StringUtil::getRandomID();
                                                $userEditor = new UserEditor($user);
-                                               $userEditor->update(array('password' => $password));
+                                               $userEditor->update(['password' => $password]);
                                                
                                                // reload user to retrieve salt
                                                $user = new User($user->userID);
@@ -149,22 +149,22 @@ class TwitterAuthAction extends AbstractAction {
                
                // start auth by fetching request_token
                try {
-                       $callbackURL = LinkHandler::getInstance()->getLink('TwitterAuth', array(
+                       $callbackURL = LinkHandler::getInstance()->getLink('TwitterAuth', [
                                'appendSession' => false
-                       ));
-                       $oauthHeader = array(
+                       ]);
+                       $oauthHeader = [
                                'oauth_callback' => $callbackURL,
                                'oauth_consumer_key' => StringUtil::trim(TWITTER_PUBLIC_KEY),
                                'oauth_nonce' => StringUtil::getRandomID(),
                                'oauth_signature_method' => 'HMAC-SHA1',
                                'oauth_timestamp' => TIME_NOW,
                                'oauth_version' => '1.0'
-                       );
+                       ];
                        $signature = $this->createSignature('https://api.twitter.com/oauth/request_token', $oauthHeader);
                        $oauthHeader['oauth_signature'] = $signature;
                        
                        // call api
-                       $request = new HTTPRequest('https://api.twitter.com/oauth/request_token', array('method' => 'POST'));
+                       $request = new HTTPRequest('https://api.twitter.com/oauth/request_token', ['method' => 'POST']);
                        $request->addHeader('Authorization', 'OAuth '.$this->buildOAuthHeader($oauthHeader));
                        $request->execute();
                        $reply = $request->getReply();
@@ -213,7 +213,7 @@ class TwitterAuthAction extends AbstractAction {
         * @return      string
         */
        public function createSignature($url, array $parameters, $tokenSecret = '') {
-               $tmp = array();
+               $tmp = [];
                foreach ($parameters as $key => $val) {
                        $tmp[rawurlencode($key)] = rawurlencode($val);
                }
index 22459e0a1d77ce419b4713b7b28f56b05ab0662e..8791f0722f47f2d0e7e8040c7997db6e4ad20350 100644 (file)
@@ -37,49 +37,49 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
         * list of object ids
         * @var integer[]
         */
-       protected $objectIDs = array();
+       protected $objectIDs = [];
        
        /**
         * list of object editors
         * @var DatabaseObjectEditor[]
         */
-       protected $objects = array();
+       protected $objects = [];
        
        /**
         * multi-dimensional array of parameters required by an action
         * @var mixed[][]
         */
-       protected $parameters = array();
+       protected $parameters = [];
        
        /**
         * list of permissions required to create objects
         * @var string[]
         */
-       protected $permissionsCreate = array();
+       protected $permissionsCreate = [];
        
        /**
         * list of permissions required to delete objects
         * @var string[]
         */
-       protected $permissionsDelete = array();
+       protected $permissionsDelete = [];
        
        /**
         * list of permissions required to update objects
         * @var string[]
         */
-       protected $permissionsUpdate = array();
+       protected $permissionsUpdate = [];
        
        /**
         * disallow requests for specified methods if the origin is not the ACP
         * @var string[]
         */
-       protected $requireACP = array();
+       protected $requireACP = [];
        
        /**
         * Resets cache if any of the listed actions is invoked
         * @var string[]
         */
-       protected $resetCache = array('create', 'delete', 'toggle', 'update', 'updatePosition');
+       protected $resetCache = ['create', 'delete', 'toggle', 'update', 'updatePosition'];
        
        /**
         * values returned by executed action
@@ -92,7 +92,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
         * is completely disabled
         * @var string[]
         */
-       protected $allowGuestAccess = array();
+       protected $allowGuestAccess = [];
        
        const TYPE_INTEGER = 1;
        const TYPE_STRING = 2;
@@ -110,7 +110,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
         * @param       array           $parameters
         * @throws      SystemException
         */
-       public function __construct(array $objects, $action, array $parameters = array()) {
+       public function __construct(array $objects, $action, array $parameters = []) {
                // set class name
                if (empty($this->className)) {
                        $className = get_called_class();
@@ -120,8 +120,8 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                        }
                }
                
-               $indexName = call_user_func(array($this->className, 'getDatabaseTableIndexName'));
-               $baseClass = call_user_func(array($this->className, 'getBaseClass'));
+               $indexName = call_user_func([$this->className, 'getDatabaseTableIndexName']);
+               $baseClass = call_user_func([$this->className, 'getBaseClass']);
                
                foreach ($objects as $object) {
                        if (is_object($object)) {
@@ -182,7 +182,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                }
                
                // execute action
-               call_user_func_array(array($this, $actionName), $this->getParameters());
+               call_user_func_array([$this, $actionName], $this->getParameters());
                
                // fire event action
                EventHandler::getInstance()->fireAction($this, 'validateAction');
@@ -197,7 +197,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                        throw new SystemException("call to undefined function '".$this->getActionName()."'");
                }
                
-               $this->returnValues = call_user_func(array($this, $this->getActionName()));
+               $this->returnValues = call_user_func([$this, $this->getActionName()]);
                
                // reset cache
                if (in_array($this->getActionName(), $this->resetCache)) {
@@ -215,7 +215,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
         */
        protected function resetCache() {
                if (is_subclass_of($this->className, 'wcf\data\IEditableCachedObject')) {
-                       call_user_func(array($this->className, 'resetCache'));
+                       call_user_func([$this->className, 'resetCache']);
                }
        }
        
@@ -242,7 +242,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                $this->objects = $objects;
                
                // update object IDs
-               $this->objectIDs = array();
+               $this->objectIDs = [];
                foreach ($this->objects as $object) {
                        $this->objectIDs[] = $object->getObjectID();
                }
@@ -259,11 +259,11 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
         * @see \wcf\data\IDatabaseObjectAction::getReturnValues()
         */
        public function getReturnValues() {
-               return array(
+               return [
                        'actionName' => $this->action,
                        'objectIDs' => $this->getObjectIDs(),
                        'returnValues' => $this->returnValues
-               );
+               ];
        }
        
        /**
@@ -329,7 +329,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
         * @return      \wcf\data\DatabaseObject
         */
        public function create() {
-               return call_user_func(array($this->className, 'create'), $this->parameters['data']);
+               return call_user_func([$this->className, 'create'], $this->parameters['data']);
        }
        
        /**
@@ -341,13 +341,13 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                }
                
                // get ids
-               $objectIDs = array();
+               $objectIDs = [];
                foreach ($this->objects as $object) {
                        $objectIDs[] = $object->getObjectID();
                }
                
                // execute action
-               return call_user_func(array($this->className, 'deleteAll'), $objectIDs);
+               return call_user_func([$this->className, 'deleteAll'], $objectIDs);
        }
        
        /**
@@ -380,11 +380,11 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                }
                
                // get base class
-               $baseClass = call_user_func(array($this->className, 'getBaseClass'));
+               $baseClass = call_user_func([$this->className, 'getBaseClass']);
                
                // get db information
-               $tableName = call_user_func(array($this->className, 'getDatabaseTableName'));
-               $indexName = call_user_func(array($this->className, 'getDatabaseTableIndexName'));
+               $tableName = call_user_func([$this->className, 'getDatabaseTableName']);
+               $indexName = call_user_func([$this->className, 'getDatabaseTableIndexName']);
                
                // get objects
                $sql = "SELECT  *
@@ -513,7 +513,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                        case self::TYPE_INTEGER:
                                if (!isset($target[$variableName])) {
                                        if ($allowEmpty) {
-                                               $target[$variableName] = ($structure === self::STRUCT_FLAT) ? 0 : array();
+                                               $target[$variableName] = ($structure === self::STRUCT_FLAT) ? 0 : [];
                                        }
                                        else {
                                                throw new UserInputException($variableName);
@@ -544,7 +544,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                        case self::TYPE_STRING:
                                if (!isset($target[$variableName])) {
                                        if ($allowEmpty) {
-                                               $target[$variableName] = ($structure === self::STRUCT_FLAT) ? '' : array();
+                                               $target[$variableName] = ($structure === self::STRUCT_FLAT) ? '' : [];
                                        }
                                        else {
                                                throw new UserInputException($variableName);
@@ -594,7 +594,7 @@ abstract class AbstractDatabaseObjectAction implements IDatabaseObjectAction, ID
                        case self::TYPE_JSON:
                                if (!isset($target[$variableName])) {
                                        if ($allowEmpty) {
-                                               $target[$variableName] = array();
+                                               $target[$variableName] = [];
                                        }
                                        else {
                                                throw new UserInputException($variableName);
index 4dbeb3d60f22e820c41d9b699760dbc511e428b1..55c815d6d39bff1175ebac49b69de57018d9d754 100644 (file)
@@ -84,35 +84,35 @@ abstract class DatabaseObjectDecorator extends DatabaseObject {
                        throw new SystemException("unknown method '".$name."'");
                }
                
-               return call_user_func_array(array($this->object, $name), $arguments);
+               return call_user_func_array([$this->object, $name], $arguments);
        }
        
        /**
         * @see \wcf\data\IStorableObject::getDatabaseTableAlias()
         */
        public static function getDatabaseTableAlias() {
-               return call_user_func(array(static::$baseClass, 'getDatabaseTableAlias'));
+               return call_user_func([static::$baseClass, 'getDatabaseTableAlias']);
        }
        
        /**
         * @see \wcf\data\IStorableObject::getDatabaseTableName()
         */
        public static function getDatabaseTableName() {
-               return call_user_func(array(static::$baseClass, 'getDatabaseTableName'));
+               return call_user_func([static::$baseClass, 'getDatabaseTableName']);
        }
        
        /**
         * @see \wcf\data\IStorableObject::getDatabaseTableIndexIsIdentity()
         */
        public static function getDatabaseTableIndexIsIdentity() {
-               return call_user_func(array(static::$baseClass, 'getDatabaseTableIndexIsIdentity'));
+               return call_user_func([static::$baseClass, 'getDatabaseTableIndexIsIdentity']);
        }
        
        /**
         * @see \wcf\data\IStorableObject::getDatabaseTableIndexName()
         */
        public static function getDatabaseTableIndexName() {
-               return call_user_func(array(static::$baseClass, 'getDatabaseTableIndexName'));
+               return call_user_func([static::$baseClass, 'getDatabaseTableIndexName']);
        }
        
        /**
index f63463f22b63bbdb8f04f5c80d6fddaaf2084d87..af9555561c5c1fe823729f23ae651592eec77840 100644 (file)
@@ -16,9 +16,9 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I
        /**
         * @see \wcf\data\IEditableObject::create()
         */
-       public static function create(array $parameters = array()) {
+       public static function create(array $parameters = []) {
                $keys = $values = '';
-               $statementParameters = array();
+               $statementParameters = [];
                foreach ($parameters as $key => $value) {
                        if (!empty($keys)) {
                                $keys .= ',';
@@ -50,11 +50,11 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I
        /**
         * @see \wcf\data\IEditableObject::update()
         */
-       public function update(array $parameters = array()) {
+       public function update(array $parameters = []) {
                if (empty($parameters)) return;
                
                $updateSQL = '';
-               $statementParameters = array();
+               $statementParameters = [];
                foreach ($parameters as $key => $value) {
                        if (!empty($updateSQL)) $updateSQL .= ', ';
                        $updateSQL .= $key . ' = ?';
@@ -72,11 +72,11 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I
        /**
         * @see \wcf\data\IEditableObject::updateCounters()
         */
-       public function updateCounters(array $counters = array()) {
+       public function updateCounters(array $counters = []) {
                if (empty($counters)) return;
                
                $updateSQL = '';
-               $statementParameters = array();
+               $statementParameters = [];
                foreach ($counters as $key => $value) {
                        if (!empty($updateSQL)) $updateSQL .= ', ';
                        $updateSQL .= $key . ' = ' . $key . ' + ?';
@@ -95,13 +95,13 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I
         * @see \wcf\data\IEditableObject::delete()
         */
        public function delete() {
-               static::deleteAll(array($this->getObjectID()));
+               static::deleteAll([$this->getObjectID()]);
        }
        
        /**
         * @see \wcf\data\IEditableObject::deleteAll()
         */
-       public static function deleteAll(array $objectIDs = array()) {
+       public static function deleteAll(array $objectIDs = []) {
                $sql = "DELETE FROM     ".static::getDatabaseTableName()."
                        WHERE           ".static::getDatabaseTableIndexName()." = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
@@ -109,7 +109,7 @@ abstract class DatabaseObjectEditor extends DatabaseObjectDecorator implements I
                $affectedCount = 0;
                WCF::getDB()->beginTransaction();
                foreach ($objectIDs as $objectID) {
-                       $statement->execute(array($objectID));
+                       $statement->execute([$objectID]);
                        $affectedCount += $statement->getAffectedRows();
                }
                WCF::getDB()->commitTransaction();
index 2a0b7f5d42366666b7a496a54d148c44fe711f4d..f18e507707e877ed2db0e400c1a870eb4e4f776b 100644 (file)
@@ -38,7 +38,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject {
         * result objects
         * @var DatabaseObject[]
         */
-       public $objects = array();
+       public $objects = [];
        
        /**
         * ids of result objects
@@ -126,7 +126,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject {
                        }
                        
                        $objectClassName = $this->objectClassName ?: $this->className;
-                       $baseClassName = call_user_func(array($this->decoratorClassName, 'getBaseClass'));
+                       $baseClassName = call_user_func([$this->decoratorClassName, 'getBaseClass']);
                        if ($objectClassName != $baseClassName && !is_subclass_of($baseClassName, $objectClassName)) {
                                throw new SystemException("'".$this->decoratorClassName."' can't decorate objects of class '".$objectClassName."'");
                        }
@@ -157,7 +157,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject {
         * Reads the object ids from database.
         */
        public function readObjectIDs() {
-               $this->objectIDs = array();
+               $this->objectIDs = [];
                $sql = "SELECT  ".$this->getDatabaseTableAlias().".".$this->getDatabaseTableIndexName()." AS objectID
                        FROM    ".$this->getDatabaseTableName()." ".$this->getDatabaseTableAlias()."
                                ".$this->sqlConditionJoins."
@@ -207,7 +207,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject {
                }
                
                // use table index as array index
-               $objects = array();
+               $objects = [];
                foreach ($this->objects as $object) {
                        $objectID = $object->getObjectID();
                        $objects[$objectID] = $object;
@@ -260,7 +260,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject {
         * @return      string
         */
        public function getDatabaseTableName() {
-               return call_user_func(array($this->className, 'getDatabaseTableName'));
+               return call_user_func([$this->className, 'getDatabaseTableName']);
        }
        
        /**
@@ -269,7 +269,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject {
         * @return      string
         */
        public function getDatabaseTableIndexName() {
-               return call_user_func(array($this->className, 'getDatabaseTableIndexName'));
+               return call_user_func([$this->className, 'getDatabaseTableIndexName']);
        }
        
        /**
@@ -278,7 +278,7 @@ abstract class DatabaseObjectList implements \Countable, ITraversableObject {
         * @return      string
         */
        public function getDatabaseTableAlias() {
-               return call_user_func(array($this->className, 'getDatabaseTableAlias'));
+               return call_user_func([$this->className, 'getDatabaseTableAlias']);
        }
        
        /**
index b7b43bf50a4699f66958e0ed1844ba3ecdaa0f3b..0b5ad8644ed914ab82bed3c7ca629cf0456feebd 100644 (file)
@@ -18,21 +18,21 @@ interface IEditableObject extends IStorableObject {
         * @param       array           $parameters
         * @return      \wcf\data\IStorableObject
         */
-       public static function create(array $parameters = array());
+       public static function create(array $parameters = []);
        
        /**
         * Updates this object.
         * 
         * @param       array           $parameters
         */
-       public function update(array $parameters = array());
+       public function update(array $parameters = []);
        
        /**
         * Updates the counters of this object.
         * 
         * @param       array           $counters
         */
-       public function updateCounters(array $counters = array());
+       public function updateCounters(array $counters = []);
        
        /**
         * Deletes this object.
@@ -46,5 +46,5 @@ interface IEditableObject extends IStorableObject {
         * @param       array           $objectIDs
         * @return      integer
         */
-       public static function deleteAll(array $objectIDs = array());
+       public static function deleteAll(array $objectIDs = []);
 }
index 5d00d6b727ececb7b55eb2431ca0e732497d9520..29d264ae72e267fd5fd3dc6dd7f854d0862fb63b 100644 (file)
@@ -42,7 +42,7 @@ class ProcessibleDatabaseObject extends DatabaseObject {
                                }
                                
                                if (is_subclass_of($this->className, 'wcf\system\SingletonFactory')) {
-                                       $this->processor = call_user_func(array($this->className, 'getInstance'));
+                                       $this->processor = call_user_func([$this->className, 'getInstance']);
                                }
                                else {
                                        if (!is_subclass_of($this->className, 'wcf\data\IDatabaseObjectProcessor')) {
index 476f22ff2dd0aee1b093dbabb06637d4db66fe1c..897a25f235b4dbb85c9bed9c281a34b5a6ef4df7 100644 (file)
@@ -33,7 +33,7 @@ trait TMultiCategoryObject {
         * ids of the object's categories
         * @var integer[]
         */
-       protected $categoryIDs = array();
+       protected $categoryIDs = [];
        
        /**
         * list of the object's leaf categories
@@ -58,7 +58,7 @@ trait TMultiCategoryObject {
         */
        public function getCategories() {
                if ($this->categories === null) {
-                       $this->categories = array();
+                       $this->categories = [];
                        
                        $className = static::getCategoryClassName();
                        if (!is_subclass_of($className, AbstractDecoratedCategory::class)) {
@@ -80,7 +80,7 @@ trait TMultiCategoryObject {
                                                        )
                                        ORDER BY        parentCategoryID, showOrder";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array($this->getObjectID()));
+                               $statement->execute([$this->getObjectID()]);
                                while ($categoryID = $statement->fetchColumn()) {
                                        $this->categories[$categoryID] = $className::getCategory($categoryID);
                                }
index 3ecec50e2cd867af099637e132450be0c6603f18..35b40ea7ec132f2f300e3f50ba92e99b9404daa6 100644 (file)
@@ -37,7 +37,7 @@ class ACLOption extends DatabaseObject {
         */
        public static function getOptions($objectTypeID) {
                $optionList = new ACLOptionList();
-               $optionList->getConditionBuilder()->add("acl_option.objectTypeID = ?", array($objectTypeID));
+               $optionList->getConditionBuilder()->add("acl_option.objectTypeID = ?", [$objectTypeID]);
                $optionList->readObjects();
                
                return $optionList;
index da5ced6b61bbe2f7af3726765bf53fdfead2dcd7..77d8f5169fbee989cc2239305f96f39a19f5183b 100644 (file)
@@ -22,7 +22,7 @@ class ACLOptionAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('loadAll');
+       protected $requireACP = ['loadAll'];
        
        /**
         * Validates parameters for ACL options.
@@ -39,7 +39,7 @@ class ACLOptionAction extends AbstractDatabaseObjectAction {
         * @return      array
         */
        public function loadAll() {
-               $objectIDs = ($this->parameters['objectID']) ? array($this->parameters['objectID']) : array();
+               $objectIDs = ($this->parameters['objectID']) ? [$this->parameters['objectID']] : [];
                $permissions = ACLHandler::getInstance()->getPermissions($this->parameters['objectTypeID'], $objectIDs, $this->parameters['categoryName'], true);
                
                return $permissions;
index ab314ad8c1dc00d5138d28726b6790b0676e66d7..cfdaa0019e06aa9db6f84cc61cc0db7223fcaa59 100644 (file)
@@ -61,9 +61,9 @@ class ACPMenuItem extends DatabaseObject implements ITreeMenuItem {
                
                $this->parseController();
                
-               $linkParameters = array(
+               $linkParameters = [
                        'application' => $this->application
-               );
+               ];
                
                // links of top option category menu items need the id of the option
                // category
index c08e264a40145b27184ec94d659992c393b6d00b..3ec14212892b9b2705efcf8ce873c54fd9f29c0c 100644 (file)
@@ -18,7 +18,7 @@ class ACPSearchProviderAction extends AbstractDatabaseObjectAction implements IS
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('getSearchResultList');
+       protected $requireACP = ['getSearchResultList'];
        
        /**
         * @see \wcf\data\ISearchAction::validateGetSearchResultList()
@@ -31,17 +31,17 @@ class ACPSearchProviderAction extends AbstractDatabaseObjectAction implements IS
         * @see \wcf\data\ISearchAction::getSearchResultList()
         */
        public function getSearchResultList() {
-               $data = array();
+               $data = [];
                $results = ACPSearchHandler::getInstance()->search($this->parameters['data']['searchString']);
                
                foreach ($results as $resultList) {
-                       $items = array();
+                       $items = [];
                        foreach ($resultList as $item) {
-                               $items[] = array(
+                               $items[] = [
                                        'link' => $item->getLink(),
                                        'subtitle' => $item->getSubtitle(),
                                        'title' => $item->getTitle()
-                               );
+                               ];
                        }
                        
                        foreach ($items as $key => &$item) {
@@ -59,10 +59,10 @@ class ACPSearchProviderAction extends AbstractDatabaseObjectAction implements IS
                        }
                        unset($item);
                        
-                       $data[] = array(
+                       $data[] = [
                                'items' => $items,
                                'title' => $resultList->getTitle()
-                       );
+                       ];
                }
                
                return $data;
index c5d318c8a57126aa6f232e0236c725b54bb4f94c..dde485fc1296c93179780750d44901e9812c2525 100644 (file)
@@ -51,11 +51,11 @@ class ACPSessionVirtual extends DatabaseObject {
                                AND ipAddress = ?
                                AND userAgent = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $sessionID,
                        UserUtil::getIpAddress(),
                        UserUtil::getUserAgent()
-               ));
+               ]);
                
                return $statement->fetchObject(static::class);
        }
@@ -71,7 +71,7 @@ class ACPSessionVirtual extends DatabaseObject {
                        FROM    ".static::getDatabaseTableName()."
                        WHERE   sessionID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($sessionID));
+               $statement->execute([$sessionID]);
                
                return $statement->fetchColumn();
        }
index 9d106c9648d17b38edc97ce28af5d6bad3120d2d..3e8dae04de4f5ea27b9be340eb4193f4d9247508 100644 (file)
@@ -27,8 +27,8 @@ class ACPSessionVirtualAction extends AbstractDatabaseObjectAction {
         */
        public function create() {
                // try to find an existing virtual session
-               $baseClass = call_user_func(array($this->className, 'getBaseClass'));
-               $virtualSession = call_user_func(array($baseClass, 'getExistingSession'), $this->parameters['data']['sessionID']);
+               $baseClass = call_user_func([$this->className, 'getBaseClass']);
+               $virtualSession = call_user_func([$baseClass, 'getExistingSession'], $this->parameters['data']['sessionID']);
                if ($virtualSession !== null) {
                        return $virtualSession;
                }
index c144fe7299baec1fbf6d90c3251e636306fa20c4..cf4af8c21d268468e68bb4f0d81424c1f0e919e5 100644 (file)
@@ -21,20 +21,20 @@ class ACPTemplateAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.template.canAddTemplate');
+       protected $permissionsCreate = ['admin.template.canAddTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.template.canDeleteTemplate');
+       protected $permissionsDelete = ['admin.template.canDeleteTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.template.canUpdateTemplate');
+       protected $permissionsUpdate = ['admin.template.canUpdateTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update');
+       protected $requireACP = ['create', 'delete', 'update'];
 }
index 0f33a5158a43f8270c97463e019e892aaf21aa10..c1e880b59f3432601b2a89e6d7aa2c495253f725 100644 (file)
@@ -21,17 +21,17 @@ class AdAction extends AbstractDatabaseObjectAction implements ISortableAction,
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.ad.canManageAd');
+       protected $permissionsDelete = ['admin.ad.canManageAd'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.ad.canManageAd');
+       protected $permissionsUpdate = ['admin.ad.canManageAd'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'toggle', 'update', 'updatePosition');
+       protected $requireACP = ['create', 'delete', 'toggle', 'update', 'updatePosition'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::create()
@@ -64,9 +64,9 @@ class AdAction extends AbstractDatabaseObjectAction implements ISortableAction,
         */
        public function toggle() {
                foreach ($this->objects as $ad) {
-                       $ad->update(array(
+                       $ad->update([
                                'isDisabled' => $ad->isDisabled ? 0 : 1
-                       ));
+                       ]);
                }
        }
        
@@ -119,10 +119,10 @@ class AdAction extends AbstractDatabaseObjectAction implements ISortableAction,
                $showOrder = $this->parameters['data']['offset'];
                WCF::getDB()->beginTransaction();
                foreach ($this->parameters['data']['structure'][0] as $adID) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $showOrder++,
                                $adID
-                       ));
+                       ]);
                }
                WCF::getDB()->commitTransaction();
        }
index f6699b0f8b3aaf69c34c4cdf3e4a3d7c9c8b7f3e..cce212baa5ec10b7cb81a8172ede20609db7c310 100644 (file)
@@ -50,16 +50,16 @@ class AdEditor extends DatabaseObjectEditor implements IEditableCachedObject {
                                SET     showOrder = showOrder + 1
                                WHERE   showOrder >= ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $showOrder
-                       ));
+                       ]);
                        
                        $newShowOrder = $showOrder;
                }
                
-               $this->update(array(
+               $this->update([
                        'showOrder' => $newShowOrder
-               ));
+               ]);
        }
        
        /**
@@ -67,8 +67,8 @@ class AdEditor extends DatabaseObjectEditor implements IEditableCachedObject {
         */
        public static function resetCache() {
                AdCacheBuilder::getInstance()->reset();
-               ConditionCacheBuilder::getInstance()->reset(array(
+               ConditionCacheBuilder::getInstance()->reset([
                        'definitionID' => ObjectTypeCache::getInstance()->getDefinitionByName('com.woltlab.wcf.condition.ad')->definitionID
-               ));
+               ]);
        }
 }
index 3acbd8d475146f87fbdf54086f1ec7905cbe692a..d534d98d753a4418bc4d8805196d474009279209 100644 (file)
@@ -103,11 +103,11 @@ class Application extends DatabaseObject {
         */
        public static function getDirectory($abbreviation) {
                if (static::$directories === null) {
-                       static::$directories = array();
+                       static::$directories = [];
                        
                        // read application directories
                        $packageList = new PackageList();
-                       $packageList->getConditionBuilder()->add('package.isApplication = ?', array(1));
+                       $packageList->getConditionBuilder()->add('package.isApplication = ?', [1]);
                        $packageList->readObjects();
                        foreach ($packageList as $package) {
                                $abbr = Package::getAbbreviation($package->package);
index 5b47102e2c219e001e1820564cc4dbe78117f0ee..d59052cc40b6f22a265e04dea6a9e8f1f36f1349 100644 (file)
@@ -17,7 +17,7 @@ class GroupedAttachmentList extends AttachmentList {
         * grouped objects
         * @var array
         */
-       public $groupedObjects = array();
+       public $groupedObjects = [];
        
        /**
         * object type
@@ -44,12 +44,12 @@ class GroupedAttachmentList extends AttachmentList {
                parent::__construct();
                
                $this->objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.attachment.objectType', $objectType);
-               $this->getConditionBuilder()->add('attachment.objectTypeID = ?', array($this->objectType->objectTypeID));
+               $this->getConditionBuilder()->add('attachment.objectTypeID = ?', [$this->objectType->objectTypeID]);
                
-               $this->getConditionBuilder()->add('(SELECT embeddedObjectID FROM wcf'.WCF_N.'_message_embedded_object WHERE messageObjectTypeID = ? AND messageID = attachment.objectID AND embeddedObjectTypeID = ? AND embeddedObjectID = attachment.attachmentID) IS NULL', array(
+               $this->getConditionBuilder()->add('(SELECT embeddedObjectID FROM wcf'.WCF_N.'_message_embedded_object WHERE messageObjectTypeID = ? AND messageID = attachment.objectID AND embeddedObjectTypeID = ? AND embeddedObjectID = attachment.attachmentID) IS NULL', [
                        ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message', $objectType),
                        ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message.embeddedObject', 'com.woltlab.wcf.attachment')
-               ));
+               ]);
        }
        
        /**
@@ -61,7 +61,7 @@ class GroupedAttachmentList extends AttachmentList {
                // group by object id
                foreach ($this->objects as $attachmentID => $attachment) {
                        if (!isset($this->groupedObjects[$attachment->objectID])) {
-                               $this->groupedObjects[$attachment->objectID] = array();
+                               $this->groupedObjects[$attachment->objectID] = [];
                        }
                        
                        $this->groupedObjects[$attachment->objectID][$attachmentID] = $attachment;
@@ -89,6 +89,6 @@ class GroupedAttachmentList extends AttachmentList {
                        return $this->groupedObjects[$objectID];
                }
                
-               return array();
+               return [];
        }
 }
index 3b9a61d1a3bf117022d6639f5bf67afa9099b0b5..8229d450b7958fabba2c14aa0e37606d5fa282e2 100644 (file)
@@ -77,9 +77,9 @@ class BBCode extends ProcessibleDatabaseObject implements IRouteController {
                        FROM    wcf".WCF_N."_bbcode
                        WHERE   bbcodeTag = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($tag));
+               $statement->execute([$tag]);
                $row = $statement->fetchArray();
-               if (!$row) $row = array();
+               if (!$row) $row = [];
                
                return new self(null, $row);
        }
index 1c304cd84ed0bfa4e96a280d40dec88f84f055a0..ebbecaaf3278850323039e855ce56e7085c2a499 100644 (file)
@@ -27,17 +27,17 @@ class BBCodeAction extends AbstractDatabaseObjectAction implements IToggleAction
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.content.bbcode.canManageBBCode');
+       protected $permissionsDelete = ['admin.content.bbcode.canManageBBCode'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.content.bbcode.canManageBBCode');
+       protected $permissionsUpdate = ['admin.content.bbcode.canManageBBCode'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('delete', 'toggle', 'update');
+       protected $requireACP = ['delete', 'toggle', 'update'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::create()
@@ -50,14 +50,14 @@ class BBCodeAction extends AbstractDatabaseObjectAction implements IToggleAction
                        FROM    wcf".WCF_N."_user_group_option
                        WHERE   optionType = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array('BBCodeSelect'));
+               $statement->execute(['BBCodeSelect']);
                $optionIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($optionIDs)) {
                        $conditionBuilder = new PreparedStatementConditionBuilder();
-                       $conditionBuilder->add("optionID IN (?)", array($optionIDs));
-                       $conditionBuilder->add("groupID IN (?)", array(UserGroup::getGroupIDsByType(array(UserGroup::EVERYONE))));
-                       $conditionBuilder->add("optionValue <> ?", array('all'));
+                       $conditionBuilder->add("optionID IN (?)", [$optionIDs]);
+                       $conditionBuilder->add("groupID IN (?)", [UserGroup::getGroupIDsByType([UserGroup::EVERYONE])]);
+                       $conditionBuilder->add("optionValue <> ?", ['all']);
                        
                        $sql = "SELECT  *
                                FROM    wcf".WCF_N."_user_group_option_value
@@ -80,11 +80,11 @@ class BBCodeAction extends AbstractDatabaseObjectAction implements IToggleAction
                                        $row['optionValue'] = $bbCode->bbcodeTag;
                                }
                                
-                               $updateStatement->execute(array(
+                               $updateStatement->execute([
                                        $row['optionValue'],
                                        $row['optionID'],
                                        $row['groupID']
-                               ));
+                               ]);
                        }
                        WCF::getDB()->commitTransaction();
                        
@@ -120,9 +120,9 @@ class BBCodeAction extends AbstractDatabaseObjectAction implements IToggleAction
         */
        public function toggle() {
                foreach ($this->objects as $bbcode) {
-                       $bbcode->update(array(
+                       $bbcode->update([
                                'isDisabled' => $bbcode->isDisabled ? 0 : 1
-                       ));
+                       ]);
                }
        }
 }
index 16a9a26c806072b5126945fdb98e09e221de46a9..76acee87184fb2e14c6e402e54b4ab1715fa2f33 100644 (file)
@@ -19,20 +19,20 @@ class BBCodeCache extends SingletonFactory {
         * cached bbcodes
         * @var BBCode[]
         */
-       protected $cachedBBCodes = array();
+       protected $cachedBBCodes = [];
        
        /**
         * list of known highlighters
         * @var string[]
         */
-       protected $highlighters = array();
+       protected $highlighters = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
         */
        protected function init() {
                // get bbcode cache
-               $this->cachedBBCodes = BBCodeCacheBuilder::getInstance()->getData(array(), 'bbcodes');
+               $this->cachedBBCodes = BBCodeCacheBuilder::getInstance()->getData([], 'bbcodes');
        }
        
        /**
@@ -75,7 +75,7 @@ class BBCodeCache extends SingletonFactory {
         */
        public function getHighlighters() {
                if (empty($this->highlighters)) {
-                       $this->highlighters = BBCodeCacheBuilder::getInstance()->getData(array(), 'highlighters');
+                       $this->highlighters = BBCodeCacheBuilder::getInstance()->getData([], 'highlighters');
                }
                
                return $this->highlighters;
index 5bd506b68ea237f3e2ccbe35f4cfca04a68b755e..70abc1eebe448375a2f5fcd02a1fc1dc0fecc2b2 100644 (file)
@@ -22,7 +22,7 @@ class MessagePreviewAction extends BBCodeAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getMessagePreview');
+       protected $allowGuestAccess = ['getMessagePreview'];
                
        /**
         * Validates parameters for message preview.
@@ -61,9 +61,9 @@ class MessagePreviewAction extends BBCodeAction {
                if ($enableBBCodes && $allowedBBCodesPermission) {
                        $disallowedBBCodes = MessageParser::getInstance()->validateBBCodes($this->parameters['data']['message'], ArrayUtil::trim(explode(',', WCF::getSession()->getPermission($allowedBBCodesPermission))));
                        if (!empty($disallowedBBCodes)) {
-                               throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.disallowedBBCodes', array(
+                               throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.disallowedBBCodes', [
                                        'disallowedBBCodes' => $disallowedBBCodes
-                               )));
+                               ]));
                        }
                }
                
@@ -86,8 +86,8 @@ class MessagePreviewAction extends BBCodeAction {
                // parse message
                $preview = MessageParser::getInstance()->parse($message, $enableSmilies, $enableHtml, $enableBBCodes, false);
                
-               return array(
+               return [
                        'message' => $preview
-               );
+               ];
        }
 }
index dcb1328fd6bd340732626bf5a14533551f788367..2d97995956ce16c4707851e10dd14258ac39b805 100644 (file)
@@ -41,7 +41,7 @@ class BBCodeAttribute extends DatabaseObject {
        public static function getAttributesByBBCode(BBCode $bbcode) {
                $attributeList = new BBCodeAttributeList();
                $attributeList->sqlOrderBy = "bbcode_attribute.attributeNo ASC";
-               $attributeList->getConditionBuilder()->add('bbcode_attribute.bbcodeID = ?', array($bbcode->bbcodeID));
+               $attributeList->getConditionBuilder()->add('bbcode_attribute.bbcodeID = ?', [$bbcode->bbcodeID]);
                $attributeList->readObjects();
                return $attributeList->getObjects();
        }
index ed1a54e02238be1b5604628d2b96c6f858fe8826..b5359f6be619a1bc3e21c79e72d3dcd1f4d34771 100644 (file)
@@ -21,15 +21,15 @@ class BBCodeMediaProviderAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.content.bbcode.canManageBBCode');
+       protected $permissionsDelete = ['admin.content.bbcode.canManageBBCode'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.content.bbcode.canManageBBCode');
+       protected $permissionsUpdate = ['admin.content.bbcode.canManageBBCode'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('delete', 'update');
+       protected $requireACP = ['delete', 'update'];
 }
index cf9dad0eb63b79b8a96a4365ce67f3cbed0a69bb..0317a0637662f47dccf1a2633701e53dfad07255 100644 (file)
@@ -17,21 +17,21 @@ class CaptchaQuestionAction extends AbstractDatabaseObjectAction implements ITog
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.captcha.canManageCaptchaQuestion');
+       protected $permissionsDelete = ['admin.captcha.canManageCaptchaQuestion'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.captcha.canManageCaptchaQuestion');
+       protected $permissionsUpdate = ['admin.captcha.canManageCaptchaQuestion'];
        
        /**
         * @see \wcf\data\IToggleAction::toggle()
         */
        public function toggle() {
                foreach ($this->objects as $question) {
-                       $question->update(array(
+                       $question->update([
                                'isDisabled' => $question->isDisabled ? 0 : 1
-                       ));
+                       ]);
                }
        }
        
index c3a89937351060f7791505447bc0fe42ace381bb..ba3e56cb7d16f01e4589769a93eeba9c6ed5d12d 100644 (file)
@@ -31,7 +31,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'toggle', 'update', 'updatePosition');
+       protected $requireACP = ['create', 'delete', 'toggle', 'update', 'updatePosition'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::delete()
@@ -52,9 +52,9 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
         */
        public function toggle() {
                foreach ($this->objects as $categoryEditor) {
-                       $categoryEditor->update(array(
+                       $categoryEditor->update([
                                'isDisabled' => 1 - $categoryEditor->isDisabled
-                       ));
+                       ]);
                }
        }
        
@@ -94,7 +94,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
                
                if (isset($this->parameters['data']['parentCategoryID'])) {
                        $objectType = null;
-                       $parentUpdates = array();
+                       $parentUpdates = [];
                        
                        foreach ($this->objects as $category) {
                                if ($objectType === null) {
@@ -102,10 +102,10 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
                                }
                                
                                if ($category->parentCategoryID != $this->parameters['data']['parentCategoryID']) {
-                                       $parentUpdates[$category->categoryID] = array(
+                                       $parentUpdates[$category->categoryID] = [
                                                'oldParentCategoryID' => $category->parentCategoryID,
                                                'newParentCategoryID' => $this->parameters['data']['parentCategoryID']
-                                       );
+                                       ];
                                }
                        }
                        
@@ -120,7 +120,7 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
         */
        public function updatePosition() {
                $objectType = null;
-               $parentUpdates = array();
+               $parentUpdates = [];
                
                WCF::getDB()->beginTransaction();
                foreach ($this->parameters['data']['structure'] as $parentCategoryID => $categoryIDs) {
@@ -132,16 +132,16 @@ class CategoryAction extends AbstractDatabaseObjectAction implements ISortableAc
                                }
                                
                                if ($category->parentCategoryID != $parentCategoryID) {
-                                       $parentUpdates[$categoryID] = array(
+                                       $parentUpdates[$categoryID] = [
                                                'oldParentCategoryID' => $category->parentCategoryID,
                                                'newParentCategoryID' => $parentCategoryID
-                                       );
+                                       ];
                                }
                                
-                               $this->objects[$categoryID]->update(array(
+                               $this->objects[$categoryID]->update([
                                        'parentCategoryID' => $parentCategoryID ? $this->objects[$parentCategoryID]->categoryID : 0,
                                        'showOrder' => $showOrder++
-                               ));
+                               ]);
                        }
                }
                WCF::getDB()->commitTransaction();
index c206dc78f98558133bb9bab28f5c3ede239f1283..9b0fd2afac09a153f4f7f0a6f1f45f7274315d88 100644 (file)
@@ -20,7 +20,7 @@ class CategoryNode extends DatabaseObjectDecorator implements \RecursiveIterator
         * child category nodes
         * @var CategoryNode[]
         */
-       protected $children = array();
+       protected $children = [];
        
        /**
         * current iterator key
index b53fca2f158be4e6fcff19143f960fef31dc655b..272eb9c422fadd8b8117b026cf28313cd9657031 100644 (file)
@@ -17,25 +17,25 @@ class UncachedCategoryNodeTree extends CategoryNodeTree {
         * locally cached categories
         * @var Category[]
         */
-       protected $categoryCache = array();
+       protected $categoryCache = [];
        
        /**
         * locally cached category ids grouped by the id of their parent category
         * @var array
         */
-       protected $categoryStructureCache = array();
+       protected $categoryStructureCache = [];
        
        /**
         * @see \wcf\data\category\CategoryNodeTree::buildTree()
         */
        protected function buildTree() {
                $categoryList = new CategoryList();
-               $categoryList->getConditionBuilder()->add('category.objectTypeID = ?', array(CategoryHandler::getInstance()->getObjectTypeByName($this->objectType)->objectTypeID));
+               $categoryList->getConditionBuilder()->add('category.objectTypeID = ?', [CategoryHandler::getInstance()->getObjectTypeByName($this->objectType)->objectTypeID]);
                $categoryList->sqlOrderBy = "category.showOrder ASC";
                $categoryList->readObjects();
                foreach ($categoryList as $category) {
                        if (!isset($this->categoryStructureCache[$category->parentCategoryID])) {
-                               $this->categoryStructureCache[$category->parentCategoryID] = array();
+                               $this->categoryStructureCache[$category->parentCategoryID] = [];
                        }
                        
                        $this->categoryStructureCache[$category->parentCategoryID][] = $category->categoryID;
@@ -56,7 +56,7 @@ class UncachedCategoryNodeTree extends CategoryNodeTree {
         * @see \wcf\data\category\CategoryNodeTree::getChildCategories()
         */
        protected function getChildCategories(CategoryNode $parentNode) {
-               $categories = array();
+               $categories = [];
                if (isset($this->categoryStructureCache[$parentNode->categoryID])) {
                        foreach ($this->categoryStructureCache[$parentNode->categoryID] as $categoryID) {
                                $categories[$categoryID] = $this->getCategory($categoryID);
index 5decb765ba060e378cb1d578e38902e0bdfaa6d6..61fa3287b6001d1c4bcd8a77e9f443047f965297 100644 (file)
@@ -30,7 +30,7 @@ class ClipboardItemAction extends AbstractDatabaseObjectAction {
         * 
         * @see \wcf\data\AbstractDatabaseObjectAction
         */
-       public function __construct(array $objects, $action, array $parameters = array()) {
+       public function __construct(array $objects, $action, array $parameters = []) {
                $this->action = $action;
                $this->parameters = $parameters;
                
index 9fa7ccd7dc66be00dd91a8849bb7d0cfddc03671..b314ab095adc94a5fe7a3e8bc5849524db1566f1 100644 (file)
@@ -26,7 +26,7 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('loadResponses');
+       protected $allowGuestAccess = ['loadResponses'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$className
@@ -60,7 +60,7 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
                $ignoreCounters = !empty($this->parameters['ignoreCounters']);
                
                // read object type ids for comments
-               $commentIDs = array();
+               $commentIDs = [];
                foreach ($this->objects as $response) {
                        $commentIDs[] = $response->commentID;
                }
@@ -71,14 +71,14 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
                $comments = $commentList->getObjects();
                
                // update counters
-               $processors = $responseIDs = $updateComments = array();
+               $processors = $responseIDs = $updateComments = [];
                foreach ($this->objects as $response) {
                        $objectTypeID = $comments[$response->commentID]->objectTypeID;
                        
                        if (!isset($processors[$objectTypeID])) {
                                $objectType = ObjectTypeCache::getInstance()->getObjectType($objectTypeID);
                                $processors[$objectTypeID] = $objectType->getProcessor();
-                               $responseIDs[$objectTypeID] = array();
+                               $responseIDs[$objectTypeID] = [];
                        }
                        $responseIDs[$objectTypeID][] = $response->responseID;
                        
@@ -101,14 +101,14 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
                        foreach ($comments as $comment) {
                                $commentEditor = new CommentEditor($comment);
                                $commentEditor->updateResponseIDs();
-                               $commentEditor->updateCounters(array(
+                               $commentEditor->updateCounters([
                                        'responses' => -1 * $updateComments[$comment->commentID]
-                               ));
+                               ]);
                        }
                }
                
-               $likeObjectIDs = array();
-               $notificationObjectTypes = array();
+               $likeObjectIDs = [];
+               $notificationObjectTypes = [];
                foreach ($responseIDs as $objectTypeID => $objectIDs) {
                        // remove activity events
                        $objectType = ObjectTypeCache::getInstance()->getObjectType($objectTypeID);
@@ -163,7 +163,7 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
        public function loadResponses() {
                // get response list
                $responseList = new StructuredCommentResponseList($this->commentManager, $this->comment);
-               $responseList->getConditionBuilder()->add("comment_response.time > ?", array($this->parameters['data']['lastResponseTime']));
+               $responseList->getConditionBuilder()->add("comment_response.time > ?", [$this->parameters['data']['lastResponseTime']]);
                if (!$this->parameters['data']['loadAllResponses']) $responseList->sqlLimit = 50;
                $responseList->readObjects();
                
@@ -176,16 +176,16 @@ class CommentResponseAction extends AbstractDatabaseObjectAction {
                        $lastResponseTime = max($lastResponseTime, $response->time);
                }
                
-               WCF::getTPL()->assign(array(
-                       'likeData' => (MODULE_LIKE ? $responseList->getLikeData() : array()),
+               WCF::getTPL()->assign([
+                       'likeData' => (MODULE_LIKE ? $responseList->getLikeData() : []),
                        'responseList' => $responseList,
                        'commentManager' => $this->commentManager
-               ));
+               ]);
                
-               return array(
+               return [
                        'commentID' => $this->comment->commentID,
                        'lastResponseTime' => $lastResponseTime,
                        'template' => WCF::getTPL()->fetch('commentResponseList')
-               );
+               ];
        }
 }
index 157576d97e3abcd2cbc0f239f423cd8b41cb337e..5bfef9fcd9b4e27a1c9d23381c84ef1fb16babe4 100644 (file)
@@ -61,7 +61,7 @@ class Condition extends DatabaseObject {
                // handle condition data
                $this->data['conditionData'] = @unserialize($data['conditionData']);
                if (!is_array($this->data['conditionData'])) {
-                       $this->data['conditionData'] = array();
+                       $this->data['conditionData'] = [];
                }
        }
        
index 27a0aee63dc54aca5e50b2ea0c6e623dad5acdf7..e9bd8808ae58b5fba4d1e696ed135d6791f29f05 100644 (file)
@@ -28,27 +28,27 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.management.canManageCronjob');
+       protected $permissionsCreate = ['admin.management.canManageCronjob'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.management.canManageCronjob');
+       protected $permissionsDelete = ['admin.management.canManageCronjob'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.management.canManageCronjob');
+       protected $permissionsUpdate = ['admin.management.canManageCronjob'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('executeCronjobs');
+       protected $allowGuestAccess = ['executeCronjobs'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update', 'toggle', 'execute');
+       protected $requireACP = ['create', 'delete', 'update', 'toggle', 'execute'];
        
        /**
         * @see \wcf\data\IDeleteAction::validateDelete()
@@ -94,9 +94,9 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
         */
        public function toggle() {
                foreach ($this->objects as $cronjob) {
-                       $cronjob->update(array(
+                       $cronjob->update([
                                'isDisabled' => $cronjob->isDisabled ? 0 : 1
-                       ));
+                       ]);
                }
        }
        
@@ -111,16 +111,16 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
         * Executes cronjobs.
         */
        public function execute() {
-               $return = array();
+               $return = [];
                
                foreach ($this->objects as $key => $cronjob) {
                        // mark them as pending
-                       $cronjob->update(array('state' => Cronjob::PENDING));
+                       $cronjob->update(['state' => Cronjob::PENDING]);
                }
                
                foreach ($this->objects as $cronjob) {
                        // it now time for executing
-                       $cronjob->update(array('state' => Cronjob::EXECUTING));
+                       $cronjob->update(['state' => Cronjob::EXECUTING]);
                        $className = $cronjob->className;
                        $executable = new $className();
                        
@@ -138,20 +138,20 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
                                catch (\Exception $exception) { }
                        }
                        
-                       CronjobLogEditor::create(array(
+                       CronjobLogEditor::create([
                                'cronjobID' => $cronjob->cronjobID,
                                'execTime' => TIME_NOW,
                                'success' => ($exception ? 0 : 1),
                                'error' => ($exception ? $exception->getMessage() : '')
-                       ));
+                       ]);
                        
                        // calculate next exec-time
                        $nextExec = $cronjob->getNextExec();
-                       $data = array(
+                       $data = [
                                'lastExec' => TIME_NOW,
                                'nextExec' => $nextExec, 
                                'afterNextExec' => $cronjob->getNextExec(($nextExec + 120))
-                       );
+                       ];
                        
                        // cronjob failed
                        if ($exception) {
@@ -180,7 +180,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
                        // build the return value
                        if ($exception === null && !$cronjob->isDisabled) {
                                $dateTime = DateUtil::getDateTimeByTimestamp($nextExec);
-                               $return[$cronjob->cronjobID] = array(
+                               $return[$cronjob->cronjobID] = [
                                        'time' => $nextExec,
                                        'formatted' => str_replace(
                                                '%time%', 
@@ -191,11 +191,11 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
                                                        WCF::getLanguage()->get('wcf.date.dateTimeFormat')
                                                )
                                        )
-                               );
+                               ];
                        }
                        
                        // we are finished
-                       $cronjob->update(array('state' => Cronjob::READY));
+                       $cronjob->update(['state' => Cronjob::READY]);
                        
                        // throw exception again to show error message
                        if ($exception) {
@@ -218,7 +218,7 @@ class CronjobAction extends AbstractDatabaseObjectAction implements IToggleActio
         */
        public function executeCronjobs() {
                // switch session owner to 'system' during execution of cronjobs
-               WCF::getSession()->changeUser(new User(null, array('userID' => 0, 'username' => 'System')), true);
+               WCF::getSession()->changeUser(new User(null, ['userID' => 0, 'username' => 'System']), true);
                WCF::getSession()->disableUpdate();
                
                CronjobScheduler::getInstance()->executeCronjobs();
index 35649e3cdc7a2882603c427e3140532c86311629..dde59826e1fb2254944de8d0423cba57e0f1b791 100644 (file)
@@ -22,13 +22,13 @@ class CronjobLogAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('clearAll');
+       protected $requireACP = ['clearAll'];
        
        /**
         * Validates the clear all action.
         */
        public function validateClearAll() {
-               WCF::getSession()->checkPermissions(array('admin.management.canManageCronjob'));
+               WCF::getSession()->checkPermissions(['admin.management.canManageCronjob']);
        }
        
        /**
index d2fb1b0e97fce028945334ecdc4bb8d21a9538dc..8b6ef611b0c285230a9c106098a92420b87767bf 100644 (file)
@@ -151,10 +151,10 @@ class LabelAction extends AbstractDatabaseObjectAction implements ISortableActio
                WCF::getDB()->beginTransaction();
                foreach ($this->parameters['data']['structure'] as $labelIDs) {
                        foreach ($labelIDs as $labelID) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $showOrder++,
                                        $labelID
-                               ));
+                               ]);
                        }
                }
                WCF::getDB()->commitTransaction();
index 4350e7228d67a12a6577aa7f088767b41abce6da..15264e306603b340537e4d34377a071ff6aa2a12 100644 (file)
@@ -22,22 +22,22 @@ class LabelGroupAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.content.label.canManageLabel');
+       protected $permissionsCreate = ['admin.content.label.canManageLabel'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.content.label.canManageLabel');
+       protected $permissionsDelete = ['admin.content.label.canManageLabel'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.content.label.canManageLabel');
+       protected $permissionsUpdate = ['admin.content.label.canManageLabel'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update');
+       protected $requireACP = ['create', 'delete', 'update'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::delete()
index 3ac6060818c31b819d0ec66a636a88dd12622576..1fc1db77da6bb3cf2e3bff31c107e9d70bef3305 100644 (file)
@@ -29,16 +29,16 @@ class ViewableLabelGroup extends DatabaseObjectDecorator implements \Countable,
         * list of labels
         * @var Label[]
         */
-       protected $labels = array();
+       protected $labels = [];
        
        /**
         * list of permissions by type
         * @var integer[][]
         */
-       protected $permissions = array(
-               'group' => array(),
-               'user' => array()
-       );
+       protected $permissions = [
+               'group' => [],
+               'user' => []
+       ];
        
        /**
         * current iterator index
index 94ac7f2549be6adca9d9963505d9f02e3403f321..506f9915abed033f86c322154d5721f9749c22fe 100644 (file)
@@ -36,13 +36,13 @@ class Language extends DatabaseObject {
         * list of language items
         * @var string[]
         */
-       protected $items = array();
+       protected $items = [];
        
        /**
         * list of dynamic language items
         * @var string[]
         */
-       protected $dynamicItems = array();
+       protected $dynamicItems = [];
        
        /**
         * instance of LanguageEditor
@@ -127,7 +127,7 @@ class Language extends DatabaseObject {
         * @param       boolean         $optional
         * @return      string          result
         */
-       public function getDynamicVariable($item, array $variables = array(), $optional = false) {
+       public function getDynamicVariable($item, array $variables = [], $optional = false) {
                $staticItem = $this->get($item, $optional);
                if (!$staticItem) return '';
                
index aff9d71741d674a95824d3e42a41c03ddb37f3c2..c01e01dcbeb405a02fa9b1811d9cc29c8726e639 100644 (file)
@@ -22,17 +22,17 @@ class LanguageAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.language.canManageLanguage');
+       protected $permissionsCreate = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.language.canManageLanguage');
+       protected $permissionsDelete = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.language.canManageLanguage');
+       protected $permissionsUpdate = ['admin.language.canManageLanguage'];
        
        /**
         * language editor object
@@ -43,7 +43,7 @@ class LanguageAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'setAsDefault', 'update');
+       protected $requireACP = ['create', 'delete', 'setAsDefault', 'update'];
        
        /**
         * Validates permission to set a language as default.
index ca2689653f8e8ca01d992dcd63e032244a59b117..264ba1d799949c4f8d1ce1d1098a9f1a0043c5ff 100644 (file)
@@ -46,13 +46,13 @@ class SetupLanguage extends Language {
                        $xml->load(TMP_DIR.'setup/lang/setup_'.$this->languageCode.'.xml');
                        
                        // get language items
-                       $categoriesToCache = array();
+                       $categoriesToCache = [];
                        $items = $xml->xpath()->query('/ns:language/ns:category/ns:item');
                        foreach ($items as $item) {
-                               $categoriesToCache[] = array(
+                               $categoriesToCache[] = [
                                        'name' => $item->getAttribute('name'),
                                        'cdata' => $item->nodeValue
-                               );
+                               ];
                        }
                        
                        // update language files here
index 76b08b1660fbd3277ab41079fb3227a478670dac..1c4ecc56f55d23e75ba33e8ac65b34dc0968a253 100644 (file)
@@ -21,20 +21,20 @@ class LanguageCategoryAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.language.canManageLanguage');
+       protected $permissionsCreate = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.language.canManageLanguage');
+       protected $permissionsDelete = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.language.canManageLanguage');
+       protected $permissionsUpdate = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update');
+       protected $requireACP = ['create', 'delete', 'update'];
 }
index cc7ffc304e54892bd2ab86caa04392e37aa6d3b4..7ef16cdabeccb0a4cd81616364e06bc5041bbe2b 100644 (file)
@@ -25,22 +25,22 @@ class LanguageItemAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.language.canManageLanguage');
+       protected $permissionsCreate = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.language.canManageLanguage');
+       protected $permissionsDelete = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.language.canManageLanguage');
+       protected $permissionsUpdate = ['admin.language.canManageLanguage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'edit', 'prepareEdit', 'update');
+       protected $requireACP = ['create', 'delete', 'edit', 'prepareEdit', 'update'];
        
        /**
         * Validates parameters to prepare edit.
@@ -61,14 +61,14 @@ class LanguageItemAction extends AbstractDatabaseObjectAction {
         */
        public function prepareEdit() {
                $item = reset($this->objects);
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'item' => $item
-               ));
+               ]);
                
-               return array(
+               return [
                        'languageItem' => $item->languageItem,
                        'template' => WCF::getTPL()->fetch('languageItemEditDialog')
-               );
+               ];
        }
        
        /**
@@ -96,15 +96,15 @@ class LanguageItemAction extends AbstractDatabaseObjectAction {
                // save item
                $editor = reset($this->objects);
                if ($editor->languageItemOriginIsSystem) {
-                       $updateData = array(
+                       $updateData = [
                                'languageCustomItemValue' => !$this->parameters['languageUseCustomValue'] && empty($this->parameters['languageCustomItemValue']) ? null : $this->parameters['languageCustomItemValue'],
                                'languageUseCustomValue' => ($this->parameters['languageUseCustomValue'] ? 1 : 0)
-                       );
+                       ];
                }
                else {
-                       $updateData = array(
+                       $updateData = [
                                'languageItemValue' => $this->parameters['languageItemValue']
-                       );
+                       ];
                }
                $editor->update($updateData);
                
index 69c38778a9806a5f85b3ca482a6705d4bd391ae7..56c6ab6be0064a4629f59bca1f3657c013d647ca 100644 (file)
@@ -59,16 +59,16 @@ class Like extends DatabaseObject {
                                AND objectID = ?
                                AND userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        $objectID,
                        $userID
-               ));
+               ]);
                
                $row = $statement->fetchArray();
                
                if (!$row) {
-                       $row = array();
+                       $row = [];
                }
                
                return new Like(null, $row);
index f1541cee312905c3873c113c98510216ac49b627..6a7898df838952ad6b4364583586b285ecb2b8e0 100644 (file)
@@ -28,7 +28,7 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getGroupedUserList', 'getLikeDetails', 'load');
+       protected $allowGuestAccess = ['getGroupedUserList', 'getLikeDetails', 'load'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$className
@@ -72,19 +72,19 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                        AND objectTypeID = ?
                        ORDER BY        time DESC";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->parameters['data']['objectID'],
                        $this->objectType->objectTypeID
-               ));
-               $data = array(
-                       Like::LIKE => array(),
-                       Like::DISLIKE => array()
-               );
+               ]);
+               $data = [
+                       Like::LIKE => [],
+                       Like::DISLIKE => []
+               ];
                while ($row = $statement->fetchArray()) {
                        $data[$row['likeValue']][] = $row['userID'];
                }
                
-               $values = array();
+               $values = [];
                if (!empty($data[Like::LIKE])) {
                        $values[Like::LIKE] = new GroupedUserList(WCF::getLanguage()->get('wcf.like.details.like'));
                        $values[Like::LIKE]->addUserIDs($data[Like::LIKE]);
@@ -97,14 +97,14 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                // load user profiles
                GroupedUserList::loadUsers();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'groupedUsers' => $values
-               ));
+               ]);
                
-               return array(
+               return [
                        'containerID' => $this->parameters['data']['containerID'],
                        'template' => WCF::getTPL()->fetch('groupedUserList')
-               );
+               ];
        }
        
        /**
@@ -166,12 +166,12 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                UserActivityEventHandler::getInstance()->fireEvent($this->objectType->objectType.'.recentActivityEvent', $this->parameters['data']['objectID'], $this->likeableObject->getLanguageID());
                        }
                        else {
-                               UserActivityEventHandler::getInstance()->removeEvents($this->objectType->objectType.'.recentActivityEvent', array($this->parameters['data']['objectID']));
+                               UserActivityEventHandler::getInstance()->removeEvents($this->objectType->objectType.'.recentActivityEvent', [$this->parameters['data']['objectID']]);
                        }
                }
                
                // get stats
-               return array(
+               return [
                        'likes' => ($likeData['data']['likes'] === null) ? 0 : $likeData['data']['likes'],
                        'dislikes' => ($likeData['data']['dislikes'] === null) ? 0 : $likeData['data']['dislikes'],
                        'cumulativeLikes' => ($likeData['data']['cumulativeLikes'] === null) ? 0 : $likeData['data']['cumulativeLikes'],
@@ -181,7 +181,7 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                        'newValue' => $likeData['newValue'],
                        'oldValue' => $likeData['oldValue'],
                        'users' => $likeData['users']
-               );
+               ];
        }
        
        /**
@@ -228,10 +228,10 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                        WHERE   objectID = ?
                                AND objectTypeID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->parameters['data']['objectID'],
                        $this->objectType->objectTypeID
-               ));
+               ]);
                $pageCount = ceil($statement->fetchColumn() / 20);
                
                $sql = "SELECT          userID, likeValue
@@ -240,19 +240,19 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                        AND objectTypeID = ?
                        ORDER BY        likeValue DESC, time DESC";
                $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
-               $statement->execute(array(
+               $statement->execute([
                        $this->parameters['data']['objectID'],
                        $this->objectType->objectTypeID
-               ));
-               $data = array(
-                       Like::LIKE => array(),
-                       Like::DISLIKE => array()
-               );
+               ]);
+               $data = [
+                       Like::LIKE => [],
+                       Like::DISLIKE => []
+               ];
                while ($row = $statement->fetchArray()) {
                        $data[$row['likeValue']][] = $row['userID'];
                }
                
-               $values = array();
+               $values = [];
                if (!empty($data[Like::LIKE])) {
                        $values[Like::LIKE] = new GroupedUserList(WCF::getLanguage()->get('wcf.like.details.like'));
                        $values[Like::LIKE]->addUserIDs($data[Like::LIKE]);
@@ -265,15 +265,15 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                // load user profiles
                GroupedUserList::loadUsers();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'groupedUsers' => $values
-               ));
+               ]);
                
-               return array(
+               return [
                        'containerID' => $this->parameters['data']['containerID'],
                        'pageCount' => $pageCount,
                        'template' => WCF::getTPL()->fetch('groupedUserList')
-               );
+               ];
        }
        
        /**
@@ -294,29 +294,29 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
        public function load() {
                $likeList = new ViewableLikeList();
                if ($this->parameters['lastLikeTime']) {
-                       $likeList->getConditionBuilder()->add("like_table.time < ?", array($this->parameters['lastLikeTime']));
+                       $likeList->getConditionBuilder()->add("like_table.time < ?", [$this->parameters['lastLikeTime']]);
                }
                if ($this->parameters['likeType'] == 'received') {
-                       $likeList->getConditionBuilder()->add("like_table.objectUserID = ?", array($this->parameters['userID']));
+                       $likeList->getConditionBuilder()->add("like_table.objectUserID = ?", [$this->parameters['userID']]);
                }
                else {
-                       $likeList->getConditionBuilder()->add("like_table.userID = ?", array($this->parameters['userID']));
+                       $likeList->getConditionBuilder()->add("like_table.userID = ?", [$this->parameters['userID']]);
                }
-               $likeList->getConditionBuilder()->add("like_table.likeValue = ?", array($this->parameters['likeValue']));
+               $likeList->getConditionBuilder()->add("like_table.likeValue = ?", [$this->parameters['likeValue']]);
                $likeList->readObjects();
                if (!count($likeList)) {
-                       return array();
+                       return [];
                }
                
                // parse template
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'likeList' => $likeList
-               ));
+               ]);
                
-               return array(
+               return [
                        'lastLikeTime' => $likeList->getLastLikeTime(),
                        'template' => WCF::getTPL()->fetch('userProfileLikeItem')
-               );
+               ];
        }
        
        /**
@@ -336,10 +336,10 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                        WHERE   objectTypeID = ?
                                AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $sourceObjectType->objectTypeID,
                        $this->parameters['sourceObjectID']
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                // no (dis-)likes at all
@@ -363,10 +363,10 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                        WHERE           objectTypeID = ?
                                        AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $sourceObjectType->objectTypeID,
                        $this->parameters['sourceObjectID']
-               ));
+               ]);
                
                //
                // step 3) update owner
@@ -379,22 +379,22 @@ class LikeAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                        AND objectID = ?
                                        AND likeValue = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $targetObjectType->objectTypeID,
                                $this->parameters['targetObjectID'],
                                Like::LIKE
-                       ));
+                       ]);
                        $count = $statement->fetchSingleColumn();
                        
                        if ($count) {
                                // update received likes
                                $userEditor = new UserEditor(new User($newLikeObject->objectUserID));
-                               $userEditor->updateCounters(array(
+                               $userEditor->updateCounters([
                                        'likesReceived' => $count
-                               ));
+                               ]);
                                
                                // add activity points
-                               UserActivityPointHandler::getInstance()->fireEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', array($newLikeObject->objectUserID => $count));
+                               UserActivityPointHandler::getInstance()->fireEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', [$newLikeObject->objectUserID => $count]);
                        }
                }
        }
index 4dc9a60fcd53ad803c1c5e0026b8aac40c050e15..a75c7adae2e0360b5c6cbedb7781b55dfe24b036 100644 (file)
@@ -46,17 +46,17 @@ class ViewableLikeList extends LikeList {
        public function readObjects() {
                parent::readObjects();
                
-               $userIDs = array();
-               $likeGroups = array();
+               $userIDs = [];
+               $likeGroups = [];
                foreach ($this->objects as &$like) {
                        $userIDs[] = $like->userID;
                        
                        if (!isset($likeGroups[$like->objectTypeID])) {
                                $objectType = ObjectTypeCache::getInstance()->getObjectType($like->objectTypeID);
-                               $likeGroups[$like->objectTypeID] = array(
+                               $likeGroups[$like->objectTypeID] = [
                                        'provider' => $objectType->getProcessor(),
-                                       'objects' => array()
-                               );
+                                       'objects' => []
+                               ];
                        }
                        
                        $likeGroups[$like->objectTypeID]['objects'][] = $like;
index 04321f9711e8fb6c6e2794183e679c4b914a1512..13125ae858d843d662d1f6702af0ba2603568a50 100644 (file)
@@ -45,7 +45,7 @@ class LikeObject extends DatabaseObject {
         * list of users who liked this object
         * @var User[]
         */
-       protected $users = array();
+       protected $users = [];
        
        /**
         * @inheritDoc
@@ -110,14 +110,14 @@ class LikeObject extends DatabaseObject {
                        WHERE   objectTypeID = ?
                                AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        $objectID
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                if (!$row) {
-                       $row = array();
+                       $row = [];
                }
                
                return new LikeObject(null, $row);
index cb4608a8be5432fa6e715d092a73613ede5516eb..110543abfed9d72d1a1574c62da5c03ef62bd011 100644 (file)
@@ -63,7 +63,7 @@ class MenuItemAction extends AbstractDatabaseObjectAction implements ISortableAc
         */
        public function toggle() {
                foreach ($this->objects as $object) {
-                       $object->update(array('isDisabled' => ($object->isDisabled) ? 0 : 1));
+                       $object->update(['isDisabled' => ($object->isDisabled) ? 0 : 1]);
                }
        }
        
index cc1b67919915db152d00cdd9dfa95101b7e0cf3f..7fab9127e0d9dab774a08ea3a7842ac7eb7fefd2 100644 (file)
@@ -123,7 +123,7 @@ class MenuItemNodeTree {
         * @return      MenuItemNode[]          nested menu item tree
         */
        protected function generateNodeTree($parentID = null, MenuItemNode $parentNode = null) {
-               $nodes = array();
+               $nodes = [];
                
                $itemIDs = (isset($this->menuItemStructure[$parentID]) ? $this->menuItemStructure[$parentID] : []);
                foreach ($itemIDs as $itemID) {
index 13646a7f54aa5ee10fe7292ebc045dc72876e01a..51579c5962ad85e7e99333ca5f92c8c48836e2fe 100644 (file)
@@ -70,13 +70,13 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                        $this->readObjects();
                }
                
-               $queueIDs = array();
+               $queueIDs = [];
                foreach ($this->objects as $queue) {
                        $queueIDs[] = $queue->queueID;
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("queueID IN (?)", array($queueIDs));
+               $conditions->add("queueID IN (?)", [$queueIDs]);
                
                $sql = "UPDATE  wcf".WCF_N."_moderation_queue
                        SET     status = ".ModerationQueue::STATUS_DONE."
@@ -92,7 +92,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
         * Validates parameters to fetch a list of outstanding queues.
         */
        public function validateGetOutstandingQueues() {
-               WCF::getSession()->checkPermissions(array('mod.general.canUseModeration'));
+               WCF::getSession()->checkPermissions(['mod.general.canUseModeration']);
        }
        
        /**
@@ -102,10 +102,10 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
         */
        public function getOutstandingQueues() {
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("moderation_queue_to_user.userID = ?", array(WCF::getUser()->userID));
-               $conditions->add("moderation_queue_to_user.isAffected = ?", array(1));
-               $conditions->add("moderation_queue.status IN (?)", array(array(ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING)));
-               $conditions->add("moderation_queue.time > ?", array(VisitTracker::getInstance()->getVisitTime('com.woltlab.wcf.moderation.queue')));
+               $conditions->add("moderation_queue_to_user.userID = ?", [WCF::getUser()->userID]);
+               $conditions->add("moderation_queue_to_user.isAffected = ?", [1]);
+               $conditions->add("moderation_queue.status IN (?)", [[ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING]]);
+               $conditions->add("moderation_queue.time > ?", [VisitTracker::getInstance()->getVisitTime('com.woltlab.wcf.moderation.queue')]);
                $conditions->add("(moderation_queue.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)");
                
                $sql = "SELECT          moderation_queue.queueID
@@ -120,10 +120,10 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                $statement->execute($conditions->getParameters());
                $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
-               $queues = array();
+               $queues = [];
                if (!empty($queueIDs)) {
                        $queueList = new ViewableModerationQueueList();
-                       $queueList->getConditionBuilder()->add("moderation_queue.queueID IN (?)", array($queueIDs));
+                       $queueList->getConditionBuilder()->add("moderation_queue.queueID IN (?)", [$queueIDs]);
                        $queueList->sqlOrderBy = "moderation_queue.lastChangeTime DESC";
                        $queueList->loadUserProfiles = true;
                        $queueList->readObjects();
@@ -138,8 +138,8 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                if ($count < 5) {
                        // load more entries to fill up list
                        $queueList = new ViewableModerationQueueList();
-                       $queueList->getConditionBuilder()->add("moderation_queue.status IN (?)", array(array(ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING)));
-                       if (!empty($queueIDs)) $queueList->getConditionBuilder()->add("moderation_queue.queueID NOT IN (?)", array($queueIDs));
+                       $queueList->getConditionBuilder()->add("moderation_queue.status IN (?)", [[ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING]]);
+                       if (!empty($queueIDs)) $queueList->getConditionBuilder()->add("moderation_queue.queueID NOT IN (?)", [$queueIDs]);
                        $queueList->sqlOrderBy = "moderation_queue.lastChangeTime DESC";
                        $queueList->sqlLimit = 5 - $count;
                        $queueList->loadUserProfiles = true;
@@ -150,7 +150,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                        
                        // check if stored count is out of sync
                        if ($count < $totalCount) {
-                               UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'outstandingModerationCount');
+                               UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'outstandingModerationCount');
                                
                                // check for orphaned queues
                                $queueCount = ModerationQueueManager::getInstance()->getUnreadModerationCount();
@@ -160,14 +160,14 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                        }
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'queues' => $queues
-               ));
+               ]);
                
-               return array(
+               return [
                        'template' => WCF::getTPL()->fetch('moderationQueueList'),
                        'totalCount' => $totalCount
-               );
+               ];
        }
        
        /**
@@ -190,14 +190,14 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
        public function getAssignUserForm() {
                $assignedUser = ($this->moderationQueueEditor->assignedUserID) ? new User($this->moderationQueueEditor->assignedUserID) : null;
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'assignedUser' => $assignedUser,
                        'queue' => $this->moderationQueueEditor
-               ));
+               ]);
                
-               return array(
+               return [
                        'template' => WCF::getTPL()->fetch('moderationQueueAssignUser')
-               );
+               ];
        }
        
        /**
@@ -242,7 +242,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
         * @return      string[]
         */
        public function assignUser() {
-               $data = array('assignedUserID' => ($this->parameters['assignedUserID'] ?: null));
+               $data = ['assignedUserID' => ($this->parameters['assignedUserID'] ?: null)];
                if ($this->user->userID) {
                        if ($this->moderationQueueEditor->status == ModerationQueue::STATUS_OUTSTANDING) {
                                $data['status'] = ModerationQueue::STATUS_PROCESSING;
@@ -259,7 +259,7 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                $username = ($this->user->userID) ? $this->user->username : WCF::getLanguage()->get('wcf.moderation.assignedUser.nobody');
                $link = '';
                if ($this->user->userID) {
-                       $link = LinkHandler::getInstance()->getLink('User', array('object' => $this->user));
+                       $link = LinkHandler::getInstance()->getLink('User', ['object' => $this->user]);
                }
                
                $newStatus = '';
@@ -267,12 +267,12 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                        $newStatus = ($data['status'] == ModerationQueue::STATUS_OUTSTANDING) ? 'outstanding' : 'processing';
                }
                
-               return array(
+               return [
                        'link' => $link,
                        'newStatus' => $newStatus,
                        'userID' => $this->user->userID,
                        'username' => $username
-               );
+               ];
        }
        
        /**
@@ -292,15 +292,15 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                }
                
                // reset storage
-               UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'unreadModerationCount');
+               UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'unreadModerationCount');
                
                if (count($this->objects) == 1) {
                        $queue = reset($this->objects);
                        
-                       return array(
+                       return [
                                'markAsRead' => $queue->queueID,
                                'totalCount' => ModerationQueueManager::getInstance()->getUnreadModerationCount(true)
-                       );
+                       ];
                }
        }
        
@@ -326,11 +326,11 @@ class ModerationQueueAction extends AbstractDatabaseObjectAction {
                VisitTracker::getInstance()->trackTypeVisit('com.woltlab.wcf.moderation.queue');
                
                // reset storage
-               UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'unreadModerationCount');
+               UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'unreadModerationCount');
                
-               return array(
+               return [
                        'markAllAsRead' => true
-               );
+               ];
        }
        
        /**
index 252b102685e298498b79fbd0cd8d663fd8e0f1d2..2b273a88366f890938738da5518991584297e97f 100644 (file)
@@ -17,7 +17,7 @@ class ModerationQueueActivationAction extends ModerationQueueAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('enableContent', 'removeContent');
+       protected $allowGuestAccess = ['enableContent', 'removeContent'];
        
        /**
         * moderation queue editor object
index aa6845cc11273fca23d05ac26a5025ba6b768868..fe2992b0d1ab2c13a8f40b5955fca588a61fd014 100644 (file)
@@ -20,7 +20,7 @@ class ModerationQueueReportAction extends ModerationQueueAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('prepareReport', 'removeContent', 'removeReport', 'report');
+       protected $allowGuestAccess = ['prepareReport', 'removeContent', 'removeReport', 'report'];
        
        /**
         * moderation queue editor object
@@ -68,7 +68,7 @@ class ModerationQueueReportAction extends ModerationQueueAction {
         * Validates parameters to prepare a report.
         */
        public function validatePrepareReport() {
-               WCF::getSession()->checkPermissions(array('user.profile.canReportContent'));
+               WCF::getSession()->checkPermissions(['user.profile.canReportContent']);
                
                $this->readInteger('objectID');
                $this->readString('objectType');
@@ -95,22 +95,22 @@ class ModerationQueueReportAction extends ModerationQueueAction {
                // content was already reported
                $alreadyReported = (ModerationQueueReportManager::getInstance()->hasPendingReport($this->parameters['objectType'], $this->parameters['objectID'])) ? 1 : 0;
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'alreadyReported' => $alreadyReported,
                        'object' => ModerationQueueReportManager::getInstance()->getReportedObject($this->parameters['objectType'], $this->parameters['objectID'])
-               ));
+               ]);
                
-               return array(
+               return [
                        'alreadyReported' => $alreadyReported,
                        'template' => WCF::getTPL()->fetch('moderationReportDialog')
-               );
+               ];
        }
        
        /**
         * Validates parameters for reporting.
         */
        public function validateReport() {
-               WCF::getSession()->checkPermissions(array('user.profile.canReportContent'));
+               WCF::getSession()->checkPermissions(['user.profile.canReportContent']);
                
                $this->readString('message');
                if (mb_strlen($this->parameters['message']) > 64000) {
@@ -135,8 +135,8 @@ class ModerationQueueReportAction extends ModerationQueueAction {
                        );
                }
                
-               return array(
+               return [
                        'reported' => 1
-               );
+               ];
        }
 }
index 9299a34dc68990a0155c9422cac1a0af4184b3a1..5939c6509b42a4b95bb19205fe2fa3090aa5b14b 100644 (file)
@@ -57,7 +57,7 @@ class ModificationLog extends DatabaseObject {
                
                $this->data['additionalData'] = @unserialize($this->data['additionalData']);
                if (!is_array($this->data['additionalData'])) {
-                       $this->data['additionalData'] = array();
+                       $this->data['additionalData'] = [];
                }
        }
 }
index 0bb31b5f451588beb1d6b900ec228be2af102de3..db25179adcfe41c90ee0adf79e65c36aeb842c59 100644 (file)
@@ -96,11 +96,11 @@ class Notice extends DatabaseObject implements IRouteController {
                                                FROM    wcf".WCF_N."_notice_dismissed
                                                WHERE   userID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                WCF::getUser()->userID
-                                       ));
+                                       ]);
                                        
-                                       $noticeIDs = array();
+                                       $noticeIDs = [];
                                        while ($noticeID = $statement->fetchColumn()) {
                                                $noticeIDs[] = $noticeID;
                                                
index aa6179dd6936cbab9c6efdb7afcaae1bd4dbe82d..bd675464bcf9d539082a2d899b0e0d5c663741cb 100644 (file)
@@ -22,22 +22,22 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('dismiss');
+       protected $allowGuestAccess = ['dismiss'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.notice.canManageNotice');
+       protected $permissionsDelete = ['admin.notice.canManageNotice'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.notice.canManageNotice');
+       protected $permissionsUpdate = ['admin.notice.canManageNotice'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'toggle', 'update', 'updatePosition');
+       protected $requireACP = ['create', 'delete', 'toggle', 'update', 'updatePosition'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::create()
@@ -76,12 +76,12 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi
                                                        (noticeID, userID)
                                VALUES                  (?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                reset($this->objectIDs),
                                WCF::getUser()->userID
-                       ));
+                       ]);
                        
-                       UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'dismissedNotices');
+                       UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'dismissedNotices');
                }
                else {
                        $dismissedNotices = WCF::getSession()->getVar('dismissedNotices');
@@ -90,17 +90,17 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi
                                $dismissedNotices[] = reset($this->objectIDs);
                        }
                        else {
-                               $dismissedNotices = array(
+                               $dismissedNotices = [
                                        reset($this->objectIDs)
-                               );
+                               ];
                        }
                        
                        WCF::getSession()->register('dismissedNotices', serialize($dismissedNotices));
                }
                
-               return array(
+               return [
                        'noticeID' => reset($this->objectIDs)
-               );
+               ];
        }
        
        /**
@@ -108,9 +108,9 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi
         */
        public function toggle() {
                foreach ($this->objects as $notice) {
-                       $notice->update(array(
+                       $notice->update([
                                'isDisabled' => $notice->isDisabled ? 0 : 1
-                       ));
+                       ]);
                }
        }
        
@@ -170,10 +170,10 @@ class NoticeAction extends AbstractDatabaseObjectAction implements ISortableActi
                $showOrder = $this->parameters['data']['offset'];
                WCF::getDB()->beginTransaction();
                foreach ($this->parameters['data']['structure'][0] as $noticeID) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $showOrder++,
                                $noticeID
-                       ));
+                       ]);
                }
                WCF::getDB()->commitTransaction();
        }
index e43c23518870724495bb6666d51885b75547161b..dd941fca85ee499cc068d1e84104141672589fab 100644 (file)
@@ -46,14 +46,14 @@ abstract class AbstractObjectTypeProvider implements IObjectTypeProvider {
         * @see \wcf\data\object\type\IObjectTypeProvider::getObjectsByIDs()
         */
        public function getObjectsByIDs(array $objectIDs) {
-               $tableAlias = call_user_func(array($this->className, 'getDatabaseTableAlias'));
-               $tableIndex = call_user_func(array($this->className, 'getDatabaseTableIndexName'));
+               $tableAlias = call_user_func([$this->className, 'getDatabaseTableAlias']);
+               $tableIndex = call_user_func([$this->className, 'getDatabaseTableIndexName']);
                
                $objectList = new $this->listClassName();
                if ($this->decoratorClassName) {
                        $objectList->decoratorClassName = $this->decoratorClassName;
                }
-               $objectList->getConditionBuilder()->add($tableAlias.".".$tableIndex." IN (?)", array($objectIDs));
+               $objectList->getConditionBuilder()->add($tableAlias.".".$tableIndex." IN (?)", [$objectIDs]);
                $objectList->readObjects();
                
                return $objectList->getObjects();
index 59ca7255cfdb38342f2105eb6f1ea2e0fec86528..893fc669583c4ef0917755ed693f5e87dd0c751b 100644 (file)
@@ -19,46 +19,46 @@ class ObjectTypeCache extends SingletonFactory {
         * object type definitions
         * @var ObjectTypeDefinition[]
         */
-       protected $definitions = array();
+       protected $definitions = [];
        
        /**
         * object type definition ids grouped by category name
         * @var integer[][]
         */
-       protected $definitionsByCategory = array();
+       protected $definitionsByCategory = [];
        
        /**
         * object type definitions sorted by name
         * @var ObjectTypeDefinition[]
         */
-       protected $definitionsByName = array();
+       protected $definitionsByName = [];
        
        /**
         * object types
         * @var ObjectType[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * object types grouped by definition
         * @var array
         */
-       protected $groupedObjectTypes = array();
+       protected $groupedObjectTypes = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
         */
        protected function init() {
                // get definition cache
-               $this->definitionsByCategory = ObjectTypeCacheBuilder::getInstance()->getData(array(), 'categories');
-               $this->definitions = ObjectTypeCacheBuilder::getInstance()->getData(array(), 'definitions');
+               $this->definitionsByCategory = ObjectTypeCacheBuilder::getInstance()->getData([], 'categories');
+               $this->definitions = ObjectTypeCacheBuilder::getInstance()->getData([], 'definitions');
                foreach ($this->definitions as $definition) {
                        $this->definitionsByName[$definition->definitionName] = $definition;
                }
                
                // get object type cache
-               $this->objectTypes = ObjectTypeCacheBuilder::getInstance()->getData(array(), 'objectTypes');
-               $this->groupedObjectTypes = ObjectTypeCacheBuilder::getInstance()->getData(array(), 'groupedObjectTypes');
+               $this->objectTypes = ObjectTypeCacheBuilder::getInstance()->getData([], 'objectTypes');
+               $this->groupedObjectTypes = ObjectTypeCacheBuilder::getInstance()->getData([], 'groupedObjectTypes');
        }
        
        /**
@@ -100,7 +100,7 @@ class ObjectTypeCache extends SingletonFactory {
         */
        public function getDefinitionsByCategory($categoryName) {
                if (isset($this->definitionsByCategory[$categoryName])) {
-                       $definitions = array();
+                       $definitions = [];
                        foreach ($this->definitionsByCategory[$categoryName] as $definitionID) {
                                $definitions[$definitionID] = $this->getDefinition($definitionID);
                        }
@@ -137,7 +137,7 @@ class ObjectTypeCache extends SingletonFactory {
                        return $this->groupedObjectTypes[$definitionName];
                }
                
-               return array();
+               return [];
        }
        
        /**
index 802f39ae6934fe611b501754b2bb5c12ebcbe713..563b0e41e073470523e1f7be278536bfe4a45928 100644 (file)
@@ -70,7 +70,7 @@ class Option extends DatabaseObject {
                parent::handleData($data);
                
                // unserialize additional data
-               $this->data['additionalData'] = (empty($data['additionalData']) ? array() : @unserialize($data['additionalData']));
+               $this->data['additionalData'] = (empty($data['additionalData']) ? [] : @unserialize($data['additionalData']));
        }
        
        /**
@@ -84,7 +84,7 @@ class Option extends DatabaseObject {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
                
-               $options = array();
+               $options = [];
                while ($row = $statement->fetchArray()) {
                        $option = new Option(null, $row);
                        $options[$option->getConstantName()] = $option;
@@ -117,10 +117,10 @@ class Option extends DatabaseObject {
                        }
                }
                
-               return array(
+               return [
                        'disableOptions' => $disableOptions,
                        'enableOptions' => $enableOptions
-               );
+               ];
        }
        
        /**
@@ -129,7 +129,7 @@ class Option extends DatabaseObject {
         * @return      array
         */
        public function parseSelectOptions() {
-               $result = array();
+               $result = [];
                $options = explode("\n", StringUtil::trim(StringUtil::unifyNewlines($this->selectOptions)));
                foreach ($options as $option) {
                        $key = $value = $option;
@@ -151,7 +151,7 @@ class Option extends DatabaseObject {
         * @return      array
         */
        public function parseMultipleEnableOptions() {
-               $result = array();
+               $result = [];
                if (!empty($this->enableOptions)) {
                        $options = explode("\n", StringUtil::trim(StringUtil::unifyNewlines($this->enableOptions)));
                        $key = -1;
index 375678816c80b16e3835d5f1d330c4c422a7e0bb..dd303be0dfe5f080b0e29cdec7b235013dbdafb2 100644 (file)
@@ -21,22 +21,22 @@ class OptionAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.configuration.canEditOption');
+       protected $permissionsCreate = ['admin.configuration.canEditOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.configuration.canEditOption');
+       protected $permissionsDelete = ['admin.configuration.canEditOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.configuration.canEditOption');
+       protected $permissionsUpdate = ['admin.configuration.canEditOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'import', 'update', 'updateAll');
+       protected $requireACP = ['create', 'delete', 'import', 'update', 'updateAll'];
        
        /**
         * Validates permissions and parameters.
@@ -57,7 +57,7 @@ class OptionAction extends AbstractDatabaseObjectAction {
         */
        public function import() {
                // create data
-               call_user_func(array($this->className, 'import'), $this->parameters['data']);
+               call_user_func([$this->className, 'import'], $this->parameters['data']);
        }
        
        /**
@@ -65,6 +65,6 @@ class OptionAction extends AbstractDatabaseObjectAction {
         */
        public function updateAll() {
                // create data
-               call_user_func(array($this->className, 'updateAll'), $this->parameters['data']);
+               call_user_func([$this->className, 'updateAll'], $this->parameters['data']);
        }
 }
index fdad3caf743b08995752dbc24d1b76b2f65c8d1a..d7ac94bffd48c7dfef07782b695d49c2a178de0d 100644 (file)
@@ -21,20 +21,20 @@ class OptionCategoryAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.configuration.canEditOption');
+       protected $permissionsCreate = ['admin.configuration.canEditOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.configuration.canEditOption');
+       protected $permissionsDelete = ['admin.configuration.canEditOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.configuration.canEditOption');
+       protected $permissionsUpdate = ['admin.configuration.canEditOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update');
+       protected $requireACP = ['create', 'delete', 'update'];
 }
index a2217e94771c8a543bc6fd0807ce0099aee11ee4..f4517133324cae3b9405bfc27f07f40331ec12f6 100644 (file)
@@ -138,7 +138,7 @@ class Package extends DatabaseObject {
                if ($this->requiredPackages === null) {
                        self::loadRequirements();
                        
-                       $this->requiredPackages = array();
+                       $this->requiredPackages = [];
                        if (isset(self::$requirements[$this->packageID])) {
                                foreach (self::$requirements[$this->packageID] as $packageID) {
                                        $this->requiredPackages[$packageID] = PackageCache::getInstance()->getPackage($packageID);
@@ -181,7 +181,7 @@ class Package extends DatabaseObject {
                if ($this->dependentPackages === null) {
                        self::loadRequirements();
                        
-                       $this->dependentPackages = array();
+                       $this->dependentPackages = [];
                        foreach (self::$requirements as $packageID => $requiredPackageIDs) {
                                if (in_array($this->packageID, $requiredPackageIDs)) {
                                        $this->dependentPackages[$packageID] = PackageCache::getInstance()->getPackage($packageID);
@@ -213,11 +213,11 @@ class Package extends DatabaseObject {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute();
                        
-                       self::$requiredPackageIDs = array();
-                       self::$requirements = array();
+                       self::$requiredPackageIDs = [];
+                       self::$requirements = [];
                        while ($row = $statement->fetchArray()) {
                                if (!isset(self::$requirements[$row['packageID']])) {
-                                       self::$requirements[$row['packageID']] = array();
+                                       self::$requirements[$row['packageID']] = [];
                                }
                                
                                self::$requirements[$row['packageID']][] = $row['requirement'];
@@ -240,7 +240,7 @@ class Package extends DatabaseObject {
                        FROM    wcf".WCF_N."_package
                        WHERE   package = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($package));
+               $statement->execute([$package]);
                
                return $statement->fetchSingleColumn() > 0;
        }
index cbe01d7c1d51f60cef7503a71c54786bf3faace1..92e20f6a5b5eb45940f7390ee36738fa6ea8190e 100644 (file)
@@ -28,35 +28,35 @@ class PackageAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.configuration.package.canInstallPackage');
+       protected $permissionsCreate = ['admin.configuration.package.canInstallPackage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.configuration.package.canUninstallPackage');
+       protected $permissionsDelete = ['admin.configuration.package.canUninstallPackage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.configuration.package.canUpdatePackage');
+       protected $permissionsUpdate = ['admin.configuration.package.canUpdatePackage'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('searchForPurchasedItems');
+       protected $requireACP = ['searchForPurchasedItems'];
        
        /**
         * Validates parameters to search for purchased items in the WoltLab Plugin-Store.
         */
        public function validateSearchForPurchasedItems() {
-               WCF::getSession()->checkPermissions(array('admin.configuration.package.canInstallPackage', 'admin.configuration.package.canUpdatePackage'));
+               WCF::getSession()->checkPermissions(['admin.configuration.package.canInstallPackage', 'admin.configuration.package.canUpdatePackage']);
                
                $this->readString('password', true);
                $this->readString('username', true);
                
                if (empty($this->parameters['username'])) {
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("serverURL IN (?)", array(array('http://store.woltlab.com/maelstrom/', 'http://store.woltlab.com/typhoon/')));
+                       $conditions->add("serverURL IN (?)", [['http://store.woltlab.com/maelstrom/', 'http://store.woltlab.com/typhoon/']]);
                        $conditions->add("loginUsername <> ''");
                        $conditions->add("loginPassword <> ''");
                        
@@ -82,24 +82,24 @@ class PackageAction extends AbstractDatabaseObjectAction {
         */
        public function searchForPurchasedItems() {
                if (!RemoteFile::supportsSSL()) {
-                       return array(
+                       return [
                                'noSSL' => WCF::getLanguage()->get('wcf.acp.pluginStore.api.noSSL')
-                       );
+                       ];
                }
                
                if (empty($this->parameters['username']) || empty($this->parameters['password'])) {
-                       return array(
+                       return [
                                'template' => $this->renderAuthorizationDialog(false)
-                       );
+                       ];
                }
                
-               $request = new HTTPRequest('https://api.woltlab.com/1.0/customer/purchases/list.json', array(
+               $request = new HTTPRequest('https://api.woltlab.com/1.0/customer/purchases/list.json', [
                        'method' => 'POST'
-               ), array(
+               ], [
                        'username' => $this->parameters['username'],
                        'password' => $this->parameters['password'],
                        'wcfVersion' => WCF_VERSION
-               ));
+               ]);
                
                $request->execute();
                $reply = $request->getReply();
@@ -109,30 +109,30 @@ class PackageAction extends AbstractDatabaseObjectAction {
                switch ($code) {
                        case 200:
                                if (empty($response['products'])) {
-                                       return array(
+                                       return [
                                                'noResults' => WCF::getLanguage()->get('wcf.acp.pluginStore.purchasedItems.noResults')
-                                       );
+                                       ];
                                }
                                else {
                                        WCF::getSession()->register('__pluginStoreProducts', $response['products']);
                                        WCF::getSession()->register('__pluginStoreWcfMajorReleases', $response['wcfMajorReleases']);
                                        
-                                       return array(
+                                       return [
                                                'redirectURL' => LinkHandler::getInstance()->getLink('PluginStorePurchasedItems')
-                                       );
+                                       ];
                                }
                        break;
                        
                        // authentication error
                        case 401:
-                               return array(
+                               return [
                                        'template' => $this->renderAuthorizationDialog(true)
-                               );
+                               ];
                        break;
                        
                        // any other kind of errors
                        default:
-                               throw new SystemException(WCF::getLanguage()->getDynamicVariable('wcf.acp.pluginStore.api.error', array('status' => $code)));
+                               throw new SystemException(WCF::getLanguage()->getDynamicVariable('wcf.acp.pluginStore.api.error', ['status' => $code]));
                        break;
                }
        }
@@ -144,9 +144,9 @@ class PackageAction extends AbstractDatabaseObjectAction {
         * @return      string
         */
        protected function renderAuthorizationDialog($rejected) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'rejected' => $rejected
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('pluginStoreAuthorization');
        }
index 7ff190f157ae10855527943c52f6932b6481fd28..1457477f3592b91bf341ee71e564ff8cc4e81518 100644 (file)
@@ -18,7 +18,7 @@ class PackageCache extends SingletonFactory {
         * list of cached packages
         * @var mixed[][]
         */
-       protected $packages = array();
+       protected $packages = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
index 0849eb0b601aa7b9db657e2dc5cd280dbc2e404f..caef4db76dab0c372914bff63db57c94e403a53a 100644 (file)
@@ -38,7 +38,7 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('cancelInstallation', 'prepareQueue');
+       protected $requireACP = ['cancelInstallation', 'prepareQueue'];
        
        /**
         * Validates the 'prepareQueue' action:
@@ -51,7 +51,7 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction {
                        throw new UserInputException('packageID');
                }
                
-               if (!isset($this->parameters['action']) || !in_array($this->parameters['action'], array('install', 'update', 'uninstall', 'rollback'))) {
+               if (!isset($this->parameters['action']) || !in_array($this->parameters['action'], ['install', 'update', 'uninstall', 'rollback'])) {
                        throw new UserInputException('action');
                }
        }
@@ -64,7 +64,7 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction {
        public function prepareQueue() {
                $processNo = PackageInstallationQueue::getNewProcessNo();
                
-               $queue = PackageInstallationQueueEditor::create(array(
+               $queue = PackageInstallationQueueEditor::create([
                        'processNo' => $processNo,
                        'userID' => WCF::getUser()->userID,
                        'package' => $this->package->package,
@@ -72,11 +72,11 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction {
                        'packageID' => $this->package->packageID,
                        'action' => $this->parameters['action'],
                        'installationType' => 'other'
-               ));
+               ]);
                
-               return array(
+               return [
                        'queueID' => $queue->queueID
-               );
+               ];
        }
        
        /**
@@ -84,7 +84,7 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction {
         */
        public function validateCancelInstallation() {
                // check permissions
-               WCF::getSession()->checkPermissions(array('admin.configuration.package.canInstallPackage'));
+               WCF::getSession()->checkPermissions(['admin.configuration.package.canInstallPackage']);
                
                // validate queue
                $this->queue = $this->getSingleObject();
@@ -105,8 +105,8 @@ class PackageInstallationQueueAction extends AbstractDatabaseObjectAction {
                
                $this->queue->delete();
                
-               return array(
+               return [
                        'url' => LinkHandler::getInstance()->getLink('PackageList')
-               );
+               ];
        }
 }
index cb15636cb78df604a4bfa48a865e70ff5c1e3c31..26b39cb87a29828910e80091fee383c583544206 100644 (file)
@@ -35,7 +35,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('getResultList', 'prepareInstallation', 'prepareUpdate', 'search', 'searchForUpdates');
+       protected $requireACP = ['getResultList', 'prepareInstallation', 'prepareUpdate', 'search', 'searchForUpdates'];
        
        /**
         * search object
@@ -47,7 +47,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
         * Validates parameters to search for installable packages.
         */
        public function validateSearch() {
-               WCF::getSession()->checkPermissions(array('admin.configuration.package.canInstallPackage'));
+               WCF::getSession()->checkPermissions(['admin.configuration.package.canInstallPackage']);
                
                $this->readString('package', true);
                $this->readString('packageDescription', true);
@@ -70,28 +70,28 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                
                // there are no available package update servers
                if (empty($availableUpdateServers)) {
-                       WCF::getTPL()->assign(array(
-                               'packageUpdates' => array()
-                       ));
+                       WCF::getTPL()->assign([
+                               'packageUpdates' => []
+                       ]);
                        
-                       return array(
+                       return [
                                'count' => 0,
                                'pageCount' => 0,
                                'searchID' => 0,
                                'template' => WCF::getTPL()->fetch('packageSearchResultList')
-                       );
+                       ];
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("package_update.packageUpdateServerID IN (?)", array(array_keys($availableUpdateServers)));
+               $conditions->add("package_update.packageUpdateServerID IN (?)", [array_keys($availableUpdateServers)]);
                if (!empty($this->parameters['package'])) {
-                       $conditions->add("package_update.package LIKE ?", array('%'.$this->parameters['package'].'%'));
+                       $conditions->add("package_update.package LIKE ?", ['%'.$this->parameters['package'].'%']);
                }
                if (!empty($this->parameters['packageDescription'])) {
-                       $conditions->add("package_update.packageDescription LIKE ?", array('%'.$this->parameters['packageDescription'].'%'));
+                       $conditions->add("package_update.packageDescription LIKE ?", ['%'.$this->parameters['packageDescription'].'%']);
                }
                if (!empty($this->parameters['packageName'])) {
-                       $conditions->add("package_update.packageName LIKE ?", array('%'.$this->parameters['packageName'].'%'));
+                       $conditions->add("package_update.packageName LIKE ?", ['%'.$this->parameters['packageName'].'%']);
                }
                $conditions->add("package.packageID IS NULL");
                
@@ -104,23 +104,23 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        ORDER BY        package_update.packageName ASC";
                $statement = WCF::getDB()->prepareStatement($sql, 1000);
                $statement->execute($conditions->getParameters());
-               $packageUpdateIDs = array();
+               $packageUpdateIDs = [];
                while ($row = $statement->fetchArray()) {
                        $packageUpdateIDs[] = $row['packageUpdateID'];
                }
                
                // no matches found
                if (empty($packageUpdateIDs)) {
-                       WCF::getTPL()->assign(array(
-                               'packageUpdates' => array()
-                       ));
+                       WCF::getTPL()->assign([
+                               'packageUpdates' => []
+                       ]);
                        
-                       return array(
+                       return [
                                'count' => 0,
                                'pageCount' => 0,
                                'searchID' => 0,
                                'template' => WCF::getTPL()->fetch('packageSearchResultList')
-                       );
+                       ];
                }
                
                // get excluded packages
@@ -128,7 +128,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        FROM    wcf".WCF_N."_package_update_exclusion";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
-               $excludedPackages = array();
+               $excludedPackages = [];
                while ($row = $statement->fetchArray()) {
                        $package = $row['excludedPackage'];
                        $packageVersion = $row['excludedPackageVersion'];
@@ -147,14 +147,14 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        FROM    wcf".WCF_N."_package";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
-               $installedPackages = array();
+               $installedPackages = [];
                while ($row = $statement->fetchArray()) {
                        $installedPackages[$row['package']] = $row['packageVersion'];
                }
                
                // filter by version
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("puv.packageUpdateID IN (?)", array($packageUpdateIDs));
+               $conditions->add("puv.packageUpdateID IN (?)", [$packageUpdateIDs]);
                $sql = "SELECT          pu.package, puv.packageUpdateVersionID, puv.packageUpdateID, puv.packageVersion, puv.isAccessible
                        FROM            wcf".WCF_N."_package_update_version puv
                        LEFT JOIN       wcf".WCF_N."_package_update pu
@@ -162,7 +162,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $packageVersions = array();
+               $packageVersions = [];
                while ($row = $statement->fetchArray()) {
                        $package = $row['package'];
                        $packageVersion = $row['packageVersion'];
@@ -185,15 +185,15 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        }
                        
                        if (!isset($packageVersions[$package])) {
-                               $packageVersions[$package] = array();
+                               $packageVersions[$package] = [];
                        }
                        
                        $packageUpdateID = $row['packageUpdateID'];
                        if (!isset($packageVersions[$package][$packageUpdateID])) {
-                               $packageVersions[$package][$packageUpdateID] = array(
-                                       'accessible' => array(),
-                                       'existing' => array()
-                               );
+                               $packageVersions[$package][$packageUpdateID] = [
+                                       'accessible' => [],
+                                       'existing' => []
+                               ];
                        }
                        
                        if ($row['isAccessible']) {
@@ -204,22 +204,22 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                
                // all found versions are excluded
                if (empty($packageVersions)) {
-                       WCF::getTPL()->assign(array(
-                               'packageUpdates' => array()
-                       ));
+                       WCF::getTPL()->assign([
+                               'packageUpdates' => []
+                       ]);
                        
-                       return array(
+                       return [
                                'count' => 0,
                                'pageCount' => 0,
                                'searchID' => 0,
                                'template' => WCF::getTPL()->fetch('packageSearchResultList')
-                       );
+                       ];
                }
                
                // determine highest versions
-               $packageUpdates = array();
+               $packageUpdates = [];
                foreach ($packageVersions as $package => $versionData) {
-                       $accessible = $existing = $versions = array();
+                       $accessible = $existing = $versions = [];
                        
                        foreach ($versionData as $packageUpdateID => $versionTypes) {
                                // ignore unaccessible packages
@@ -227,8 +227,8 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                                        continue;
                                }
                                
-                               uasort($versionTypes['accessible'], array('wcf\data\package\Package', 'compareVersion'));
-                               uasort($versionTypes['existing'], array('wcf\data\package\Package', 'compareVersion'));
+                               uasort($versionTypes['accessible'], ['wcf\data\package\Package', 'compareVersion']);
+                               uasort($versionTypes['existing'], ['wcf\data\package\Package', 'compareVersion']);
                                
                                $accessibleVersion = array_slice($versionTypes['accessible'], -1, 1, true);
                                $existingVersion = array_slice($versionTypes['existing'], -1, 1, true);
@@ -249,43 +249,43 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                                continue;
                        }
                        
-                       uksort($accessible, array('wcf\data\package\Package', 'compareVersion'));
-                       uksort($existing, array('wcf\data\package\Package', 'compareVersion'));
+                       uksort($accessible, ['wcf\data\package\Package', 'compareVersion']);
+                       uksort($existing, ['wcf\data\package\Package', 'compareVersion']);
                        
                        $accessible = array_pop($accessible);
                        $existing = array_pop($existing);
-                       $packageUpdates[$versions[$accessible]] = array(
+                       $packageUpdates[$versions[$accessible]] = [
                                'accessible' => $accessible,
                                'existing' => $existing
-                       );
+                       ];
                }
                
                // no found packages is accessible
                if (empty($packageUpdates)) {
-                       WCF::getTPL()->assign(array(
-                               'packageUpdates' => array()
-                       ));
+                       WCF::getTPL()->assign([
+                               'packageUpdates' => []
+                       ]);
                        
-                       return array(
+                       return [
                                'count' => 0,
                                'pageCount' => 0,
                                'searchID' => 0,
                                'template' => WCF::getTPL()->fetch('packageSearchResultList')
-                       );
+                       ];
                }
                
-               $search = SearchEditor::create(array(
+               $search = SearchEditor::create([
                        'userID' => WCF::getUser()->userID,
                        'searchData' => serialize($packageUpdates),
                        'searchTime' => TIME_NOW,
                        'searchType' => 'acpPackageSearch'
-               ));
+               ]);
                
                // forward call to build the actual result list
-               $updateAction = new PackageUpdateAction(array(), 'getResultList', array(
+               $updateAction = new PackageUpdateAction([], 'getResultList', [
                        'pageNo' => 1,
                        'search' => $search
-               ));
+               ]);
                
                $returnValues = $updateAction->executeAction();
                return $returnValues['returnValues'];
@@ -295,7 +295,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
         * Validates parameters to return a result list for a previous search.
         */
        public function validateGetResultList() {
-               WCF::getSession()->checkPermissions(array('admin.configuration.package.canInstallPackage'));
+               WCF::getSession()->checkPermissions(['admin.configuration.package.canInstallPackage']);
                
                $this->readInteger('pageNo');
                $this->readInteger('searchID');
@@ -319,14 +319,14 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                
                // get package updates
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("packageUpdateID IN (?)", array(array_keys($updateData)));
+               $conditions->add("packageUpdateID IN (?)", [array_keys($updateData)]);
                
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_package_update
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
                $statement->execute($conditions->getParameters());
-               $packageUpdates = $packageVersionIDs = array();
+               $packageUpdates = $packageVersionIDs = [];
                while ($packageUpdate = $statement->fetchObject('wcf\data\package\update\PackageUpdate')) {
                        $packageUpdates[$packageUpdate->packageUpdateID] = new ViewablePackageUpdate($packageUpdate);
                        
@@ -338,14 +338,14 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                
                // read update versions
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("packageUpdateVersionID IN (?)", array($packageVersionIDs));
+               $conditions->add("packageUpdateVersionID IN (?)", [$packageVersionIDs]);
                
                $sql = "SELECT  packageUpdateVersionID, packageVersion, packageDate, license, licenseURL
                        FROM    wcf".WCF_N."_package_update_version
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $updateVersions = array();
+               $updateVersions = [];
                while ($updateVersion = $statement->fetchObject('wcf\data\package\update\version\PackageUpdateVersion')) {
                        $updateVersions[$updateVersion->packageUpdateVersionID] = $updateVersion;
                }
@@ -357,24 +357,24 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        $packageUpdate->setLatestVersion($updateVersions[$versionIDs['existing']]);
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'packageUpdates' => $packageUpdates
-               ));
+               ]);
                
                $count = count($updateData);
-               return array(
+               return [
                        'count' => $count,
                        'pageCount' => ceil($count / 20),
                        'searchID' => $this->search->searchID,
                        'template' => WCF::getTPL()->fetch('packageSearchResultList')
-               );
+               ];
        }
        
        /**
         * Validates permissions to search for updates.
         */
        public function validateSearchForUpdates() {
-               WCF::getSession()->checkPermissions(array('admin.configuration.package.canUpdatePackage'));
+               WCF::getSession()->checkPermissions(['admin.configuration.package.canUpdatePackage']);
                
                $this->readBoolean('ignoreCache', true);
        }
@@ -385,7 +385,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
         * @return      array
         */
        public function searchForUpdates() {
-               PackageUpdateDispatcher::getInstance()->refreshPackageDatabase(array(), $this->parameters['ignoreCache']);
+               PackageUpdateDispatcher::getInstance()->refreshPackageDatabase([], $this->parameters['ignoreCache']);
                
                $updates = PackageUpdateDispatcher::getInstance()->getAvailableUpdates();
                $url = '';
@@ -393,16 +393,16 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        $url = LinkHandler::getInstance()->getLink('PackageUpdate');
                }
                
-               return array(
+               return [
                        'url' => $url
-               );
+               ];
        }
        
        /**
         * Validates parameters to perform a system update.
         */
        public function validatePrepareUpdate() {
-               WCF::getSession()->checkPermissions(array('admin.configuration.package.canUpdatePackage'));
+               WCF::getSession()->checkPermissions(['admin.configuration.package.canUpdatePackage']);
                
                if (!isset($this->parameters['packages']) || !is_array($this->parameters['packages'])) {
                        throw new UserInputException('packages');
@@ -453,7 +453,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
         * Validates parameters to prepare a package installation.
         */
        public function validatePrepareInstallation() {
-               WCF::getSession()->checkPermissions(array('admin.configuration.package.canInstallPackage'));
+               WCF::getSession()->checkPermissions(['admin.configuration.package.canInstallPackage']);
                
                if (!isset($this->parameters['packages']) || !is_array($this->parameters['packages']) || count($this->parameters['packages']) != 1) {
                        throw new UserInputException('packages');
@@ -497,9 +497,9 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        $scheduler->buildPackageInstallationStack(($queueType == 'install'));
                }
                catch (PackageUpdateUnauthorizedException $e) {
-                       return array(
+                       return [
                                'template' => $e->getRenderedTemplate()
-                       );
+                       ];
                }
                
                // validate exclusions
@@ -507,10 +507,10 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        $excludedPackages = $scheduler->getExcludedPackages();
                        
                        if (!empty($excludedPackages)) {
-                               return array(
+                               return [
                                        'excludedPackages' => true,
-                                       'template' => WCF::getTPL()->fetch('packageUpdateExcludedPackages', 'wcf', array('excludedPackages' => $excludedPackages))
-                               );
+                                       'template' => WCF::getTPL()->fetch('packageUpdateExcludedPackages', 'wcf', ['excludedPackages' => $excludedPackages])
+                               ];
                        }
                }
                
@@ -520,7 +520,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        $parentQueueID = 0;
                        $processNo = PackageInstallationQueue::getNewProcessNo();
                        foreach ($stack as $package) {
-                               $queue = PackageInstallationQueueEditor::create(array(
+                               $queue = PackageInstallationQueueEditor::create([
                                        'parentQueueID' => $parentQueueID,
                                        'processNo' => $processNo,
                                        'userID' => WCF::getUser()->userID,
@@ -529,7 +529,7 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                                        'packageID' => ($package['packageID'] ?: null),
                                        'archive' => $package['archive'],
                                        'action' => $package['action']
-                               ));
+                               ]);
                                $parentQueueID = $queue->queueID;
                                
                                if ($queueID === null) {
@@ -538,8 +538,8 @@ class PackageUpdateAction extends AbstractDatabaseObjectAction {
                        }
                }
                
-               return array(
+               return [
                        'queueID' => $queueID
-               );
+               ];
        }
 }
index 12dc7677a73be46ef680824fcaf61c160253c085..cf3a7d813a221002f06d1738f6f267e00206c9fa 100644 (file)
@@ -22,22 +22,22 @@ class PackageUpdateServerAction extends AbstractDatabaseObjectAction implements
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.configuration.package.canEditServer');
+       protected $permissionsCreate = ['admin.configuration.package.canEditServer'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.configuration.package.canEditServer');
+       protected $permissionsDelete = ['admin.configuration.package.canEditServer'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.configuration.package.canEditServer');
+       protected $permissionsUpdate = ['admin.configuration.package.canEditServer'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'toggle', 'update');
+       protected $requireACP = ['create', 'delete', 'toggle', 'update'];
        
        /**
         * @see \wcf\data\IToggleAction::validateToggle()
@@ -51,7 +51,7 @@ class PackageUpdateServerAction extends AbstractDatabaseObjectAction implements
         */
        public function toggle() {
                foreach ($this->objects as $server) {
-                       $server->update(array('isDisabled' => ($server->isDisabled) ? 0 : 1));
+                       $server->update(['isDisabled' => ($server->isDisabled) ? 0 : 1]);
                }
        }
 }
index 2fec461a2398016cae01f413824e65c4459ee6af..04efb91912f7ac20e6cebf9b32c00822b3ec4a23 100644 (file)
@@ -47,7 +47,7 @@ class PaidSubscription extends DatabaseObject {
         */
        public function getPurchaseButtons() {
                $objectTypeID = ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.payment.type', 'com.woltlab.wcf.payment.type.paidSubscription');
-               $buttons = array();
+               $buttons = [];
                foreach (PaymentMethodHandler::getInstance()->getPaymentMethods() as $paymentMethod) {
                        // check if payment method supports recurring payments
                        if ($this->isRecurring && !$paymentMethod->supportsRecurringPayments()) continue;
index cd49e40e85542eee3bbdaf1782f5a27fea68a75f..08cca11babaa9d9414e937abd0f5c0653ebe644a 100644 (file)
@@ -17,17 +17,17 @@ class PaidSubscriptionAction extends AbstractDatabaseObjectAction implements ITo
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.paidSubscription.canManageSubscription');
+       protected $permissionsDelete = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.paidSubscription.canManageSubscription');
+       protected $permissionsUpdate = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'toggle', 'update');
+       protected $requireACP = ['create', 'delete', 'toggle', 'update'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::create()
@@ -62,9 +62,9 @@ class PaidSubscriptionAction extends AbstractDatabaseObjectAction implements ITo
         */
        public function toggle() {
                foreach ($this->objects as $object) {
-                       $object->update(array(
+                       $object->update([
                                'isDisabled' => $object->isDisabled ? 0 : 1
-                       ));
+                       ]);
                }
        }
        
index 2b36203ce6164333aa2537542d39878fc6aa8831..68803b142583a13513dc63023a31512bb7770ca0 100644 (file)
@@ -107,7 +107,7 @@ class PaidSubscriptionTransactionLog extends DatabaseObject {
                        WHERE   paymentMethodObjectTypeID = ?
                                AND transactionID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($paymentMethodObjectTypeID, $transactionID));
+               $statement->execute([$paymentMethodObjectTypeID, $transactionID]);
                $row = $statement->fetchArray();
                if ($row !== false) {
                        return new PaidSubscriptionTransactionLog(null, $row);
index 1bfed0864b8a0ea0ee6f1f01bc6e1faeecc78dd0..fa923fd9181aa8cf090875ed509705f36a4222ba 100644 (file)
@@ -73,7 +73,7 @@ class PaidSubscriptionUser extends DatabaseObject {
                        WHERE   subscriptionID = ?
                                AND userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($subscriptionID, $userID));
+               $statement->execute([$subscriptionID, $userID]);
                $row = $statement->fetchArray();
                if ($row !== false) {
                        return new PaidSubscriptionUser(null, $row);
index a8dc5a5a46c2c0f7b2b805283a02331d881e4992..20f3629643321a88ec38f6b2c55da2dd6afeb66b 100644 (file)
@@ -22,17 +22,17 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.paidSubscription.canManageSubscription');
+       protected $permissionsDelete = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.paidSubscription.canManageSubscription');
+       protected $permissionsUpdate = ['admin.paidSubscription.canManageSubscription'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update');
+       protected $requireACP = ['create', 'delete', 'update'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::create()
@@ -56,7 +56,7 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                $subscriptionUser = parent::create();
                
                // update group memberships
-               $action = new PaidSubscriptionUserAction(array($subscriptionUser), 'addGroupMemberships');
+               $action = new PaidSubscriptionUserAction([$subscriptionUser], 'addGroupMemberships');
                $action->executeAction();
                
                return $subscriptionUser;
@@ -98,14 +98,14 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                                $endDate = $this->parameters['data']['endDate'];
                        }
                        
-                       $subscriptionUser->update(array(
+                       $subscriptionUser->update([
                                'endDate' => $endDate,
                                'isActive' => 1
-                       ));
+                       ]);
                        
                        if (!$subscriptionUser->isActive) {
                                // update group memberships
-                               $action = new PaidSubscriptionUserAction(array($subscriptionUser), 'addGroupMemberships');
+                               $action = new PaidSubscriptionUserAction([$subscriptionUser], 'addGroupMemberships');
                                $action->executeAction();
                        }
                }
@@ -129,10 +129,10 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                }
                
                foreach ($this->objects as $subscriptionUser) {
-                       $subscriptionUser->update(array('isActive' => 0));
+                       $subscriptionUser->update(['isActive' => 0]);
                        
                        // update group memberships
-                       $action = new PaidSubscriptionUserAction(array($subscriptionUser), 'removeGroupMemberships');
+                       $action = new PaidSubscriptionUserAction([$subscriptionUser], 'removeGroupMemberships');
                        $action->executeAction();
                }
        }
@@ -161,10 +161,10 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                }
                
                foreach ($this->objects as $subscriptionUser) {
-                       $subscriptionUser->update(array('isActive' => 1));
+                       $subscriptionUser->update(['isActive' => 1]);
                                
                        // update group memberships
-                       $action = new PaidSubscriptionUserAction(array($subscriptionUser), 'addGroupMemberships');
+                       $action = new PaidSubscriptionUserAction([$subscriptionUser], 'addGroupMemberships');
                        $action->executeAction();
                }
        }
@@ -193,18 +193,18 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                }
                
                foreach ($this->objects as $subscriptionUser) {
-                       $groupIDs = array();
+                       $groupIDs = [];
                        foreach (explode(',', $subscriptionUser->getSubscription()->groupIDs) as $groupID) {
                                if (UserGroup::getGroupByID($groupID) !== null) {
                                        $groupIDs[] = $groupID;
                                }
                        }
                        if (!empty($groupIDs)) {
-                               $action = new UserAction(array($subscriptionUser->userID), 'addToGroups', array(
+                               $action = new UserAction([$subscriptionUser->userID], 'addToGroups', [
                                        'groups' => $groupIDs,
                                        'deleteOldGroups' => false,
                                        'addDefaultGroups' => false
-                               ));
+                               ]);
                                $action->executeAction();
                        }
                }
@@ -219,16 +219,16 @@ class PaidSubscriptionUserAction extends AbstractDatabaseObjectAction {
                }
                
                foreach ($this->objects as $subscriptionUser) {
-                       $groupIDs = array();
+                       $groupIDs = [];
                        foreach (explode(',', $subscriptionUser->getSubscription()->groupIDs) as $groupID) {
                                if (UserGroup::getGroupByID($groupID) !== null) {
                                        $groupIDs[] = $groupID;
                                }
                        }
                        if (!empty($groupIDs)) {
-                               $action = new UserAction(array($subscriptionUser->userID), 'removeFromGroups', array(
+                               $action = new UserAction([$subscriptionUser->userID], 'removeFromGroups', [
                                        'groups' => $groupIDs,
-                               ));
+                               ]);
                                $action->executeAction();
                        }
                }
index e411a6ee7e86d8d22cf4a002856620003a965181..71011a0e204a49a6d7ff98b77ac2023c70b2cba0 100644 (file)
@@ -50,7 +50,7 @@ class Poll extends DatabaseObject {
         * list of poll options
         * @var PollOption[]
         */
-       protected $options = array();
+       protected $options = [];
        
        /**
         * related object
@@ -120,7 +120,7 @@ class Poll extends DatabaseObject {
                        return;
                }
                
-               $optionList = PollManager::getInstance()->getPollOptions(array($this->pollID));
+               $optionList = PollManager::getInstance()->getPollOptions([$this->pollID]);
                foreach ($optionList as $option) {
                        $this->options[$option->optionID] = $option;
                        
index e99613d6133f178ad5fe69ac17b90253cebd253f..a44894cdf4b4fff0f0ecde9fd355a803b7139f02 100644 (file)
@@ -24,7 +24,7 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getGroupedUserList');
+       protected $allowGuestAccess = ['getGroupedUserList'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$className
@@ -54,11 +54,11 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                
                WCF::getDB()->beginTransaction();
                foreach ($this->parameters['options'] as $showOrder => $option) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $poll->pollID,
                                $option['optionValue'],
                                $showOrder
-                       ));
+                       ]);
                }
                WCF::getDB()->commitTransaction();
                
@@ -76,31 +76,31 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                
                // get current options
                $optionList = new PollOptionList();
-               $optionList->getConditionBuilder()->add("poll_option.pollID = ?", array($pollEditor->pollID));
+               $optionList->getConditionBuilder()->add("poll_option.pollID = ?", [$pollEditor->pollID]);
                $optionList->sqlOrderBy = "poll_option.showOrder ASC";
                $optionList->readObjects();
                $options = $optionList->getObjects();
                
-               $newOptions = $updateOptions = array();
+               $newOptions = $updateOptions = [];
                foreach ($this->parameters['options'] as $showOrder => $option) {
                        // check if editing an existing option
                        if ($option['optionID']) {
                                // check if an update is required
                                if ($options[$option['optionID']]->showOrder != $showOrder || $options[$option['optionID']]->optionValue != $option['optionValue']) {
-                                       $updateOptions[$option['optionID']] = array(
+                                       $updateOptions[$option['optionID']] = [
                                                'optionValue' => $option['optionValue'],
                                                'showOrder' => $showOrder
-                                       );
+                                       ];
                                }
                                
                                // remove option
                                unset($options[$option['optionID']]);
                        }
                        else {
-                               $newOptions[] = array(
+                               $newOptions[] = [
                                        'optionValue' => $option['optionValue'],
                                        'showOrder' => $showOrder
-                               );
+                               ];
                        }
                }
                
@@ -114,11 +114,11 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                        VALUES          (?, ?, ?)";
                                $statement = WCF::getDB()->prepareStatement($sql);
                                foreach ($newOptions as $option) {
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                $pollEditor->pollID,
                                                $option['optionValue'],
                                                $option['showOrder']
-                                       ));
+                                       ]);
                                }
                        }
                        
@@ -130,11 +130,11 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                        WHERE   optionID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
                                foreach ($updateOptions as $optionID => $option) {
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                $option['optionValue'],
                                                $option['showOrder'],
                                                $optionID
-                                       ));
+                                       ]);
                                }
                        }
                        
@@ -144,7 +144,7 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                        WHERE           optionID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
                                foreach ($options as $option) {
-                                       $statement->execute(array($option->optionID));
+                                       $statement->execute([$option->optionID]);
                                }
                        }
                        
@@ -167,12 +167,12 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                        WHERE   pollID = ?
                                AND userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $poll->pollID,
                        WCF::getUser()->userID
-               ));
+               ]);
                $alreadyVoted = false;
-               $optionIDs = array();
+               $optionIDs = [];
                while ($row = $statement->fetchArray()) {
                        $alreadyVoted = true;
                        $optionIDs[] = $row['optionID'];
@@ -195,11 +195,11 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                VALUES          (?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($this->parameters['optionIDs'] as $optionID) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $poll->pollID,
                                        $optionID,
                                        WCF::getUser()->userID
-                               ));
+                               ]);
                        }
                        
                        // increase votes per option
@@ -208,7 +208,7 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                WHERE   optionID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($this->parameters['optionIDs'] as $optionID) {
-                               $statement->execute(array($optionID));
+                               $statement->execute([$optionID]);
                        }
                }
                
@@ -219,10 +219,10 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                                AND userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($optionIDs as $optionID) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $optionID,
                                        WCF::getUser()->userID
-                               ));
+                               ]);
                        }
                        
                        // decrease votes per option
@@ -231,7 +231,7 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                WHERE   optionID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($optionIDs as $optionID) {
-                               $statement->execute(array($optionID));
+                               $statement->execute([$optionID]);
                        }
                }
                
@@ -267,8 +267,8 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                        WHERE           pollID = ?
                        ORDER BY        ".($this->poll->sortByVotes ? "votes DESC" : "showOrder ASC");
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->poll->pollID));
-               $options = array();
+               $statement->execute([$this->poll->pollID]);
+               $options = [];
                while ($row = $statement->fetchArray()) {
                        $options[$row['optionID']] = new GroupedUserList($row['optionValue'], 'wcf.poll.noVotes');
                }
@@ -278,11 +278,11 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                        FROM    wcf".WCF_N."_poll_option_vote
                        WHERE   pollID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->poll->pollID));
-               $voteData = array();
+               $statement->execute([$this->poll->pollID]);
+               $voteData = [];
                while ($row = $statement->fetchArray()) {
                        if (!isset($voteData[$row['optionID']])) {
-                               $voteData[$row['optionID']] = array();
+                               $voteData[$row['optionID']] = [];
                        }
                        
                        $voteData[$row['optionID']][] = $row['userID'];
@@ -296,14 +296,14 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                // load user profiles
                GroupedUserList::loadUsers();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'groupedUsers' => $options
-               ));
+               ]);
                
-               return array(
+               return [
                        'pageCount' => 1,
                        'template' => WCF::getTPL()->fetch('groupedUserList')
-               );
+               ];
        }
        
        /**
@@ -323,21 +323,21 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                        WHERE   objectTypeID = ?
                                AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $sourceObjectType->objectTypeID,
                        $this->parameters['sourceObjectID']
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                if ($row === false) {
-                       return array(
+                       return [
                                'pollID' => null
-                       );
+                       ];
                }
                
                // get options
                $pollOptionList = new PollOptionList();
-               $pollOptionList->getConditionBuilder()->add("poll_option.pollID = ?", array($row['pollID']));
+               $pollOptionList->getConditionBuilder()->add("poll_option.pollID = ?", [$row['pollID']]);
                $pollOptionList->readObjects();
                
                //
@@ -353,14 +353,14 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                $newPoll = PollEditor::create($pollData);
                
                // create options
-               $newOptionIDs = array();
+               $newOptionIDs = [];
                foreach ($pollOptionList as $pollOption) {
-                       $newOption = PollOptionEditor::create(array(
+                       $newOption = PollOptionEditor::create([
                                'pollID' => $newPoll->pollID,
                                'optionValue' => $pollOption->optionValue,
                                'votes' => $pollOption->votes,
                                'showOrder' => $pollOption->showOrder
-                       ));
+                       ]);
                        
                        $newOptionIDs[$pollOption->optionID] = $newOption->optionID;
                }
@@ -374,12 +374,12 @@ class PollAction extends AbstractDatabaseObjectAction implements IGroupedUserLis
                                FROM            wcf".WCF_N."_poll_option_vote
                                WHERE           optionID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($oldOptionID));
+                       $statement->execute([$oldOptionID]);
                }
                WCF::getDB()->commitTransaction();
                
-               return array(
+               return [
                        'pollID' => $newPoll->pollID
-               );
+               ];
        }
 }
index 0d530b9fe8d683987d3f4448516bbbdd263a843b..c5cb182a71f3e738ebd77473bc15e1402ff02c12 100644 (file)
@@ -23,7 +23,7 @@ class SearchKeywordAction extends AbstractDatabaseObjectAction implements ISearc
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getSearchResultList');
+       protected $allowGuestAccess = ['getSearchResultList'];
        
        /**
         * @see \wcf\data\ISearchAction::validateGetSearchResultList()
@@ -36,7 +36,7 @@ class SearchKeywordAction extends AbstractDatabaseObjectAction implements ISearc
         * @see \wcf\data\ISearchAction::getSearchResultList()
         */
        public function getSearchResultList() {
-               $list = array();
+               $list = [];
                
                // find users
                $sql = "SELECT          *
@@ -44,12 +44,12 @@ class SearchKeywordAction extends AbstractDatabaseObjectAction implements ISearc
                        WHERE           keyword LIKE ?
                        ORDER BY        searches DESC";
                $statement = WCF::getDB()->prepareStatement($sql, 10);
-               $statement->execute(array($this->parameters['data']['searchString'].'%'));
+               $statement->execute([$this->parameters['data']['searchString'].'%']);
                while ($row = $statement->fetchArray()) {
-                       $list[] = array(
+                       $list[] = [
                                'label' => $row['keyword'],
                                'objectID' => $row['keywordID']
-                       );
+                       ];
                }
                
                return $list;
index e55c4c8fa06a2495805fd932b66a73947c2f32e6..b3a8fc276e999fce8ac1f89deba922bfbcc74108 100644 (file)
@@ -20,7 +20,7 @@ class SessionAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('keepAlive');
+       protected $allowGuestAccess = ['keepAlive'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$className
@@ -31,7 +31,7 @@ class SessionAction extends AbstractDatabaseObjectAction {
         * list of data values returned upon a keep alive request
         * @var mixed[]
         */
-       public $keepAliveData = array();
+       public $keepAliveData = [];
        
        /**
         * Validates the 'keepAlive' action.
@@ -56,9 +56,9 @@ class SessionAction extends AbstractDatabaseObjectAction {
                SessionHandler::getInstance()->keepAlive();
                
                // update notification counts
-               $this->keepAliveData = array(
+               $this->keepAliveData = [
                        'userNotificationCount' => UserNotificationHandler::getInstance()->getNotificationCount(true)
-               );
+               ];
                
                // notify 3rd party components
                EventHandler::getInstance()->fireAction($this, 'keepAlive');
index 83a21decafa46a35f496a852355dbb4840b4f8c3..064f2c35f5c097cdcf05c3f2e261b27c08954d76 100644 (file)
@@ -18,7 +18,7 @@ class SitemapAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getSitemap');
+       protected $allowGuestAccess = ['getSitemap'];
        
        /**
         * Validates the 'getSitemap' action.
@@ -36,24 +36,24 @@ class SitemapAction extends AbstractDatabaseObjectAction {
         */
        public function getSitemap() {
                if (isset($this->parameters['sitemapName'])) {
-                       return array(
+                       return [
                                'sitemapName' => $this->parameters['sitemapName'],
                                'template' => SitemapHandler::getInstance()->getSitemap($this->parameters['sitemapName'])
-                       );
+                       ];
                }
                else {
                        $sitemapName = SitemapHandler::getInstance()->getDefaultSitemapName();
                        
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'defaultSitemapName' => $sitemapName,
                                'sitemap' => SitemapHandler::getInstance()->getSitemap($sitemapName),
                                'tree' => SitemapHandler::getInstance()->getTree()
-                       ));
+                       ]);
                        
-                       return array(
+                       return [
                                'sitemapName' => $sitemapName,
                                'template' => WCF::getTPL()->fetch('sitemap')
-                       );
+                       ];
                }
        }
 }
index bc028c01d9a7357fb3d3545584dc32860fbbc2e3..853bd14e5ac1a3757d2de18e996f0d5ce6442558 100644 (file)
@@ -49,7 +49,7 @@ class Smiley extends DatabaseObject {
         * @return      string[]
         */
        public function getAliases() {
-               if (!$this->aliases) return array();
+               if (!$this->aliases) return [];
                
                return explode("\n", StringUtil::unifyNewlines($this->aliases));
        }
index d7769374b772bd7a2c730d89c94912a89b97d9de..7a80ec8b4b52ef22370d05f90b3f7791c0f64c97 100644 (file)
@@ -25,17 +25,17 @@ class SmileyAction extends AbstractDatabaseObjectAction implements ISortableActi
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.content.smiley.canManageSmiley');
+       protected $permissionsDelete = ['admin.content.smiley.canManageSmiley'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.content.smiley.canManageSmiley');
+       protected $permissionsUpdate = ['admin.content.smiley.canManageSmiley'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('delete', 'update', 'updatePosition');
+       protected $requireACP = ['delete', 'update', 'updatePosition'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::create()
@@ -48,9 +48,9 @@ class SmileyAction extends AbstractDatabaseObjectAction implements ISortableActi
                        @rename($this->parameters['fileLocation'], WCF_DIR.'images/smilies/'.$smileyFilename);
                        
                        $smileyEditor = new SmileyEditor($smiley);
-                       $smileyEditor->update(array(
+                       $smileyEditor->update([
                                'smileyPath' => 'images/smilies/'.$smileyFilename
-                       ));
+                       ]);
                        
                        $smiley = new Smiley($smiley->smileyID);
                }
@@ -110,7 +110,7 @@ class SmileyAction extends AbstractDatabaseObjectAction implements ISortableActi
                        if ($smiley === null) continue;
                        
                        $editor = new SmileyEditor($smiley);
-                       $editor->update(array('showOrder' => $i++));
+                       $editor->update(['showOrder' => $i++]);
                }
                WCF::getDB()->commitTransaction();
        }
index 0a1343c4b719e6611d2d9bbb6da2b1235928a867..2ee225f7db592970dbada2352a24d168914fc83c 100644 (file)
@@ -21,13 +21,13 @@ class SmileyCache extends SingletonFactory {
         * cached smilies
         * @var array
         */
-       protected $cachedSmilies = array();
+       protected $cachedSmilies = [];
        
        /**
         * cached smiley categories
         * @var SmileyCategory[]
         */
-       protected $cachedCategories = array();
+       protected $cachedCategories = [];
        
        /**
         * enabled smiley categories with at least one smiley
@@ -40,17 +40,17 @@ class SmileyCache extends SingletonFactory {
         */
        protected function init() {
                // get smiley cache
-               $this->cachedSmilies = SmileyCacheBuilder::getInstance()->getData(array(), 'smilies');
+               $this->cachedSmilies = SmileyCacheBuilder::getInstance()->getData([], 'smilies');
                $smileyCategories = CategoryHandler::getInstance()->getCategories('com.woltlab.wcf.bbcode.smiley');
                
-               $this->cachedCategories[null] = new SmileyCategory(new Category(null, array(
+               $this->cachedCategories[null] = new SmileyCategory(new Category(null, [
                        'categoryID' => null,
                        'parentCategoryID' => 0,
                        'title' => 'wcf.acp.smiley.categoryID.default',
                        'description' => '',
                        'showOrder' => -1,
                        'isDisabled' => 0
-               )));
+               ]));
                
                foreach ($smileyCategories as $key => $smileyCategory) {
                        $this->cachedCategories[$key] = new SmileyCategory($smileyCategory);
@@ -82,7 +82,7 @@ class SmileyCache extends SingletonFactory {
         */
        public function getVisibleCategories() {
                if ($this->visibleCategories === null) {
-                       $this->visibleCategories = array();
+                       $this->visibleCategories = [];
                        
                        foreach ($this->cachedCategories as $key => $category) {
                                if (!$category->isDisabled) {
@@ -107,6 +107,6 @@ class SmileyCache extends SingletonFactory {
        public function getCategorySmilies($categoryID = null) {
                if (isset($this->cachedSmilies[$categoryID])) return $this->cachedSmilies[$categoryID];
                
-               return array();
+               return [];
        }
 }
index ddf14c798b903c03fd354499270c44af771a749e..1245f8045e3e997c39e570befe64f904e444dd2f 100644 (file)
@@ -23,7 +23,7 @@ class SmileyCategoryAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getSmilies');
+       protected $allowGuestAccess = ['getSmilies'];
        
        /**
         * active smiley category
@@ -48,13 +48,13 @@ class SmileyCategoryAction extends AbstractDatabaseObjectAction {
        public function getSmilies() {
                $this->smileyCategory->loadSmilies();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'smilies' => $this->smileyCategory
-               ));
+               ]);
                
-               return array(
+               return [
                        'smileyCategoryID' => $this->smileyCategory->categoryID,
                        'template' => WCF::getTPL()->fetch('__messageFormSmilies')
-               );
+               ];
        }
 }
index 8eb8a73acb94537f033b9c2a0be9e51740f45b2e..53fc9264e2c50de2655f38f9c7aac6ca0cea4af1 100644 (file)
@@ -26,7 +26,7 @@ class StatDailyAction extends AbstractDatabaseObjectAction {
         * Validates the getData action.
         */
        public function validateGetData() {
-               WCF::getSession()->checkPermissions(array('admin.management.canViewLog'));
+               WCF::getSession()->checkPermissions(['admin.management.canViewLog']);
                
                // validate start date
                if (empty($this->parameters['startDate']) || !preg_match('/^\d{4}\-\d{2}\-\d{2}$/', $this->parameters['startDate'])) {
@@ -57,10 +57,10 @@ class StatDailyAction extends AbstractDatabaseObjectAction {
         * Returns the stat data.
         */
        public function getData() {
-               $data = array();
+               $data = [];
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add('objectTypeID IN (?)', array($this->parameters['objectTypeIDs']));
-               $conditionBuilder->add('date BETWEEN ? AND ?', array($this->parameters['startDate'], $this->parameters['endDate']));
+               $conditionBuilder->add('objectTypeID IN (?)', [$this->parameters['objectTypeIDs']]);
+               $conditionBuilder->add('date BETWEEN ? AND ?', [$this->parameters['startDate'], $this->parameters['endDate']]);
                
                $limit = 0;
                if ($this->parameters['dateGrouping'] == 'yearly') {
@@ -102,13 +102,13 @@ class StatDailyAction extends AbstractDatabaseObjectAction {
                        $objectType = ObjectTypeCache::getInstance()->getObjectType($row['objectTypeID']);
                        
                        if (!isset($data[$row['objectTypeID']])) {
-                               $data[$row['objectTypeID']] = array(
+                               $data[$row['objectTypeID']] = [
                                        'label' => WCF::getLanguage()->get('wcf.acp.stat.'.$objectType->objectType),
-                                       'data' => array()
-                               );
+                                       'data' => []
+                               ];
                        }
                        
-                       $data[$row['objectTypeID']]['data'][] = array(strtotime($row['date'] . ' UTC'), $objectType->getProcessor()->getFormattedCounter($value));
+                       $data[$row['objectTypeID']]['data'][] = [strtotime($row['date'] . ' UTC'), $objectType->getProcessor()->getFormattedCounter($value)];
                }
                
                return $data;
index 462ad4a56be2c42fa523362f0b8ed1d132dbdbdd..f76b400a4fce2ee326cd04c9fc36f3fdf7a66af4 100644 (file)
@@ -46,7 +46,7 @@ class Style extends DatabaseObject {
         * list of style variables
         * @var string[]
         */
-       protected $variables = array();
+       protected $variables = [];
        
        const PREVIEW_IMAGE_MAX_HEIGHT = 64;
        const PREVIEW_IMAGE_MAX_WIDTH = 102;
@@ -104,7 +104,7 @@ class Style extends DatabaseObject {
                        ON              (value.variableID = variable.variableID AND value.styleID = ?)
                        ORDER BY        variable.variableID ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->styleID));
+               $statement->execute([$this->styleID]);
                while ($row = $statement->fetchArray()) {
                        $variableName = $row['variableName'];
                        $variableValue = (isset($row['variableValue'])) ? $row['variableValue'] : $row['defaultValue'];
index d0e8a0bc0095405c1a3c7016118173e39a9f0623..6b9910c5c0384423c7e2d25a9146b7e5cd0bcb6a 100644 (file)
@@ -44,7 +44,7 @@ class Tag extends DatabaseObject implements IRouteController {
                        WHERE   languageID = ?
                                AND name = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($languageID, $name));
+               $statement->execute([$languageID, $name]);
                $row = $statement->fetchArray();
                if ($row !== false) return new Tag(null, $row);
                
index c41754f2e07ed3c38e32b0edb6a391be2d77dfda..fc6e4ce7e8bd73dddf42fc3e21f5c6b015e95f8a 100644 (file)
@@ -21,7 +21,7 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction
         */
-       protected $allowGuestAccess = array('getSearchResultList');
+       protected $allowGuestAccess = ['getSearchResultList'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$className
@@ -31,17 +31,17 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.content.tag.canManageTag');
+       protected $permissionsDelete = ['admin.content.tag.canManageTag'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.content.tag.canManageTag');
+       protected $permissionsUpdate = ['admin.content.tag.canManageTag'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('delete', 'update');
+       protected $requireACP = ['delete', 'update'];
        
        /**
         * tag for which other tags will be used as synonyms
@@ -64,16 +64,16 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction {
         * @see \wcf\data\ISearchAction::getSearchResultList()
         */
        public function getSearchResultList() {
-               $excludedSearchValues = array();
+               $excludedSearchValues = [];
                if (isset($this->parameters['data']['excludedSearchValues'])) {
                        $excludedSearchValues = $this->parameters['data']['excludedSearchValues'];
                }
-               $list = array();
+               $list = [];
                
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add("name LIKE ?", array($this->parameters['data']['searchString'].'%'));
+               $conditionBuilder->add("name LIKE ?", [$this->parameters['data']['searchString'].'%']);
                if (!empty($excludedSearchValues)) {
-                       $conditionBuilder->add("name NOT IN (?)", array($excludedSearchValues));
+                       $conditionBuilder->add("name NOT IN (?)", [$excludedSearchValues]);
                }
                
                // find tags
@@ -83,10 +83,10 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction {
                $statement = WCF::getDB()->prepareStatement($sql, 5);
                $statement->execute($conditionBuilder->getParameters());
                while ($row = $statement->fetchArray()) {
-                       $list[] = array(
+                       $list[] = [
                                'label' => $row['name'],
                                'objectID' => $row['tagID']
-                       );
+                       ];
                }
                
                return $list;
@@ -151,7 +151,7 @@ class TagAction extends AbstractDatabaseObjectAction implements ISearchAction {
         * @param       integer[]               $tagIDs
         * @since       2.2
         */
-       protected function unmarkItems(array $tagIDs = array()) {
+       protected function unmarkItems(array $tagIDs = []) {
                if (empty($tagIDs)) {
                        $tagIDs = $this->objectIDs;
                }
index 386b83d94ea746baba1d786bd9b89565e74ac77a..0213ed0ca612aefede92a9de95fd07eb6366e7dd 100644 (file)
@@ -48,7 +48,7 @@ class Template extends DatabaseObject {
                                ON              (package.packageID = template.packageID)
                                WHERE           template.templateID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($id));
+                       $statement->execute([$id]);
                        $row = $statement->fetchArray();
                        
                        if ($row !== false) {
@@ -63,7 +63,7 @@ class Template extends DatabaseObject {
                                $row['packageDir'] = PackageCache::getInstance()->getPackage($application->packageID)->packageDir;
                        }
                        else {
-                               $row = array();
+                               $row = [];
                        }
                }
                else if ($object !== null) {
index 65bb2fefa3f276836052ada73a473bfe7f62816c..9f1703eb42e11c2d4fabb05061a244865027c69d 100644 (file)
@@ -22,22 +22,22 @@ class TemplateAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.template.canManageTemplate');
+       protected $permissionsCreate = ['admin.template.canManageTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.template.canManageTemplate');
+       protected $permissionsDelete = ['admin.template.canManageTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.template.canManageTemplate');
+       protected $permissionsUpdate = ['admin.template.canManageTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update');
+       protected $requireACP = ['create', 'delete', 'update'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::create()
index 663a0d8c664cbff75a180a37b5c8d708516cade7..8acd1a623d5b435d30cb08fb81ea91281b62d0f3 100644 (file)
@@ -40,9 +40,9 @@ class TemplateGroup extends DatabaseObject {
         * @param       integer         $initialDepth   Specifies the initial indentation depth of the list
         * @return      array
         */
-       public static function getSelectList($ignore = array(), $initialDepth = 0) {
+       public static function getSelectList($ignore = [], $initialDepth = 0) {
                if (self::$templateGroupStructure === null) {
-                       self::$templateGroupStructure = array();
+                       self::$templateGroupStructure = [];
                        
                        $sql = "SELECT          templateGroupID, templateGroupName, parentTemplateGroupID
                                FROM            wcf".WCF_N."_template_group
@@ -54,7 +54,7 @@ class TemplateGroup extends DatabaseObject {
                        }
                }
                
-               self::$selectList = array();
+               self::$selectList = [];
                self::makeSelectList(0, $initialDepth, $ignore);
                
                return self::$selectList;
@@ -67,7 +67,7 @@ class TemplateGroup extends DatabaseObject {
         * @param       integer         $depth                  current list depth
         * @param       array           $ignore                 list of template group ids to ignore in result
         */
-       protected static function makeSelectList($parentID = 0, $depth = 0, $ignore = array()) {
+       protected static function makeSelectList($parentID = 0, $depth = 0, $ignore = []) {
                if (!isset(self::$templateGroupStructure[$parentID ?: 0])) return;
                
                foreach (self::$templateGroupStructure[$parentID ?: 0] as $templateGroup) {
index 5cf8de525977e1a49909ef5b00b782810acfba65..d0186c00c9e681d0f4152fb1f5f56baaa7ab8bc8 100644 (file)
@@ -21,20 +21,20 @@ class TemplateGroupAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.template.canManageTemplate');
+       protected $permissionsCreate = ['admin.template.canManageTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.template.canManageTemplate');
+       protected $permissionsDelete = ['admin.template.canManageTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.template.canManageTemplate');
+       protected $permissionsUpdate = ['admin.template.canManageTemplate'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update');
+       protected $requireACP = ['create', 'delete', 'update'];
 }
index c4ed80279a276cdbe3687de06af0a6573da41e69..60bb1a7170a5337bbe47dc15b1a0832584c5e22d 100644 (file)
@@ -19,7 +19,7 @@ class TeamList extends UserProfileList {
         * teams included in the list
         * @var Team[]
         */
-       protected $teams = array();
+       protected $teams = [];
        
        /**
         * @see \wcf\data\DatabaseObjectList::countObjects()
@@ -40,7 +40,7 @@ class TeamList extends UserProfileList {
         * @see \wcf\data\DatabaseObjectList::readObjectIDs()
         */
        public function readObjectIDs() {
-               $this->objectIDs = array();
+               $this->objectIDs = [];
                $sql = "SELECT          user_to_group.userID AS objectID
                        FROM            wcf".WCF_N."_user_group user_group,
                                        wcf".WCF_N."_user_to_group user_to_group
index ba10a6d01fef83a594d24a38febf0390801de74e..4abf03dbc752c8b42a3f4ebfdc52c7d4296cdb6d 100644 (file)
@@ -20,7 +20,7 @@ class UserBirthdayAction extends UserProfileAction implements IGroupedUserListAc
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getGroupedUserList');
+       protected $allowGuestAccess = ['getGroupedUserList'];
        
        /**
         * @see \wcf\data\IGroupedUserListAction::validateGetGroupedUserList()
@@ -44,8 +44,8 @@ class UserBirthdayAction extends UserProfileAction implements IGroupedUserListAc
                if (isset($value[2])) $day = intval($value[2]);
                
                // get users
-               $users = array();
-               $userOptions = UserOptionCacheBuilder::getInstance()->getData(array(), 'options');
+               $users = [];
+               $userOptions = UserOptionCacheBuilder::getInstance()->getData([], 'options');
                if (isset($userOptions['birthday'])) {
                        $birthdayUserOption = $userOptions['birthday'];
                        
@@ -63,13 +63,13 @@ class UserBirthdayAction extends UserProfileAction implements IGroupedUserListAc
                        }
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'users' => $users,
                        'year' => $year
-               ));
-               return array(
+               ]);
+               return [
                        'pageCount' => 1,
                        'template' => WCF::getTPL()->fetch('userBirthdayList')
-               );
+               ];
        }
 }
index 55bd29005f886d189161d987277aff6b459a86c0..ae2235aee8fd158539ea984f4817f803455438e9 100644 (file)
@@ -28,7 +28,7 @@ class UserProfileAction extends UserAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getUserProfile', 'getDetailedActivityPointList');
+       protected $allowGuestAccess = ['getUserProfile', 'getDetailedActivityPointList'];
        
        /**
         * user profile object
@@ -49,9 +49,9 @@ class UserProfileAction extends UserAction {
                if (isset($this->parameters['options']['enableBBCodes']) && WCF::getSession()->getPermission('user.signature.canUseBBCodes')) {
                        $disallowedBBCodes = BBCodeParser::getInstance()->validateBBCodes($this->parameters['data']['message'], explode(',', WCF::getSession()->getPermission('user.signature.allowedBBCodes')));
                        if (!empty($disallowedBBCodes)) {
-                               throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.disallowedBBCodes', array(
+                               throw new UserInputException('message', WCF::getLanguage()->getDynamicVariable('wcf.message.error.disallowedBBCodes', [
                                        'disallowedBBCodes' => $disallowedBBCodes
-                               )));
+                               ]));
                        }
                }
        }
@@ -76,9 +76,9 @@ class UserProfileAction extends UserAction {
                $message = StringUtil::trim($this->parameters['data']['message']);
                $preview = MessageParser::getInstance()->parse($message, $enableSmilies, $enableHtml, $enableBBCodes, false);
                
-               return array(
+               return [
                        'message' => $preview
-               );
+               ];
        }
        
        /**
@@ -100,7 +100,7 @@ class UserProfileAction extends UserAction {
                
                if ($userID) {
                        $userProfileList = new UserProfileList();
-                       $userProfileList->getConditionBuilder()->add("user_table.userID = ?", array($userID));
+                       $userProfileList->getConditionBuilder()->add("user_table.userID = ?", [$userID]);
                        $userProfileList->readObjects();
                        $userProfiles = $userProfileList->getObjects();
                        
@@ -115,10 +115,10 @@ class UserProfileAction extends UserAction {
                        WCF::getTPL()->assign('unknownUser', true);
                }
                
-               return array(
+               return [
                        'template' => WCF::getTPL()->fetch('userProfilePreview'),
                        'userID' => $userID
-               );
+               ];
        }
        
        /**
@@ -141,14 +141,14 @@ class UserProfileAction extends UserAction {
         * @return      array
         */
        public function getDetailedActivityPointList() {
-               $activityPointObjectTypes = array();
+               $activityPointObjectTypes = [];
                foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.user.activityPointEvent') as $objectType) {
                        $activityPointObjectTypes[$objectType->objectTypeID] = $objectType;
                }
                
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add('userID = ?', array($this->userProfile->userID));
-               $conditionBuilder->add('objectTypeID IN (?)', array(array_keys($activityPointObjectTypes)));
+               $conditionBuilder->add('userID = ?', [$this->userProfile->userID]);
+               $conditionBuilder->add('objectTypeID IN (?)', [array_keys($activityPointObjectTypes)]);
                
                $sql = "SELECT  objectTypeID, activityPoints
                        FROM    wcf".WCF_N."_user_activity_point
@@ -159,15 +159,15 @@ class UserProfileAction extends UserAction {
                        $activityPointObjectTypes[$row['objectTypeID']]->activityPoints = $row['activityPoints'];
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'activityPointObjectTypes' => $activityPointObjectTypes,
                        'user' => $this->userProfile
-               ));
+               ]);
                
-               return array(
+               return [
                        'template' => WCF::getTPL()->fetch('detailedActivityPointList'),
                        'userID' => $this->userProfile->userID
-               );
+               ];
        }
        
        /**
@@ -200,15 +200,15 @@ class UserProfileAction extends UserAction {
         */
        public function beginEdit() {
                $optionTree = $this->getOptionHandler($this->userProfile->getDecoratedObject())->getOptionTree();
-               WCF::getTPL()->assign(array(
-                       'errorType' => array(),
+               WCF::getTPL()->assign([
+                       'errorType' => [],
                        'optionTree' => $optionTree,
                        '__userTitle' => $this->userProfile->userTitle
-               ));
+               ]);
                
-               return array(
+               return [
                        'template' => WCF::getTPL()->fetch('userProfileAboutEditable')
-               );
+               ];
        }
        
        /**
@@ -218,7 +218,7 @@ class UserProfileAction extends UserAction {
                $this->validateBeginEdit();
                
                if (!isset($this->parameters['values']) || !is_array($this->parameters['values'])) {
-                       $this->parameters['values'] = array();
+                       $this->parameters['values'] = [];
                }
                
                if (isset($this->parameters['values']['__userTitle']) && !WCF::getSession()->getPermission('user.profile.canEditUserTitle')) {
@@ -261,23 +261,23 @@ class UserProfileAction extends UserAction {
                // validation was successful
                if (empty($errors)) {
                        $saveOptions = $optionHandler->save();
-                       $data = array(
+                       $data = [
                                'options' => $saveOptions
-                       );
+                       ];
                        
                        // save user title
                        if ($userTitle !== null) {
-                               $data['data'] = array(
+                               $data['data'] = [
                                        'userTitle' => $userTitle
-                               );
+                               ];
                        }
                        
-                       $userAction = new UserAction(array($this->userProfile->userID), 'update', $data);
+                       $userAction = new UserAction([$this->userProfile->userID], 'update', $data);
                        $userAction->executeAction();
                        
                        // check if the user will be automatically added to new
                        // user groups because of the changed user options
-                       UserGroupAssignmentHandler::getInstance()->checkUsers(array($this->userProfile->userID));
+                       UserGroupAssignmentHandler::getInstance()->checkUsers([$this->userProfile->userID]);
                        
                        // return parsed template
                        $user = new User($this->userProfile->userID);
@@ -286,28 +286,28 @@ class UserProfileAction extends UserAction {
                        $optionHandler = $this->getOptionHandler($user, false);
                        
                        $options = $optionHandler->getOptionTree();
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'options' => $options,
                                'userID' => $this->userProfile->userID
-                       ));
+                       ]);
                        
-                       return array(
+                       return [
                                'success' => true,
                                'template' => WCF::getTPL()->fetch('userProfileAbout')
-                       );
+                       ];
                }
                else {
                        // validation failed
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'errorType' => $errors,
                                'optionTree' => $optionHandler->getOptionTree(),
                                '__userTitle' => ($userTitle !== null ? $userTitle : $this->userProfile->userTitle)
-                       ));
+                       ]);
                        
-                       return array(
+                       return [
                                'success' => false,
                                'template' => WCF::getTPL()->fetch('userProfileAboutEditable')
-                       );
+                       ];
                }
        }
        
@@ -319,13 +319,13 @@ class UserProfileAction extends UserAction {
                        $this->readObjects();
                }
                
-               $resetUserIDs = array();
+               $resetUserIDs = [];
                foreach ($this->objects as $user) {
                        $conditionBuilder = new PreparedStatementConditionBuilder();
-                       $conditionBuilder->add('user_rank.groupID IN (?)', array($user->getGroupIDs()));
-                       $conditionBuilder->add('user_rank.requiredPoints <= ?', array($user->activityPoints));
-                       if ($user->gender) $conditionBuilder->add('user_rank.requiredGender IN (?)', array(array(0, $user->gender)));
-                       else $conditionBuilder->add('user_rank.requiredGender = ?', array(0));
+                       $conditionBuilder->add('user_rank.groupID IN (?)', [$user->getGroupIDs()]);
+                       $conditionBuilder->add('user_rank.requiredPoints <= ?', [$user->activityPoints]);
+                       if ($user->gender) $conditionBuilder->add('user_rank.requiredGender IN (?)', [[0, $user->gender]]);
+                       else $conditionBuilder->add('user_rank.requiredGender = ?', [0]);
                        
                        $sql = "SELECT          user_rank.rankID
                                FROM            wcf".WCF_N."_user_rank user_rank
@@ -338,13 +338,13 @@ class UserProfileAction extends UserAction {
                        $row = $statement->fetchArray();
                        if ($row === false) {
                                if ($user->rankID) {
-                                       $user->update(array('rankID' => null));
+                                       $user->update(['rankID' => null]);
                                        $resetUserIDs[] = $user->userID;
                                }
                        }
                        else {
                                if ($row['rankID'] != $user->rankID) {
-                                       $user->update(array('rankID' => $row['rankID']));
+                                       $user->update(['rankID' => $row['rankID']]);
                                        $resetUserIDs[] = $user->userID;
                                }
                        }
@@ -363,10 +363,10 @@ class UserProfileAction extends UserAction {
                        $this->readObjects();
                }
                
-               $userToGroup = array();
+               $userToGroup = [];
                foreach ($this->objects as $user) {
                        $conditionBuilder = new PreparedStatementConditionBuilder();
-                       $conditionBuilder->add('groupID IN (?)', array($user->getGroupIDs()));
+                       $conditionBuilder->add('groupID IN (?)', [$user->getGroupIDs()]);
                        
                        $sql = "SELECT          groupID
                                FROM            wcf".WCF_N."_user_group
@@ -388,10 +388,10 @@ class UserProfileAction extends UserAction {
                        
                        WCF::getDB()->beginTransaction();
                        foreach ($userToGroup as $userID => $groupID) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $groupID,
                                        $userID
-                               ));
+                               ]);
                        }
                        WCF::getDB()->commitTransaction();
                }
index 459607afee2e0f9f81bc95877bd373b866e4cb6e..e17fbf360b966af6098dd9cdd96ccd1a2a5c662c 100644 (file)
@@ -17,7 +17,7 @@ class UserRegistrationAction extends UserAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('validateEmailAddress', 'validatePassword', 'validateUsername');
+       protected $allowGuestAccess = ['validateEmailAddress', 'validatePassword', 'validateUsername'];
        
        /**
         * Validates the validate username function.
@@ -47,22 +47,22 @@ class UserRegistrationAction extends UserAction {
         */
        public function validateUsername() {
                if (!UserRegistrationUtil::isValidUsername($this->parameters['username'])) {
-                       return array(
+                       return [
                                'isValid' => false,
                                'error' => 'notValid'
-                       );
+                       ];
                }
                
                if (!UserUtil::isAvailableUsername($this->parameters['username'])) {
-                       return array(
+                       return [
                                'isValid' => false,
                                'error' => 'notUnique'
-                       );
+                       ];
                }
                
-               return array(
+               return [
                        'isValid' => true
-               );
+               ];
        }
        
        /**
@@ -72,22 +72,22 @@ class UserRegistrationAction extends UserAction {
         */
        public function validateEmailAddress() {
                if (!UserRegistrationUtil::isValidEmail($this->parameters['email'])) {
-                       return array(
+                       return [
                                'isValid' => false,
                                'error' => 'notValid'
-                       );
+                       ];
                }
                
                if (!UserUtil::isAvailableEmail($this->parameters['email'])) {
-                       return array(
+                       return [
                                'isValid' => false,
                                'error' => 'notUnique'
-                       );
+                       ];
                }
                
-               return array(
+               return [
                        'isValid' => true
-               );
+               ];
        }
        
        /**
@@ -97,14 +97,14 @@ class UserRegistrationAction extends UserAction {
         */
        public function validatePassword() {
                if (!UserRegistrationUtil::isSecurePassword($this->parameters['password'])) {
-                       return array(
+                       return [
                                'isValid' => false,
                                'error' => 'notSecure'
-                       );
+                       ];
                }
                
-               return array(
+               return [
                        'isValid' => true
-               );
+               ];
        }
 }
index 1a2b7dae2c36760a25727ef39e02e78ca7af4cb6..ca37110bd822ee2602f8ecdd429e242822b251a9 100644 (file)
@@ -53,7 +53,7 @@ class UserActivityEvent extends DatabaseObject {
                
                $this->data['additionalData'] = @unserialize($this->data['additionalData']);
                if (!is_array($this->data['additionalData'])) {
-                       $this->data['additionalData'] = array();
+                       $this->data['additionalData'] = [];
                }
        }
 }
index b4e1685f2239eaa6c90987f8e7fb3b4585bd05e9..a6c26a273116c29e754ac2615e6cd7f97829ac31 100644 (file)
@@ -20,7 +20,7 @@ class UserActivityEventAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       public $allowGuestAccess = array('load');
+       public $allowGuestAccess = ['load'];
        
        /**
         * Validates parameters to load recent activity entries.
@@ -40,46 +40,46 @@ class UserActivityEventAction extends AbstractDatabaseObjectAction {
        public function load() {
                $eventList = new ViewableUserActivityEventList();
                if ($this->parameters['lastEventID']) {
-                       $eventList->getConditionBuilder()->add("user_activity_event.time <= ?", array($this->parameters['lastEventTime']));
-                       $eventList->getConditionBuilder()->add("user_activity_event.eventID < ?", array($this->parameters['lastEventID']));
+                       $eventList->getConditionBuilder()->add("user_activity_event.time <= ?", [$this->parameters['lastEventTime']]);
+                       $eventList->getConditionBuilder()->add("user_activity_event.eventID < ?", [$this->parameters['lastEventID']]);
                }
                else {
-                       $eventList->getConditionBuilder()->add("user_activity_event.time < ?", array($this->parameters['lastEventTime']));
+                       $eventList->getConditionBuilder()->add("user_activity_event.time < ?", [$this->parameters['lastEventTime']]);
                }
                
                // profile view
                if ($this->parameters['userID']) {
-                       $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", array($this->parameters['userID']));
+                       $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", [$this->parameters['userID']]);
                }
                else if ($this->parameters['filteredByFollowedUsers'] && count(WCF::getUserProfileHandler()->getFollowingUsers())) {
-                       $eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', array(WCF::getUserProfileHandler()->getFollowingUsers()));
+                       $eventList->getConditionBuilder()->add('user_activity_event.userID IN (?)', [WCF::getUserProfileHandler()->getFollowingUsers()]);
                }
                
                $eventList->readObjects();
                $lastEventTime = $eventList->getLastEventTime();
                
                if (!$lastEventTime) {
-                       return array();
+                       return [];
                }
                
                // removes orphaned and non-accessable events
                UserActivityEventHandler::validateEvents($eventList);
                
                if (!count($eventList)) {
-                       return array();
+                       return [];
                }
                
                // parse template
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'eventList' => $eventList
-               ));
+               ]);
                
                $events = $eventList->getObjects();
-               return array(
+               return [
                        'lastEventID' => end($events)->eventID,
                        'lastEventTime' => $lastEventTime,
                        'template' => WCF::getTPL()->fetch('recentActivityListItem')
-               );
+               ];
        }
        
        /**
@@ -88,11 +88,11 @@ class UserActivityEventAction extends AbstractDatabaseObjectAction {
        public function validateSwitchContext() { }
        
        public function switchContext() {
-               $userAction = new UserAction(array(WCF::getUser()), 'update', array(
-                       'options' => array(
+               $userAction = new UserAction([WCF::getUser()], 'update', [
+                       'options' => [
                                User::getUserOptionID('recentActivitiesFilterByFollowing') => (WCF::getUser()->recentActivitiesFilterByFollowing ? 0 : 1)
-                       )
-               ));
+                       ]
+               ]);
                $userAction->executeAction();
        }
 }
index 8e152880e5bb0128019c45c787afddeffe799906..bf5e15088a2ca1cc3d9337e0a0c451c7ed502b29 100644 (file)
@@ -54,7 +54,7 @@ class UserAuthenticationFailure extends DatabaseObject {
                        WHERE   ipAddress = ?
                                AND time > ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($ipAddress, TIME_NOW - USER_AUTHENTICATION_FAILURE_TIMEOUT));
+               $statement->execute([$ipAddress, TIME_NOW - USER_AUTHENTICATION_FAILURE_TIMEOUT]);
                
                return $statement->fetchColumn();
        }
@@ -71,7 +71,7 @@ class UserAuthenticationFailure extends DatabaseObject {
                        WHERE   userID = ?
                                AND time > ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($userID, TIME_NOW - USER_AUTHENTICATION_FAILURE_TIMEOUT));
+               $statement->execute([$userID, TIME_NOW - USER_AUTHENTICATION_FAILURE_TIMEOUT]);
                
                return $statement->fetchColumn();
        }
index e9f95fdd50373476962f1da86ce71bc2b004a784..8d160b8b5816f8bb2c695bbb1645a8faa6fc7e98 100644 (file)
@@ -58,7 +58,7 @@ class Gravatar extends DefaultAvatar {
         * urls of this gravatar
         * @var string[]
         */
-       protected $url = array();
+       protected $url = [];
        
        /**
         * Creates a new Gravatar object.
@@ -97,9 +97,9 @@ class Gravatar extends DefaultAvatar {
                                $this->url[$size] = WCF::getPath().$cachedFilename;
                        }
                        else {
-                               $this->url[$size] = LinkHandler::getInstance()->getLink('GravatarDownload', array(
+                               $this->url[$size] = LinkHandler::getInstance()->getLink('GravatarDownload', [
                                        'forceFrontend' => true
-                               ), 'userID='.$this->userID.'&size='.$size);
+                               ], 'userID='.$this->userID.'&size='.$size);
                        }
                }
                
index 77c9df921a1d5a1b39fb0e5cdbf02fa4448177b8..be2c7c4b6185194db9c4e007a67dec1673d486f1 100644 (file)
@@ -29,7 +29,7 @@ class UserAvatar extends DatabaseObject implements IUserAvatar {
         * needed avatar thumbnail sizes
         * @var integer[]
         */
-       public static $avatarThumbnailSizes = array(32, 96, 128);
+       public static $avatarThumbnailSizes = [32, 96, 128];
        
        /**
         * @see \wcf\data\DatabaseObject::$databaseTableName
index 36f18e15f378b3fdadf7ac1a426a3102ce8c9a22..b9e4f1e1ea06319f1943caa387c5674fd58c4e7b 100644 (file)
@@ -78,14 +78,14 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                                $fileLocation = $this->enforceDimensions($file->getLocation());
                                $imageData = getimagesize($fileLocation);
                                
-                               $data = array(
+                               $data = [
                                        'avatarName' => $file->getFilename(),
                                        'avatarExtension' => $file->getFileExtension(),
                                        'width' => $imageData[0],
                                        'height' => $imageData[1],
                                        'userID' => $userID,
                                        'fileHash' => sha1_file($fileLocation)
-                               );
+                               ];
                                
                                // create avatar
                                $avatar = UserAvatarEditor::create($data);
@@ -102,31 +102,31 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                                        @unlink($fileLocation);
                                        
                                        // create thumbnails
-                                       $action = new UserAvatarAction(array($avatar), 'generateThumbnails');
+                                       $action = new UserAvatarAction([$avatar], 'generateThumbnails');
                                        $action->executeAction();
                                        
                                        // delete old avatar
                                        if ($user->avatarID) {
-                                               $action = new UserAvatarAction(array($user->avatarID), 'delete');
+                                               $action = new UserAvatarAction([$user->avatarID], 'delete');
                                                $action->executeAction();
                                        }
                                        
                                        // update user
                                        $userEditor = new UserEditor($user);
-                                       $userEditor->update(array(
+                                       $userEditor->update([
                                                'avatarID' => $avatar->avatarID,
                                                'enableGravatar' => 0
-                                       ));
+                                       ]);
                                        
                                        // reset user storage
-                                       UserStorageHandler::getInstance()->reset(array($userID), 'avatar');
+                                       UserStorageHandler::getInstance()->reset([$userID], 'avatar');
                                        
                                        // return result
-                                       return array(
+                                       return [
                                                'avatarID' => $avatar->avatarID,
                                                'canCrop' => $avatar->canCrop(),
                                                'url' => $avatar->getURL(96)
-                                       );
+                                       ];
                                }
                                else {
                                        // moving failed; delete avatar
@@ -140,7 +140,7 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                        $file->setValidationErrorType($e->getType());
                }
                
-               return array('errorType' => $file->getValidationErrorType());
+               return ['errorType' => $file->getValidationErrorType()];
        }
        
        /**
@@ -214,14 +214,14 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                        return;
                }
                
-               $data = array(
+               $data = [
                        'avatarName' => $tmp['basename'],
                        'avatarExtension' => $tmp['extension'],
                        'width' => $imageData[0],
                        'height' => $imageData[1],
                        'userID' => $this->parameters['userEditor']->userID,
                        'fileHash' => sha1_file($filename)
-               );
+               ];
                
                // create avatar
                $avatar = UserAvatarEditor::create($data);
@@ -238,7 +238,7 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                        @unlink($filename);
                        
                        // create thumbnails
-                       $action = new UserAvatarAction(array($avatar), 'generateThumbnails');
+                       $action = new UserAvatarAction([$avatar], 'generateThumbnails');
                        $action->executeAction();
                        
                        $avatarID = $avatar->avatarID;
@@ -253,20 +253,20 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                
                // update user
                if ($avatarID) {
-                       $this->parameters['userEditor']->update(array(
+                       $this->parameters['userEditor']->update([
                                'avatarID' => $avatarID,
                                'enableGravatar' => 0
-                       ));
+                       ]);
                        
                        // delete old avatar
                        if ($this->parameters['userEditor']->avatarID) {
-                               $action = new UserAvatarAction(array($this->parameters['userEditor']->avatarID), 'delete');
+                               $action = new UserAvatarAction([$this->parameters['userEditor']->avatarID], 'delete');
                                $action->executeAction();
                        }
                }
                
                // reset user storage
-               UserStorageHandler::getInstance()->reset(array($this->parameters['userEditor']->userID), 'avatar');
+               UserStorageHandler::getInstance()->reset([$this->parameters['userEditor']->userID], 'avatar');
        }
        
        /**
@@ -320,13 +320,13 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
         * @return      array
         */
        public function getCropDialog() {
-               return array(
+               return [
                        'cropX' => $this->avatar->cropX,
                        'cropY' => $this->avatar->cropY,
-                       'template' => WCF::getTPL()->fetch('avatarCropDialog', 'wcf', array(
+                       'template' => WCF::getTPL()->fetch('avatarCropDialog', 'wcf', [
                                'avatar' => $this->avatar
-                       ))
-               );
+                       ])
+               ];
        }
        
        /**
@@ -372,13 +372,13 @@ class UserAvatarAction extends AbstractDatabaseObjectAction {
                }
                
                // update database entry
-               $this->avatar->update(array(
+               $this->avatar->update([
                        'cropX' => $this->parameters['cropX'],
                        'cropY' => $this->parameters['cropY']
-               ));
+               ]);
                
-               return array(
+               return [
                        'url' => $this->avatar->getURL(96)
-               );
+               ];
        }
 }
index 315f19d68445590f7648c1790e65cf3f79f200cd..4a3fb920913b0e39deaae6d0b6afbf150f9159d3 100644 (file)
@@ -29,7 +29,7 @@ class UserAvatarEditor extends DatabaseObjectEditor {
                $sql = "DELETE FROM     wcf".WCF_N."_user_avatar
                        WHERE           avatarID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->avatarID));
+               $statement->execute([$this->avatarID]);
                
                $this->deleteFiles();
        }
@@ -37,7 +37,7 @@ class UserAvatarEditor extends DatabaseObjectEditor {
        /**
         * @inheritDoc
         */
-       public static function deleteAll(array $objectIDs = array()) {
+       public static function deleteAll(array $objectIDs = []) {
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_user_avatar
                        WHERE   avatarID IN (".str_repeat('?,', count($objectIDs) - 1)."?)";
index 624fe9a4f8a346551e94ea064bbadfbce8bf46bc..c8ecbfcb8a8701ad2e34ac64d84ba6948df378c2 100644 (file)
@@ -42,13 +42,13 @@ class UserFollow extends DatabaseObject {
                        WHERE   userID = ?
                                AND followUserID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $userID,
                        $followUserID
-               ));
+               ]);
                
                $row = $statement->fetchArray();
-               if (!$row) $row = array();
+               if (!$row) $row = [];
                
                return new UserFollow(null, $row);
        }
index 6a64c914a8776827649ba905d2aaad3a377ff739..b7f3ecd7a047042d19841acc02d64818677687d7 100644 (file)
@@ -27,7 +27,7 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getGroupedUserList');
+       protected $allowGuestAccess = ['getGroupedUserList'];
        
        /**
         * user profile object
@@ -72,26 +72,26 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                
                // not following right now
                if (!$follow->followID) {
-                       $follow = UserFollowEditor::create(array(
+                       $follow = UserFollowEditor::create([
                                'userID' => WCF::getUser()->userID,
                                'followUserID' => $this->parameters['data']['userID'],
                                'time' => TIME_NOW
-                       ));
+                       ]);
                        
                        // send notification
-                       UserNotificationHandler::getInstance()->fireEvent('following', 'com.woltlab.wcf.user.follow', new UserFollowUserNotificationObject($follow), array($follow->followUserID));
+                       UserNotificationHandler::getInstance()->fireEvent('following', 'com.woltlab.wcf.user.follow', new UserFollowUserNotificationObject($follow), [$follow->followUserID]);
                        
                        // fire activity event
                        UserActivityEventHandler::getInstance()->fireEvent('com.woltlab.wcf.user.recentActivityEvent.follow', $this->parameters['data']['userID']);
                        
                        // reset storage
-                       UserStorageHandler::getInstance()->reset(array($this->parameters['data']['userID']), 'followerUserIDs');
-                       UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'followingUserIDs');
+                       UserStorageHandler::getInstance()->reset([$this->parameters['data']['userID']], 'followerUserIDs');
+                       UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'followingUserIDs');
                }
                
-               return array(
+               return [
                        'following' => 1
-               );
+               ];
        }
        
        /**
@@ -114,16 +114,16 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                        $followEditor->delete();
                        
                        // remove activity event
-                       UserActivityEventHandler::getInstance()->removeEvents('com.woltlab.wcf.user.recentActivityEvent.follow', array($this->parameters['data']['userID']));
+                       UserActivityEventHandler::getInstance()->removeEvents('com.woltlab.wcf.user.recentActivityEvent.follow', [$this->parameters['data']['userID']]);
                }
                
                // reset storage
-               UserStorageHandler::getInstance()->reset(array($this->parameters['data']['userID']), 'followerUserIDs');
-               UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'followingUserIDs');
+               UserStorageHandler::getInstance()->reset([$this->parameters['data']['userID']], 'followerUserIDs');
+               UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'followingUserIDs');
                
-               return array(
+               return [
                        'following' => 0
-               );
+               ];
        }
        
        /**
@@ -153,16 +153,16 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
        public function delete() {
                $returnValues = parent::delete();
                
-               $followUserIDs = array();
+               $followUserIDs = [];
                foreach ($this->objects as $follow) {
                        $followUserIDs[] = $follow->followUserID;
                        // remove activity event
-                       UserActivityEventHandler::getInstance()->removeEvents('com.woltlab.wcf.user.recentActivityEvent.follow', array($follow->followUserID));
+                       UserActivityEventHandler::getInstance()->removeEvents('com.woltlab.wcf.user.recentActivityEvent.follow', [$follow->followUserID]);
                }
                
                // reset storage
                UserStorageHandler::getInstance()->reset($followUserIDs, 'followerUserIDs');
-               UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'followingUserIDs');
+               UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'followingUserIDs');
                
                return $returnValues;
        }
@@ -189,7 +189,7 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                        FROM    wcf".WCF_N."_user_follow
                        WHERE   followUserID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->parameters['userID']));
+               $statement->execute([$this->parameters['userID']]);
                $pageCount = ceil($statement->fetchSingleColumn() / 20);
                
                // get user ids
@@ -197,7 +197,7 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                        FROM    wcf".WCF_N."_user_follow
                        WHERE   followUserID = ?";
                $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
-               $statement->execute(array($this->parameters['userID']));
+               $statement->execute([$this->parameters['userID']]);
                $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // create group
@@ -207,13 +207,13 @@ class UserFollowAction extends AbstractDatabaseObjectAction implements IGroupedU
                // load user profiles
                GroupedUserList::loadUsers();
                
-               WCF::getTPL()->assign(array(
-                       'groupedUsers' => array($group)
-               ));
+               WCF::getTPL()->assign([
+                       'groupedUsers' => [$group]
+               ]);
                
-               return array(
+               return [
                        'pageCount' => $pageCount,
                        'template' => WCF::getTPL()->fetch('groupedUserList')
-               );
+               ];
        }
 }
index 93fd45fd0dc745c99233da5d6eb01dedb4bb9f70..10c2f7faf8126bf9078a8759d95df736515d1d41 100644 (file)
@@ -43,7 +43,7 @@ class UserFollowingAction extends UserFollowAction {
                        FROM    wcf".WCF_N."_user_follow
                        WHERE   userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->parameters['userID']));
+               $statement->execute([$this->parameters['userID']]);
                $pageCount = ceil($statement->fetchSingleColumn() / 20);
                
                // get user ids
@@ -51,7 +51,7 @@ class UserFollowingAction extends UserFollowAction {
                        FROM    wcf".WCF_N."_user_follow
                        WHERE   userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
-               $statement->execute(array($this->parameters['userID']));
+               $statement->execute([$this->parameters['userID']]);
                $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // create group
@@ -61,13 +61,13 @@ class UserFollowingAction extends UserFollowAction {
                // load user profiles
                GroupedUserList::loadUsers();
                
-               WCF::getTPL()->assign(array(
-                       'groupedUsers' => array($group)
-               ));
+               WCF::getTPL()->assign([
+                       'groupedUsers' => [$group]
+               ]);
                
-               return array(
+               return [
                        'pageCount' => $pageCount,
                        'template' => WCF::getTPL()->fetch('groupedUserList')
-               );
+               ];
        }
 }
index 3bb469156f39f9d23077ee13b4dbf1c715dd8afc..b9e2eb6bd1eca7b19a9674d4462e793bf9960f1f 100644 (file)
@@ -88,7 +88,7 @@ class UserGroup extends DatabaseObject implements ITitledObject {
        public static function getGroupIDsByType(array $types) {
                self::getCache();
                
-               $groupIDs = array();
+               $groupIDs = [];
                foreach ($types as $type) {
                        if (isset(self::$cache['types'][$type])) {
                                $groupIDs = array_merge($groupIDs, self::$cache['types'][$type]);
@@ -106,10 +106,10 @@ class UserGroup extends DatabaseObject implements ITitledObject {
         * @param       integer[]       $invalidGroupTypes
         * @return      UserGroup[]
         */
-       public static function getGroupsByType(array $types = array(), array $invalidGroupTypes = array()) {
+       public static function getGroupsByType(array $types = [], array $invalidGroupTypes = []) {
                self::getCache();
                
-               $groups = array();
+               $groups = [];
                foreach (self::$cache['groups'] as $group) {
                        if ((empty($types) || in_array($group->groupType, $types)) && !in_array($group->groupType, $invalidGroupTypes)) {
                                $groups[$group->groupID] = $group;
@@ -131,7 +131,7 @@ class UserGroup extends DatabaseObject implements ITitledObject {
                        throw new SystemException('invalid value for type argument');
                }
                
-               $groups = self::getGroupsByType(array($type));
+               $groups = self::getGroupsByType([$type]);
                return array_shift($groups);
        }
        
@@ -182,7 +182,7 @@ class UserGroup extends DatabaseObject implements ITitledObject {
         * @param       array           $groupIDs
         * @return      boolean
         */
-       public static function isAccessibleGroup(array $groupIDs = array()) {
+       public static function isAccessibleGroup(array $groupIDs = []) {
                if (self::$accessibleGroups === null) {
                        self::$accessibleGroups = explode(',', WCF::getSession()->getPermission('admin.user.accessibleGroups'));
                }
@@ -205,11 +205,11 @@ class UserGroup extends DatabaseObject implements ITitledObject {
         * @param       integer[]               $invalidGroupTypes
         * @return      UserGroup[]
         */
-       public static function getAccessibleGroups(array $groupTypes = array(), array $invalidGroupTypes = array()) {
+       public static function getAccessibleGroups(array $groupTypes = [], array $invalidGroupTypes = []) {
                $groups = self::getGroupsByType($groupTypes, $invalidGroupTypes);
                
                foreach ($groups as $key => $value) {
-                       if (!self::isAccessibleGroup(array($key))) {
+                       if (!self::isAccessibleGroup([$key])) {
                                unset($groups[$key]);
                        }
                }
@@ -261,7 +261,7 @@ class UserGroup extends DatabaseObject implements ITitledObject {
         * @return      boolean
         */
        public function isAccessible() {
-               return self::isAccessibleGroup(array($this->groupID));
+               return self::isAccessibleGroup([$this->groupID]);
        }
        
        /**
@@ -337,7 +337,7 @@ class UserGroup extends DatabaseObject implements ITitledObject {
        public function getGroupOption($name) {
                if ($this->groupOptions === null) {
                        // get all options and filter options with low priority
-                       $this->groupOptions = $groupOptionIDs = array();
+                       $this->groupOptions = $groupOptionIDs = [];
                        
                        $sql = "SELECT          optionName, optionID
                                FROM            wcf".WCF_N."_user_group_option";
@@ -350,8 +350,8 @@ class UserGroup extends DatabaseObject implements ITitledObject {
                        
                        if (!empty($groupOptionIDs)) {
                                $conditions = new PreparedStatementConditionBuilder();
-                               $conditions->add("option_value.groupID = ?", array($this->groupID));
-                               $conditions->add("option_value.optionID IN (?)", array($groupOptionIDs));
+                               $conditions->add("option_value.groupID = ?", [$this->groupID]);
+                               $conditions->add("option_value.optionID IN (?)", [$groupOptionIDs]);
                                
                                $sql = "SELECT          group_option.optionName, option_value.optionValue
                                        FROM            wcf".WCF_N."_user_group_option_value option_value
index 3ae0f45b261f71c74999aef928ea8dc95fc9bec1..0a65eeca7c418ad83cd7d2ee778b4eabc01bdc48 100644 (file)
@@ -32,22 +32,22 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.user.canAddGroup');
+       protected $permissionsCreate = ['admin.user.canAddGroup'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.user.canDeleteGroup');
+       protected $permissionsDelete = ['admin.user.canDeleteGroup'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.user.canEditGroup');
+       protected $permissionsUpdate = ['admin.user.canEditGroup'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('copy', 'create', 'delete', 'update');
+       protected $requireACP = ['copy', 'create', 'delete', 'update'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::create()
@@ -81,10 +81,10 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
         * Validates the 'copy' action.
         */
        public function validateCopy() {
-               WCF::getSession()->checkPermissions(array(
+               WCF::getSession()->checkPermissions([
                        'admin.user.canAddGroup',
                        'admin.user.canEditGroup'
-               ));
+               ]);
                
                $this->readBoolean('copyACLOptions');
                $this->readBoolean('copyMembers');
@@ -106,7 +106,7 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
                                FROM    wcf".WCF_N."_user_group_option_value
                                WHERE   groupID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->groupEditor->groupID));
+                       $statement->execute([$this->groupEditor->groupID]);
                }
                else {
                        $sql = "SELECT  optionID, defaultValue AS optionValue
@@ -115,21 +115,21 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
                        $statement->execute();
                }
                
-               $optionValues = array();
+               $optionValues = [];
                while ($row = $statement->fetchArray()) {
                        $optionValues[$row['optionID']] = $row['optionValue'];
                }
                
-               $groupAction = new UserGroupAction(array(), 'create', array(
-                       'data' => array(
+               $groupAction = new UserGroupAction([], 'create', [
+                       'data' => [
                                'groupName' => $this->groupEditor->groupName,
                                'groupDescription' => $this->groupEditor->groupDescription,
                                'priority' => $this->groupEditor->priority,
                                'userOnlineMarking' => $this->groupEditor->userOnlineMarking,
                                'showOnTeamPage' => $this->groupEditor->showOnTeamPage
-                       ),
+                       ],
                        'options' => $optionValues
-               ));
+               ]);
                $returnValues = $groupAction->executeAction();
                $group = $returnValues['returnValues'];
                $groupEditor = new UserGroupEditor($group);
@@ -146,7 +146,7 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
                                FROM            wcf".WCF_N."_language_item
                                WHERE           languageItem = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->groupEditor->groupName));
+                       $statement->execute([$this->groupEditor->groupName]);
                }
                else {
                        $groupName .= ' (2)';
@@ -164,13 +164,13 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
                                FROM            wcf".WCF_N."_language_item
                                WHERE           languageItem = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->groupEditor->groupDescription));
+                       $statement->execute([$this->groupEditor->groupDescription]);
                }
                
-               $groupEditor->update(array(
+               $groupEditor->update([
                        'groupDescription' => $groupDescription,
                        'groupName' => $groupName
-               ));
+               ]);
                
                // copy members
                if ($this->parameters['copyMembers']) {
@@ -180,7 +180,7 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
                                FROM            wcf".WCF_N."_user_to_group
                                WHERE           groupID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->groupEditor->groupID));
+                       $statement->execute([$this->groupEditor->groupID]);
                }
                
                // copy acl options
@@ -191,7 +191,7 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
                                FROM            wcf".WCF_N."_acl_option_to_group
                                WHERE           groupID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->groupEditor->groupID));
+                       $statement->execute([$this->groupEditor->groupID]);
                        
                        // it is likely that applications or plugins use caches
                        // for acl option values like for the labels which have
@@ -206,10 +206,10 @@ class UserGroupAction extends AbstractDatabaseObjectAction {
                
                UserGroupEditor::resetCache();
                
-               return array(
-                       'redirectURL' => LinkHandler::getInstance()->getLink('UserGroupEdit', array(
+               return [
+                       'redirectURL' => LinkHandler::getInstance()->getLink('UserGroupEdit', [
                                'id' => $group->groupID
-                       ))
-               );
+                       ])
+               ];
        }
 }
index c31bd8f8d908a5f075d1427596627f3d1f34fb5d..ec491afbd7ef413aef77441262550991a8119449 100644 (file)
@@ -18,17 +18,17 @@ class UserGroupAssignmentAction extends AbstractDatabaseObjectAction implements
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.user.canManageGroupAssignment');
+       protected $permissionsDelete = ['admin.user.canManageGroupAssignment'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.user.canManageGroupAssignment');
+       protected $permissionsUpdate = ['admin.user.canManageGroupAssignment'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'toggle', 'update');
+       protected $requireACP = ['create', 'delete', 'toggle', 'update'];
        
        /**
         * @see \wcf\data\IDeleteAction::delete()
@@ -44,9 +44,9 @@ class UserGroupAssignmentAction extends AbstractDatabaseObjectAction implements
         */
        public function toggle() {
                foreach ($this->objects as $assignment) {
-                       $assignment->update(array(
+                       $assignment->update([
                                'isDisabled' => $assignment->isDisabled ? 0 : 1
-                       ));
+                       ]);
                }
        }
        
index 1c42a2dde4f5d30bcfdbe90b4000b0c5c905b520..c6bbce6717f49daa5f5dcfad4c61a4f9f9c6e999 100644 (file)
@@ -30,9 +30,9 @@ class UserGroupOptionAction extends AbstractDatabaseObjectAction {
                $sql = "DELETE FROM     wcf".WCF_N."_user_group_option_value
                        WHERE           optionID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $option->optionID
-               ));
+               ]);
                
                if (!empty($this->parameters['values'])) {
                        $sql = "INSERT INTO     wcf".WCF_N."_user_group_option_value
@@ -42,11 +42,11 @@ class UserGroupOptionAction extends AbstractDatabaseObjectAction {
                        
                        WCF::getDB()->beginTransaction();
                        foreach ($this->parameters['values'] as $groupID => $optionValue) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $option->optionID,
                                        $groupID,
                                        $optionValue
-                               ));
+                               ]);
                        }
                        WCF::getDB()->commitTransaction();
                }
index ee759823c7d8d9bb7ee7447fec0586a4312dd419..d4f6e43a93372175b1d3c4e14ae0af5bcdf063ef 100644 (file)
@@ -41,13 +41,13 @@ class UserIgnore extends DatabaseObject {
                        WHERE   userID = ?
                                AND ignoreUserID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        WCF::getUser()->userID,
                        $ignoreUserID
-               ));
+               ]);
                
                $row = $statement->fetchArray();
-               if (!$row) $row = array();
+               if (!$row) $row = [];
                
                return new UserIgnore(null, $row);
        }
index 276c1873758a848cbd96998cd4bd9a8ad841f429..46c312497c5c0f62c557f417a0842ac94cee2a8d 100644 (file)
@@ -78,7 +78,7 @@ class UserMenuItem extends ProcessibleDatabaseObject implements ITreeMenuItem {
                }
                
                $this->parseController();
-               return LinkHandler::getInstance()->getLink($this->controller, array('application' => $this->application), $this->menuItemLink);
+               return LinkHandler::getInstance()->getLink($this->controller, ['application' => $this->application], $this->menuItemLink);
        }
        
        /**
index 875a99ac201179d2c47015a63ab145e1ae40c8ba..6437bbfbbe55aee3f18757bd459880412b9823fc 100644 (file)
@@ -61,7 +61,7 @@ class UserNotification extends DatabaseObject {
                
                $this->data['additionalData'] = @unserialize($this->data['additionalData']);
                if (!is_array($this->data['additionalData'])) {
-                       $this->data['additionalData'] = array();
+                       $this->data['additionalData'] = [];
                }
        }
        
@@ -80,7 +80,7 @@ class UserNotification extends DatabaseObject {
                                AND eventID = ?
                                AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID, $eventID, $objectID));
+               $statement->execute([$packageID, $eventID, $objectID]);
                $row = $statement->fetchArray();
                if ($row !== false) return new UserNotification(null, $row);
                
index e1b35944a343e21ee6f12aec816333d548ad8f96..fa866807c29173ee06c372645f7912af81a4201a 100644 (file)
@@ -46,7 +46,7 @@ class UserObjectWatch extends DatabaseObject {
                                AND userID = ?
                                AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($objectTypeID, $userID, $objectID));
+               $statement->execute([$objectTypeID, $userID, $objectID]);
                $row = $statement->fetch();
                if (!$row) return null;
                return new UserObjectWatch(null, $row);
index dee4aaf6b43771a8ab071c55dd7f55ed54bb90d6..b48a583089759f3e5fa7c4078ad4ef833eee1d22 100644 (file)
@@ -55,15 +55,15 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction {
         * @return      array
         */
        public function manageSubscription() {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'objectType' => $this->objectType,
                        'userObjectWatch' => $this->userObjectWatch
-               ));
+               ]);
                
-               return array(
+               return [
                        'objectID' => $this->parameters['objectID'],
                        'template' => WCF::getTPL()->fetch('manageSubscription')
-               );
+               ];
        }
        
        /**
@@ -84,23 +84,23 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction {
                if ($this->parameters['subscribe']) {
                        // newly subscribed
                        if ($this->userObjectWatch === null) {
-                               UserObjectWatchEditor::create(array(
+                               UserObjectWatchEditor::create([
                                        'notification' => ($this->parameters['enableNotification'] ? 1 : 0),
                                        'objectID' => $this->parameters['objectID'],
                                        'objectTypeID' => $this->objectType->objectTypeID,
                                        'userID' => WCF::getUser()->userID
-                               ));
+                               ]);
                        }
                        else if ($this->userObjectWatch->notification != $this->parameters['enableNotification']) {
                                // update notification type
                                $editor = new UserObjectWatchEditor($this->userObjectWatch);
-                               $editor->update(array(
+                               $editor->update([
                                        'notification' => ($this->parameters['enableNotification'] ? 1 : 0)
-                               ));
+                               ]);
                        }
                        
                        // reset user storage
-                       $this->objectType->getProcessor()->resetUserStorage(array(WCF::getUser()->userID));
+                       $this->objectType->getProcessor()->resetUserStorage([WCF::getUser()->userID]);
                }
                else if ($this->userObjectWatch !== null) {
                        // unsubscribe
@@ -108,13 +108,13 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction {
                        $editor->delete();
                        
                        // reset user storage
-                       $this->objectType->getProcessor()->resetUserStorage(array(WCF::getUser()->userID));
+                       $this->objectType->getProcessor()->resetUserStorage([WCF::getUser()->userID]);
                }
                
-               return array(
+               return [
                        'objectID' => $this->parameters['objectID'],
                        'subscribe' => $this->parameters['subscribe']
-               );
+               ];
        }
        
        /**
@@ -123,15 +123,15 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction {
        public function subscribe() {
                $objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.objectWatch', $this->parameters['data']['objectType']);
                
-               UserObjectWatchEditor::create(array(
+               UserObjectWatchEditor::create([
                        'userID' => WCF::getUser()->userID,
                        'objectID' => intval($this->parameters['data']['objectID']),
                        'objectTypeID' => $objectType->objectTypeID,
                        'notification' => (!empty($this->parameters['enableNotification']) ? 1 : 0)
-               ));
+               ]);
                
                // reset user storage
-               $objectType->getProcessor()->resetUserStorage(array(WCF::getUser()->userID));
+               $objectType->getProcessor()->resetUserStorage([WCF::getUser()->userID]);
        }
        
        /**
@@ -148,7 +148,7 @@ class UserObjectWatchAction extends AbstractDatabaseObjectAction {
                $editor->delete();
                
                // reset user storage
-               $objectType->getProcessor()->resetUserStorage(array(WCF::getUser()->userID));
+               $objectType->getProcessor()->resetUserStorage([WCF::getUser()->userID]);
        }
        
        /**
index 415eea0d4e7037a66039678f20ea66b47485c42f..7b19290090bec86a08896e40919862daa69be12c 100644 (file)
@@ -32,12 +32,12 @@ class UsersOnlineList extends SessionList {
         * users online stats
         * @var array
         */
-       public $stats = array(
+       public $stats = [
                'total' => 0,
                'invisible' => 0,
                'members' => 0,
                'guests' => 0
-       );
+       ];
        
        /**
         * users online markings
@@ -58,7 +58,7 @@ class UsersOnlineList extends SessionList {
                $this->sqlJoins .= " LEFT JOIN wcf".WCF_N."_user_avatar user_avatar ON (user_avatar.avatarID = user_table.avatarID)";
                $this->sqlJoins .= " LEFT JOIN wcf".WCF_N."_user_group user_group ON (user_group.groupID = user_table.userOnlineGroupID)";
                
-               $this->getConditionBuilder()->add('session.lastActivityTime > ?', array(TIME_NOW - USER_ONLINE_TIMEOUT));
+               $this->getConditionBuilder()->add('session.lastActivityTime > ?', [TIME_NOW - USER_ONLINE_TIMEOUT]);
        }
        
        /**
@@ -68,7 +68,7 @@ class UsersOnlineList extends SessionList {
                parent::readObjects();
                
                $objects = $this->objects;
-               $this->indexToObject = $this->objects = array();
+               $this->indexToObject = $this->objects = [];
                
                foreach ($objects as $object) {
                        $object = new UserOnline(new User(null, null, $object));
@@ -117,7 +117,7 @@ class UsersOnlineList extends SessionList {
         */
        public function getUsersOnlineMarkings() {
                if ($this->usersOnlineMarkings === null) {
-                       $this->usersOnlineMarkings = $priorities = array();
+                       $this->usersOnlineMarkings = $priorities = [];
                        
                        // get groups
                        foreach (UserGroup::getGroupsByType() as $group) {
@@ -141,10 +141,10 @@ class UsersOnlineList extends SessionList {
                $usersOnlineTotal = (USERS_ONLINE_RECORD_NO_GUESTS ? $this->stats['members'] : $this->stats['total']);
                if ($usersOnlineTotal > USERS_ONLINE_RECORD) {
                        // save new record
-                       $optionAction = new OptionAction(array(), 'import', array('data' => array(
+                       $optionAction = new OptionAction([], 'import', ['data' => [
                                'users_online_record' => $usersOnlineTotal,
                                'users_online_record_time' => TIME_NOW
-                       )));
+                       ]]);
                        $optionAction->executeAction();
                }
        }
index 5b8f66200b9f26449ed64ffc42ed3e2a2756c85f..f5b13952984f611b8da16e1bb3aa6a5da2b7dab8 100644 (file)
@@ -23,22 +23,22 @@ class UserOptionAction extends AbstractDatabaseObjectAction implements IToggleAc
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.user.canManageUserOption');
+       protected $permissionsCreate = ['admin.user.canManageUserOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.user.canManageUserOption');
+       protected $permissionsDelete = ['admin.user.canManageUserOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.user.canManageUserOption');
+       protected $permissionsUpdate = ['admin.user.canManageUserOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'toggle', 'update');
+       protected $requireACP = ['create', 'delete', 'toggle', 'update'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::validateDelete()
@@ -58,9 +58,9 @@ class UserOptionAction extends AbstractDatabaseObjectAction implements IToggleAc
         */
        public function toggle() {
                foreach ($this->objects as $optionEditor) {
-                       $optionEditor->update(array(
+                       $optionEditor->update([
                                'isDisabled' => 1 - $optionEditor->isDisabled
-                       ));
+                       ]);
                }
        }
        
index 36ecb8688148e753d4025d90023954454858abaa..8add39cfdcae3c52407837ad7c00192093525175 100644 (file)
@@ -30,13 +30,13 @@ class ViewableUserOption extends DatabaseObjectDecorator {
         * list of output objects
         * @var IUserOptionOutput[]
         */
-       public static $outputObjects = array();
+       public static $outputObjects = [];
        
        /**
         * cached user options
         * @var ViewableUserOption[]
         */
-       public static $userOptions = array();
+       public static $userOptions = [];
        
        /**
         * user option value
@@ -95,7 +95,7 @@ class ViewableUserOption extends DatabaseObjectDecorator {
         */
        public static function getUserOption($name) {
                if (!isset(self::$userOptions[$name])) {
-                       $options = UserOptionCacheBuilder::getInstance()->getData(array(), 'options');
+                       $options = UserOptionCacheBuilder::getInstance()->getData([], 'options');
                        self::$userOptions[$name] = new ViewableUserOption($options[$name]);
                }
                
index de9ed9be87db065771e5b3ead50041f68849e638..711b6d09f3df3d46c94f89bd938c589155a0bee0 100644 (file)
@@ -42,7 +42,7 @@ class UserOptionCategory extends DatabaseObject {
                                FROM    wcf".WCF_N."_user_option_category option_category
                                WHERE   option_category.categoryID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($categoryID));
+                       $statement->execute([$categoryID]);
                        $row = $statement->fetchArray();
                }
                
@@ -69,7 +69,7 @@ class UserOptionCategory extends DatabaseObject {
                        FROM    wcf".WCF_N."_user_option_category
                        WHERE   categoryName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($categoryName));
+               $statement->execute([$categoryName]);
                $row = $statement->fetchArray();
                if ($row === false) return null;
                
index 479215485cd541c85f119c9378e3420478a1a704..471e8e0500af89568733da10fe1145e2978a572b 100644 (file)
@@ -21,20 +21,20 @@ class UserOptionCategoryAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsCreate
         */
-       protected $permissionsCreate = array('admin.user.canManageUserOption');
+       protected $permissionsCreate = ['admin.user.canManageUserOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.user.canManageUserOption');
+       protected $permissionsDelete = ['admin.user.canManageUserOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsUpdate
         */
-       protected $permissionsUpdate = array('admin.user.canManageUserOption');
+       protected $permissionsUpdate = ['admin.user.canManageUserOption'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('create', 'delete', 'update');
+       protected $requireACP = ['create', 'delete', 'update'];
 }
index 02399a0cdcc55ddc264cfeab497dd5923ce88875..e1ed1e1d718918ad7d48b7e833734ba9fcb87503 100644 (file)
@@ -74,7 +74,7 @@ class UserProfileMenuItem extends DatabaseObject {
                                throw new SystemException("'".$this->className."' does not implement 'wcf\system\menu\user\profile\content\IUserProfileMenuContent'");
                        }
                        
-                       $this->contentManager = call_user_func(array($this->className, 'getInstance'));
+                       $this->contentManager = call_user_func([$this->className, 'getInstance']);
                }
                
                return $this->contentManager;
index 5443127ce9dc9e1e88eb3f9f10cbd016c93585ff..8b04c5095f94fd760cf64bc9176cbe90137270c1 100644 (file)
@@ -19,7 +19,7 @@ class UserProfileMenuItemAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getContent');
+       protected $allowGuestAccess = ['getContent'];
        
        /**
         * menu item
@@ -50,9 +50,9 @@ class UserProfileMenuItemAction extends AbstractDatabaseObjectAction {
        public function getContent() {
                $contentManager = $this->menuItem->getContentManager();
                
-               return array(
+               return [
                        'containerID' => $this->parameters['data']['containerID'],
                        'template' => $contentManager->getContent($this->parameters['data']['userID'])
-               );
+               ];
        }
 }
index a9d79311fb94bf4d3d4fa63f652dc5778a92b90d..4b4db76e53ea2560a4da9243e330282c8ff15d3d 100644 (file)
@@ -42,7 +42,7 @@ class UserProfileVisitor extends DatabaseObject {
                        WHERE   ownerID = ?
                                AND userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($ownerID, $userID));
+               $statement->execute([$ownerID, $userID]);
                if ($row = $statement->fetchArray()) {
                        return new UserProfileVisitor(null, $row);
                }
index 06ebce9015c7125f855ea9ac9c04002262b47efc..186acbf87a2e4156a43c717b962733e20b610154 100644 (file)
@@ -22,7 +22,7 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$allowGuestAccess
         */
-       protected $allowGuestAccess = array('getGroupedUserList');
+       protected $allowGuestAccess = ['getGroupedUserList'];
        
        /**
         * user profile object
@@ -52,7 +52,7 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I
                        FROM    wcf".WCF_N."_user_profile_visitor
                        WHERE   ownerID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->parameters['userID']));
+               $statement->execute([$this->parameters['userID']]);
                $pageCount = ceil($statement->fetchSingleColumn() / 20);
                
                // get user ids
@@ -61,7 +61,7 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I
                        WHERE           ownerID = ?
                        ORDER BY        time DESC";
                $statement = WCF::getDB()->prepareStatement($sql, 20, ($this->parameters['pageNo'] - 1) * 20);
-               $statement->execute(array($this->parameters['userID']));
+               $statement->execute([$this->parameters['userID']]);
                $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // create group
@@ -71,13 +71,13 @@ class UserProfileVisitorAction extends AbstractDatabaseObjectAction implements I
                // load user profiles
                GroupedUserList::loadUsers();
                
-               WCF::getTPL()->assign(array(
-                       'groupedUsers' => array($group)
-               ));
+               WCF::getTPL()->assign([
+                       'groupedUsers' => [$group]
+               ]);
                
-               return array(
+               return [
                        'pageCount' => $pageCount,
                        'template' => WCF::getTPL()->fetch('groupedUserList')
-               );
+               ];
        }
 }
index 89793136c370d99eea9603bc1f33a43ca49e9d44..818685c1cb56d7477687fde1f371257160e4e3ea 100644 (file)
@@ -16,10 +16,10 @@ class UserRankAction extends AbstractDatabaseObjectAction {
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$permissionsDelete
         */
-       protected $permissionsDelete = array('admin.user.rank.canManageRank');
+       protected $permissionsDelete = ['admin.user.rank.canManageRank'];
        
        /**
         * @see \wcf\data\AbstractDatabaseObjectAction::$requireACP
         */
-       protected $requireACP = array('delete');
+       protected $requireACP = ['delete'];
 }
index 254774023ff6cbae5b0853e9e3f0104c6f624619..752aaa597fbb8d045b6fe510c7cdb05eb0d3d5d7 100644 (file)
@@ -39,10 +39,10 @@ abstract class AbstractCaptchaForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'captchaObjectType' => $this->captchaObjectType,
                        'useCaptcha' => $this->useCaptcha
-               ));
+               ]);
        }
        
        /**
index c1eca91d77ebb68454e1f9fe5f7f220c0b306927..2e0ba0877b0f52ac512e9dbec0e24a301e208025 100644 (file)
@@ -46,7 +46,7 @@ abstract class AbstractForm extends AbstractPage implements IForm {
         * additional fields
         * @var mixed[]
         */
-       public $additionalFields = array();
+       public $additionalFields = [];
        
        /**
         * @see \wcf\form\IForm::submit()
@@ -124,10 +124,10 @@ abstract class AbstractForm extends AbstractPage implements IForm {
                parent::assignVariables();
                
                // assign default variables
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'activeTabMenuItem' => $this->activeTabMenuItem,
                        'errorField' => $this->errorField,
                        'errorType' => $this->errorType
-               ));
+               ]);
        }
 }
index 8c5d28a63282efef7a015b27ba660df938a2bb31..0d6d3babe7eb04550c323c801d15316f5cd96cc4 100644 (file)
@@ -273,7 +273,7 @@ class AccountManagementForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'password' => $this->password,
                        'email' => $this->email,
                        'confirmEmail' => $this->confirmEmail,
@@ -292,7 +292,7 @@ class AccountManagementForm extends AbstractForm {
                        'facebookDisconnect' => $this->facebookDisconnect,
                        'googleConnect' => $this->googleConnect,
                        'googleDisconnect' => $this->googleDisconnect
-               ));
+               ]);
        }
        
        /**
@@ -311,8 +311,8 @@ class AccountManagementForm extends AbstractForm {
        public function save() {
                parent::save();
                
-               $success = array();
-               $updateParameters = array();
+               $success = [];
+               $updateParameters = [];
                
                // quit
                if (WCF::getSession()->getPermission('user.profile.canQuit')) {
@@ -353,13 +353,13 @@ class AccountManagementForm extends AbstractForm {
                                $updateParameters['reactivationCode'] = $activationCode;
                                $updateParameters['newEmail'] = $this->email;
                                
-                               $messageData = array(
+                               $messageData = [
                                        'username' => WCF::getUser()->username,
                                        'userID' => WCF::getUser()->userID,
                                        'activationCode' => $activationCode
-                               );
+                               ];
                                
-                               $mail = new Mail(array(WCF::getUser()->username => $this->email), WCF::getLanguage()->getDynamicVariable('wcf.user.changeEmail.needReactivation.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.changeEmail.needReactivation.mail', $messageData));
+                               $mail = new Mail([WCF::getUser()->username => $this->email], WCF::getLanguage()->getDynamicVariable('wcf.user.changeEmail.needReactivation.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.changeEmail.needReactivation.mail', $messageData));
                                $mail->send();
                                $success[] = 'wcf.user.changeEmail.needReactivation';
                        }
@@ -431,12 +431,12 @@ class AccountManagementForm extends AbstractForm {
                        $success[] = 'wcf.user.3rdparty.google.disconnect.success';
                }
                
-               $data = array();
+               $data = [];
                if (!empty($updateParameters) || !empty($this->additionalFields)) {
                        $data['data'] = array_merge($this->additionalFields, $updateParameters);
                }
                
-               $this->objectAction = new UserAction(array(WCF::getUser()), 'update', $data);
+               $this->objectAction = new UserAction([WCF::getUser()], 'update', $data);
                $this->objectAction->executeAction();
                
                // update cookie
@@ -449,7 +449,7 @@ class AccountManagementForm extends AbstractForm {
                
                $this->saved();
                
-               $success = array_merge($success, WCF::getTPL()->get('success') ?: array());
+               $success = array_merge($success, WCF::getTPL()->get('success') ?: []);
                
                // show success message
                WCF::getTPL()->assign('success', $success);
index 185c1447ad06dd33e4505176f186695ce6fdb651..65ba16e61dda86acf5c05e189f442f30c897531d 100644 (file)
@@ -91,7 +91,7 @@ class AvatarEditForm extends AbstractForm {
                if ($this->avatarType != 'custom') {
                        // delete custom avatar
                        if (WCF::getUser()->avatarID) {
-                               $action = new UserAvatarAction(array(WCF::getUser()->avatarID), 'delete');
+                               $action = new UserAvatarAction([WCF::getUser()->avatarID], 'delete');
                                $action->executeAction();
                        }
                }
@@ -99,33 +99,33 @@ class AvatarEditForm extends AbstractForm {
                // update user
                switch ($this->avatarType) {
                        case 'none':
-                               $data = array(
+                               $data = [
                                        'avatarID' => null,
                                        'enableGravatar' => 0
-                               );
+                               ];
                        break;
                                
                        case 'custom':
-                               $data = array(
+                               $data = [
                                        'enableGravatar' => 0
-                               );
+                               ];
                        break;
                                
                        case 'gravatar':
-                               $data = array(
+                               $data = [
                                        'avatarID' => null,
                                        'enableGravatar' => 1
-                               );
+                               ];
                        break;
                }
-               $this->objectAction = new UserAction(array(WCF::getUser()), 'update', array(
+               $this->objectAction = new UserAction([WCF::getUser()], 'update', [
                        'data' => array_merge($this->additionalFields, $data)
-               ));
+               ]);
                $this->objectAction->executeAction();
                
                // check if the user will be automatically added to new user groups
                // because of the changed avatar
-               UserGroupAssignmentHandler::getInstance()->checkUsers(array(WCF::getUser()->userID));
+               UserGroupAssignmentHandler::getInstance()->checkUsers([WCF::getUser()->userID]);
                
                // reset gravatar cache
                if ($this->avatarType == 'gravatar') {
@@ -162,9 +162,9 @@ class AvatarEditForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'avatarType' => $this->avatarType
-               ));
+               ]);
        }
        
        /**
index b7cf702883a318163e0c0f52bad729ccd4c09a88..e600caf9f11d644474b3de94c1cc5289ef66e010 100644 (file)
@@ -95,13 +95,13 @@ class EmailActivationForm extends AbstractForm {
                parent::save();
                
                // enable new email
-               $this->objectAction = new UserAction(array($this->user), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserAction([$this->user], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'email' => $this->user->newEmail,
                                'newEmail' => '',
                                'reactivationCode' => 0
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -116,10 +116,10 @@ class EmailActivationForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'u' => $this->userID,
                        'a' => $this->activationCode
-               ));
+               ]);
        }
        
        /**
index 230fc9d40f82939db3d1c27366fba51e22bb512d..c3732a8d13bbfa29f0e7beaf6ca551c7a75a3ff9 100644 (file)
@@ -59,20 +59,20 @@ class EmailNewActivationCodeForm extends RegisterNewActivationCodeForm {
                $activationCode = UserRegistrationUtil::getActivationCode();
                
                // save user
-               $this->objectAction = new UserAction(array($this->user), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserAction([$this->user], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'reactivationCode' => $activationCode
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                
                // send activation mail
-               $messageData = array(
+               $messageData = [
                        'username' => $this->user->username,
                        'userID' => $this->user->userID,
                        'activationCode' => $activationCode
-               );
-               $mail = new Mail(array($this->user->username => $this->user->newEmail), WCF::getLanguage()->getDynamicVariable('wcf.user.changeEmail.needReactivation.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.changeEmail.needReactivation.mail', $messageData));
+               ];
+               $mail = new Mail([$this->user->username => $this->user->newEmail], WCF::getLanguage()->getDynamicVariable('wcf.user.changeEmail.needReactivation.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.changeEmail.needReactivation.mail', $messageData));
                $mail->send();
                $this->saved();
                
index d601e0874223295dfc97d4dbaaf80bc4d43be6a0..90391c46ba687f9cbac7d366f4bec5f506fc17f9 100644 (file)
@@ -91,7 +91,7 @@ class LostPasswordForm extends AbstractCaptchaForm {
                
                // check whether a lost password request was sent in the last 24 hours
                if ($this->user->lastLostPasswordRequestTime && TIME_NOW - 86400 < $this->user->lastLostPasswordRequestTime) {
-                       throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword.error.tooManyRequests', array('hours' => ceil(($this->user->lastLostPasswordRequestTime - (TIME_NOW - 86400)) / 3600))));
+                       throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword.error.tooManyRequests', ['hours' => ceil(($this->user->lastLostPasswordRequestTime - (TIME_NOW - 86400)) / 3600)]));
                }
        }
        
@@ -105,20 +105,20 @@ class LostPasswordForm extends AbstractCaptchaForm {
                $lostPasswordKey = StringUtil::getRandomID();
                
                // save key and request time in database
-               $this->objectAction = new UserAction(array($this->user), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserAction([$this->user], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'lostPasswordKey' => $lostPasswordKey,
                                'lastLostPasswordRequestTime' => TIME_NOW
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                
                // send mail
-               $mail = new Mail(array($this->user->username => $this->user->email), WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword.mail', array(
+               $mail = new Mail([$this->user->username => $this->user->email], WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.lostPassword.mail', [
                        'username' => $this->user->username,
                        'userID' => $this->user->userID,
                        'key' => $lostPasswordKey
-               )));
+               ]));
                $mail->send();
                $this->saved();
                
@@ -133,9 +133,9 @@ class LostPasswordForm extends AbstractCaptchaForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'username' => $this->username,
                        'email' => $this->email
-               ));
+               ]);
        }
 }
index 04b68237b6eb36b5e3da0e8ed03abe5f1b43d865..9b140caf53557bd7c115c0737e7e1c423d9348c7 100644 (file)
@@ -62,13 +62,13 @@ abstract class MessageForm extends AbstractCaptchaForm {
         * list of available content languages
         * @var Language[]
         */
-       public $availableContentLanguages = array();
+       public $availableContentLanguages = [];
        
        /**
         * list of default smilies
         * @var Smiley[]
         */
-       public $defaultSmilies = array();
+       public $defaultSmilies = [];
        
        /**
         * enables bbcodes
@@ -146,7 +146,7 @@ abstract class MessageForm extends AbstractCaptchaForm {
         * list of smiley categories
         * @var SmileyCategory[]
         */
-       public $smileyCategories = array();
+       public $smileyCategories = [];
        
        /**
         * message subject
@@ -369,7 +369,7 @@ abstract class MessageForm extends AbstractCaptchaForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'attachmentHandler' => $this->attachmentHandler,
                        'attachmentObjectID' => $this->attachmentObjectID,
                        'attachmentObjectType' => $this->attachmentObjectType,
@@ -391,7 +391,7 @@ abstract class MessageForm extends AbstractCaptchaForm {
                        'subject' => $this->subject,
                        'text' => $this->text,
                        'tmpHash' => $this->tmpHash
-               ));
+               ]);
                
                if ($this->allowedBBCodesPermission) {
                        WCF::getTPL()->assign('allowedBBCodes', explode(',', ArrayUtil::trim(WCF::getSession()->getPermission($this->allowedBBCodesPermission))));
index 2acc66286f850625c9ccfc114a38f48c4f0e5c6f..410e11b83e44acd604207e0f31d0006f5c2400c4 100644 (file)
@@ -35,9 +35,9 @@ class ModerationActivationForm extends AbstractModerationForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'disabledContent' => ModerationQueueActivationManager::getInstance()->getDisabledContent($this->queue),
                        'queueManager' => ModerationQueueActivationManager::getInstance()
-               ));
+               ]);
        }
 }
index 8acb077682bd2c72738af8238a999901f70f4d15..e0aff6fd4125264c4dbb4981939c6cf7c1cb8e00 100644 (file)
@@ -38,11 +38,11 @@ class ModerationReportForm extends AbstractModerationForm {
                parent::assignVariables();
                
                $reportUser = UserProfile::getUserProfile($this->queue->userID);
-               if ($reportUser === null) $reportUser = new UserProfile(new User(null, array()));
-               WCF::getTPL()->assign(array(
+               if ($reportUser === null) $reportUser = new UserProfile(new User(null, []));
+               WCF::getTPL()->assign([
                        'reportedContent' => ModerationQueueReportManager::getInstance()->getReportedContent($this->queue),
                        'queueManager' => ModerationQueueReportManager::getInstance(),
                        'reportUser' => $reportUser
-               ));
+               ]);
        }
 }
index 9df1e06ef9d15cf0bb621091ade5e78316284593..8aa2827c1d048502576d9687d99f1aca025a2097 100644 (file)
@@ -103,21 +103,21 @@ class NewPasswordForm extends AbstractForm {
                $this->newPassword = PasswordUtil::getRandomPassword((REGISTER_PASSWORD_MIN_LENGTH > 12 ? REGISTER_PASSWORD_MIN_LENGTH : 12));
                
                // update user
-               $this->objectAction = new UserAction(array($this->user), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserAction([$this->user], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'password' => $this->newPassword,
                                'lastLostPasswordRequestTime' => 0,
                                'lostPasswordKey' => ''
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                
                // send mail
-               $mail = new Mail(array($this->user->username => $this->user->email), WCF::getLanguage()->getDynamicVariable('wcf.user.newPassword.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.newPassword.mail', array(
+               $mail = new Mail([$this->user->username => $this->user->email], WCF::getLanguage()->getDynamicVariable('wcf.user.newPassword.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.newPassword.mail', [
                        'username' => $this->user->username,
                        'userID' => $this->user->userID,
                        'newPassword' => $this->newPassword
-               )));
+               ]));
                $mail->send();
                $this->saved();
                
@@ -132,10 +132,10 @@ class NewPasswordForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'userID' => $this->userID,
                        'lostPasswordKey' => $this->lostPasswordKey
-               ));
+               ]);
        }
        
        /**
index 8e5e9a7cc7204f50e80643b6fa67c084ccb8becf..e1520465696db69e7132a84287820fef907f57a8 100644 (file)
@@ -33,13 +33,13 @@ class NotificationSettingsForm extends AbstractForm {
         * list of settings by event
         * @var mixed[][]
         */
-       public $settings = array();
+       public $settings = [];
        
        /**
         * list of valid options for the mail notification type.
         * @var string[]
         */
-       protected static $validMailNotificationTypes = array('none', 'instant', 'daily');
+       protected static $validMailNotificationTypes = ['none', 'instant', 'daily'];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -79,7 +79,7 @@ class NotificationSettingsForm extends AbstractForm {
                parent::validate();
                
                // valid event ids
-               $validEventIDs = array();
+               $validEventIDs = [];
                foreach ($this->events as $events) {
                        foreach ($events as $event) {
                                $validEventIDs[] = $event->eventID;
@@ -118,14 +118,14 @@ class NotificationSettingsForm extends AbstractForm {
                // default values
                if (empty($_POST)) {
                        // get user settings
-                       $eventIDs = array();
+                       $eventIDs = [];
                        foreach ($this->events as $events) {
                                foreach ($events as $event) {
                                        $eventIDs[] = $event->eventID;
-                                       $this->settings[$event->eventID] = array(
+                                       $this->settings[$event->eventID] = [
                                                'enabled' => false,
                                                'mailNotificationType' => 'none'
-                                       );
+                                       ];
                                }
                        }
                        
@@ -134,7 +134,7 @@ class NotificationSettingsForm extends AbstractForm {
                                FROM    wcf".WCF_N."_user_notification_event_to_user
                                WHERE   userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(WCF::getUser()->userID));
+                       $statement->execute([WCF::getUser()->userID]);
                        while ($row = $statement->fetchArray()) {
                                $this->settings[$row['eventID']]['enabled'] = true;
                                $this->settings[$row['eventID']]['mailNotificationType'] = $row['mailNotificationType'];
@@ -148,13 +148,13 @@ class NotificationSettingsForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               $groupedEvents = array();
+               $groupedEvents = [];
                foreach ($this->events as $objectType => $events) {
                        $objectTypeObj = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.notification.objectType', $objectType);
                        $category = ($objectTypeObj->category ?: $objectType);
                        
                        if (!isset($groupedEvents[$category])) {
-                               $groupedEvents[$category] = array();
+                               $groupedEvents[$category] = [];
                        }
                        
                        foreach ($events as $event) $groupedEvents[$category][] = $event;
@@ -162,10 +162,10 @@ class NotificationSettingsForm extends AbstractForm {
                
                ksort($groupedEvents);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'events' => $groupedEvents,
                        'settings' => $this->settings
-               ));
+               ]);
        }
        
        /**
@@ -200,18 +200,18 @@ class NotificationSettingsForm extends AbstractForm {
                                        AND userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                WCF::getDB()->beginTransaction();
-               $newSettings = array();
+               $newSettings = [];
                foreach ($this->settings as $eventID => $setting) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $eventID,
                                WCF::getUser()->userID
-                       ));
+                       ]);
                        
                        if ($setting['enabled']) {
-                               $newSettings[] = array(
+                               $newSettings[] = [
                                        'eventID' => $eventID,
                                        'mailNotificationType' => $setting['mailNotificationType']
-                               );
+                               ];
                        }
                }
                
@@ -221,11 +221,11 @@ class NotificationSettingsForm extends AbstractForm {
                                VALUES          (?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($newSettings as $newSetting) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $newSetting['eventID'],
                                        WCF::getUser()->userID,
                                        $newSetting['mailNotificationType']
-                               ));
+                               ]);
                        }
                }
                WCF::getDB()->commitTransaction();
index 19b702755a0c5838c35237fca22754bb23871f9f..9139b34b02423dd0af0cd51990afb83376574bce 100644 (file)
@@ -111,13 +111,13 @@ abstract class RecaptchaForm extends AbstractForm {
                }
                else {
                        // V2
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'recaptchaLegacyMode' => true
-                       ));
+                       ]);
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'useCaptcha' => $this->useCaptcha
-               ));
+               ]);
        }
 }
index afae3d22a8a71721a9d94fd651b13faeaafd2eb0..0ca3463f6012e1e531051bcaabca25a47acdb6b0 100644 (file)
@@ -96,7 +96,7 @@ class RegisterActivationForm extends AbstractForm {
                parent::save();
                
                // enable user
-               $this->objectAction = new UserAction(array($this->user), 'enable', array('skipNotification' => true));
+               $this->objectAction = new UserAction([$this->user], 'enable', ['skipNotification' => true]);
                $this->objectAction->executeAction();
                $this->saved();
                
@@ -111,10 +111,10 @@ class RegisterActivationForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'username' => $this->username,
                        'activationCode' => $this->activationCode
-               ));
+               ]);
        }
        
        /**
index 813e741f3c0e571c22e650c86a94704b65729238..7cfb463079a06e2116763e2b22eec592d6c149e7 100644 (file)
@@ -138,23 +138,23 @@ class RegisterNewActivationCodeForm extends AbstractForm {
                $activationCode = UserRegistrationUtil::getActivationCode();
                
                // save user
-               $parameters = array('activationCode' => $activationCode);
+               $parameters = ['activationCode' => $activationCode];
                if (!empty($this->email)) $parameters['email'] = $this->email;
-               $this->objectAction = new UserAction(array($this->user), 'update', array(
+               $this->objectAction = new UserAction([$this->user], 'update', [
                        'data' => array_merge($this->additionalFields, $parameters)
-               ));
+               ]);
                $this->objectAction->executeAction();
                
                // reload user to reflect changes
                $this->user = new User($this->user->userID);
                
                // send activation mail
-               $mail = new Mail(array($this->user->username => (!empty($this->email) ? $this->email : $this->user->email)), WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail', array('user' => $this->user)));
+               $mail = new Mail([$this->user->username => (!empty($this->email) ? $this->email : $this->user->email)], WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail.subject'), WCF::getLanguage()->getDynamicVariable('wcf.user.register.needActivation.mail', ['user' => $this->user]));
                $mail->send();
                $this->saved();
                
                // forward to index page
-               HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), WCF::getLanguage()->getDynamicVariable('wcf.user.newActivationCode.success', array('email' => (!empty($this->email) ? $this->email : $this->user->email))), 10);
+               HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), WCF::getLanguage()->getDynamicVariable('wcf.user.newActivationCode.success', ['email' => (!empty($this->email) ? $this->email : $this->user->email)]), 10);
                exit;
        }
        
@@ -175,11 +175,11 @@ class RegisterNewActivationCodeForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'username' => $this->username,
                        'password' => $this->password,
                        'email' => $this->email
-               ));
+               ]);
        }
        
        /**
index 3a2030fd5af5bf8ff06161444e07604bd78c60f9..0ee3410e66e38517d44dfa225a6db0ce3e4f1e09 100644 (file)
@@ -31,7 +31,7 @@ class SearchForm extends AbstractCaptchaForm {
         * list of additional conditions
         * @var string[]
         */
-       public $additionalConditions = array();
+       public $additionalConditions = [];
        
        /**
         * end date
@@ -67,7 +67,7 @@ class SearchForm extends AbstractCaptchaForm {
         * list of search results
         * @var array
         */
-       public $results = array();
+       public $results = [];
        
        /**
         * @see \wcf\page\SortablePage::$sortField
@@ -100,7 +100,7 @@ class SearchForm extends AbstractCaptchaForm {
         * parameters used for previous search
         * @var array
         */
-       public $searchData = array();
+       public $searchData = [];
        
        /**
         * search id
@@ -124,7 +124,7 @@ class SearchForm extends AbstractCaptchaForm {
         * selected object types
         * @var string[]
         */
-       public $selectedObjectTypes = array();
+       public $selectedObjectTypes = [];
        
        /**
         * start date
@@ -263,11 +263,11 @@ class SearchForm extends AbstractCaptchaForm {
                }
                
                // build search hash
-               $this->searchHash = StringUtil::getHash(serialize(array($this->query, $this->selectedObjectTypes, !$this->subjectOnly, $this->searchIndexCondition, $this->additionalConditions, $this->sortField.' '.$this->sortOrder, PACKAGE_ID)));
+               $this->searchHash = StringUtil::getHash(serialize([$this->query, $this->selectedObjectTypes, !$this->subjectOnly, $this->searchIndexCondition, $this->additionalConditions, $this->sortField.' '.$this->sortOrder, PACKAGE_ID]));
                
                // check search hash
                if (!empty($this->query)) {
-                       $parameters = array($this->searchHash, 'messages', TIME_NOW - 1800);
+                       $parameters = [$this->searchHash, 'messages', TIME_NOW - 1800];
                        if (WCF::getUser()->userID) $parameters[] = WCF::getUser()->userID;
                        
                        $sql = "SELECT  searchID
@@ -280,7 +280,7 @@ class SearchForm extends AbstractCaptchaForm {
                        $statement->execute($parameters);
                        $row = $statement->fetchArray();
                        if ($row !== false) {
-                               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('SearchResult', array('id' => $row['searchID']), 'highlight='.urlencode($this->query)));
+                               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('SearchResult', ['id' => $row['searchID']], 'highlight='.urlencode($this->query)));
                                exit;
                        }
                }
@@ -304,7 +304,7 @@ class SearchForm extends AbstractCaptchaForm {
                        throw new NamedUserException(WCF::getLanguage()->get('wcf.search.error.user.noMatches'));
                }
                else {
-                       throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.search.error.noMatches', array('query' => $this->query)));
+                       throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.search.error.noMatches', ['query' => $this->query]));
                }
        }
        
@@ -327,7 +327,7 @@ class SearchForm extends AbstractCaptchaForm {
                parent::save();
                
                // get additional data
-               $additionalData = array();
+               $additionalData = [];
                foreach (SearchEngine::getInstance()->getAvailableObjectTypes() as $objectTypeName => $objectType) {
                        if (($data = $objectType->getAdditionalData()) !== null) {
                                $additionalData[$objectTypeName] = $data;
@@ -335,7 +335,7 @@ class SearchForm extends AbstractCaptchaForm {
                }
                
                // save result in database
-               $this->searchData = array(
+               $this->searchData = [
                        'packageID' => PACKAGE_ID,
                        'query' => $this->query,
                        'results' => $this->results,
@@ -350,24 +350,24 @@ class SearchForm extends AbstractCaptchaForm {
                        'userID' => $this->userID,
                        'selectedObjectTypes' => $this->selectedObjectTypes,
                        'alterable' => (!$this->userID ? 1 : 0)
-               );
+               ];
                if ($this->modifySearchID) {
-                       $this->objectAction = new SearchAction(array($this->modifySearchID), 'update', array('data' => array(
+                       $this->objectAction = new SearchAction([$this->modifySearchID], 'update', ['data' => [
                                'searchData' => serialize($this->searchData),
                                'searchTime' => TIME_NOW,
                                'searchType' => 'messages',
                                'searchHash' => $this->searchHash
-                       )));
+                       ]]);
                        $this->objectAction->executeAction();
                }
                else {
-                       $this->objectAction = new SearchAction(array(), 'create', array('data' => array(
+                       $this->objectAction = new SearchAction([], 'create', ['data' => [
                                'userID' => (WCF::getUser()->userID ?: null),
                                'searchData' => serialize($this->searchData),
                                'searchTime' => TIME_NOW,
                                'searchType' => 'messages',
                                'searchHash' => $this->searchHash
-                       )));
+                       ]]);
                        $resultValues = $this->objectAction->executeAction();
                        $this->searchID = $resultValues['returnValues']->searchID;
                }
@@ -387,10 +387,10 @@ class SearchForm extends AbstractCaptchaForm {
                }
                
                // forward to result page
-               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('SearchResult', array(
+               HeaderUtil::redirect(LinkHandler::getInstance()->getLink('SearchResult', [
                        'id' => $this->searchID,
                        'application' => $application
-               ), 'highlight='.urlencode($this->query)));
+               ], 'highlight='.urlencode($this->query)));
                exit;
        }
        
@@ -403,7 +403,7 @@ class SearchForm extends AbstractCaptchaForm {
                // init form
                foreach (SearchEngine::getInstance()->getAvailableObjectTypes() as $objectType) $objectType->show($this);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'query' => $this->query,
                        'subjectOnly' => $this->subjectOnly,
                        'username' => $this->username,
@@ -414,7 +414,7 @@ class SearchForm extends AbstractCaptchaForm {
                        'sortOrder' => $this->sortOrder,
                        'selectedObjectTypes' => $this->selectedObjectTypes,
                        'objectTypes' => SearchEngine::getInstance()->getAvailableObjectTypes()
-               ));
+               ]);
        }
        
        /**
@@ -444,25 +444,25 @@ class SearchForm extends AbstractCaptchaForm {
                
                // user ids
                if (!empty($userIDs)) {
-                       $this->searchIndexCondition->add('userID IN (?)', array($userIDs));
+                       $this->searchIndexCondition->add('userID IN (?)', [$userIDs]);
                }
                
                // dates
                $startDate = @strtotime($this->startDate);
                $endDate = @strtotime($this->endDate);
                if ($startDate && $endDate) {
-                       $this->searchIndexCondition->add('time BETWEEN ? AND ?', array($startDate, $endDate));
+                       $this->searchIndexCondition->add('time BETWEEN ? AND ?', [$startDate, $endDate]);
                }
                else if ($startDate) {
-                       $this->searchIndexCondition->add('time > ?', array($startDate));
+                       $this->searchIndexCondition->add('time > ?', [$startDate]);
                }
                else if ($endDate) {
-                       $this->searchIndexCondition->add('time < ?', array($endDate));
+                       $this->searchIndexCondition->add('time < ?', [$endDate]);
                }
                
                // language
                if (!empty($this->query) && LanguageFactory::getInstance()->multilingualismEnabled() && count(WCF::getUser()->getLanguageIDs())) {
-                       $this->searchIndexCondition->add('(languageID IN (?) OR languageID = 0)', array(WCF::getUser()->getLanguageIDs()));
+                       $this->searchIndexCondition->add('(languageID IN (?) OR languageID = 0)', [WCF::getUser()->getLanguageIDs()]);
                }
                
                foreach ($this->selectedObjectTypes as $key => $objectTypeName) {
@@ -498,7 +498,7 @@ class SearchForm extends AbstractCaptchaForm {
         * @return      integer[]
         */
        public function getUserIDs() {
-               $userIDs = array();
+               $userIDs = [];
                
                // username
                if (!empty($this->username)) {
@@ -506,7 +506,7 @@ class SearchForm extends AbstractCaptchaForm {
                                FROM    wcf".WCF_N."_user
                                WHERE   username ".($this->nameExactly ? "= ?" : "LIKE ?");
                        $statement = WCF::getDB()->prepareStatement($sql, 100);
-                       $statement->execute(array($this->username.(!$this->nameExactly ? '%' : '')));
+                       $statement->execute([$this->username.(!$this->nameExactly ? '%' : '')]);
                        $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                        
                        if (empty($userIDs)) {
index 63739b77cab249006c51f1823820e6b0cc192419..9c4fe3e85fa9fc7863ba766e0f3cfd669bd4c3ed 100644 (file)
@@ -44,7 +44,7 @@ class SettingsForm extends AbstractForm {
        /**
         * @see \wcf\form\AbstractForm::$errorType
         */
-       public $errorType = array();
+       public $errorType = [];
        
        /**
         * option category
@@ -56,25 +56,25 @@ class SettingsForm extends AbstractForm {
         * list of available content languages
         * @var Language[]
         */
-       public $availableContentLanguages = array();
+       public $availableContentLanguages = [];
        
        /**
         * list of available languages
         * @var Language[]
         */
-       public $availableLanguages = array();
+       public $availableLanguages = [];
        
        /**
         * list of available styles
         * @var Style[]
         */
-       public $availableStyles = array();
+       public $availableStyles = [];
        
        /**
         * list of content language ids
         * @var integer[]
         */
-       public $contentLanguageIDs = array();
+       public $contentLanguageIDs = [];
        
        /**
         * language id
@@ -193,23 +193,23 @@ class SettingsForm extends AbstractForm {
                parent::save();
                
                $saveOptions = $this->optionHandler->save();
-               $parameters = array('options' => $saveOptions);
+               $parameters = ['options' => $saveOptions];
                // static options
                if ($this->category == 'general') {
-                       $parameters['data'] = array_merge($this->additionalFields, array(
+                       $parameters['data'] = array_merge($this->additionalFields, [
                                'languageID' => $this->languageID,
                                'styleID' => $this->styleID
-                       ));
+                       ]);
                        $parameters['languageIDs'] = $this->contentLanguageIDs;
                }
                
-               $this->objectAction = new UserAction(array(WCF::getUser()), 'update', $parameters);
+               $this->objectAction = new UserAction([WCF::getUser()], 'update', $parameters);
                $this->objectAction->executeAction();
                
                // static options
                if ($this->category == 'general') {
                        // reset user language ids cache
-                       UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'languageIDs');
+                       UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'languageIDs');
                }
                $this->saved();
                
@@ -222,20 +222,20 @@ class SettingsForm extends AbstractForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'optionTree' => $this->optionHandler->getOptionTree(),
                        'category' => $this->category
-               ));
+               ]);
                // static options
                if ($this->category == 'general') {
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'availableContentLanguages' => $this->availableContentLanguages,
                                'availableLanguages' => $this->availableLanguages,
                                'availableStyles' => $this->availableStyles,
                                'contentLanguageIDs' => $this->contentLanguageIDs,
                                'languageID' => $this->languageID,
                                'styleID' => $this->styleID
-                       ));
+                       ]);
                }
        }
        
index e3356f8a60ade2f915827edaab48e12b56247aaa..10fa4c8010f23264b0a4672d69a7ce2222edde60 100644 (file)
@@ -31,7 +31,7 @@ class SignatureEditForm extends MessageForm {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_USER_SIGNATURE');
+       public $neededModules = ['MODULE_USER_SIGNATURE'];
        
        /**
         * @see \wcf\page\AbstractPage::$templateName
@@ -116,9 +116,9 @@ class SignatureEditForm extends MessageForm {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'signatureCache' => $this->signatureCache
-               ));
+               ]);
        }
        
        /**
@@ -137,14 +137,14 @@ class SignatureEditForm extends MessageForm {
        public function save() {
                parent::save();
                
-               $this->objectAction = new UserAction(array(WCF::getUser()), 'update', array(
-                       'data' => array_merge($this->additionalFields, array(
+               $this->objectAction = new UserAction([WCF::getUser()], 'update', [
+                       'data' => array_merge($this->additionalFields, [
                                'signature' => $this->text,
                                'signatureEnableBBCodes' => $this->enableBBCodes,
                                'signatureEnableHtml' => $this->enableHtml,
                                'signatureEnableSmilies' => $this->enableSmilies
-                       ))
-               ));
+                       ])
+               ]);
                $this->objectAction->executeAction();
                SignatureCache::getInstance()->getSignature(new User(WCF::getUser()->userID));
                $this->saved();
index 4fd64e6b991bf975ab4f7f2bf8758e7c68051546..13b59f7a48044d58589908efa2abc99008f400b2 100644 (file)
@@ -34,7 +34,7 @@ abstract class AbstractFeedPage extends AbstractAuthedPage {
         * parsed contents of $_REQUEST['id']
         * @var integer[]
         */
-       public $objectIDs = array();
+       public $objectIDs = [];
        
        /**
         * list of feed-entries for the current page
@@ -54,10 +54,10 @@ abstract class AbstractFeedPage extends AbstractAuthedPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'items' => $this->items,
                        'title' => $this->title
-               ));
+               ]);
        }
        
        /**
index 648ae5436360aeca9664af5d42bb881d9b706694..e682661b5056abbd2dd6edce40af6a3ff9ab9cd7 100644 (file)
@@ -65,13 +65,13 @@ abstract class AbstractPage implements IPage, ITrackablePage {
         * needed modules to view this page
         * @var string[]
         */
-       public $neededModules = array();
+       public $neededModules = [];
        
        /**
         * needed permissions to view this page
         * @var string[]
         */
-       public $neededPermissions = array();
+       public $neededPermissions = [];
        
        /**
         * name of the template for the called page
@@ -132,10 +132,10 @@ abstract class AbstractPage implements IPage, ITrackablePage {
                EventHandler::getInstance()->fireAction($this, 'assignVariables');
                
                // assign parameters
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'action' => $this->action,
                        'templateName' => $this->templateName
-               ));
+               ]);
        }
        
        /**
index fc3637437ff6eb04b63b5152ff11eb32b8fdd05b..92377650670a5fc4e96837a64929e9de1c484977 100644 (file)
@@ -58,7 +58,7 @@ class AttachmentPage extends AbstractPage {
         * list of mime types which belong to files that are displayed inline
         * @var string[]
         */
-       public static $inlineMimeTypes = array('image/gif', 'image/jpeg', 'image/png', 'image/x-png', 'application/pdf', 'image/pjpeg');
+       public static $inlineMimeTypes = ['image/gif', 'image/jpeg', 'image/png', 'image/x-png', 'application/pdf', 'image/pjpeg'];
        
        /**
         * etag for this attachment
@@ -78,7 +78,7 @@ class AttachmentPage extends AbstractPage {
                        throw new IllegalLinkException();
                }
                
-               $parameters = array('object' => $this->attachment);
+               $parameters = ['object' => $this->attachment];
                if (isset($_REQUEST['tiny']) && $this->attachment->tinyThumbnailType) {
                        $this->tiny = intval($_REQUEST['tiny']);
                        $parameters['tiny'] = $this->tiny;
@@ -142,7 +142,7 @@ class AttachmentPage extends AbstractPage {
                }
                
                // init file reader
-               $this->fileReader = new FileReader($location, array(
+               $this->fileReader = new FileReader($location, [
                        'filename' => $this->attachment->filename,
                        'mimeType' => $mimeType,
                        'filesize' => $filesize,
@@ -151,7 +151,7 @@ class AttachmentPage extends AbstractPage {
                        'lastModificationTime' => $this->attachment->uploadTime,
                        'expirationDate' => TIME_NOW + 31536000,
                        'maxAge' => 31536000
-               ));
+               ]);
                
                if ($this->eTag !== null) {
                        $this->fileReader->addHeader('ETag', '"'.$this->eTag.'"');
@@ -173,10 +173,10 @@ class AttachmentPage extends AbstractPage {
                if (!$this->tiny && !$this->thumbnail) {
                        // update download count
                        $editor = new AttachmentEditor($this->attachment);
-                       $editor->update(array(
+                       $editor->update([
                                'downloads' => $this->attachment->downloads + 1,
                                'lastDownloadTime' => TIME_NOW
-                       ));
+                       ]);
                }
                
                // send file to client
index 25419cd848997a86d1b7291137d01784493bbeff..d5a2454fe2d3082175220b0c7e4c83ada067fdcc 100644 (file)
@@ -23,7 +23,7 @@ class DeletedContentListPage extends MultipleLinkPage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('mod.general.canUseModeration');
+       public $neededPermissions = ['mod.general.canUseModeration'];
        
        /**
         * object type object
@@ -65,11 +65,11 @@ class DeletedContentListPage extends MultipleLinkPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'availableObjectTypes' => ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.deletedContent'),
                        'objectType' => $this->objectType->objectType,
                        'resultListTemplateName' => $this->objectType->getProcessor()->getTemplateName(),
                        'resultListApplication' => $this->objectType->getProcessor()->getApplication()
-               ));
+               ]);
        }
 }
index f9fae50ba65ace904b250cb50f127a3e638e5498..61cb0c7e0342b1549e62d1aae6ee9b9be03ab28d 100644 (file)
@@ -35,7 +35,7 @@ class FollowingPage extends MultipleLinkPage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               $this->objectList->getConditionBuilder()->add("user_follow.userID = ?", array(WCF::getUser()->userID));
+               $this->objectList->getConditionBuilder()->add("user_follow.userID = ?", [WCF::getUser()->userID]);
        }
        
        /**
index a813dd976f7d19f33cf0df6c8c8425bc008ac87c..30409cc2ba0971ea66997c56b39f338a41ed5fca 100644 (file)
@@ -35,7 +35,7 @@ class IgnoredUsersPage extends MultipleLinkPage {
        protected function initObjectList() {
                parent::initObjectList();
                
-               $this->objectList->getConditionBuilder()->add("user_ignore.userID = ?", array(WCF::getUser()->userID));
+               $this->objectList->getConditionBuilder()->add("user_ignore.userID = ?", [WCF::getUser()->userID]);
        }
        
        /**
index 95f311b5185b522f8d217e1342d57afcaf2cafa0..f748cfb08f492fc16f96ddedce8232e14d17cc1c 100644 (file)
@@ -26,7 +26,7 @@ class ModerationListPage extends SortablePage {
         * list of available definitions
         * @var string[]
         */
-       public $availableDefinitions = array();
+       public $availableDefinitions = [];
        
        /**
         * @see \wcf\page\SortablePage::$defaultSortField
@@ -52,7 +52,7 @@ class ModerationListPage extends SortablePage {
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('mod.general.canUseModeration');
+       public $neededPermissions = ['mod.general.canUseModeration'];
        
        /**
         * @see \wcf\page\MultipleLinkPage::$objectListClassName
@@ -68,7 +68,7 @@ class ModerationListPage extends SortablePage {
        /**
         * @see \wcf\page\SortablePage::$validSortFields
         */
-       public $validSortFields = array('assignedUsername', 'lastChangeTime', 'queueID', 'time', 'username', 'comments');
+       public $validSortFields = ['assignedUsername', 'lastChangeTime', 'queueID', 'time', 'username', 'comments'];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -95,25 +95,25 @@ class ModerationListPage extends SortablePage {
                parent::initObjectList();
                
                // filter by object type id
-               $objectTypeIDs = ModerationQueueManager::getInstance()->getObjectTypeIDs( ($this->definitionID ? array($this->definitionID) : array_keys($this->availableDefinitions)) );
+               $objectTypeIDs = ModerationQueueManager::getInstance()->getObjectTypeIDs( ($this->definitionID ? [$this->definitionID] : array_keys($this->availableDefinitions)) );
                if (empty($objectTypeIDs)) {
                        // no object type ids given? screw that, display nothing
                        $this->objectList->getConditionBuilder()->add("0 = 1");
                        return;
                }
                
-               $this->objectList->getConditionBuilder()->add("moderation_queue.objectTypeID IN (?)", array($objectTypeIDs));
+               $this->objectList->getConditionBuilder()->add("moderation_queue.objectTypeID IN (?)", [$objectTypeIDs]);
                
                // filter by assigned user id
                if ($this->assignedUserID == 0) $this->objectList->getConditionBuilder()->add("moderation_queue.assignedUserID IS NULL");
-               else if ($this->assignedUserID > 0) $this->objectList->getConditionBuilder()->add("moderation_queue.assignedUserID = ?", array($this->assignedUserID));
+               else if ($this->assignedUserID > 0) $this->objectList->getConditionBuilder()->add("moderation_queue.assignedUserID = ?", [$this->assignedUserID]);
                
                // filter by status
                if ($this->status == ModerationQueue::STATUS_DONE) {
-                       $this->objectList->getConditionBuilder()->add("moderation_queue.status IN (?)", array(array(ModerationQueue::STATUS_DONE, ModerationQueue::STATUS_CONFIRMED, ModerationQueue::STATUS_REJECTED)));
+                       $this->objectList->getConditionBuilder()->add("moderation_queue.status IN (?)", [[ModerationQueue::STATUS_DONE, ModerationQueue::STATUS_CONFIRMED, ModerationQueue::STATUS_REJECTED]]);
                }
                else {
-                       $this->objectList->getConditionBuilder()->add("moderation_queue.status IN (?)", array(array(ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING)));
+                       $this->objectList->getConditionBuilder()->add("moderation_queue.status IN (?)", [[ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING]]);
                }
        }
        
@@ -123,12 +123,12 @@ class ModerationListPage extends SortablePage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'assignedUserID' => $this->assignedUserID,
                        'availableDefinitions' => $this->availableDefinitions,
                        'definitionID' => $this->definitionID,
                        'definitionNames' => ModerationQueueManager::getInstance()->getDefinitionNamesByObjectTypeIDs(),
                        'status' => $this->status
-               ));
+               ]);
        }
 }
index 569eae124488c460b7bc543b5b13f9b323b041d6..3802af779058d4d2e6532da2dd8713bdd0df4fde 100644 (file)
@@ -218,7 +218,7 @@ abstract class MultipleLinkPage extends AbstractPage {
                parent::assignVariables();
                
                // assign page parameters
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'pageNo' => $this->pageNo,
                        'pages' => $this->pages,
                        'items' => $this->items,
@@ -226,6 +226,6 @@ abstract class MultipleLinkPage extends AbstractPage {
                        'startIndex' => $this->startIndex,
                        'endIndex' => $this->endIndex,
                        'objects' => $this->objectList
-               ));
+               ]);
        }
 }
index 37887bcbbcf39681f029a20796e19dacec4bae3b..11c03b2fc992084b086194b580f3aa78d8891633 100644 (file)
@@ -24,7 +24,7 @@ class NotificationListPage extends MultipleLinkPage {
         * list of outstanding notifications
         * @var mixed[][]
         */
-       public $notifications = array();
+       public $notifications = [];
        
        /**
         * @see \wcf\page\MultipleLinkPage::countItems()
@@ -58,9 +58,9 @@ class NotificationListPage extends MultipleLinkPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'notifications' => $this->notifications
-               ));
+               ]);
        }
        
        /**
index f089d7f1a3dfbee9b8e9bfaf11454aca2c5e526f..a28cc217d1dfd2f7f6385c74a42f6205f10f2980 100644 (file)
@@ -24,19 +24,19 @@ class PaidSubscriptionListPage extends AbstractPage {
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_PAID_SUBSCRIPTION');
+       public $neededModules = ['MODULE_PAID_SUBSCRIPTION'];
        
        /**
         * list of available paid subscriptions
         * @var array
         */
-       public $subscriptions = array();
+       public $subscriptions = [];
        
        /**
         * list of user subscriptions
         * @var \wcf\data\paid\subscription\user\PaidSubscriptionUserList
         */
-       public $userSubscriptionList = array();
+       public $userSubscriptionList = [];
        
        /**
         * @see \wcf\page\AbstractPage::readData()
@@ -49,8 +49,8 @@ class PaidSubscriptionListPage extends AbstractPage {
                
                // get user subscriptions
                $this->userSubscriptionList = new PaidSubscriptionUserList();
-               $this->userSubscriptionList->getConditionBuilder()->add('userID = ?', array(WCF::getUser()->userID));
-               $this->userSubscriptionList->getConditionBuilder()->add('isActive = ?', array(1));
+               $this->userSubscriptionList->getConditionBuilder()->add('userID = ?', [WCF::getUser()->userID]);
+               $this->userSubscriptionList->getConditionBuilder()->add('isActive = ?', [1]);
                $this->userSubscriptionList->readObjects();
                
                foreach ($this->userSubscriptionList as $userSubscription) {
@@ -74,10 +74,10 @@ class PaidSubscriptionListPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'subscriptions' => $this->subscriptions,
                        'userSubscriptions' => $this->userSubscriptionList
-               ));
+               ]);
        }
        
        /**
index 5d9bf0f2b3d119810caa1dde2ef070c4f70717a2..cf13950ff730f5a7687f907168d203310967eebb 100644 (file)
@@ -25,10 +25,10 @@ class PaidSubscriptionReturnPage extends AbstractPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'message' => WCF::getLanguage()->get('wcf.paidSubscription.returnMessage'),
                        'wait' => 60,
                        'url' => LinkHandler::getInstance()->getLink()
-               ));
+               ]);
        }
 }
index 4d2143640f4f2bfb30676dd9b60c678c66ad6901..a125e328027643e53a8bfeaad1b1ac517799963a 100644 (file)
@@ -48,7 +48,7 @@ class SearchResultPage extends MultipleLinkPage {
         * messages
         * @var array
         */
-       public $messages = array();
+       public $messages = [];
        
        /**
         * search data
@@ -114,14 +114,14 @@ class SearchResultPage extends MultipleLinkPage {
         * Caches the message data.
         */
        protected function cacheMessageData() {
-               $types = array();
+               $types = [];
                
                // group object id by object type
                for ($i = $this->startIndex - 1; $i < $this->endIndex; $i++) {
                        $type = $this->searchData['results'][$i]['objectType'];
                        $objectID = $this->searchData['results'][$i]['objectID'];
                        
-                       if (!isset($types[$type])) $types[$type] = array();
+                       if (!isset($types[$type])) $types[$type] = [];
                        $types[$type][] = $objectID;
                }
                
@@ -156,7 +156,7 @@ class SearchResultPage extends MultipleLinkPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'query' => $this->searchData['query'],
                        'objects' => $this->messages,
                        'searchData' => $this->searchData,
@@ -169,7 +169,7 @@ class SearchResultPage extends MultipleLinkPage {
                        'resultListTemplateName' => $this->resultListTemplateName,
                        'resultListApplication' => $this->resultListApplication,
                        'application' => ApplicationHandler::getInstance()->getAbbreviation(ApplicationHandler::getInstance()->getActiveApplication()->packageID)
-               ));
+               ]);
        }
        
        /**
index 8c71eaf3179d9763aa0d405f8ad66433ff506a6e..4461c0f4c3763bb7a29050ef7bc96e6186d8a282 100644 (file)
@@ -31,7 +31,7 @@ abstract class SortablePage extends MultipleLinkPage {
         * list of valid sort fields
         * @var string[]
         */
-       public $validSortFields = array();
+       public $validSortFields = [];
        
        /**
         * @see \wcf\page\IPage::readParameters()
@@ -90,9 +90,9 @@ abstract class SortablePage extends MultipleLinkPage {
                parent::assignVariables();
                
                // assign sorting parameters
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'sortField' => $this->sortField,
                        'sortOrder' => $this->sortOrder
-               ));
+               ]);
        }
 }
index 222e51cd5d297675008976bd968845c45c2c9593..139dc29dc62253380abb74dcfccc646211bde071 100644 (file)
@@ -23,17 +23,17 @@ class TaggedPage extends MultipleLinkPage {
         * list of available taggable object types
         * @var ObjectType[]
         */
-       public $availableObjectTypes = array();
+       public $availableObjectTypes = [];
        
        /**
         * @see \wcf\page\AbstractPage::$neededModules
         */
-       public $neededModules = array('MODULE_TAGGING');
+       public $neededModules = ['MODULE_TAGGING'];
        
        /**
         * @see \wcf\page\AbstractPage::$neededPermissions
         */
-       public $neededPermissions = array('user.tag.canViewTag');
+       public $neededPermissions = ['user.tag.canViewTag'];
        
        /**
         * tag id
@@ -120,14 +120,14 @@ class TaggedPage extends MultipleLinkPage {
        public function assignVariables() {
                parent::assignVariables();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'tag' => $this->tag,
                        'tags' => $this->tagCloud->getTags(100),
                        'availableObjectTypes' => $this->availableObjectTypes,
                        'objectType' => $this->objectType->objectType,
                        'resultListTemplateName' => $this->objectType->getProcessor()->getTemplateName(),
                        'resultListApplication' => $this->objectType->getProcessor()->getApplication()
-               ));
+               ]);
                
                if (count($this->objectList) === 0) {
                        @header('HTTP/1.0 404 Not Found');
index c7b4cbfa252198cde4be30004d5a2ea3bb8c5659..fd83c3d4e382f880533d0c7a57c25738637a5f13 100644 (file)
@@ -22,7 +22,7 @@ use Zend\Console\Getopt as ArgvParser;
 use Zend\Loader\StandardAutoloader as ZendLoader;
 
 // set exception handler
-set_exception_handler(array('wcf\system\CLIWCF', 'handleCLIException'));
+set_exception_handler(['wcf\system\CLIWCF', 'handleCLIException']);
 
 /**
  * Extends WCF class with functions for CLI.
@@ -60,12 +60,12 @@ class CLIWCF extends WCF {
                // register additional autoloaders
                require_once(WCF_DIR.'lib/system/api/phpline/phpline.phar');
                require_once(WCF_DIR.'lib/system/api/zend/Loader/StandardAutoloader.php');
-               $zendLoader = new ZendLoader(array(ZendLoader::AUTOREGISTER_ZF => true));
+               $zendLoader = new ZendLoader([ZendLoader::AUTOREGISTER_ZF => true]);
                $zendLoader->register();
                
-               $argv = new ArgvParser(array(
+               $argv = new ArgvParser([
                        'packageID=i' => ''
-               ));
+               ]);
                $argv->setOption(ArgvParser::CONFIG_FREEFORM_FLAGS, true);
                $argv->parse();
                define('PACKAGE_ID', $argv->packageID ?: 1);
@@ -83,7 +83,7 @@ class CLIWCF extends WCF {
                $this->initApplications();
                
                // the destructor registered in core.functions.php will only call the destructor of the parent class
-               register_shutdown_function(array('wcf\system\CLIWCF', 'destruct'));
+               register_shutdown_function(['wcf\system\CLIWCF', 'destruct']);
                
                $this->initArgv();
                $this->initPHPLine();
@@ -116,7 +116,7 @@ class CLIWCF extends WCF {
         */
        protected function initArgv() {
                // initialise ArgvParser
-               self::$argvParser = new ArgvParser(array(
+               self::$argvParser = new ArgvParser([
                        'language=s' => WCF::getLanguage()->get('wcf.cli.help.language'),
                        'v' => WCF::getLanguage()->get('wcf.cli.help.v'),
                        'q' => WCF::getLanguage()->get('wcf.cli.help.q'),
@@ -125,11 +125,11 @@ class CLIWCF extends WCF {
                        'disableUpdateCheck' => WCF::getLanguage()->get('wcf.cli.help.disableUpdateCheck'),
                        'exitOnFail' => WCF::getLanguage()->get('wcf.cli.help.exitOnFail'),
                        'packageID=i' => WCF::getLanguage()->get('wcf.cli.help.packageID')
-               ));
-               self::getArgvParser()->setOptions(array(
+               ]);
+               self::getArgvParser()->setOptions([
                        ArgvParser::CONFIG_CUMULATIVE_FLAGS => true,
                        ArgvParser::CONFIG_DASHDASH => false
-               ));
+               ]);
                
                // parse arguments
                EventHandler::getInstance()->fireAction($this, 'beforeArgumentParsing');
@@ -154,7 +154,7 @@ class CLIWCF extends WCF {
                        $help = WCF::getLanguage()->get('wcf.cli.help.'.self::getArgvParser()->help.'.description', true);
                        if ($help) echo $help.PHP_EOL;
                        else {
-                               echo WCF::getLanguage()->getDynamicVariable('wcf.cli.help.noLongHelp', array('topic' => self::getArgvParser()->help)).PHP_EOL;
+                               echo WCF::getLanguage()->getDynamicVariable('wcf.cli.help.noLongHelp', ['topic' => self::getArgvParser()->help]).PHP_EOL;
                        }
                        exit;
                }
@@ -167,7 +167,7 @@ class CLIWCF extends WCF {
                        // set language
                        $language = LanguageFactory::getInstance()->getLanguageByCode(self::getArgvParser()->language);
                        if ($language === null) {
-                               echo WCF::getLanguage()->getDynamicVariable('wcf.cli.error.language.notFound', array('languageCode' => self::getArgvParser()->language)).PHP_EOL;
+                               echo WCF::getLanguage()->getDynamicVariable('wcf.cli.error.language.notFound', ['languageCode' => self::getArgvParser()->language]).PHP_EOL;
                                exit;
                        }
                        self::setLanguage($language->languageID);
@@ -246,7 +246,7 @@ class CLIWCF extends WCF {
                        WCF::getSession()->changeUser($user);
                }
                catch (UserInputException $e) {
-                       $message = WCF::getLanguage()->getDynamicVariable('wcf.user.'.$e->getField().'.error.'.$e->getType(), array('username' => $username));
+                       $message = WCF::getLanguage()->getDynamicVariable('wcf.user.'.$e->getField().'.error.'.$e->getType(), ['username' => $username]);
                        self::getReader()->println($message);
                        exit(1);
                }
@@ -281,8 +281,8 @@ class CLIWCF extends WCF {
                                $command->execute(CLICommandHandler::getParameters($line));
                        }
                        catch (IllegalLinkException $e) {
-                               Log::error('notFound:'.JSON::encode(array('command' => $line)));
-                               self::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.cli.error.command.notFound', array('command' => $line)));
+                               Log::error('notFound:'.JSON::encode(['command' => $line]));
+                               self::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.cli.error.command.notFound', ['command' => $line]));
                                
                                if (self::getArgvParser()->exitOnFail) {
                                        exit(1);
@@ -331,20 +331,20 @@ class CLIWCF extends WCF {
                                self::getReader()->println(count($updates) . ' update' . (count($updates) > 1 ? 's are' : ' is') . ' available');
                                
                                if (VERBOSITY >= 1) {
-                                       $table = array(
-                                               array(
+                                       $table = [
+                                               [
                                                        WCF::getLanguage()->get('wcf.acp.package.name'),
                                                        WCF::getLanguage()->get('wcf.acp.package.version'),
                                                        WCF::getLanguage()->get('wcf.acp.package.newVersion')
-                                               )
-                                       );
+                                               ]
+                                       ];
                                        
                                        foreach ($updates as $update) {
-                                               $row = array(
+                                               $row = [
                                                        WCF::getLanguage()->get($update['packageName']),
                                                        $update['packageVersion'],
                                                        $update['version']['packageVersion']
-                                               );
+                                               ];
                                                
                                                $table[] = $row;
                                        }
index 101ce038b6627a5eb661ba10773fdecba3b32cf8..8043841505038d2554c733135df07f78661eabde 100644 (file)
@@ -29,7 +29,7 @@ class MetaTagHandler extends SingletonFactory implements \Countable, \Iterator {
         * list of meta tags
         * @var array
         */
-       protected $objects = array();
+       protected $objects = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -54,11 +54,11 @@ class MetaTagHandler extends SingletonFactory implements \Countable, \Iterator {
                        $this->indexToObject[] = $identifier;
                }
                
-               $this->objects[$identifier] = array(
+               $this->objects[$identifier] = [
                        'isProperty' => $isProperty,
                        'name' => $name,
                        'value' => $value
-               );
+               ];
                
                // replace description if Open Graph Protocol tag was given
                if ($name == 'og:description') {
index 3d95a73f174f544a69eb7243540c82dcd590e116..ad163203e7504c762a34655e1315fe250fb6fa21 100644 (file)
@@ -126,7 +126,7 @@ final class Regex {
         * last matches
         * @var array
         */
-       private $matches = array();
+       private $matches = [];
        
        /**
         * Creates a regex.
index a8afb3bb68a1610ac298ff996b7920395107309f..64773846f013201c0aef9010cc5dab7fc842b34a 100644 (file)
@@ -17,7 +17,7 @@ abstract class SingletonFactory {
         * list of singletons
         * @var SingletonFactory[]
         */
-       protected static $__singletonObjects = array();
+       protected static $__singletonObjects = [];
        
        /**
         * Singletons do not support a public constructor. Override init() if
index c349b58029ac3af0974c1d8a0a3321f3a47f0d0a..f6eb9a1c36fe3e9b897d0a0a649f1883e86a00ea 100644 (file)
@@ -71,31 +71,31 @@ class WCF {
         * list of currently loaded applications
         * @var Application[]
         */
-       protected static $applications = array();
+       protected static $applications = [];
        
        /**
         * list of currently loaded application objects
         * @var IApplication[]
         */
-       protected static $applicationObjects = array();
+       protected static $applicationObjects = [];
        
        /**
         * list of autoload directories
         * @var array
         */
-       protected static $autoloadDirectories = array();
+       protected static $autoloadDirectories = [];
        
        /**
         * list of unique instances of each core object
         * @var SingletonFactory[]
         */
-       protected static $coreObject = array();
+       protected static $coreObject = [];
        
        /**
         * list of cached core objects
         * @var string[]
         */
-       protected static $coreObjectCache = array();
+       protected static $coreObjectCache = [];
        
        /**
         * database object
@@ -449,7 +449,7 @@ class WCF {
         */
        protected function initApplications() {
                // step 1) load all applications
-               $loadedApplications = array();
+               $loadedApplications = [];
                
                // register WCF as application
                self::$applications['wcf'] = ApplicationHandler::getInstance()->getApplicationByID(1);
@@ -551,7 +551,7 @@ class WCF {
                        }
                        
                        // init application and assign it as template variable
-                       self::$applicationObjects[$application->packageID] = call_user_func(array($className, 'getInstance'));
+                       self::$applicationObjects[$application->packageID] = call_user_func([$className, 'getInstance']);
                        $this->getTPL()->assign('__'.$abbreviation, self::$applicationObjects[$application->packageID]);
                }
                else {
@@ -620,11 +620,11 @@ class WCF {
         * Assigns some default variables to the template engine.
         */
        protected function assignDefaultTemplateVariables() {
-               self::getTPL()->registerPrefilter(array('event', 'hascontent', 'lang'));
-               self::getTPL()->assign(array(
+               self::getTPL()->registerPrefilter(['event', 'hascontent', 'lang']);
+               self::getTPL()->assign([
                        '__wcf' => $this,
                        '__wcfVersion' => LAST_UPDATE_TIME // @deprecated since 2.1, use LAST_UPDATE_TIME directly
-               ));
+               ]);
        }
        
        /**
@@ -723,7 +723,7 @@ class WCF {
                                throw new SystemException("class '".$objectName."' does not implement the interface 'SingletonFactory'");
                        }
                        
-                       self::$coreObject[$className] = call_user_func(array($objectName, 'getInstance'));
+                       self::$coreObject[$className] = call_user_func([$objectName, 'getInstance']);
                        return self::$coreObject[$className];
                }
        }
index 9a8c333c9e148fa267278bb34db82c15f9a1f59e..bfe28b5fc1fcf3017e50cbd38631ba06ec27d499 100644 (file)
@@ -162,14 +162,14 @@ class WCFACP extends WCF {
                                // work-around for AJAX-requests within ACP
                                if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
                                        try {
-                                               WCF::getSession()->checkPermissions(array('admin.general.canUseAcp'));
+                                               WCF::getSession()->checkPermissions(['admin.general.canUseAcp']);
                                        }
                                        catch (PermissionDeniedException $e) {
                                                throw new AJAXException(self::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS, $e->getTraceAsString());
                                        }
                                }
                                else {
-                                       WCF::getSession()->checkPermissions(array('admin.general.canUseAcp'));
+                                       WCF::getSession()->checkPermissions(['admin.general.canUseAcp']);
                                }
                                
                                // force debug mode if in ACP and authenticated
@@ -210,9 +210,9 @@ class WCFACP extends WCF {
                $host = RouteHandler::getHost();
                $path = RouteHandler::getPath();
                
-               self::getTPL()->assign(array(
+               self::getTPL()->assign([
                        'baseHref' => $host . $path
-               ));
+               ]);
        }
        
        /**
index 4fa5589ad85c9fec4d198ee1ec9955b0eb45826b..53974372c7961f1ff24385543218fc7d592fe214 100644 (file)
@@ -35,13 +35,13 @@ class ACLHandler extends SingletonFactory {
         * list of available object types
         * @var array
         */
-       protected $availableObjectTypes = array();
+       protected $availableObjectTypes = [];
        
        /**
         * list of acl option categories sorted by their object type id and name
         * @var ACLOptionCategory[][]
         */
-       protected $categories = array();
+       protected $categories = [];
        
        /**
         * Assignes the acl values to the template.
@@ -50,23 +50,23 @@ class ACLHandler extends SingletonFactory {
         */
        public function assignVariables($objectTypeID) {
                if (WCF::getTPL()->get('aclValues') === null) {
-                       WCF::getTPL()->assign('aclValues', array());
+                       WCF::getTPL()->assign('aclValues', []);
                }
                
                if (!$this->assignVariablesDisabled && isset($_POST['aclValues'])) {
                        $values = $_POST['aclValues'];
                        
-                       $data = $this->getPermissions($objectTypeID, array(), null, true);
+                       $data = $this->getPermissions($objectTypeID, [], null, true);
                        
                        foreach ($values as $type => $optionData) {
                                if ($type === 'user') {
                                        $users = User::getUsers(array_keys($optionData));
                                }
                                
-                               $values[$type] = array(
-                                       'label' => array(),
-                                       'option' => array()
-                               );
+                               $values[$type] = [
+                                       'label' => [],
+                                       'option' => []
+                               ];
                                
                                foreach ($optionData as $typeID => $optionValues) {
                                        foreach ($optionValues as $optionID => $optionValue) {
@@ -93,9 +93,9 @@ class ACLHandler extends SingletonFactory {
                        $values['options'] = $data['options'];
                        $values['categories'] = $data['categories'];
                        
-                       WCF::getTPL()->append('aclValues', array(
+                       WCF::getTPL()->append('aclValues', [
                                $objectTypeID => $values
-                       ));
+                       ]);
                }
        }
        
@@ -177,8 +177,8 @@ class ACLHandler extends SingletonFactory {
                
                // remove previous values
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("optionID IN (?)", array(array_keys($options)));
-               $conditions->add("objectID = ?", array($objectID));
+               $conditions->add("optionID IN (?)", [array_keys($options)]);
+               $conditions->add("objectID = ?", [$objectID]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_acl_option_to_".$type."
                        ".$conditions;
@@ -204,12 +204,12 @@ class ACLHandler extends SingletonFactory {
                                        continue;
                                }
                                
-                               $statement->execute(array(
+                               $statement->execute([
                                        $optionID,
                                        $objectID,
                                        $typeID,
                                        $optionValue
-                               ));
+                               ]);
                        }
                }
                WCF::getDB()->commitTransaction();
@@ -227,11 +227,11 @@ class ACLHandler extends SingletonFactory {
        public function getPermissions($objectTypeID, array $objectIDs, $categoryName = '', $settingsView = false) {
                $optionList = $this->getOptions($objectTypeID, $categoryName);
                
-               $data = array(
+               $data = [
                        'options' => $optionList,
-                       'group' => array(),
-                       'user' => array()
-               );
+                       'group' => [],
+                       'user' => []
+               ];
                
                if (!empty($objectIDs)) {
                        $this->getValues($optionList, 'group', $objectIDs, $data, $settingsView);
@@ -242,17 +242,17 @@ class ACLHandler extends SingletonFactory {
                if ($settingsView) {
                        $objectType = ObjectTypeCache::getInstance()->getObjectType($objectTypeID);
                        
-                       $data['options'] = array();
-                       $data['categories'] = array();
+                       $data['options'] = [];
+                       $data['categories'] = [];
                        
                        if (count($optionList)) {
-                               $categoryNames = array();
+                               $categoryNames = [];
                                foreach ($optionList as $option) {
-                                       $data['options'][$option->optionID] = array(
+                                       $data['options'][$option->optionID] = [
                                                'categoryName' => $option->categoryName,
                                                'label' => WCF::getLanguage()->get('wcf.acl.option.'.$objectType->objectType.'.'.$option->optionName),
                                                'optionName' => $option->optionName
-                                       );
+                                       ];
                                        
                                        if (!in_array($option->categoryName, $categoryNames)) {
                                                $categoryNames[] = $option->categoryName;
@@ -261,8 +261,8 @@ class ACLHandler extends SingletonFactory {
                                
                                // load categories
                                $categoryList = new ACLOptionCategoryList();
-                               $categoryList->getConditionBuilder()->add("acl_option_category.categoryName IN (?)", array($categoryNames));
-                               $categoryList->getConditionBuilder()->add("acl_option_category.objectTypeID = ?", array($objectTypeID));
+                               $categoryList->getConditionBuilder()->add("acl_option_category.categoryName IN (?)", [$categoryNames]);
+                               $categoryList->getConditionBuilder()->add("acl_option_category.objectTypeID = ?", [$objectTypeID]);
                                $categoryList->readObjects();
                                
                                foreach ($categoryList as $category) {
@@ -284,8 +284,8 @@ class ACLHandler extends SingletonFactory {
         * @param       boolean                                 $settingsView
         */
        protected function getValues(ACLOptionList $optionList, $type, array $objectIDs, array &$data, $settingsView) {
-               $data[$type] = array();
-               $optionsIDs = array();
+               $data[$type] = [];
+               $optionsIDs = [];
                foreach ($optionList as $option) {
                        $optionsIDs[] = $option->optionID;
                }
@@ -297,8 +297,8 @@ class ACLHandler extends SingletonFactory {
                
                $columnID = $type.'ID';
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("optionID IN (?)", array($optionsIDs));
-               $conditions->add("objectID IN (?)", array($objectIDs));
+               $conditions->add("optionID IN (?)", [$optionsIDs]);
+               $conditions->add("objectID IN (?)", [$objectIDs]);
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_acl_option_to_".$type."
                        ".$conditions;
@@ -306,11 +306,11 @@ class ACLHandler extends SingletonFactory {
                $statement->execute($conditions->getParameters());
                while ($row = $statement->fetchArray()) {
                        if (!isset($data[$type][$row['objectID']])) {
-                               $data[$type][$row['objectID']] = array();
+                               $data[$type][$row['objectID']] = [];
                        }
                        
                        if (!isset($data[$type][$row['objectID']][$row[$columnID]])) {
-                               $data[$type][$row['objectID']][$row[$columnID]] = array();
+                               $data[$type][$row['objectID']][$row[$columnID]] = [];
                        }
                        
                        $data[$type][$row['objectID']][$row[$columnID]][$row['optionID']] = $row['optionValue'];
@@ -320,21 +320,21 @@ class ACLHandler extends SingletonFactory {
                if ($settingsView) {
                        $objectID = current($objectIDs);
                        if (!isset($data[$type][$objectID])) {
-                               $data[$type][$objectID] = array();
+                               $data[$type][$objectID] = [];
                        }
                        
                        // build JS-compilant structure
-                       $data[$type] = array(
-                               'label' => array(),
+                       $data[$type] = [
+                               'label' => [],
                                'option' => $data[$type][$objectID]
-                       );
+                       ];
                        
                        // load labels
                        if (!empty($data[$type]['option'])) {
                                $conditions = new PreparedStatementConditionBuilder();
                                
                                if ($type == 'group') {
-                                       $conditions->add("groupID IN (?)", array(array_keys($data[$type]['option'])));
+                                       $conditions->add("groupID IN (?)", [array_keys($data[$type]['option'])]);
                                        $sql = "SELECT  groupID, groupName
                                                FROM    wcf".WCF_N."_user_group
                                                ".$conditions;
@@ -346,7 +346,7 @@ class ACLHandler extends SingletonFactory {
                                        }
                                }
                                else {
-                                       $conditions->add("userID IN (?)", array(array_keys($data[$type]['option'])));
+                                       $conditions->add("userID IN (?)", [array_keys($data[$type]['option'])]);
                                        $sql = "SELECT  userID, username
                                                FROM    wcf".WCF_N."_user
                                                ".$conditions;
@@ -373,13 +373,13 @@ class ACLHandler extends SingletonFactory {
                if (!empty($categoryName)) {
                        if (StringUtil::endsWith($categoryName, '.*')) {
                                $categoryName = mb_substr($categoryName, 0, -1) . '%';
-                               $optionList->getConditionBuilder()->add("acl_option.categoryName LIKE ?", array($categoryName));
+                               $optionList->getConditionBuilder()->add("acl_option.categoryName LIKE ?", [$categoryName]);
                        }
                        else {
-                               $optionList->getConditionBuilder()->add("acl_option.categoryName = ?", array($categoryName));
+                               $optionList->getConditionBuilder()->add("acl_option.categoryName = ?", [$categoryName]);
                        }
                }
-               $optionList->getConditionBuilder()->add("acl_option.objectTypeID = ?", array($objectTypeID));
+               $optionList->getConditionBuilder()->add("acl_option.objectTypeID = ?", [$objectTypeID]);
                $optionList->readObjects();
                
                return $optionList;
@@ -397,11 +397,11 @@ class ACLHandler extends SingletonFactory {
                $options = $optionList->getObjects();
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("optionID IN (?)", array(array_keys($options)));
-               $conditions->add("objectID IN (?)", array($objectIDs));
+               $conditions->add("optionID IN (?)", [array_keys($options)]);
+               $conditions->add("objectID IN (?)", [$objectIDs]);
                
                WCF::getDB()->beginTransaction();
-               foreach (array('group', 'user') as $type) {
+               foreach (['group', 'user'] as $type) {
                        $sql = "DELETE FROM     wcf".WCF_N."_acl_option_to_".$type."
                                ".$conditions;
                        $statement = WCF::getDB()->prepareStatement($sql);
index 333950d183c1eac72ce1efd946da49ebf20b807a..01da2e9634bb02e15fe7d6a32192680c9ae65bd7 100644 (file)
@@ -22,13 +22,13 @@ class AdHandler extends SingletonFactory {
         * list of ad objects grouped by ad location
         * @var array
         */
-       protected $ads = array();
+       protected $ads = [];
        
        /**
         * list of ad location object types
         * @var ObjectType[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * Returns the ad output for the given ad location.
@@ -75,7 +75,7 @@ class AdHandler extends SingletonFactory {
                        return $this->objectTypes;
                }
                
-               $objectTypes = array();
+               $objectTypes = [];
                foreach ($this->objectTypes as $key => $objectType) {
                        if ($objectType->categoryname == $categoryName) {
                                $objectTypes[$key] = $objectType;
@@ -100,11 +100,11 @@ class AdHandler extends SingletonFactory {
                        }
                }
                
-               $selection = array();
+               $selection = [];
                foreach ($objectTypes as $objectType) {
                        $categoryName = WCF::getLanguage()->get('wcf.acp.ad.location.category.'.$objectType->categoryname);
                        if (!isset($selection[$categoryName])) {
-                               $selection[$categoryName] = array();
+                               $selection[$categoryName] = [];
                        }
                        
                        $selection[$categoryName][$objectType->objectTypeID] = WCF::getLanguage()->get('wcf.acp.ad.location.'.$objectType->objectType);
@@ -120,9 +120,9 @@ class AdHandler extends SingletonFactory {
                
                ksort($selection);
                
-               $selection = array_merge(array(
+               $selection = array_merge([
                        $globalCategory => $globalLocations
-               ), $selection);
+               ], $selection);
                
                return $selection;
        }
index 0c77c8e433c52bbeff4ef242ccb27a3ca4f09c09..4c77c7c17d845b3f25cae1e7693ac2ebb6c84a52 100644 (file)
@@ -98,6 +98,6 @@ abstract class AbstractApplication extends SingletonFactory implements IApplicat
         * @see \wcf\system\application\IApplication::__callStatic()
         */
        public static function __callStatic($method, array $arguments) {
-               return call_user_func_array(array('wcf\system\WCF', $method), $arguments);
+               return call_user_func_array(['wcf\system\WCF', $method], $arguments);
        }
 }
index 4135689735cdc8cbc0a2260281d93f8b6237dd2d..8e25c41319c258ab0580602b172c48aff822cc10 100644 (file)
@@ -19,7 +19,7 @@ abstract class AbstractAttachmentObjectType implements IAttachmentObjectType {
         * cached objects
         * @var DatabaseObject[]
         */
-       protected $cachedObjects = array();
+       protected $cachedObjects = [];
        
        /**
         * @see \wcf\system\attachment\IAttachmentObjectType::getMaxSize()
@@ -77,10 +77,10 @@ abstract class AbstractAttachmentObjectType implements IAttachmentObjectType {
         */
        public function setPermissions(array $attachments) {
                foreach ($attachments as $attachment) {
-                       $attachment->setPermissions(array(
+                       $attachment->setPermissions([
                                'canDownload' => $this->canDownload($attachment->objectID),
                                'canViewPreview' => $this->canViewPreview($attachment->objectID)
-                       ));
+                       ]);
                }
        }
 }
index 3c38fb7a2be3fda270d9826bba2d664ccbc970cb..2b1e92b586c3735f93a034a67824d810f30a117c 100644 (file)
@@ -83,12 +83,12 @@ class AttachmentHandler implements \Countable {
                if ($this->attachmentList === null) {
                        $this->attachmentList = new AttachmentList();
                        $this->attachmentList->sqlOrderBy = 'attachment.showOrder';
-                       $this->attachmentList->getConditionBuilder()->add('objectTypeID = ?', array($this->objectType->objectTypeID));
+                       $this->attachmentList->getConditionBuilder()->add('objectTypeID = ?', [$this->objectType->objectTypeID]);
                        if ($this->objectID) {
-                               $this->attachmentList->getConditionBuilder()->add('objectID = ?', array($this->objectID));
+                               $this->attachmentList->getConditionBuilder()->add('objectID = ?', [$this->objectID]);
                        }
                        else {
-                               $this->attachmentList->getConditionBuilder()->add('tmpHash = ?', array($this->tmpHash));
+                               $this->attachmentList->getConditionBuilder()->add('tmpHash = ?', [$this->tmpHash]);
                        }
                        $this->attachmentList->readObjects();
                }
@@ -115,7 +115,7 @@ class AttachmentHandler implements \Countable {
                        WHERE   objectTypeID = ?
                                AND tmpHash = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($objectID, $this->objectType->objectTypeID, $this->tmpHash));
+               $statement->execute([$objectID, $this->objectType->objectTypeID, $this->tmpHash]);
        }
        
        /**
@@ -127,8 +127,8 @@ class AttachmentHandler implements \Countable {
         */
        public static function transferAttachments($objectType, $newObjectID, array $oldObjectIDs) {
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectTypeID = ?", array(ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.attachment.objectType', $objectType)->objectTypeID));
-               $conditions->add("objectID IN (?)", array($oldObjectIDs));
+               $conditions->add("objectTypeID = ?", [ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.attachment.objectType', $objectType)->objectTypeID]);
+               $conditions->add("objectID IN (?)", [$oldObjectIDs]);
                $parameters = $conditions->getParameters();
                array_unshift($parameters, $newObjectID);
                
@@ -147,8 +147,8 @@ class AttachmentHandler implements \Countable {
         */
        public static function removeAttachments($objectType, array $objectIDs) {
                $attachmentList = new AttachmentList();
-               $attachmentList->getConditionBuilder()->add("objectTypeID = ?", array(ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.attachment.objectType', $objectType)->objectTypeID));
-               $attachmentList->getConditionBuilder()->add("objectID IN (?)", array($objectIDs));
+               $attachmentList->getConditionBuilder()->add("objectTypeID = ?", [ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.attachment.objectType', $objectType)->objectTypeID]);
+               $attachmentList->getConditionBuilder()->add("objectID IN (?)", [$objectIDs]);
                $attachmentList->readObjects();
                
                if (count($attachmentList)) {
index 674ce706c3ee28622af06e7aed7cb4b0f12752e8..ba2d3cd6a59e4b7951e868b72957708b3b44ff3f 100644 (file)
@@ -80,15 +80,15 @@ class AttachmentBBCode extends AbstractBBCode {
                                                $class = 'messageFloatObject'.ucfirst($alignment);
                                        }
                                        
-                                       $source = StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('Attachment', array('object' => $attachment)));
+                                       $source = StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment]));
                                        $title = StringUtil::encodeHTML($attachment->filename);
                                        
                                        $result = '<a href="' . $source . '" title="' . $title . '" class="embeddedAttachmentLink jsImageViewer' . ($class ? ' '.$class : '') . '"><img src="' . $source . '" style="width: '.$width.'px" alt="" /></a>';
                                }
                                else {
-                                       $linkParameters = array(
+                                       $linkParameters = [
                                                'object' => $attachment
-                                       );
+                                       ];
                                        if ($attachment->hasThumbnail()) $linkParameters['thumbnail'] = 1;
                                        
                                        $class = '';
@@ -107,7 +107,7 @@ class AttachmentBBCode extends AbstractBBCode {
                                        
                                        $result = '<img src="'.StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('Attachment', $linkParameters)).'"'.($imageClasses ? ' class="'.$imageClasses.'"' : '').' style="width: '.($attachment->hasThumbnail() ? $attachment->thumbnailWidth : $attachment->width).'px; height: '.($attachment->hasThumbnail() ? $attachment->thumbnailHeight : $attachment->height).'px;" alt="" />';
                                        if ($attachment->hasThumbnail() && $attachment->canDownload()) {
-                                               $result = '<a href="'.StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('Attachment', array('object' => $attachment))).'" title="'.StringUtil::encodeHTML($attachment->filename).'" class="embeddedAttachmentLink jsImageViewer' . ($class ? ' '.$class : '') . '">'.$result.'</a>';
+                                               $result = '<a href="'.StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('Attachment', ['object' => $attachment])).'" title="'.StringUtil::encodeHTML($attachment->filename).'" class="embeddedAttachmentLink jsImageViewer' . ($class ? ' '.$class : '') . '">'.$result.'</a>';
                                        }
                                }
                                
@@ -115,16 +115,16 @@ class AttachmentBBCode extends AbstractBBCode {
                        }
                        else {
                                // file
-                               return StringUtil::getAnchorTag(LinkHandler::getInstance()->getLink('Attachment', array(
+                               return StringUtil::getAnchorTag(LinkHandler::getInstance()->getLink('Attachment', [
                                        'object' => $attachment
-                               )), ((!empty($content) && $content != $attachmentID) ? $content : $attachment->filename));
+                               ]), ((!empty($content) && $content != $attachmentID) ? $content : $attachment->filename));
                        }
                }
                
                // fallback
-               return StringUtil::getAnchorTag(LinkHandler::getInstance()->getLink('Attachment', array(
+               return StringUtil::getAnchorTag(LinkHandler::getInstance()->getLink('Attachment', [
                        'id' => $attachmentID
-               )));
+               ]));
        }
        
        /**
index 5b5bfb90a6a4780f172ac461f9864ba3767f4ba9..02a405e09ad1d0ba8f19a3ad1d5c944160c8526c 100644 (file)
@@ -19,13 +19,13 @@ class BBCodeHandler extends SingletonFactory {
         * list of BBCodes allowed for usage
         * @var BBCode[]
         */
-       protected $allowedBBCodes = array();
+       protected $allowedBBCodes = [];
        
        /**
         * list of BBCodes displayed as buttons
         * @var BBCode[]
         */
-       protected $buttonBBCodes = array();
+       protected $buttonBBCodes = [];
        
        /**
         * list of BBCodes which contain raw code (disabled BBCode parsing)
@@ -81,7 +81,7 @@ class BBCodeHandler extends SingletonFactory {
         * @return      BBCode[]
         */
        public function getButtonBBCodes() {
-               $buttons = array();
+               $buttons = [];
                foreach ($this->buttonBBCodes as $bbcode) {
                        if ($this->isAvailableBBCode($bbcode->bbcodeTag)) {
                                $buttons[] = $bbcode;
@@ -107,11 +107,11 @@ class BBCodeHandler extends SingletonFactory {
         */
        public function getSourceBBCodes() {
                if (empty($this->allowedBBCodes)) {
-                       return array();
+                       return [];
                }
                
                if ($this->sourceBBCodes === null) {
-                       $this->sourceBBCodes = array();
+                       $this->sourceBBCodes = [];
                        
                        foreach (BBCodeCache::getInstance()->getBBCodes() as $bbcode) {
                                if (!$bbcode->isSourceCode) {
index 3c55b501b59c5b4135a501065b1e9365708d85c3..6e480f01d4d103dc72fafb942e374e116dd9ff6b 100644 (file)
@@ -20,7 +20,7 @@ class BBCodeParser extends SingletonFactory {
         * list of bbcodes
         * @var BBCode[]
         */
-       protected $bbcodes = array();
+       protected $bbcodes = [];
        
        /**
         * output type
@@ -44,13 +44,13 @@ class BBCodeParser extends SingletonFactory {
         * tag array
         * @var array
         */
-       protected $tagArray = array();
+       protected $tagArray = [];
        
        /**
         * text array
         * @var array
         */
-       protected $textArray = array();
+       protected $textArray = [];
        
        /**
         * regular expression for source code tags
@@ -66,7 +66,7 @@ class BBCodeParser extends SingletonFactory {
                $this->bbcodes = BBCodeCache::getInstance()->getBBCodes();
                
                // handle source codes
-               $sourceCodeTags = array();
+               $sourceCodeTags = [];
                foreach ($this->bbcodes as $bbcode) {
                        if ($bbcode->isSourceCode) $sourceCodeTags[] = $bbcode->bbcodeTag;
                }
@@ -121,9 +121,9 @@ class BBCodeParser extends SingletonFactory {
         */
        public function buildXMLStructure() {
                // stack for open tags
-               $openTagStack = $openTagDataStack = array();
-               $newTagArray = array();
-               $newTextArray = array();
+               $openTagStack = $openTagDataStack = [];
+               $newTagArray = [];
+               $newTextArray = [];
                
                $i = -1;
                foreach ($this->tagArray as $i => $tag) {
@@ -131,7 +131,7 @@ class BBCodeParser extends SingletonFactory {
                                // closing tag
                                if (in_array($tag['name'], $openTagStack) && $this->isAllowed($openTagStack, $tag['name'], true)) {
                                        // close unclosed tags
-                                       $tmpOpenTags = array();
+                                       $tmpOpenTags = [];
                                        while (($previousTag = end($openTagStack)) != $tag['name']) {
                                                $nextIndex = count($newTagArray);
                                                $newTagArray[$nextIndex] = $this->buildTag('[/'.$previousTag.']');
@@ -218,7 +218,7 @@ class BBCodeParser extends SingletonFactory {
                }
                
                foreach ($this->bbcodes[$tag['name']]->getAttributes() as $attribute) {
-                       if (!$this->isValidTagAttribute((isset($tag['attributes']) ? $tag['attributes'] : array()), $attribute)) {
+                       if (!$this->isValidTagAttribute((isset($tag['attributes']) ? $tag['attributes'] : []), $attribute)) {
                                return false;
                        }
                }
@@ -330,7 +330,7 @@ class BBCodeParser extends SingletonFactory {
                        
                        $arguments = explode('^', $this->bbcodes[$openTag]->allowedChildren);
                        if (!empty($arguments[1])) $tags = explode(',', $arguments[1]);
-                       else $tags = array();
+                       else $tags = [];
                        
                        if ($arguments[0] == 'none' && !in_array($tag, $tags)) return false;
                        if ($arguments[0] == 'all' && in_array($tag, $tags)) return false;
@@ -350,7 +350,7 @@ class BBCodeParser extends SingletonFactory {
                $buffer =& $this->parsedText;
                
                // stack of buffered tags
-               $bufferedTagStack = array();
+               $bufferedTagStack = [];
                
                // loop through the tags
                $i = -1;
@@ -474,7 +474,7 @@ class BBCodeParser extends SingletonFactory {
         * @return      array           bbcode tag data
         */
        protected function buildTag($string) {
-               $tag = array('name' => '', 'closing' => false, 'source' => $string);
+               $tag = ['name' => '', 'closing' => false, 'source' => $string];
                
                if (mb_substr($string, 1, 1) == '/') {
                        // closing tag
@@ -529,14 +529,14 @@ class BBCodeParser extends SingletonFactory {
        public function validateBBCodes($text, array $allowedBBCodes) {
                // if all BBCodes are allowed, return directly
                if (in_array('all', $allowedBBCodes)) {
-                       return array();
+                       return [];
                }
                
                $this->setText($text);
                $this->buildTagArray(false);
                $this->buildXMLStructure();
                
-               $usedDisallowedBBCodes = array();
+               $usedDisallowedBBCodes = [];
                foreach ($this->tagArray as $tag) {
                        if (!in_array($tag['name'], $allowedBBCodes) && !isset($usedDisallowedBBCodes[$tag['name']])) {
                                $usedDisallowedBBCodes[$tag['name']] = $tag['name'];
index e31744b39cadbd43b027029cb37fabe52a2da38c..bd2d096c7f67cd75e9200cd3b6aaf04ec1c01706 100644 (file)
@@ -37,7 +37,7 @@ class CodeBBCode extends AbstractBBCode {
         * already used ids for line numbers to prevent duplicate ids in the output
         * @var string[]
         */
-       private static $codeIDs = array();
+       private static $codeIDs = [];
        
        /**
         * @see \wcf\system\bbcode\IBBCode::getParsedTag()
@@ -131,21 +131,21 @@ class CodeBBCode extends AbstractBBCode {
                        $highlightedContent = self::fixMarkup(explode("\n", $className::getInstance()->highlight($content)));
                        
                        // show template
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'lineNumbers' => self::makeLineNumbers($content, $this->startLineNumber),
                                'startLineNumber' => $this->startLineNumber,
                                'content' => $highlightedContent,
                                'highlighter' => $className::getInstance(),
                                'filename' => $this->filename,
                                'lines' => substr_count($content, "\n") + 1
-                       ));
+                       ]);
                        return WCF::getTPL()->fetch('codeBBCodeTag');
                }
                else if ($parser->getOutputType() == 'text/simplified-html') {
-                       return WCF::getLanguage()->getDynamicVariable('wcf.bbcode.code.text', array(
+                       return WCF::getLanguage()->getDynamicVariable('wcf.bbcode.code.text', [
                                'highlighterTitle' => $className::getInstance()->getTitle(),
                                'lines' => substr_count($content, "\n") + 1
-                       ));
+                       ]);
                }
        }
        
@@ -217,7 +217,7 @@ class CodeBBCode extends AbstractBBCode {
        protected static function makeLineNumbers($code, $start, $split = "\n") {
                $lines = explode($split, $code);
                
-               $lineNumbers = array();
+               $lineNumbers = [];
                $i = -1;
                // find an unused codeID
                do {
@@ -260,7 +260,7 @@ class CodeBBCode extends AbstractBBCode {
                        $emptyTagRegex = new Regex('<span(?: class="(?:[^"])*")?></span>');
                }
                
-               $openTags = array();
+               $openTags = [];
                foreach ($lines as &$line) {
                        $spanRegex->match($line, true);
                        // open all tags again
index d057c1128735ae10f8c3253d469de5729ab3f940..cd2744a4ad790905fd9d7f054fd91cdfe2d0ce80 100644 (file)
@@ -63,7 +63,7 @@ class HtmlBBCodeParser extends BBCodeParser {
                $buffer =& $this->parsedText;
                
                // stack of buffered tags
-               $bufferedTagStack = array();
+               $bufferedTagStack = [];
                
                // loop through the tags
                $i = -1;
index ce84858ed92536cfb44b744c291230322ddc61f8..56c54694d69aa6ccb0d3a491a40e3afc4531d208 100644 (file)
@@ -19,13 +19,13 @@ class KeywordHighlighter extends SingletonFactory {
         * search keywords
         * @var string[]
         */
-       protected $keywords = array();
+       protected $keywords = [];
        
        /**
         * search query parameters
         * @var string[]
         */
-       protected static $searchQueryKeys = array(
+       protected static $searchQueryKeys = [
                'q',            // google, msn, altavista
                'p',            // yahoo
                'query',        // lycos, fireball
@@ -55,7 +55,7 @@ class KeywordHighlighter extends SingletonFactory {
                //'k',
                //'t',
                'va'
-       );
+       ];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -110,12 +110,12 @@ class KeywordHighlighter extends SingletonFactory {
                        $keywordString = StringUtil::trim(mb_substr($keywordString, 1, -1));
                        
                        if (!empty($keywordString)) {
-                               $this->keywords = array_merge($this->keywords, array(StringUtil::encodeHTML($keywordString)));
+                               $this->keywords = array_merge($this->keywords, [StringUtil::encodeHTML($keywordString)]);
                        }
                }
                else {
                        // replace word delimiters by space
-                       $keywordString = str_replace(array('.', ','), ' ', $keywordString);
+                       $keywordString = str_replace(['.', ','], ' ', $keywordString);
                        
                        $keywords = ArrayUtil::encodeHTML(ArrayUtil::trim(explode(' ', $keywordString)));
                        if (!empty($keywords)) {
index c49affbdd5d384f2f11cc1d1ae773c4662b0a8e8..9cf84aad1f5716fef1ba94c3d8d64759d9da58aa 100644 (file)
@@ -21,13 +21,13 @@ class MessageParser extends BBCodeParser {
         * list of smilies
         * @var Smiley[]
         */
-       protected $smilies = array();
+       protected $smilies = [];
        
        /**
         * cached bbcodes
         * @var array
         */
-       protected $cachedCodes = array();
+       protected $cachedCodes = [];
        
        /**
         * currently parsed message
@@ -69,7 +69,7 @@ class MessageParser extends BBCodeParser {
         * @return      string          parsed message
         */
        public function parse($message, $enableSmilies = true, $enableHtml = false, $enableBBCodes = true, $doKeywordHighlighting = true) {
-               $this->cachedCodes = array();
+               $this->cachedCodes = [];
                $this->message = $message;
                
                // call event
@@ -116,8 +116,8 @@ class MessageParser extends BBCodeParser {
                }
                
                // replace bad html tags (script etc.)
-               $badSearch = array('/(javascript):/i', '/(about):/i', '/(vbscript):/i');
-               $badReplace = array('$1<b></b>:', '$1<b></b>:', '$1<b></b>:');
+               $badSearch = ['/(javascript):/i', '/(about):/i', '/(vbscript):/i'];
+               $badReplace = ['$1<b></b>:', '$1<b></b>:', '$1<b></b>:'];
                $this->message = preg_replace($badSearch, $badReplace, $this->message);
                
                // call event
@@ -155,7 +155,7 @@ class MessageParser extends BBCodeParser {
                                        (?:,(?:\'[^\'\\\\]*(?:\\\\.[^\'\\\\]*)*\'|[^,\]]*))*
                                )?\])
                                (.*?)
-                               (?:\[/\\2\])~six", array($this, 'cacheCodesCallback'), $text);
+                               (?:\[/\\2\])~six", [$this, 'cacheCodesCallback'], $text);
                }
                return $text;
        }
index 477aba1ee5d7456c804a885285711d3deff44e4e..ed374548bce670e8510478e44b992bea1f2d35a7 100644 (file)
@@ -50,7 +50,7 @@ class PreParser extends SingletonFactory {
         * @see \wcf\system\SingletonFactory::init()
         */
        protected function init() {
-               $sourceCodeTags = array();
+               $sourceCodeTags = [];
                foreach (BBCodeCache::getInstance()->getBBCodes() as $bbcode) {
                        if ($bbcode->isSourceCode) $sourceCodeTags[] = $bbcode->bbcodeTag;
                }
@@ -229,7 +229,7 @@ class PreParser extends SingletonFactory {
                $matches = $userRegex->getMatches();
                
                if (!empty($matches)) {
-                       $usernames = array();
+                       $usernames = [];
                        foreach ($matches as $match) {
                                // we don't care about the full match
                                array_shift($match);
@@ -243,28 +243,28 @@ class PreParser extends SingletonFactory {
                        if (!empty($usernames)) {
                                // fetch users
                                $userList = new UserList();
-                               $userList->getConditionBuilder()->add('user_table.username IN (?)', array($usernames));
+                               $userList->getConditionBuilder()->add('user_table.username IN (?)', [$usernames]);
                                $userList->readObjects();
-                               $users = array();
+                               $users = [];
                                foreach ($userList as $user) {
                                        $users[mb_strtolower($user->username)] = $user;
                                }
                                
                                $text = $userRegex->replace($text, new Callback(function ($matches) use ($users) {
                                        // containing the full match
-                                       $usernames = array($matches[1]);
+                                       $usernames = [$matches[1]];
                                        
                                        // containing only the part before the first space
                                        if (isset($matches[2])) $usernames[] = $matches[2];
                                        
-                                       $usernames = array_map(array(PreParser::class, 'getUsername'), $usernames);
+                                       $usernames = array_map([PreParser::class, 'getUsername'], $usernames);
                                        
                                        foreach ($usernames as $username) {
                                                if (!isset($users[$username])) continue;
-                                               $link = LinkHandler::getInstance()->getLink('User', array(
+                                               $link = LinkHandler::getInstance()->getLink('User', [
                                                        'appendSession' => false,
                                                        'object' => $users[$username]
-                                               ));
+                                               ]);
                                                
                                                $mention = "[url='".$link."']@".$users[$username]->username.'[/url]';
                                                
index 6c5ed066082af1c99b2e543f7dd587c13c1d841f..c22fb5a0c88ef38312389ebc0efa7fd04c20289f 100644 (file)
@@ -39,17 +39,17 @@ class QuoteBBCode extends AbstractBBCode {
                                }
                        }
                        
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'content' => $content,
                                'quoteLink' => $quoteLink,
                                'quoteAuthor' => $quoteAuthor,
                                'quoteAuthorObject' => $quoteAuthorObject,
                                'isExternalQuoteLink' => $externalQuoteLink
-                       ));
+                       ]);
                        return WCF::getTPL()->fetch('quoteBBCodeTag');
                }
                else if ($parser->getOutputType() == 'text/simplified-html') {
-                       return WCF::getLanguage()->getDynamicVariable('wcf.bbcode.quote.text', array('content' => $content, 'cite' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '')))."\n";
+                       return WCF::getLanguage()->getDynamicVariable('wcf.bbcode.quote.text', ['content' => $content, 'cite' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '')])."\n";
                }
        }
 }
index 7c793d46c7d8cbf875598534ab0e3464b80a29b8..8f8c902b93846a538aac3b17b324eb85553bf118 100644 (file)
@@ -27,19 +27,19 @@ class SimpleMessageParser extends SingletonFactory {
         * list of smilies
         * @var Smiley[]
         */
-       protected $smilies = array();
+       protected $smilies = [];
        
        /**
         * cached URLs
         * @var string[]
         */
-       protected $cachedURLs = array();
+       protected $cachedURLs = [];
        
        /**
         * cached e-mails
         * @var string[]
         */
-       protected $cachedEmails = array();
+       protected $cachedEmails = [];
        
        /**
         * currently parsed message
@@ -80,7 +80,7 @@ class SimpleMessageParser extends SingletonFactory {
         */
        public function parse($message, $parseURLs = true, $parseSmilies = true) {
                $this->message = $message;
-               $this->cachedURLs = $this->cachedEmails = array();
+               $this->cachedURLs = $this->cachedEmails = [];
                
                // call event
                EventHandler::getInstance()->fireAction($this, 'beforeParsing');
@@ -107,8 +107,8 @@ class SimpleMessageParser extends SingletonFactory {
                }
                
                // replace bad html tags (script etc.)
-               $badSearch = array('/(javascript):/i', '/(about):/i', '/(vbscript):/i');
-               $badReplace = array('$1<b></b>:', '$1<b></b>:', '$1<b></b>:');
+               $badSearch = ['/(javascript):/i', '/(about):/i', '/(vbscript):/i'];
+               $badReplace = ['$1<b></b>:', '$1<b></b>:', '$1<b></b>:'];
                $this->message = preg_replace($badSearch, $badReplace, $this->message);
                
                // call event
@@ -153,11 +153,11 @@ class SimpleMessageParser extends SingletonFactory {
                        ~ix';
                
                // parse urls
-               $text = preg_replace_callback($urlPattern, array($this, 'cacheURLsCallback'), $text);
+               $text = preg_replace_callback($urlPattern, [$this, 'cacheURLsCallback'], $text);
                
                // parse emails
                if (mb_strpos($text, '@') !== false) {
-                       $text = preg_replace_callback($emailPattern, array($this, 'cacheEmailsCallback'), $text);
+                       $text = preg_replace_callback($emailPattern, [$this, 'cacheEmailsCallback'], $text);
                }
                
                return $text;
index 4ef4c819053c11e8b20b1cb9b4d4c477611adb81..3592b4d1c4ce0e36e0728d4aafdb193c24c262c1 100644 (file)
@@ -18,10 +18,10 @@ class SpoilerBBCode extends AbstractBBCode {
         */
        public function getParsedTag(array $openingTag, $content, array $closingTag, BBCodeParser $parser) {
                if ($parser->getOutputType() == 'text/html') {
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'content' => $content,
                                'buttonTitle' => (!empty($openingTag['attributes'][0]) ? $openingTag['attributes'][0] : '')
-                       ));
+                       ]);
                        return WCF::getTPL()->fetch('spoilerBBCodeTag');
                }
                if ($parser->getOutputType() == 'text/simplified-html') {
index 4156b674b7571e15fa2ec45ccd5c3d17f77e7aaa..4ac67240e4dc221816477380e933c9ed9e42a661 100644 (file)
@@ -25,7 +25,7 @@ class TableBBCode extends AbstractBBCode {
                        if ($regex->match($parsedContent, true)) {
                                $matches = $regex->getMatches();
                                
-                               $openTags = array();
+                               $openTags = [];
                                $openTDs = 0;
                                $firstRowTDs = 0;
                                
index a49cad2fd29b96c976b033074c805b476cac1721..aef155cb533663419214d1a3fa0782e377b4a89e 100644 (file)
@@ -15,47 +15,47 @@ class BashHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array(';', '=');
+       protected $separators = [';', '='];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$quotes
         */
-       protected $quotes = array('"', "'", '`');
+       protected $quotes = ['"', "'", '`'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$singleLineComment
         */
-       protected $singleLineComment = array('#');
+       protected $singleLineComment = ['#'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$commentStart
         */
-       protected $commentStart = array();
+       protected $commentStart = [];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$commentEnd
         */
-       protected $commentEnd = array();
+       protected $commentEnd = [];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$operators
         */
-       protected $operators = array('||', '&&', '&', '|', '<<=', '>>=', '<<', '+=', '-=', '*=', '/=', '%=',
+       protected $operators = ['||', '&&', '&', '|', '<<=', '>>=', '<<', '+=', '-=', '*=', '/=', '%=',
                                        '-gt', '-lt', '-n', '-a', '-o',
-                                       '+', '-', '*', '/', '%', '<', '?', ':', '==', '!=', '=', '!', '>', '2>', '>>');
+                                       '+', '-', '*', '/', '%', '<', '?', ':', '==', '!=', '=', '!', '>', '2>', '>>'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords1
         */
-       protected $keywords1 = array(
+       protected $keywords1 = [
                'true',
                'false'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords2
         */
-       protected $keywords2 = array(
+       protected $keywords2 = [
                'if',
                'then',
                'else',
@@ -68,12 +68,12 @@ class BashHighlighter extends Highlighter {
                'case',
                'in',
                'esac'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords3
         */
-       protected $keywords3 = array(
+       protected $keywords3 = [
                'echo',
                'exit',
                'unset',
@@ -83,12 +83,12 @@ class BashHighlighter extends Highlighter {
                'sed',
                'grep',
                'awk'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords4
         */
-       protected $keywords4 = array(
+       protected $keywords4 = [
                '$?'
-       );
+       ];
 }
index f3a8d45711de70a545f2d7df5fb24d0a3b72c815..c2ac320a7d5a0495d359795daa440cf9848788c9 100644 (file)
@@ -22,7 +22,7 @@ class BrainfuckHighlighter extends Highlighter {
                $string = preg_replace('/[\\.,]+/', '<span class="hlKeywords2">\\0</span>', $string);
                $string = preg_replace('/[\\[\\]]+/', '<span class="hlKeywords3">\\0</span>', $string);
                
-               $string = str_replace(array('||span class="hlComments"||', '||/span||'), array('<span class="hlComments">', '</span>'), $string);
+               $string = str_replace(['||span class="hlComments"||', '||/span||'], ['<span class="hlComments">', '</span>'], $string);
                return $string;
        }
 }
index e4a606fb3941b65a53a758ea408cfb098b8cf655..cc7b435b1a76b8e6f660fb8625cbdd2b1a021dd2 100644 (file)
@@ -15,19 +15,19 @@ class CHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array('(', ')', '{', '}', '[', ']', ';', '.', ',');
+       protected $separators = ['(', ')', '{', '}', '[', ']', ';', '.', ','];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$operators
         */
-       protected $operators = array('=', '>', '<', '!', '~', '?', ':', '==', '<=', '>=', '!=',
+       protected $operators = ['=', '>', '<', '!', '~', '?', ':', '==', '<=', '>=', '!=',
                '&&', '||', '++', '--', '+', '-', '*', '/', '&', '|', '^', '%', '<<', '>>', '>>>', '+=', '-=', '*=',
-               '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>=');
+               '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>='];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords1
         */
-       protected $keywords1 = array(
+       protected $keywords1 = [
                'and',
                'and_eq',
                'asm',
@@ -71,12 +71,12 @@ class CHighlighter extends Highlighter {
                'while',
                'xor',
                'xor_eq'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords2
         */
-       protected $keywords2 = array(
+       protected $keywords2 = [
                'auto',
                'bool',
                'char',
@@ -107,17 +107,17 @@ class CHighlighter extends Highlighter {
                'void',
                'volatile',
                'wchar_t'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords3
         */
-       protected $keywords3 = array(
+       protected $keywords3 = [
                '#include',
                '#define',
                '#if',
                '#else',
                '#ifdef',
                '#endif'
-       );
+       ];
 }
index f26ec9fefc96953fab6987e5f3d12fb01340e604..e3c13d25c9644721163b13f866f3b093c93f6a79 100644 (file)
@@ -16,7 +16,7 @@ class CssHighlighter extends Highlighter {
         * temporary string replacement map for properties that can also be tags
         * @var string[]
         */
-       public static $duplicates = array(
+       public static $duplicates = [
                'table:' => 't@@able:',
                'caption:' => 'c@@aption:',
                'menu:' => 'm@@enu:',
@@ -24,7 +24,7 @@ class CssHighlighter extends Highlighter {
                'sub:' => 's@@ub:',
                'pre:' => 'p@@re:',
                'small:' => 's@@mall:'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::highlightNumbers()
@@ -54,13 +54,13 @@ class CssHighlighter extends Highlighter {
        public function highlight($string) {
                $string = str_replace('span', '053a0024219422ca9215c0a3ed0578ee76cff477', $string); // fix to not highlight the spans of the highlighter
                $string = str_replace(':link', ':li@@nk', $string); // fix to highlight pseudo-class different than tag
-               $string = str_replace(array('right:', 'left:'), array('r@@ight:', 'l@@eft:'), $string); // fix to highlight properties different than values
+               $string = str_replace(['right:', 'left:'], ['r@@ight:', 'l@@eft:'], $string); // fix to highlight properties different than values
                $string = strtr($string, self::$duplicates); // fix to highlight properties different than tags
                
                $string = parent::highlight($string);
                
                $string = strtr($string, array_flip(self::$duplicates)); // fix to highlight properties different than tags
-               $string = str_replace(array('r@@ight', 'l@@eft'), array('right', 'left'), $string); // fix to highlight properties different than values
+               $string = str_replace(['r@@ight', 'l@@eft'], ['right', 'left'], $string); // fix to highlight properties different than values
                $string = str_replace('li@@nk', 'link', $string); // fix to highlight pseudo-class different than tag
                return str_replace('053a0024219422ca9215c0a3ed0578ee76cff477', 'span', $string); // fix to not highlight the spans of the highlighter
        }
@@ -68,17 +68,17 @@ class CssHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$singleLineComment
         */
-       protected $singleLineComment = array('//');
+       protected $singleLineComment = ['//'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array('(', ')', '{', '}', ';', '[', ']', ':', ',', '.');
+       protected $separators = ['(', ')', '{', '}', ';', '[', ']', ':', ',', '.'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords1
         */
-       protected $keywords1 = array(
+       protected $keywords1 = [
                'azimuth',
                'background',
                'background-attachment',
@@ -224,12 +224,12 @@ class CssHighlighter extends Highlighter {
                '!important',
                '@import',
                '@media'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords2
         */
-       protected $keywords2 = array(
+       protected $keywords2 = [
                'left-side',
                'far-left',
                'left',
@@ -469,12 +469,12 @@ class CssHighlighter extends Highlighter {
                'hsla',
                'rgb',
                'rgba'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords3
         */
-       protected $keywords3 = array(
+       protected $keywords3 = [
                'active',
                'after',
                'before',
@@ -502,12 +502,12 @@ class CssHighlighter extends Highlighter {
                'root',
                'target',
                'visited'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords4
         */
-       protected $keywords4 = array(
+       protected $keywords4 = [
                'abbr',
                'acronym',
                'address',
@@ -621,12 +621,12 @@ class CssHighlighter extends Highlighter {
                'var',
                'video',
                'wbr'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords5
         */
-       public $keywords5 = array(
+       public $keywords5 = [
                // modifying
                'darken',
                'lighten',
@@ -663,5 +663,5 @@ class CssHighlighter extends Highlighter {
                'true',
                // others
                '&'
-       );
+       ];
 }
index 65f160036b757e9799a82a4a5b35206208a4737e..764f814583f7bba78ecf8d5418e3b17a182991ca 100644 (file)
@@ -18,27 +18,27 @@ class DiffHighlighter extends Highlighter {
         * normal diffs
         * @var string[]
         */
-       protected $add = array("+", ">");
+       protected $add = ["+", ">"];
        
        /**
         * keywords for an deleted line, the - is used in unified diff, the < in
         * normal diffs
         * @var string[]
         */
-       protected $delete = array("-", "<");
+       protected $delete = ["-", "<"];
        
        /**
         * splitter in changes for normal diff
         * @var string[]
         */
-       protected $splitter = array("---");
+       protected $splitter = ["---"];
        
        /**
         * keywords for the line info, the @ is used in unified diffs, the numbers
         * in normal diffs
         * @var string[]
         */
-       protected $info = array("@", '0', '1', '2', '3', '4', '5', '6', '7', '8', '9');
+       protected $info = ["@", '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::highlight()
index 99ccbb474062c8f12be2f7af2b7b2ae0b6a9a9c2..5bbf5c40c5bd060e28c756164de688d793249a32 100644 (file)
@@ -28,73 +28,73 @@ abstract class Highlighter extends SingletonFactory {
         * comment end delimiter
         * @var string[]
         */
-       protected $commentEnd = array("*/");
+       protected $commentEnd = ["*/"];
        
        /**
         * comment start delimiter
         * @var string[]
         */
-       protected $commentStart = array("/*");
+       protected $commentStart = ["/*"];
        
        /**
         * escape sequence
         * @var string[]
         */
-       protected $escapeSequence = array("\\");
+       protected $escapeSequence = ["\\"];
        
        /**
         * categorized keywords
         * @var string[]
         */
-       protected $keywords1 = array();
+       protected $keywords1 = [];
        
        /**
         * categorized keywords
         * @var string[]
         */
-       protected $keywords2 = array();
+       protected $keywords2 = [];
        
        /**
         * categorized keywords
         * @var string[]
         */
-       protected $keywords3 = array();
+       protected $keywords3 = [];
        
        /**
         * categorized keywords
         * @var string[]
         */
-       protected $keywords4 = array();
+       protected $keywords4 = [];
        
        /**
         * categorized keywords
         * @var string[]
         */
-       protected $keywords5 = array();
+       protected $keywords5 = [];
        
        /**
         * list of arithmetic operators
         * @var string[]
         */
-       protected $operators = array();
+       protected $operators = [];
        
        /**
         * list of quote marks
         * @var string[]
         */
-       protected $quotes = array("'", '"');
+       protected $quotes = ["'", '"'];
        
        /**
         * list of separator sequences
         * @var string[]
         */
-       protected $separators = array();
+       protected $separators = [];
        
        /**
         * inline comment sequence
         * @var string[]
         */
-       protected $singleLineComment = array("//");
+       protected $singleLineComment = ["//"];
        
        /**
         * regular expression to extract comments
@@ -172,7 +172,7 @@ abstract class Highlighter extends SingletonFactory {
                $quotesRegEx = '';
                foreach ($this->quotes as $quote) {
                        if ($quotesRegEx !== '') $quotesRegEx .= '|';
-                       if (!is_array($quote)) $quote = array($quote, $quote);
+                       if (!is_array($quote)) $quote = [$quote, $quote];
                        list($opening, $closing) = $quote;
                        
                        $opening = preg_quote($opening);
index 1665752a41934b72b0873120ca7c3c876ba34249..3734b2bc0dda35afb70a592707943c0efe1d14d2 100644 (file)
@@ -15,12 +15,12 @@ class JavaHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array("(", ")", "{", "}", "[", "]", ";", ".", ",", "<", ">");
+       protected $separators = ["(", ")", "{", "}", "[", "]", ";", ".", ",", "<", ">"];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords2
         */
-       protected $keywords2 = array(
+       protected $keywords2 = [
                'package',
                'abstract',
                'break',
@@ -72,12 +72,12 @@ class JavaHighlighter extends Highlighter {
                'static',
                'void',
                'import'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords3
         */
-       protected $keywords3 = array(
+       protected $keywords3 = [
                'Boolean',
                'Float',
                'Character',
@@ -100,5 +100,5 @@ class JavaHighlighter extends Highlighter {
                'HashMap',
                'List',
                'ArrayList'
-       );
+       ];
 }
index dc67649bab0e4c846f0c71e9c1ecc99d55597063..62c49daf02ef8984a39b3333d239db6110cbab95 100644 (file)
@@ -15,19 +15,19 @@ class JsHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array("(", ")", "{", "}", "[", "]", ";", ".", ",");
+       protected $separators = ["(", ")", "{", "}", "[", "]", ";", ".", ","];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$operators
         */
-       protected $operators = array("=", ">", "<", "!", "~", "?", ":", "==", "<=", ">=", "!=",
+       protected $operators = ["=", ">", "<", "!", "~", "?", ":", "==", "<=", ">=", "!=",
                "&&", "||", "++", "--", "+", "-", "*", "/", "&", "|", "^", "%", "<<", ">>", ">>>", "+=", "-=", "*=",
-               "/=", "&=", "|=", "^=", "%=", "<<=", ">>=", ">>>=");
+               "/=", "&=", "|=", "^=", "%=", "<<=", ">>=", ">>>="];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords1
         */
-       protected $keywords1 = array(
+       protected $keywords1 = [
                "String",
                "Array",
                "RegExp",
@@ -62,12 +62,12 @@ class JsHighlighter extends Highlighter {
                "onSelect",
                "onSubmit",
                "onUnload"
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords2
         */
-       protected $keywords2 = array(
+       protected $keywords2 = [
                "break",
                "continue",
                "do",
@@ -128,5 +128,5 @@ class JsHighlighter extends Highlighter {
                "true",
                "try",
                "volatile"
-       );
+       ];
 }
index b326b343ceb3cbc6c70ec5ced5a6a6b471314b4f..532bdef0234193e8ca1c15aba0e468c15ccc4b93 100644 (file)
@@ -15,34 +15,34 @@ class PerlHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array('(', ')', '{', '}', '[', ']', ';', '.', ',');
+       protected $separators = ['(', ')', '{', '}', '[', ']', ';', '.', ','];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$singleLineComment
         */
-       protected $singleLineComment = array('#');
+       protected $singleLineComment = ['#'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$commentStart
         */
-       protected $commentStart = array();
+       protected $commentStart = [];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$commentEnd
         */
-       protected $commentEnd = array();
+       protected $commentEnd = [];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$operators
         */
-       protected $operators = array('.=', '=', '>', '<', '!', '~', '?', ':', '==', '<=', '>=', '!=',
+       protected $operators = ['.=', '=', '>', '<', '!', '~', '?', ':', '==', '<=', '>=', '!=',
                '&&', '||', '++', '--', '+', '-', '*', '/', '&', '|', '^', '%', '<<', '>>', '>>>', '+=', '-=', '*=',
-               '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>=', '->', '::');
+               '/=', '&=', '|=', '^=', '%=', '<<=', '>>=', '>>>=', '->', '::'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords1
         */
-       protected $keywords1 = array(
+       protected $keywords1 = [
                'print',
                'sprintf',
                'length',
@@ -81,12 +81,12 @@ class PerlHighlighter extends Highlighter {
                'crypt',
                'pack',
                'unpack'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords2
         */
-       protected $keywords2 = array(
+       protected $keywords2 = [
                'case',
                'do',
                'while',
@@ -115,15 +115,15 @@ class PerlHighlighter extends Highlighter {
                'until',
                'break',
                'exit'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords3
         */
-       protected $keywords3 = array(
+       protected $keywords3 = [
                'use',
                'import',
                'require',
                'sub'
-       );
+       ];
 }
index 9ccdec5bc1b90e7639e1f21bc6566a555930bfcf..62d62f633b8678ec3c9a2ea6a50877b49a89ec71 100644 (file)
@@ -13,7 +13,7 @@ use wcf\system\Regex;
  * @category   Community Framework
  */
 class PhpHighlighter extends Highlighter {
-       public static $colorToClass = array();
+       public static $colorToClass = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -21,7 +21,7 @@ class PhpHighlighter extends Highlighter {
        protected function init() {
                parent::init();
                
-               $types = array('default' => 'hlKeywords1', 'keyword' => 'hlKeywords2', 'comment' => 'hlComments', 'string' => 'hlQuotes');
+               $types = ['default' => 'hlKeywords1', 'keyword' => 'hlKeywords2', 'comment' => 'hlComments', 'string' => 'hlQuotes'];
                
                self::$colorToClass['<span style="color: '.ini_get('highlight.html').'">'] = '<span>';
                foreach ($types as $type => $class) {
index 47921a66dc1d9e6368a747c48af71173e5cf4c5f..442b21b57a998b2f94d508c6acaa95bf26c73dbd 100644 (file)
@@ -15,38 +15,38 @@ class PythonHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array('(', ')',/* from __future__ import braces '{', '}', */'[', ']', ';', '.', ',', ':');
+       protected $separators = ['(', ')',/* from __future__ import braces '{', '}', */'[', ']', ';', '.', ',', ':'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$singleLineComment
         */
-       protected $singleLineComment = array('#');
+       protected $singleLineComment = ['#'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$commentStart
         */
-       protected $commentStart = array();
+       protected $commentStart = [];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$commentEnd
         */
-       protected $commentEnd = array();
+       protected $commentEnd = [];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$operators
         */
-       protected $operators = array('+=', '-=', '**=', '*=', '//=', '/=', '%=', '~=', '+', '-', '**', '*', '//', '/', '%', 
-                                       '&=', '<<=', '>>=', '^=', '~', '&', '^', '|', '<<', '>>', '=', '!=', '<', '>', '<=', '>=');
+       protected $operators = ['+=', '-=', '**=', '*=', '//=', '/=', '%=', '~=', '+', '-', '**', '*', '//', '/', '%', 
+                                       '&=', '<<=', '>>=', '^=', '~', '&', '^', '|', '<<', '>>', '=', '!=', '<', '>', '<=', '>='];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$quotes
         */
-       protected $quotes = array(array("r'", "'"), array("u'", "'"), array('r"', '"'), array('u"', '"'), "'", '"');
+       protected $quotes = [["r'", "'"], ["u'", "'"], ['r"', '"'], ['u"', '"'], "'", '"'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords1
         */
-       protected $keywords1 = array(
+       protected $keywords1 = [
                'print',
                'del',
                'str',
@@ -59,12 +59,12 @@ class PythonHighlighter extends Highlighter {
                'continue',
                'break',
                'return'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords2
         */
-       protected $keywords2 = array(
+       protected $keywords2 = [
                'if',
                'elif',
                'else',
@@ -74,23 +74,23 @@ class PythonHighlighter extends Highlighter {
                'for',
                'in',
                'while'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords3
         */
-       protected $keywords3 = array(
+       protected $keywords3 = [
                'from',
                'import',
                'as',
                'class',
                'def'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords4
         */
-       protected $keywords4 = array(
+       protected $keywords4 = [
                '__name__',
                '__init__',
                '__str__',
@@ -103,5 +103,5 @@ class PythonHighlighter extends Highlighter {
                'or',
                'not',
                'is'
-       );
+       ];
 }
index 7c1e275d735f7427e26e315fe8d26126186024c9..cb6932614bfbcc34d8de22645c19b94b520abc9d 100644 (file)
@@ -23,22 +23,22 @@ class SqlHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$quotes
         */
-       protected $quotes = array("'", '"');
+       protected $quotes = ["'", '"'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$singleLineComment
         */
-       protected $singleLineComment = array('#', '--');
+       protected $singleLineComment = ['#', '--'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array('(', ')', ',', ';');
+       protected $separators = ['(', ')', ',', ';'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$operators
         */
-       protected $operators = array('<>', '~=', '!=', '^=', '=', '<', '<=', '>', '>=', '*', '/', '+', '-', '||', '@', '%', '&', '?', '\$');
+       protected $operators = ['<>', '~=', '!=', '^=', '=', '<', '<=', '>', '>=', '*', '/', '+', '-', '||', '@', '%', '&', '?', '\$'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::cacheComments()
@@ -83,7 +83,7 @@ class SqlHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords1
         */
-       protected $keywords1 = array(
+       protected $keywords1 = [
                'action',
                'add',
                'aggregate',
@@ -316,12 +316,12 @@ class SqlHighlighter extends Highlighter {
                'year',
                'year_month',
                'zerofill'
-       );
+       ];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$keywords2
         */
-       protected $keywords2 = array(
+       protected $keywords2 = [
                'ABS',
                'ACOS',
                'ADDDATE',
@@ -430,5 +430,5 @@ class SqlHighlighter extends Highlighter {
                'WEEK',
                'WEEKDAY',
                'YEAR'
-       );
+       ];
 }
index 9d9ee92e8059d7a83d46b51faed84ccbafe6cc4d..92ff4755f0c362f31a220effecbec4b069e4065f 100644 (file)
@@ -16,12 +16,12 @@ class TexHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$quotes
         */
-       protected $quotes = array();
+       protected $quotes = [];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$singleLineComment
         */
-       protected $singleLineComment = array('%');
+       protected $singleLineComment = ['%'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::highlightKeywords()
index 4bdcf4810626ec140a9d441dd25b1b5514f74cc3..674c9d8bd45dad9d5f4831a5db24b0959cbe3264 100644 (file)
@@ -24,32 +24,32 @@ class XmlHighlighter extends Highlighter {
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$quotes
         */
-       protected $quotes = array('"');
+       protected $quotes = ['"'];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$singleLineComment
         */
-       protected $singleLineComment = array();
+       protected $singleLineComment = [];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$commentStart
         */
-       protected $commentStart = array("<!--");
+       protected $commentStart = ["<!--"];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$commentEnd
         */
-       protected $commentEnd = array("-->");
+       protected $commentEnd = ["-->"];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$separators
         */
-       protected $separators = array("<", ">");
+       protected $separators = ["<", ">"];
        
        /**
         * @see \wcf\system\bbcode\highlighter\Highlighter::$operators
         */
-       protected $operators = array();
+       protected $operators = [];
        
        const XML_ATTRIBUTE_NAME = '[a-z0-9](?:(?:(?<!-)-)?[a-z0-9])*';
        
index 80dfce33962ef609baf380bcc8a178e0870b4e1f..2853b226465eba69a4aba985812b61cbdc7f9055 100644 (file)
@@ -27,7 +27,7 @@ class Benchmark extends SingletonFactory {
         * benchmark items
         * @var array
         */
-       protected $items = array();
+       protected $items = [];
        
        /**
         * number of executed sql queries
index 0d185a6cab44fe83ba0aace160f06ed5b8eec11b..6bef3408ad19c791ffa32a1b63907f19c79b3b3c 100644 (file)
@@ -38,8 +38,8 @@ class BoxHandler extends SingletonFactory {
                
                // load box layout for active page
                $boxList = new BoxList();
-               if ($pageID) $boxList->getConditionBuilder()->add('(box.visibleEverywhere = ? AND boxID NOT IN (SELECT boxID FROM wcf'.WCF_N.'_box_to_page WHERE pageID = ? AND visible = ?)) OR boxID IN (SELECT boxID FROM wcf'.WCF_N.'_box_to_page WHERE pageID = ? AND visible = ?)', array(1, $pageID, 0, $pageID, 1));
-               else $boxList->getConditionBuilder()->add('box.visibleEverywhere = ?', array(1));
+               if ($pageID) $boxList->getConditionBuilder()->add('(box.visibleEverywhere = ? AND boxID NOT IN (SELECT boxID FROM wcf'.WCF_N.'_box_to_page WHERE pageID = ? AND visible = ?)) OR boxID IN (SELECT boxID FROM wcf'.WCF_N.'_box_to_page WHERE pageID = ? AND visible = ?)', [1, $pageID, 0, $pageID, 1]);
+               else $boxList->getConditionBuilder()->add('box.visibleEverywhere = ?', [1]);
                $boxList->sqlOrderBy = 'showOrder';
                $boxList->readObjects();
                foreach ($boxList as $box) {
index d86bf9e0d18be5afb485990ac0e2836ec9ef43f1..36078a4dd4ba99708bf5813dbe6e945a1024c714 100644 (file)
@@ -24,9 +24,9 @@ class StatisticsBoxController extends AbstractBoxController {
         * @inheritDoc
         */
        protected function loadContent() {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'statistics' => UserStatsCacheBuilder::getInstance()->getData()
-               ));
+               ]);
                
                $this->content = WCF::getTPL()->fetch('boxStatistics');
        }
index 520aa3910acea3dad7d5e2bca1336125cb49946d..5dcaf021a869fd4a1cd88aba90265772944aac78 100644 (file)
@@ -38,7 +38,7 @@ class DeleteUserBulkProcessingAction extends AbstractUserBulkProcessingAction {
                $userList = parent::getObjectList();
                
                // deny self deletion
-               $userList->getConditionBuilder()->add('user_table.userID <> ?', array(WCF::getUser()->userID));
+               $userList->getConditionBuilder()->add('user_table.userID <> ?', [WCF::getUser()->userID]);
                
                return $userList;
        }
index a30ca88d310595c4e91e37a5f574be32a12ca42d..506414bc1305ac1beeea1f2b91091b4c28da72c6 100644 (file)
@@ -35,7 +35,7 @@ class RemoveFromUserGroupsUserBulkProcessingAction extends AbstractUserGroupsUse
                
                // the active user may not remove themselves from any user group
                // to avoid potential permission issues
-               $userList->getConditionBuilder()->add('user_table.userID <> ?', array(WCF::getUser()->userID));
+               $userList->getConditionBuilder()->add('user_table.userID <> ?', [WCF::getUser()->userID]);
                
                return $userList;
        }
index 8192cb668f7b6cf8946ae7f0ee5add4a4b10a1e3..cb2d5021b5e48a8d2a2ed0c1265c579a5bec2e3c 100644 (file)
@@ -57,9 +57,9 @@ class SendMailUserBulkProcessingAction extends AbstractUserBulkProcessingAction
                if (count($objectList)) {
                        // save config in session
                        $userMailData = WCF::getSession()->getVar('userMailData');
-                       if ($userMailData === null) $userMailData = array();
+                       if ($userMailData === null) $userMailData = [];
                        $this->mailID = count($userMailData);
-                       $userMailData[$this->mailID] = array(
+                       $userMailData[$this->mailID] = [
                                'action' => '',
                                'enableHTML' => $this->enableHTML,
                                'from' => $this->from,
@@ -67,7 +67,7 @@ class SendMailUserBulkProcessingAction extends AbstractUserBulkProcessingAction
                                'subject' => $this->subject,
                                'text' => $this->text,
                                'userIDs' => $objectList->getObjectIDs()
-                       );
+                       ];
                        WCF::getSession()->register('userMailData', $userMailData);
                }
        }
index 93c30245e5ddc6992854357c1851f19af8005b50..6b6f94a861849cd4e810edc965df2a7493d334f1 100644 (file)
@@ -105,7 +105,7 @@ class CacheHandler extends SingletonFactory {
         * @param       array                                           $parameters
         * @return      string
         */
-       protected function getCacheName(ICacheBuilder $cacheBuilder, array $parameters = array()) {
+       protected function getCacheName(ICacheBuilder $cacheBuilder, array $parameters = []) {
                $className = explode('\\', get_class($cacheBuilder));
                $application = array_shift($className);
                $cacheName = str_replace('CacheBuilder', '', array_pop($className));
index 293a108722c6e92417d9b434fadf23062ba02ed6..37c7d95385c4b702ecdad197abceb122edc29404 100644 (file)
@@ -20,10 +20,10 @@ class ACLOptionCategoryCacheBuilder extends AbstractCacheBuilder {
                $list = new ACLOptionCategoryList();
                $list->readObjects();
                
-               $data = array();
+               $data = [];
                foreach ($list as $aclOptionCategory) {
                        if (!isset($data[$aclOptionCategory->objectTypeID])) {
-                               $data[$aclOptionCategory->objectTypeID] = array();
+                               $data[$aclOptionCategory->objectTypeID] = [];
                        }
                        
                        $data[$aclOptionCategory->objectTypeID][$aclOptionCategory->categoryName] = $aclOptionCategory;
index ec539946b327d5457ec226fd15fc835831866f18..9403f8ad7d634c18e93beb97310263391905a601 100644 (file)
@@ -21,19 +21,19 @@ class ACPMenuCacheBuilder extends AbstractCacheBuilder {
         * list of option categories which directly contain options
         * @var string[]
         */
-       protected $categoriesWithOptions = array();
+       protected $categoriesWithOptions = [];
        
        /**
         * list of option categories grouped by the name of their parent category
         * @var OptionCategory[]
         */
-       protected $categoryStructure = array();
+       protected $categoryStructure = [];
        
        /**
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $data = array();
+               $data = [];
                
                // get "real" menu items
                $menuItemList = new ACPMenuItemList();
@@ -44,16 +44,16 @@ class ACPMenuCacheBuilder extends AbstractCacheBuilder {
                }
                
                // get menu items for top option categories
-               $data['wcf.acp.menu.link.option.category'] = array();
+               $data['wcf.acp.menu.link.option.category'] = [];
                foreach ($this->getTopOptionCategories() as $optionCategory) {
-                       $data['wcf.acp.menu.link.option.category'][] = new ACPMenuItem(null, array(
+                       $data['wcf.acp.menu.link.option.category'][] = new ACPMenuItem(null, [
                                'menuItem' => 'wcf.acp.option.category.'.$optionCategory->categoryName,
                                'parentMenuItem' => 'wcf.acp.menu.link.option.category',
                                'menuItemController' => 'wcf\acp\form\OptionForm',
                                'permissions' => $optionCategory->permissions,
                                'optionCategoryID' => $optionCategory->categoryID,
                                'options' => $optionCategory->options
-                       ));
+                       ]);
                }
                
                return $data;
@@ -70,10 +70,10 @@ class ACPMenuCacheBuilder extends AbstractCacheBuilder {
                $optionCategories = $optionCategoryList->getObjects();
                
                // build category structure
-               $this->categoryStructure = array();
+               $this->categoryStructure = [];
                foreach ($optionCategories as $optionCategory) {
                        if (!isset($this->categoryStructure[$optionCategory->parentCategoryName])) {
-                               $this->categoryStructure[$optionCategory->parentCategoryName] = array();
+                               $this->categoryStructure[$optionCategory->parentCategoryName] = [];
                        }
                        
                        $this->categoryStructure[$optionCategory->parentCategoryName][] = $optionCategory;
@@ -90,7 +90,7 @@ class ACPMenuCacheBuilder extends AbstractCacheBuilder {
                }
                
                // collect top categories which contain options
-               $topCategories = array();
+               $topCategories = [];
                foreach ($this->categoryStructure[""] as $topCategory) {
                        if ($this->containsOptions($topCategory)) {
                                $topCategories[$topCategory->categoryID] = $topCategory;
index 9e8499c0cd2208d57da7fcc7eec24e3b16fd0cd7..366e29bd7be6318b6c99b261e160f1bd7b705abd 100644 (file)
@@ -19,7 +19,7 @@ abstract class AbstractCacheBuilder extends SingletonFactory implements ICacheBu
         * list of cache resources by index
         * @var mixed[][]
         */
-       protected $cache = array();
+       protected $cache = [];
        
        /**
         * maximum cache lifetime in seconds, '0' equals infinite
@@ -30,7 +30,7 @@ abstract class AbstractCacheBuilder extends SingletonFactory implements ICacheBu
        /**
         * @inheritDoc
         */
-       public function getData(array $parameters = array(), $arrayIndex = '') {
+       public function getData(array $parameters = [], $arrayIndex = '') {
                $index = CacheHandler::getInstance()->getCacheIndex($parameters);
                
                if (!isset($this->cache[$index])) {
@@ -65,7 +65,7 @@ abstract class AbstractCacheBuilder extends SingletonFactory implements ICacheBu
        /**
         * @inheritDoc
         */
-       public function reset(array $parameters = array()) {
+       public function reset(array $parameters = []) {
                CacheHandler::getInstance()->flush($this, $parameters);
        }
        
index 1faa4bb2c564760d510e022cf77aa1c3e6f9ba8b..ee3850bc14af1b8a3bd2b0451048c6bd3fc85c3f 100644 (file)
@@ -18,14 +18,14 @@ class AdCacheBuilder extends AbstractCacheBuilder {
         */
        public function rebuild(array $parameters) {
                $adList = new AdList();
-               $adList->getConditionBuilder()->add('isDisabled = ?', array(0));
+               $adList->getConditionBuilder()->add('isDisabled = ?', [0]);
                $adList->sqlOrderBy = 'showOrder ASC';
                $adList->readObjects();
                
-               $data = array();
+               $data = [];
                foreach ($adList as $ad) {
                        if (!isset($data[$ad->objectTypeID])) {
-                               $data[$ad->objectTypeID] = array();
+                               $data[$ad->objectTypeID] = [];
                        }
                        
                        $data[$ad->objectTypeID][$ad->adID] = $ad;
index 8d3c65038cfe6227dbab1b3bd54e047eda001bc2..f5ed0b9feb81675707a2070ec6ed54b2b29b819d 100644 (file)
@@ -19,8 +19,8 @@ class BBCodeCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        protected function rebuild(array $parameters) {
-               $attributes = array();
-               $data = array('bbcodes' => array(), 'highlighters' => array());
+               $attributes = [];
+               $data = ['bbcodes' => [], 'highlighters' => []];
                
                // get attributes
                $sql = "SELECT          attribute.*, bbcode.bbcodeTag
@@ -32,7 +32,7 @@ class BBCodeCacheBuilder extends AbstractCacheBuilder {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
                while ($row = $statement->fetchArray()) {
-                       if (!isset($attributes[$row['bbcodeTag']])) $attributes[$row['bbcodeTag']] = array();
+                       if (!isset($attributes[$row['bbcodeTag']])) $attributes[$row['bbcodeTag']] = [];
                        
                        $attributes[$row['bbcodeTag']][$row['attributeNo']] = new BBCodeAttribute(null, $row);
                }
@@ -44,7 +44,7 @@ class BBCodeCacheBuilder extends AbstractCacheBuilder {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
                while ($row = $statement->fetchArray()) {
-                       $row['attributes'] = (isset($attributes[$row['bbcodeTag']]) ? $attributes[$row['bbcodeTag']] : array());
+                       $row['attributes'] = (isset($attributes[$row['bbcodeTag']]) ? $attributes[$row['bbcodeTag']] : []);
                        $data['bbcodes'][$row['bbcodeTag']] = new BBCode(null, $row);
                }
                
index 0cb67f9107c4ae393c552b56f1c6b2b75a0f7d39..be6103540e0caf8083c68b755a913fd45cb7e14c 100644 (file)
@@ -18,7 +18,7 @@ class CaptchaQuestionCacheBuilder extends AbstractCacheBuilder {
         */
        public function rebuild(array $parameters) {
                $questionList = new CaptchaQuestionList();
-               $questionList->getConditionBuilder()->add('isDisabled = ?', array(0));
+               $questionList->getConditionBuilder()->add('isDisabled = ?', [0]);
                $questionList->readObjects();
                
                return $questionList->getObjects();
index 3b292765757e8e909f94c8ea1871e1b0168ce9af..b16197ef59edd4ae7b542b914c4b19f2564be90e 100644 (file)
@@ -18,7 +18,7 @@ class CategoryACLOptionCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $data = array();
+               $data = [];
                foreach (CategoryHandler::getInstance()->getCategories() as $objectTypeName => $categories) {
                        $objectType = CategoryHandler::getInstance()->getObjectTypeByName($objectTypeName);
                        $aclObjectType = $objectType->getProcessor()->getObjectTypeName('com.woltlab.wcf.acl');
@@ -29,17 +29,17 @@ class CategoryACLOptionCacheBuilder extends AbstractCacheBuilder {
                        $aclOptions = ACLHandler::getInstance()->getPermissions(ACLHandler::getInstance()->getObjectTypeID($aclObjectType), array_keys($categories));
                        $options = $aclOptions['options']->getObjects();
                        
-                       foreach (array('group', 'user') as $type) {
+                       foreach (['group', 'user'] as $type) {
                                foreach ($aclOptions[$type] as $categoryID => $optionData) {
                                        if (!isset($data[$categoryID])) {
-                                               $data[$categoryID] = array(
-                                                       'group' => array(),
-                                                       'user' => array()
-                                               );
+                                               $data[$categoryID] = [
+                                                       'group' => [],
+                                                       'user' => []
+                                               ];
                                        }
                                        
                                        foreach ($optionData as $typeID => $optionValues) {
-                                               $data[$categoryID][$type][$typeID] = array();
+                                               $data[$categoryID][$type][$typeID] = [];
                                                
                                                foreach ($optionValues as $optionID => $optionValue) {
                                                        $data[$categoryID][$type][$typeID][$options[$optionID]->optionName] = $optionValue;
index e1f67188413465e78eefffef09a0ec2fc2fd947b..d2356bde84340583f10c23d0c3f4fc17797004ea 100644 (file)
@@ -23,13 +23,13 @@ class CategoryCacheBuilder extends AbstractCacheBuilder {
                $list->sqlOrderBy = "category.showOrder ASC";
                $list->readObjects();
                
-               $data = array(
+               $data = [
                        'categories' => $list->getObjects(),
-                       'objectTypeCategoryIDs' => array()
-               );
+                       'objectTypeCategoryIDs' => []
+               ];
                foreach ($list as $category) {
                        if (!isset($data['objectTypeCategoryIDs'][$category->objectType])) {
-                               $data['objectTypeCategoryIDs'][$category->objectType] = array();
+                               $data['objectTypeCategoryIDs'][$category->objectType] = [];
                        }
                        
                        $data['objectTypeCategoryIDs'][$category->objectType][] = $category->categoryID;
index 285c2d84bd65be1cc534c2b31355870a75892457..d01854ac62bfe0ad5fb996be472e7f04ccf1d936 100644 (file)
@@ -22,10 +22,10 @@ class ClipboardPageCacheBuilder extends AbstractCacheBuilder {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
                
-               $data = array();
+               $data = [];
                while ($row = $statement->fetchArray()) {
                        if (!isset($data[$row['pageClassName']])) {
-                               $data[$row['pageClassName']] = array();
+                               $data[$row['pageClassName']] = [];
                        }
                        
                        $data[$row['pageClassName']][] = $row['actionID'];
index 38fbf2834c3fb4cba7abba7ae4b5908c158d0004..bd47c358d871036e5fc854d044fb1e6d72e9de76 100644 (file)
@@ -30,22 +30,22 @@ class ConditionCacheBuilder extends AbstractCacheBuilder {
                
                $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes($definition->definitionName);
                if (empty($objectTypes)) {
-                       return array();
+                       return [];
                }
                
-               $objectTypeIDs = array();
+               $objectTypeIDs = [];
                foreach ($objectTypes as $objectType) {
                        $objectTypeIDs[] = $objectType->objectTypeID;
                }
                
                $conditionList = new ConditionList();
-               $conditionList->getConditionBuilder()->add('condition_table.objectTypeID IN (?)', array($objectTypeIDs));
+               $conditionList->getConditionBuilder()->add('condition_table.objectTypeID IN (?)', [$objectTypeIDs]);
                $conditionList->readObjects();
                
-               $groupedConditions = array();
+               $groupedConditions = [];
                foreach ($conditionList as $condition) {
                        if (!isset($groupedConditions[$condition->objectID])) {
-                               $groupedConditions[$condition->objectID] = array();
+                               $groupedConditions[$condition->objectID] = [];
                        }
                        
                        $groupedConditions[$condition->objectID][$condition->conditionID] = $condition;
index 0d6c0957d332a216c51965481641ba424ea095d6..225345ca400964461745194dd99075347630aa23 100644 (file)
@@ -17,7 +17,7 @@ class CoreObjectCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $data = array();
+               $data = [];
                
                $coreObjectList = new CoreObjectList();
                $coreObjectList->readObjects();
index f166496051fcc15e99113e8c93319ab96cb90c13..6d7785c4e8b79ddc35c38af56b49308d07531237 100644 (file)
@@ -22,12 +22,12 @@ class CronjobCacheBuilder extends AbstractCacheBuilder {
                        FROM    wcf".WCF_N."_cronjob
                        WHERE   isDisabled = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(0));
+               $statement->execute([0]);
                $row = $statement->fetchArray();
                
-               return array(
+               return [
                        'afterNextExec' => $row['afterNextExec'],
                        'nextExec' => $row['nextExec']
-               );
+               ];
        }
 }
index 1bc23a77941d856f801f46243fbf2f4baffc4727..291faa2a2b57136d4ad805902470444a25ed3c12 100644 (file)
@@ -21,15 +21,15 @@ class EventListenerCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $actions = array(
-                       'admin' => array(),
-                       'user' => array()
-               );
+               $actions = [
+                       'admin' => [],
+                       'user' => []
+               ];
                
-               $inheritedActions = array(
-                       'admin' => array(),
-                       'user' => array()
-               );
+               $inheritedActions = [
+                       'admin' => [],
+                       'user' => []
+               ];
                
                $sql = "SELECT          *
                        FROM            wcf".WCF_N."_event_listener
@@ -41,13 +41,13 @@ class EventListenerCacheBuilder extends AbstractCacheBuilder {
                        
                        if (!$eventListener->inherit) {
                                if (!isset($actions[$eventListener->environment])) {
-                                       $actions[$eventListener->environment] = array();
+                                       $actions[$eventListener->environment] = [];
                                }
                                
                                foreach ($eventNames as $eventName) {
                                        $key = EventHandler::generateKey($eventListener->eventClassName, $eventName);
                                        if (!isset($actions[$eventListener->environment][$key])) {
-                                               $actions[$eventListener->environment][$key] = array();
+                                               $actions[$eventListener->environment][$key] = [];
                                        }
                                        
                                        $actions[$eventListener->environment][$key][] = $eventListener;
@@ -55,12 +55,12 @@ class EventListenerCacheBuilder extends AbstractCacheBuilder {
                        }
                        else {
                                if (!isset($inheritedActions[$eventListener->environment])) {
-                                       $inheritedActions[$eventListener->environment] = array();
+                                       $inheritedActions[$eventListener->environment] = [];
                                }
                                
                                foreach ($eventNames as $eventName) {
                                        if (!isset($inheritedActions[$eventListener->environment][$eventListener->eventClassName])) {
-                                               $inheritedActions[$eventListener->environment][$eventListener->eventClassName] = array();
+                                               $inheritedActions[$eventListener->environment][$eventListener->eventClassName] = [];
                                        }
                                        
                                        $inheritedActions[$eventListener->environment][$eventListener->eventClassName][$eventName][] = $eventListener;
@@ -68,9 +68,9 @@ class EventListenerCacheBuilder extends AbstractCacheBuilder {
                        }
                }
                
-               return array(
+               return [
                        'actions' => $actions,
                        'inheritedActions' => $inheritedActions
-               );
+               ];
        }
 }
index 1d0ac2843f899f0342ab8520492aa07076e631c0..b8baeaa008108ec34751b06c72aa72c7dd821c39 100644 (file)
@@ -19,7 +19,7 @@ interface ICacheBuilder {
         * @param       string          $arrayIndex
         * @return      mixed
         */
-       public function getData(array $parameters = array(), $arrayIndex = '');
+       public function getData(array $parameters = [], $arrayIndex = '');
        
        /**
         * Returns maximum lifetime for cache resource.
@@ -34,5 +34,5 @@ interface ICacheBuilder {
         * 
         * @param       array           $parameters
         */
-       public function reset(array $parameters = array());
+       public function reset(array $parameters = []);
 }
index e4ca970aaff78613d7e618f16ac2de364abe9b4a..7aeaffeea39b637e261d83bf6bb9e4276ecef2d5 100644 (file)
@@ -19,15 +19,15 @@ class LanguageCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $data = array(
-                       'codes' => array(),
-                       'countryCodes' => array(),
-                       'languages' => array(),
+               $data = [
+                       'codes' => [],
+                       'countryCodes' => [],
+                       'languages' => [],
                        'default' => 0,
-                       'categories' => array(),
-                       'categoryIDs' => array(),
+                       'categories' => [],
+                       'categoryIDs' => [],
                        'multilingualismEnabled' => false
-               );
+               ];
                
                // get languages
                $languageList = new LanguageList();
index 511e6aba886cd69e6dacb81b5e427e9c696e3131..dbf2d79d5d6c1e0a3c4cac45cd23fb99dc46b1af 100644 (file)
@@ -18,7 +18,7 @@ class NoticeCacheBuilder extends AbstractCacheBuilder {
         */
        protected function rebuild(array $parameters) {
                $noticeList = new NoticeList();
-               $noticeList->getConditionBuilder()->add('isDisabled = ?', array(0));
+               $noticeList->getConditionBuilder()->add('isDisabled = ?', [0]);
                $noticeList->sqlOrderBy = 'showOrder ASC';
                $noticeList->readObjects();
                
index 45e97a3b72816f75376c9dfb5b61216b503caab6..bccb57f87d8cf76ae896eee92fae545bc3adf94c 100644 (file)
@@ -19,12 +19,12 @@ class ObjectTypeCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $data = array(
-                       'categories' => array(),
-                       'definitions' => array(),
-                       'objectTypes' => array(),
-                       'groupedObjectTypes' => array()
-               );
+               $data = [
+                       'categories' => [],
+                       'definitions' => [],
+                       'objectTypes' => [],
+                       'groupedObjectTypes' => []
+               ];
                
                // get definitions
                $sql = "SELECT  *
@@ -36,7 +36,7 @@ class ObjectTypeCacheBuilder extends AbstractCacheBuilder {
                        
                        if ($row['categoryName']) {
                                if (!isset($data['categories'][$row['categoryName']])) {
-                                       $data['categories'][$row['categoryName']] = array();
+                                       $data['categories'][$row['categoryName']] = [];
                                }
                                
                                $data['categories'][$row['categoryName']][] = $row['definitionID'];
@@ -52,7 +52,7 @@ class ObjectTypeCacheBuilder extends AbstractCacheBuilder {
                        $data['objectTypes'][$row['objectTypeID']] = $objectType = new ObjectType(null, $row);
                        
                        $definition = $data['definitions'][$objectType->definitionID];
-                       if (!isset($data['groupedObjectTypes'][$definition->definitionName])) $data['groupedObjectTypes'][$definition->definitionName] = array();
+                       if (!isset($data['groupedObjectTypes'][$definition->definitionName])) $data['groupedObjectTypes'][$definition->definitionName] = [];
                        $data['groupedObjectTypes'][$definition->definitionName][$objectType->objectType] = $objectType;
                }
                
index d054bf2cffcd02eeca3ebeec8cf14a0fd09f84c7..0230916f0d44bd18d41f9ce624bb5b34119d642e 100644 (file)
@@ -17,10 +17,10 @@ class PackageCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $data = array(
-                       'packages' => array(),
-                       'packageIDs' => array()
-               );
+               $data = [
+                       'packages' => [],
+                       'packageIDs' => []
+               ];
                
                $packageList = new PackageList();
                $packageList->readObjects();
index 465d46c0106e4efc303b45c2868e077f8ce57a77..144e52b007fecb3e89dec632dd1ace3b470715e8 100644 (file)
@@ -19,6 +19,6 @@ class PackageUpdateCacheBuilder extends AbstractCacheBuilder {
        public function rebuild(array $parameters) {
                $updates = PackageUpdateDispatcher::getInstance()->getAvailableUpdates();
                
-               return array('updates' => count($updates));
+               return ['updates' => count($updates)];
        }
 }
index e883e4f172adaae8606eabc207031dca9f793b8c..ddbd6601e5d89a0806151808df108e36f13bd7e0 100644 (file)
@@ -18,7 +18,7 @@ class PaidSubscriptionCacheBuilder extends AbstractCacheBuilder {
         */
        protected function rebuild(array $parameters) {
                $subscriptionList = new PaidSubscriptionList();
-               $subscriptionList->getConditionBuilder()->add('isDisabled = ?', array(0));
+               $subscriptionList->getConditionBuilder()->add('isDisabled = ?', [0]);
                $subscriptionList->sqlOrderBy = 'showOrder';
                $subscriptionList->readObjects();
                
index 84df4312e662389b976f11d83986b2e30b672797..763b75daab8e8c5d1214e6847d32e1a737a927cc 100644 (file)
@@ -17,7 +17,7 @@ class SmileyCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        protected function rebuild(array $parameters) {
-               $data = array('smilies' => array());
+               $data = ['smilies' => []];
                
                // get smilies
                $sql = "SELECT          *
index 8c0a1f9786ed35e3e584b8b8e7200adad07d9849..200bca459514de8d48253b347d2f54c47720ca8a 100644 (file)
@@ -18,10 +18,10 @@ class StyleCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $data = array(
+               $data = [
                        'default' => 0,
-                       'styles' => array()
-               );
+                       'styles' => []
+               ];
                
                // get all styles
                $sql = "SELECT          *
index 3811b9bbc6e7b3822e3a511e2f0f4c13f31d1e8f..3bee6ec6a4a608ae2c86fc1dc5253b867c657d1e 100644 (file)
@@ -21,13 +21,13 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder {
         * list of tags
         * @var TagCloudTag[]
         */
-       protected $tags = array();
+       protected $tags = [];
        
        /**
         * language ids
         * @var integer
         */
-       protected $languageIDs = array();
+       protected $languageIDs = [];
        
        /**
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::$maxLifetime
@@ -38,7 +38,7 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder {
         * object type ids
         * @var integer
         */
-       protected $objectTypeIDs = array();
+       protected $objectTypeIDs = [];
        
        /**
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
@@ -68,7 +68,7 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder {
                // handle special '0' value
                if (in_array(0, $parameters)) {
                        // discard all language ids
-                       $parameters = array();
+                       $parameters = [];
                }
                
                return $parameters;
@@ -78,14 +78,14 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder {
         * Reads associated tags.
         */
        protected function getTags() {
-               $this->tags = array();
+               $this->tags = [];
                
                if (!empty($this->objectTypeIDs)) {
                        // get tag ids
-                       $tagIDs = array();
+                       $tagIDs = [];
                        $conditionBuilder = new PreparedStatementConditionBuilder();
-                       $conditionBuilder->add('object.objectTypeID IN (?)', array($this->objectTypeIDs));
-                       $conditionBuilder->add('object.languageID IN (?)', array($this->languageIDs));
+                       $conditionBuilder->add('object.objectTypeID IN (?)', [$this->objectTypeIDs]);
+                       $conditionBuilder->add('object.languageID IN (?)', [$this->languageIDs]);
                        $sql = "SELECT          COUNT(*) AS counter, object.tagID
                                FROM            wcf".WCF_N."_tag_to_object object
                                ".$conditionBuilder."
@@ -110,7 +110,7 @@ class TagCloudCacheBuilder extends AbstractCacheBuilder {
                                }
                                
                                // sort by counter
-                               uasort($this->tags, array('self', 'compareTags'));
+                               uasort($this->tags, ['self', 'compareTags']);
                        }
                }
        }
index a7c0b6569942798a4e0e706e0ee4f65b051a43f5..a51a958bd578b84f44545b06511987e07c844539 100644 (file)
@@ -20,13 +20,13 @@ class TemplateListenerCacheBuilder extends AbstractCacheBuilder {
        public function rebuild(array $parameters) {
                // get templates for current package id
                $templateListenerList = new TemplateListenerList();
-               $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($parameters['environment']));
+               $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", [$parameters['environment']]);
                $templateListenerList->sqlOrderBy = "template_listener.listenerID ASC";
                $templateListenerList->readObjects();
                
-               $data = array();
+               $data = [];
                foreach ($templateListenerList->getObjects() as $templateListener) {
-                       $data[$templateListener->templateName] = array();
+                       $data[$templateListener->templateName] = [];
                }
                
                return $data;
index 1bde544370ae96f733bcf144a59f46da35081b15..8db0e07aec2f3c7cef5a39bafc4a3b4586e8f331 100644 (file)
@@ -19,14 +19,14 @@ class TemplateListenerCodeCacheBuilder extends AbstractCacheBuilder {
        public function rebuild(array $parameters) {
                // get template codes for specified template
                $templateListenerList = new TemplateListenerList();
-               $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", array($parameters['environment']));
+               $templateListenerList->getConditionBuilder()->add("template_listener.environment = ?", [$parameters['environment']]);
                $templateListenerList->sqlOrderBy = 'template_listener.niceValue ASC, template_listener.listenerID ASC';
                $templateListenerList->readObjects();
                
-               $data = array();
+               $data = [];
                foreach ($templateListenerList->getObjects() as $templateListener) {
                        if (!isset($data[$templateListener->templateName])) {
-                               $data[$templateListener->templateName] = array();
+                               $data[$templateListener->templateName] = [];
                        }
                        
                        $templateCode = $templateListener->templateCode;
index 8189e5a5246b9510332a66ff62508163b0e59c0c..3fc9dedaee6614c38ae318774e0c3e8449222378 100644 (file)
@@ -26,19 +26,19 @@ class UserBirthdayCacheBuilder extends AbstractCacheBuilder {
                $userOptionID = User::getUserOptionID('birthday');
                if ($userOptionID === null) {
                        // birthday profile field missing; skip
-                       return array();
+                       return [];
                }
                
-               $data = array();
+               $data = [];
                $birthday = 'userOption'.$userOptionID;
                $sql = "SELECT  userID, ".$birthday."
                        FROM    wcf".WCF_N."_user_option_value
                        WHERE   ".$birthday." LIKE ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array('%-' . ($parameters['month'] < 10 ? '0' : '') . $parameters['month'] . '-%'));
+               $statement->execute(['%-' . ($parameters['month'] < 10 ? '0' : '') . $parameters['month'] . '-%']);
                while ($row = $statement->fetchArray()) {
                        list($year, $month, $day) = explode('-', $row[$birthday]);
-                       if (!isset($data[$month . '-' . $day])) $data[$month . '-' . $day] = array();
+                       if (!isset($data[$month . '-' . $day])) $data[$month . '-' . $day] = [];
                        $data[$month . '-' . $day][] = $row['userID'];
                }
                
index aaf5cc546db6a9a6f607de530ef6c1370aa55a30..9dc00e29cb55678b0121239cf9af19e9640dc8cc 100644 (file)
@@ -18,7 +18,7 @@ class UserGroupAssignmentCacheBuilder extends AbstractCacheBuilder {
         */
        protected function rebuild(array $parameters) {
                $assignmentList = new UserGroupAssignmentList();
-               $assignmentList->getConditionBuilder()->add('isDisabled = ?', array(0));
+               $assignmentList->getConditionBuilder()->add('isDisabled = ?', [0]);
                $assignmentList->readObjects();
                
                return $assignmentList->getObjects();
index 3a64ee4916290ce0271860a12c77bce6f82a032c..7e2c3eb6ba27e841e7b9858411b29422e9ad09c4 100644 (file)
@@ -17,10 +17,10 @@ class UserGroupCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        public function rebuild(array $parameters) {
-               $data = array(
-                       'types' => array(),
-                       'groups' => array()
-               );
+               $data = [
+                       'types' => [],
+                       'groups' => []
+               ];
                
                // get all user groups
                $groupList = new UserGroupList();
@@ -29,7 +29,7 @@ class UserGroupCacheBuilder extends AbstractCacheBuilder {
                
                foreach ($groups as $group) {
                        if (!isset($data['types'][$group->groupType])) {
-                               $data['types'][$group->groupType] = array();
+                               $data['types'][$group->groupType] = [];
                        }
                        
                        $data['types'][$group->groupType][] = $group->groupID;
index 99aa87628d85be2d547e5c2e818753232802dade..caec744e2d25bc599ffd97c595bf2458f5579c5e 100644 (file)
@@ -28,7 +28,7 @@ class UserGroupOptionCacheBuilder extends OptionCacheBuilder {
        public function rebuild(array $parameters) {
                $data = parent::rebuild($parameters);
                
-               $usersOnlyPermissions = array();
+               $usersOnlyPermissions = [];
                foreach ($data['options'] as $option) {
                        if ($option->usersOnly) {
                                $usersOnlyPermissions[] = $option->optionName;
index 4e0ac3c044269f64d45602a451e76839bac114d4..5105847c2060351589d6d05e246964121ac9ee7e 100644 (file)
@@ -18,7 +18,7 @@ class UserMenuCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        protected function rebuild(array $parameters) {
-               $data = array();
+               $data = [];
                
                // get all option categories
                $sql = "SELECT          *
@@ -26,15 +26,15 @@ class UserMenuCacheBuilder extends AbstractCacheBuilder {
                        WHERE           parentCategoryName = ?
                        ORDER BY        showOrder ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array('settings'));
+               $statement->execute(['settings']);
                while ($row = $statement->fetchArray()) {
                        if (!isset($data['wcf.user.menu.settings'])) {
-                               $data['wcf.user.menu.settings'] = array();
+                               $data['wcf.user.menu.settings'] = [];
                        }
                        
                        $categoryShortName = str_replace('settings.', '', $row['categoryName']);
                        
-                       $data['wcf.user.menu.settings'][] = new UserMenuItem(null, array(
+                       $data['wcf.user.menu.settings'][] = new UserMenuItem(null, [
                                'packageID' => $row['packageID'],
                                'menuItem' => 'wcf.user.option.category.'.$row['categoryName'],
                                'parentMenuItem' => 'wcf.user.menu.settings',
@@ -42,7 +42,7 @@ class UserMenuCacheBuilder extends AbstractCacheBuilder {
                                'menuItemLink' => ($categoryShortName != 'general' ? 'category='.$categoryShortName : ''),
                                'permissions' => $row['permissions'],
                                'options' => $row['options']
-                       ));
+                       ]);
                }
                
                // get all menu items
@@ -53,7 +53,7 @@ class UserMenuCacheBuilder extends AbstractCacheBuilder {
                $statement->execute();
                while ($row = $statement->fetchArray()) {
                        if (!isset($data[$row['parentMenuItem']])) {
-                               $data[$row['parentMenuItem']] = array();
+                               $data[$row['parentMenuItem']] = [];
                        }
                        
                        $data[$row['parentMenuItem']][] = new UserMenuItem(null, $row);
index b8757812af383b4fcf8a3eee8fcd72e3cf0fbbff..6b8e2f8c6551b66ac732513da41e0bb6cffa7435 100644 (file)
@@ -18,7 +18,7 @@ class UserNotificationEventCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        protected function rebuild(array $parameters) {
-               $data = array();
+               $data = [];
                
                // get events
                $sql = "SELECT          event.*, object_type.objectType
@@ -29,7 +29,7 @@ class UserNotificationEventCacheBuilder extends AbstractCacheBuilder {
                $statement->execute();
                while ($row = $statement->fetchArray()) {
                        if (!isset($data[$row['objectType']])) {
-                               $data[$row['objectType']] = array();
+                               $data[$row['objectType']] = [];
                        }
                        
                        if (!isset($data[$row['objectType']][$row['eventName']])) {
index 8f761c0ff96e14871deea531e0b4dacd371d0dd7..910d6b9a6d1fe5dc2bf112a6827ed840f3fd8ac6 100644 (file)
@@ -22,7 +22,7 @@ class UserStatsCacheBuilder extends AbstractCacheBuilder {
         * @see \wcf\system\cache\builder\AbstractCacheBuilder::rebuild()
         */
        protected function rebuild(array $parameters) {
-               $data = array();
+               $data = [];
                
                // number of members
                $sql = "SELECT  COUNT(*) AS amount
index f119d0b11e46bd34ce72555a206f3e4f280d5670..b05c8e1ec775c132e0d3e5b71aa796f4fc5848f1 100644 (file)
@@ -58,7 +58,7 @@ class MemcachedCacheSource implements ICacheSource {
                
                // add servers
                $tmp = explode("\n", StringUtil::unifyNewlines(CACHE_SOURCE_MEMCACHED_HOST));
-               $servers = array();
+               $servers = [];
                $defaultWeight = floor(100 / count($tmp));
                $regex = new Regex('^\[([a-z0-9\:\.]+)\](?::([0-9]{1,5}))?(?::([0-9]{1,3}))?$', Regex::CASE_INSENSITIVE);
                
@@ -93,7 +93,7 @@ class MemcachedCacheSource implements ICacheSource {
                                        }
                                }
                                
-                               $servers[] = array($host, $port, $weight);
+                               $servers[] = [$host, $port, $weight];
                        }
                }
                $this->memcached->addServers($servers);
index 89b9ea1063d957eb4ec1f81efd297289c2b49267..20a9035aebb601686d3962c4934aa7e8c1fd096c 100644 (file)
@@ -28,7 +28,7 @@ class CaptchaHandler extends SingletonFactory {
         * @return      string[]
         */
        public function getCaptchaSelection() {
-               $selection = array();
+               $selection = [];
                foreach ($this->objectTypes as $objectType) {
                        if ($objectType->getProcessor()->isAvailable()) {
                                $selection[$objectType->objectType] = WCF::getLanguage()->get('wcf.captcha.'.$objectType->objectType);
index 48ce4408c481f1470ffe3fca61b097353aa6d81f..3c739c55e9fe2aae7b4b37f005146631b7a0de4f 100644 (file)
@@ -39,9 +39,9 @@ class RecaptchaHandler implements ICaptchaHandler {
                }
                else {
                        // V2
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'recaptchaLegacyMode' => true
-                       ));
+                       ]);
                }
                
                return WCF::getTPL()->fetch('recaptcha');
index 79252f952d8a423bf9c1988875304764596684a4..77b508cc20e61952c0753090bdd9c99be50bafe3 100644 (file)
@@ -57,7 +57,7 @@ abstract class AbstractCategoryType extends SingletonFactory implements ICategor
         * key is the definition name and value the object type name)
         * @var string[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * @see \wcf\system\category\ICategoryType::afterDeletion()
@@ -68,12 +68,12 @@ abstract class AbstractCategoryType extends SingletonFactory implements ICategor
                if (!empty($categoryIDs)) {
                        // move child categories to parent category
                        $conditionBuilder = new PreparedStatementConditionBuilder();
-                       $conditionBuilder->add("categoryID IN (?)", array($categoryIDs));
+                       $conditionBuilder->add("categoryID IN (?)", [$categoryIDs]);
                        $sql = "UPDATE  wcf".WCF_N."_category
                                SET     parentCategoryID = ?
                                ".$conditionBuilder;
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array_merge(array($categoryEditor->parentCategoryID), $conditionBuilder->getParameters()));
+                       $statement->execute(array_merge([$categoryEditor->parentCategoryID], $conditionBuilder->getParameters()));
                }
        }
        
index b0e3d62795220a62110f231674d3b8c59188fa8e..904c1beb0e8b5216f55198cc328901e2a88cbf8b 100644 (file)
@@ -22,25 +22,25 @@ class CategoryHandler extends SingletonFactory {
         * cached categories
         * @var Category[]
         */
-       protected $categories = array();
+       protected $categories = [];
        
        /**
         * category ids grouped by the object type they belong to
         * @var integer[][]
         */
-       protected $objectTypeCategoryIDs = array();
+       protected $objectTypeCategoryIDs = [];
        
        /**
         * mapes the names of the category object types to the object type ids
         * @var integer[]
         */
-       protected $objectTypeIDs = array();
+       protected $objectTypeIDs = [];
        
        /**
         * list of category object types
         * @var ObjectType[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * Returns all category objects with the given object type. If no object
@@ -50,7 +50,7 @@ class CategoryHandler extends SingletonFactory {
         * @return      mixed[]
         */
        public function getCategories($objectType = null) {
-               $categories = array();
+               $categories = [];
                if ($objectType === null) {
                        foreach ($this->objectTypes as $objectType) {
                                $categories[$objectType->objectType] = $this->getCategories($objectType->objectType);
@@ -94,7 +94,7 @@ class CategoryHandler extends SingletonFactory {
                        throw new SystemException("Missing object type id");
                }
                
-               $categories = array();
+               $categories = [];
                foreach ($this->categories as $category) {
                        if ($category->parentCategoryID == $categoryID && ($categoryID || $category->objectTypeID == $objectTypeID)) {
                                $categories[$category->categoryID] = $category;
@@ -150,8 +150,8 @@ class CategoryHandler extends SingletonFactory {
                        $this->objectTypeIDs[$objectType->objectTypeID] = $objectType->objectType;
                }
                
-               $this->categories = CategoryCacheBuilder::getInstance()->getData(array(), 'categories');
-               $this->objectTypeCategoryIDs = CategoryCacheBuilder::getInstance()->getData(array(), 'objectTypeCategoryIDs');
+               $this->categories = CategoryCacheBuilder::getInstance()->getData([], 'categories');
+               $this->objectTypeCategoryIDs = CategoryCacheBuilder::getInstance()->getData([], 'objectTypeCategoryIDs');
        }
        
        /**
index b61c75f2814ddcd2e5265e344fdf95ca9a30f568..34a7279c274f015ac79270ab8bf12eeeaefd1ec7 100644 (file)
@@ -30,7 +30,7 @@ class DatabaseCLICommandHistory extends MemoryHistory {
                        $sql = "DELETE FROM     wcf".WCF_N."_cli_history
                                WHERE           userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(WCF::getUser()->userID));
+                       $statement->execute([WCF::getUser()->userID]);
                }
                
                $sql = "INSERT INTO     wcf".WCF_N."_cli_history (userID, command)
@@ -39,7 +39,7 @@ class DatabaseCLICommandHistory extends MemoryHistory {
                WCF::getDB()->beginTransaction();
                
                foreach ($this as $item) {
-                       $statement->execute(array(WCF::getUser()->userID, $item));
+                       $statement->execute([WCF::getUser()->userID, $item]);
                }
                WCF::getDB()->commitTransaction();
        }
@@ -52,7 +52,7 @@ class DatabaseCLICommandHistory extends MemoryHistory {
                        FROM    wcf".WCF_N."_cli_history
                        WHERE   userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(WCF::getUser()->userID));
+               $statement->execute([WCF::getUser()->userID]);
                
                while ($row = $statement->fetchArray()) {
                        $this->add($row['command']);
index 52ca66289d6ca7493c41908d7659e2daf72121b3..aba6601566b2db9c9a91aaf2326787c8723072eb 100644 (file)
@@ -21,7 +21,7 @@ class CLICommandHandler {
         * list of all available commands
         * @var ICLICommand[]
         */
-       private static $commands = array();
+       private static $commands = [];
        
        /**
         * Returns all available commands.
@@ -96,7 +96,7 @@ class CLICommandHandler {
                $tmp = '';
                $escaped = false;
                $quoted = false;
-               $return = array();
+               $return = [];
                // handle quotes
                foreach ($chars as $char) {
                        // escaped chars are simply added
index 0d3c9a536f2bf487dd60e06551ef5524715a577a..3a80b1bdb603b3cda7a437228227ddeea916dd80 100644 (file)
@@ -17,7 +17,7 @@ class CLICommandNameCompleter implements Completer {
         * names of all available commands
         * @var string[]
         */
-       private $commands = array();
+       private $commands = [];
        
        /**
         * Creates a new instance of CLICommandNameCompleter.
index 5b78d316e474ee78b3102720ac6d6d4a92b2f1a4..3890e10ceea70464b96e66427616977962759c0d 100644 (file)
@@ -25,7 +25,7 @@ class CronjobCLICommand implements IArgumentedCLICommand {
         * Initializes the argument parser.
         */
        public function __construct() {
-               $this->argv = new ArgvParser(array());
+               $this->argv = new ArgvParser([]);
        }
        
        /**
index b68959b3c5effa290fa14eafefb8a896be76e37a..309b31954cf27f036445f7aa5d17daf1410b4c86 100644 (file)
@@ -25,12 +25,12 @@ class HelpCLICommand implements IArgumentedCLICommand {
         * Initializes the argument parser.
         */
        public function __construct() {
-               $this->argv = new ArgvParser(array());
-               $this->argv->setOptions(array(
+               $this->argv = new ArgvParser([]);
+               $this->argv->setOptions([
                        ArgvParser::CONFIG_FREEFORM_FLAGS => true,
                        ArgvParser::CONFIG_PARSEALL => false,
                        ArgvParser::CONFIG_CUMULATIVE_PARAMETERS => true
-               ));
+               ]);
        }
        
        /**
@@ -48,12 +48,12 @@ class HelpCLICommand implements IArgumentedCLICommand {
                $commands = CLICommandHandler::getCommands();
                
                if (!isset($commands[$args[0]])) {
-                       throw new ArgvException(CLIWCF::getLanguage()->getDynamicVariable('wcf.cli.error.command.notFound', array('command' => $args[0])), $this->getUsage());
+                       throw new ArgvException(CLIWCF::getLanguage()->getDynamicVariable('wcf.cli.error.command.notFound', ['command' => $args[0]]), $this->getUsage());
                }
                
                $command = $commands[$args[0]];
                if (!($command instanceof IArgumentedCLICommand)) {
-                       throw new ArgvException(CLIWCF::getLanguage()->getDynamicVariable('wcf.cli.error.help.noArguments', array('command' => $args[0])), $this->getUsage());
+                       throw new ArgvException(CLIWCF::getLanguage()->getDynamicVariable('wcf.cli.error.help.noArguments', ['command' => $args[0]]), $this->getUsage());
                }
                
                CLIWCF::getReader()->println($command->getUsage());
index ead08affa53e45f18efd272c9aff5cdac96f513d..333c27adc19f54d8dfe5affdf8c3a9ff3e8b2afa 100644 (file)
@@ -66,7 +66,7 @@ class ImportCLICommand implements ICLICommand {
         * list of available exporters
         * @var ObjectType[]
         */
-       protected $exporters = array();
+       protected $exporters = [];
        
        /**
         * file system path
@@ -78,7 +78,7 @@ class ImportCLICommand implements ICLICommand {
         * list of available importers
         * @var string[]
         */
-       public $importers = array();
+       public $importers = [];
        
        /**
         * indicates if the imported will be quit
@@ -90,13 +90,13 @@ class ImportCLICommand implements ICLICommand {
         * selected data types
         * @var string[]
         */
-       public $selectedData = array();
+       public $selectedData = [];
        
        /**
         * list of supported data types
         * @var array
         */
-       protected $supportedData = array();
+       protected $supportedData = [];
        
        /**
         * user merge mode
@@ -173,8 +173,8 @@ class ImportCLICommand implements ICLICommand {
                
                // step 7) save import data
                $queue = $this->exporter->getQueue();
-               WCF::getSession()->register('importData', array(
-                       'additionalData' => array(),
+               WCF::getSession()->register('importData', [
+                       'additionalData' => [],
                        'dbHost' => $this->dbHost,
                        'dbName' => $this->dbName,
                        'dbPassword' => $this->dbPassword,
@@ -183,7 +183,7 @@ class ImportCLICommand implements ICLICommand {
                        'exporterName' => $this->exporterName,
                        'fileSystemPath' => $this->fileSystemPath,
                        'userMergeMode' => $this->userMergeMode
-               ));
+               ]);
                
                // step 8) import data
                CLIWCF::getReader()->println(WCF::getLanguage()->get('wcf.acp.dataImport.started'));
@@ -191,10 +191,10 @@ class ImportCLICommand implements ICLICommand {
                foreach ($queue as $objectType) {
                        CLIWCF::getReader()->println(WCF::getLanguage()->get('wcf.acp.dataImport.data.'.$objectType));
                        $workerCommand = CLICommandHandler::getCommand('worker');
-                       $workerCommand->execute(array(
+                       $workerCommand->execute([
                                '--objectType='.$objectType,
                                'ImportWorker'
-                       ));
+                       ]);
                }
                
                CLIWCF::getReader()->println(WCF::getLanguage()->get('wcf.acp.dataImport.completed'));
@@ -219,15 +219,15 @@ class ImportCLICommand implements ICLICommand {
                        $this->dbPrefix = CLIWCF::getReader()->readLine(WCF::getLanguage()->get('wcf.acp.dataImport.configure.database.prefix').'> ');
                        if ($this->dbPrefix === null) exit;
                        
-                       $this->exporter->setData($this->dbHost, $this->dbUser, $this->dbPassword, $this->dbName, $this->dbPrefix, '', array());
+                       $this->exporter->setData($this->dbHost, $this->dbUser, $this->dbPassword, $this->dbName, $this->dbPrefix, '', []);
                        
                        try {
                                $this->exporter->validateDatabaseAccess();
                        }
                        catch (DatabaseException $e) {
-                               $errorMessage = WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.configure.database.error', array(
+                               $errorMessage = WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.configure.database.error', [
                                        'exception' => $e
-                               ));
+                               ]);
                                $errorMessageLines = explode('<br />', $errorMessage);
                                foreach ($errorMessageLines as &$line) {
                                        $line = StringUtil::stripHTML($line);
@@ -249,16 +249,16 @@ class ImportCLICommand implements ICLICommand {
         */
        protected function readExporter() {
                CLIWCF::getReader()->println(WCF::getLanguage()->get('wcf.acp.dataImport.selectExporter'));
-               $exporterSelection = array();
+               $exporterSelection = [];
                $exporterIndex = 1;
                foreach ($this->exporters as $objectType) {
                        CLIWCF::getReader()->println($exporterIndex.') '.WCF::getLanguage()->get('wcf.acp.dataImport.exporter.'.$objectType->objectType));
                        $exporterSelection[$exporterIndex++] = $objectType->objectType;
                }
-               CLIWCF::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', array(
+               CLIWCF::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', [
                        'minSelection' => 1,
                        'maxSelection' => $exporterIndex - 1
-               )));
+               ]));
                
                while (true) {
                        $exporterIndex = CLIWCF::getReader()->readLine(WCF::getLanguage()->get('wcf.acp.dataImport.exporter').'> ');
@@ -298,7 +298,7 @@ class ImportCLICommand implements ICLICommand {
                while (true) {
                        $this->fileSystemPath = CLIWCF::getReader()->readLine('> ');
                        if ($this->fileSystemPath === null) exit;
-                       $this->exporter->setData($this->dbHost, $this->dbUser, $this->dbPassword, $this->dbName, $this->dbPrefix, $this->fileSystemPath, array());
+                       $this->exporter->setData($this->dbHost, $this->dbUser, $this->dbPassword, $this->dbName, $this->dbPrefix, $this->fileSystemPath, []);
                        
                        if (!$this->exporter->validateFileAccess()) {
                                CLIWCF::getReader()->println(WCF::getLanguage()->get('wcf.acp.dataImport.configure.fileSystem.path.error'));
@@ -314,13 +314,13 @@ class ImportCLICommand implements ICLICommand {
         */
        protected function readSelectedData() {
                $printPrimaryTypes = true;
-               $selectedData = array();
-               $supportedDataSelection = array(
-                       '' => array()
-               );
+               $selectedData = [];
+               $supportedDataSelection = [
+                       '' => []
+               ];
                
                $i = 1;
-               $availablePrimaryDataTypes = array();
+               $availablePrimaryDataTypes = [];
                foreach ($this->supportedData as $objectType => $subData) {
                        $availablePrimaryDataTypes[$i++] = $objectType;
                }
@@ -342,10 +342,10 @@ class ImportCLICommand implements ICLICommand {
                                                $supportedDataIndex++;
                                        }
                                }
-                               CLIWCF::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', array(
+                               CLIWCF::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', [
                                        'minSelection' => $minSupportedDataIndex,
                                        'maxSelection' => $supportedDataIndex - 1
-                               )));
+                               ]));
                                $printPrimaryTypes = false;
                        }
                        
@@ -367,7 +367,7 @@ class ImportCLICommand implements ICLICommand {
                        // validate selected primary import data type
                        if (isset($supportedDataSelection[''][$selectedObjectTypeIndex])) {
                                $selectedObjectType = $supportedDataSelection[''][$selectedObjectTypeIndex];
-                               $selectedData[$selectedObjectType] = array();
+                               $selectedData[$selectedObjectType] = [];
                                unset($supportedDataSelection[''][$selectedObjectTypeIndex]);
                        }
                        else if (isset($availablePrimaryDataTypes[$selectedObjectTypeIndex])) {
@@ -385,16 +385,16 @@ class ImportCLICommand implements ICLICommand {
                                CLIWCF::getReader()->println('  '.WCF::getLanguage()->get('wcf.acp.dataImport.configure.data.description'));
                                CLIWCF::getReader()->println('  0) '.WCF::getLanguage()->get('wcf.acp.dataImport.cli.configure.data.selectAll'));
                                
-                               $supportedDataSelection[$selectedObjectType] = array();
+                               $supportedDataSelection[$selectedObjectType] = [];
                                $supportedDataIndex = 1;
                                foreach ($this->supportedData[$selectedObjectType] as $objectType) {
                                        CLIWCF::getReader()->println('  '.$supportedDataIndex.') '.WCF::getLanguage()->get('wcf.acp.dataImport.data.'.$objectType));
                                        $supportedDataSelection[$selectedObjectType][$supportedDataIndex++] = $objectType;
                                }
-                               CLIWCF::getReader()->println('  '.WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', array(
+                               CLIWCF::getReader()->println('  '.WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', [
                                        'minSelection' => 0,
                                        'maxSelection' => $supportedDataIndex - 1
-                               )));
+                                       ]));
                                
                                while (true) {
                                        // read index of selected secondary import data type
@@ -462,10 +462,10 @@ class ImportCLICommand implements ICLICommand {
                CLIWCF::getReader()->println(WCF::getLanguage()->get('wcf.acp.dataImport.configure.settings.userMergeMode'));
                CLIWCF::getReader()->println('1) '.WCF::getLanguage()->get('wcf.acp.dataImport.configure.settings.userMergeMode.4').' (*)');
                CLIWCF::getReader()->println('2) '.WCF::getLanguage()->get('wcf.acp.dataImport.configure.settings.userMergeMode.5'));
-               CLIWCF::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', array(
+               CLIWCF::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', [
                        'minSelection' => 1,
                        'maxSelection' => 2
-               )));
+               ]));
                
                while (true) {
                        $this->userMergeMode = CLIWCF::getReader()->readLine('> ');
index a4b7cba1f0adc3e00531820c9074a1f382d12e54..ea20d4321340623b70d92d580f7f8f9b74684e5a 100644 (file)
@@ -32,15 +32,15 @@ class WorkerCLICommand implements IArgumentedCLICommand {
         * Initializes the argument parser.
         */
        public function __construct() {
-               $this->argv = new ArgvParser(array(
+               $this->argv = new ArgvParser([
                        'l|list' => CLIWCF::getLanguage()->get('wcf.cli.worker.list'),
                        'setParameter=s' => CLIWCF::getLanguage()->get('wcf.cli.worker.setParameter')
-               ));
-               $this->argv->setOptions(array(
+               ]);
+               $this->argv->setOptions([
                        ArgvParser::CONFIG_FREEFORM_FLAGS => true,
                        ArgvParser::CONFIG_PARSEALL => false,
                        ArgvParser::CONFIG_CUMULATIVE_PARAMETERS => true
-               ));
+               ]);
        }
        
        /**
@@ -87,12 +87,12 @@ class WorkerCLICommand implements IArgumentedCLICommand {
                
                // parse parameters
                $options = $this->argv->getOptions();
-               $parameters = array();
+               $parameters = [];
                foreach ($options as $option) {
                        $value = $this->argv->getOption($option);
                        if ($option === 'setParameter') {
                                if (!is_array($value)) {
-                                       $value = array($value);
+                                       $value = [$value];
                                }
                                
                                foreach ($value as $parameter) {
@@ -110,9 +110,9 @@ class WorkerCLICommand implements IArgumentedCLICommand {
                $worker->getProgress(); // make sure objects are counted
                
                // initialize progressbar
-               $progressbar = new ProgressBar(new ConsoleProgressBar(array(
+               $progressbar = new ProgressBar(new ConsoleProgressBar([
                        'width' => CLIWCF::getTerminal()->getWidth()
-               )));
+               ]));
                $progress = 0;
                for ($i = 0; $progress < 100; $i++) {
                        $worker->setLoopCount($i);
@@ -140,12 +140,12 @@ class WorkerCLICommand implements IArgumentedCLICommand {
                $directory = DirectoryUtil::getInstance(WCF_DIR.'lib/system/worker/');
                $workerList = $directory->getFiles(SORT_ASC, new Regex('Worker\.class\.php$'));
                
-               $table = array(
-                       array(
+               $table = [
+                       [
                                'Class',
                                'Description'
-                       )
-               );
+                       ]
+               ];
                foreach ($workerList as $worker) {
                        $class = 'wcf\system\worker\\'.basename($worker, '.class.php');
                        if (!class_exists($class) && !interface_exists($class)) {
@@ -168,10 +168,10 @@ class WorkerCLICommand implements IArgumentedCLICommand {
                                }
                        }
                        
-                       $table[] = array(
+                       $table[] = [
                                basename($worker, '.class.php'),
                                $comment
-                       );
+                       ];
                }
                
                return $table;
index 2418fc210865a81ff0f5a44578e925f17a21e65f..31b1cec8104ba06e5216e651cdf21713715c0ce6 100644 (file)
@@ -17,7 +17,7 @@ final class ClipboardEditorItem {
         * internal data
         * @var array
         */
-       protected $internalData = array();
+       protected $internalData = [];
        
        /**
         * item name
@@ -29,7 +29,7 @@ final class ClipboardEditorItem {
         * list of parameters passed to ClipboardProxyAction
         * @var array
         */
-       protected $parameters = array();
+       protected $parameters = [];
        
        /**
         * redirect url
index 7de50d708e388658ec3345e81957f03f31d583bf..d92feefc7cb68c6941a4bf365338b829f0fa8b43 100644 (file)
@@ -54,10 +54,10 @@ class ClipboardHandler extends SingletonFactory {
         * @see \wcf\system\SingletonFactory::init()
         */
        protected function init() {
-               $this->cache = array(
-                       'objectTypes' => array(),
-                       'objectTypeNames' => array()
-               );
+               $this->cache = [
+                       'objectTypes' => [],
+                       'objectTypeNames' => []
+               ];
                $cache = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.clipboardItem');
                foreach ($cache as $objectType) {
                        $this->cache['objectTypes'][$objectType->objectTypeID] = $objectType;
@@ -91,11 +91,11 @@ class ClipboardHandler extends SingletonFactory {
                        VALUES          (?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($objectIDs as $objectID) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $objectTypeID,
                                WCF::getUser()->userID,
                                $objectID
-                       ));
+                       ]);
                }
        }
        
@@ -107,9 +107,9 @@ class ClipboardHandler extends SingletonFactory {
         */
        public function unmark(array $objectIDs, $objectTypeID) {
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectTypeID = ?", array($objectTypeID));
-               $conditions->add("objectID IN (?)", array($objectIDs));
-               $conditions->add("userID = ?", array(WCF::getUser()->userID));
+               $conditions->add("objectTypeID = ?", [$objectTypeID]);
+               $conditions->add("objectID IN (?)", [$objectIDs]);
+               $conditions->add("userID = ?", [WCF::getUser()->userID]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_clipboard_item
                        ".$conditions;
@@ -127,10 +127,10 @@ class ClipboardHandler extends SingletonFactory {
                        WHERE           objectTypeID = ?
                                        AND userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        WCF::getUser()->userID
-               ));
+               ]);
        }
        
        /**
@@ -185,7 +185,7 @@ class ClipboardHandler extends SingletonFactory {
         */
        protected function loadMarkedItems($objectTypeID = null) {
                if ($this->markedItems === null) {
-                       $this->markedItems = array();
+                       $this->markedItems = [];
                }
                
                if ($objectTypeID !== null) {
@@ -195,14 +195,14 @@ class ClipboardHandler extends SingletonFactory {
                        }
                        
                        if (!isset($this->markedItems[$objectType->objectType])) {
-                               $this->markedItems[$objectType->objectType] = array();
+                               $this->markedItems[$objectType->objectType] = [];
                        }
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID = ?", array(WCF::getUser()->userID));
+               $conditions->add("userID = ?", [WCF::getUser()->userID]);
                if ($objectTypeID !== null) {
-                       $conditions->add("objectTypeID = ?", array($objectTypeID));
+                       $conditions->add("objectTypeID = ?", [$objectTypeID]);
                }
                
                // fetch object ids
@@ -213,7 +213,7 @@ class ClipboardHandler extends SingletonFactory {
                $statement->execute($conditions->getParameters());
                
                // group object ids by type name
-               $data = array();
+               $data = [];
                while ($row = $statement->fetchArray()) {
                        $objectType = $this->getObjectType($row['objectTypeID']);
                        if ($objectType === null) {
@@ -225,10 +225,10 @@ class ClipboardHandler extends SingletonFactory {
                                        throw new SystemException("Missing list class for object type '".$objectType->objectType."'");
                                }
                                
-                               $data[$objectType->objectType] = array(
+                               $data[$objectType->objectType] = [
                                        'className' => $objectType->listclassname,
-                                       'objectIDs' => array()
-                               );
+                                       'objectIDs' => []
+                               ];
                        }
                        
                        $data[$objectType->objectType]['objectIDs'][] = $row['objectID'];
@@ -237,7 +237,7 @@ class ClipboardHandler extends SingletonFactory {
                // read objects
                foreach ($data as $objectType => $objectData) {
                        $objectList = new $objectData['className']();
-                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias() . "." . $objectList->getDatabaseTableIndexName() . " IN (?)", array($objectData['objectIDs']));
+                       $objectList->getConditionBuilder()->add($objectList->getDatabaseTableAlias() . "." . $objectList->getDatabaseTableIndexName() . " IN (?)", [$objectData['objectIDs']]);
                        $objectList->readObjects();
                        
                        $this->markedItems[$objectType] = $objectList->getObjects();
@@ -251,9 +251,9 @@ class ClipboardHandler extends SingletonFactory {
                        
                        if (!empty($objectData['objectIDs'])) {
                                $conditions = new PreparedStatementConditionBuilder();
-                               $conditions->add("objectTypeID = ?", array($this->getObjectTypeByName($objectType)));
-                               $conditions->add("userID = ?", array(WCF::getUser()->userID));
-                               $conditions->add("objectID IN (?)", array($objectData['objectIDs']));
+                               $conditions->add("objectTypeID = ?", [$this->getObjectTypeByName($objectType)]);
+                               $conditions->add("userID = ?", [WCF::getUser()->userID]);
+                               $conditions->add("objectID IN (?)", [$objectData['objectIDs']]);
                                
                                $sql = "DELETE FROM     wcf".WCF_N."_clipboard_item
                                        ".$conditions;
@@ -308,7 +308,7 @@ class ClipboardHandler extends SingletonFactory {
                
                // fetch action ids
                $this->loadActionCache();
-               $actionIDs = array();
+               $actionIDs = [];
                foreach ($this->pageCache[$page] as $actionID) {
                        if (isset($this->actionCache[$actionID])) {
                                $actionIDs[] = $actionID;
@@ -317,7 +317,7 @@ class ClipboardHandler extends SingletonFactory {
                $actionIDs = array_unique($actionIDs);
                
                // load actions
-               $actions = array();
+               $actions = [];
                foreach ($actionIDs as $actionID) {
                        $actionObject = $this->actionCache[$actionID];
                        $actionClassName = $actionObject->actionClassName;
@@ -327,27 +327,27 @@ class ClipboardHandler extends SingletonFactory {
                                        throw new SystemException("'".$actionClassName."' does not implement 'wcf\system\clipboard\action\IClipboardAction'");
                                }
                                
-                               $actions[$actionClassName] = array(
-                                       'actions' => array(),
+                               $actions[$actionClassName] = [
+                                       'actions' => [],
                                        'object' => new $actionClassName()
-                               );
+                               ];
                        }
                        
                        $actions[$actionClassName]['actions'][] = $actionObject;
                }
                
                // execute actions
-               $editorData = array();
+               $editorData = [];
                foreach ($actions as $actionData) {
                        // get accepted objects
                        $typeName = $actionData['object']->getTypeName();
                        if (!isset($this->markedItems[$typeName]) || empty($this->markedItems[$typeName])) continue;
                        
                        if (!isset($editorData[$typeName])) {
-                               $editorData[$typeName] = array(
+                               $editorData[$typeName] = [
                                        'label' => $actionData['object']->getEditorLabel($this->markedItems[$typeName]),
-                                       'items' => array()
-                               );
+                                       'items' => []
+                               ];
                        }
                        
                        foreach ($actionData['actions'] as $actionObject) {
@@ -370,8 +370,8 @@ class ClipboardHandler extends SingletonFactory {
         */
        public function removeItems($typeID = null) {
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID = ?", array(WCF::getUser()->userID));
-               if ($typeID !== null) $conditions->add("objectTypeID = ?", array($typeID));
+               $conditions->add("userID = ?", [WCF::getUser()->userID]);
+               if ($typeID !== null) $conditions->add("objectTypeID = ?", [$typeID]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_clipboard_item
                        ".$conditions;
@@ -389,9 +389,9 @@ class ClipboardHandler extends SingletonFactory {
                if (!WCF::getUser()->userID) return 0;
                
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add("userID = ?", array(WCF::getUser()->userID));
+               $conditionBuilder->add("userID = ?", [WCF::getUser()->userID]);
                if ($objectTypeID !== null) {
-                       $conditionBuilder->add("objectTypeID = ?", array($objectTypeID));
+                       $conditionBuilder->add("objectTypeID = ?", [$objectTypeID]);
                }
                
                $sql = "SELECT  COUNT(*)
index 38505aa1a51dceaff043d8e0936cc70f04ceae06..b974150e642bee75d6c602e9367ea9e41e3c81dd 100644 (file)
@@ -21,19 +21,19 @@ abstract class AbstractClipboardAction implements IClipboardAction {
         * list of the clipboard actions which are executed by the action class
         * @var string[]
         */
-       protected $actionClassActions = array();
+       protected $actionClassActions = [];
        
        /**
         * relevant database objects
         * @var DatabaseObject[]
         */
-       protected $objects = array();
+       protected $objects = [];
        
        /**
         * list of the supported clipboard actions
         * @var string[]
         */
-       protected $supportedActions = array();
+       protected $supportedActions = [];
        
        /**
         * @see \wcf\system\clipboard\action\IClipboardAction::execute()
@@ -72,8 +72,8 @@ abstract class AbstractClipboardAction implements IClipboardAction {
         * @see \wcf\system\clipboard\action\IClipboardAction::getEditorLabel()
         */
        public function getEditorLabel(array $objects) {
-               return WCF::getLanguage()->getDynamicVariable('wcf.clipboard.label.'.$this->getTypeName().'.marked', array(
+               return WCF::getLanguage()->getDynamicVariable('wcf.clipboard.label.'.$this->getTypeName().'.marked', [
                        'count' => count($objects)
-               ));
+               ]);
        }
 }
index 5ad1fa1cc42214fb6eb1adfd7374b88c6d119799..27a5f5e0a8b310729d33e05a1b240d3264b1248c 100644 (file)
@@ -18,12 +18,12 @@ class TagClipboardAction extends AbstractClipboardAction {
        /**
         * @see \wcf\system\clipboard\action\AbstractClipboardAction::$actionClassActions
         */
-       protected $actionClassActions = array('delete');
+       protected $actionClassActions = ['delete'];
        
        /**
         * @see \wcf\system\clipboard\action\AbstractClipboardAction::$supportedActions
         */
-       protected $supportedActions = array('delete', 'setAsSynonyms');
+       protected $supportedActions = ['delete', 'setAsSynonyms'];
        
        /**
         * @see \wcf\system\clipboard\action\IClipboardAction::execute()
index 52e791b428c1dacbee1cfc06791dbf3233ddd6ec..05d25fcc93c534a9afdf185dd7fdf9be3ad6e16f 100644 (file)
@@ -20,12 +20,12 @@ class UserClipboardAction extends AbstractClipboardAction {
        /**
         * @see \wcf\system\clipboard\action\AbstractClipboardAction::$actionClassActions
         */
-       protected $actionClassActions = array('delete');
+       protected $actionClassActions = ['delete'];
        
        /**
         * @see \wcf\system\clipboard\action\AbstractClipboardAction::$supportedActions
         */
-       protected $supportedActions = array('assignToGroup', 'ban', 'delete', 'enable', 'exportMailAddress', 'merge', 'sendMail', 'sendNewPassword');
+       protected $supportedActions = ['assignToGroup', 'ban', 'delete', 'enable', 'exportMailAddress', 'merge', 'sendMail', 'sendNewPassword'];
        
        /**
         * @see \wcf\system\clipboard\action\IClipboardAction::execute()
@@ -44,9 +44,9 @@ class UserClipboardAction extends AbstractClipboardAction {
                        break;
                        
                        case 'delete':
-                               $item->addInternalData('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.com.woltlab.wcf.user.delete.confirmMessage', array(
+                               $item->addInternalData('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.com.woltlab.wcf.user.delete.confirmMessage', [
                                        'count' => $item->getCount()
-                               )));
+                               ]));
                        break;
                        
                        case 'exportMailAddress':
@@ -62,9 +62,9 @@ class UserClipboardAction extends AbstractClipboardAction {
                        break;
                        
                        case 'sendNewPassword':
-                               $item->addParameter('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.com.woltlab.wcf.user.sendNewPassword.confirmMessage', array(
+                               $item->addParameter('confirmMessage', WCF::getLanguage()->getDynamicVariable('wcf.clipboard.item.com.woltlab.wcf.user.sendNewPassword.confirmMessage', [
                                        'count' => $item->getCount()
-                               )));
+                               ]));
                        break;
                }
                
@@ -93,7 +93,7 @@ class UserClipboardAction extends AbstractClipboardAction {
        protected function validateDelete() {
                // check permissions
                if (!WCF::getSession()->getPermission('admin.user.canDeleteUser')) {
-                       return array();
+                       return [];
                }
                
                return $this->__validateAccessibleGroups(array_keys($this->objects));
@@ -107,7 +107,7 @@ class UserClipboardAction extends AbstractClipboardAction {
        protected function validateBan() {
                // check permissions
                if (!WCF::getSession()->getPermission('admin.user.canBanUser')) {
-                       return array();
+                       return [];
                }
                
                return $this->__validateAccessibleGroups(array_keys($this->objects));
@@ -128,11 +128,11 @@ class UserClipboardAction extends AbstractClipboardAction {
                }
                
                // no valid users found
-               if (empty($userIDs)) return array();
+               if (empty($userIDs)) return [];
                
                // fetch user to group associations
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($userIDs));
+               $conditions->add("userID IN (?)", [$userIDs]);
                
                $sql = "SELECT  userID, groupID
                        FROM    wcf".WCF_N."_user_to_group
@@ -140,10 +140,10 @@ class UserClipboardAction extends AbstractClipboardAction {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
                
-               $userToGroup = array();
+               $userToGroup = [];
                while ($row = $statement->fetchArray()) {
                        if (!isset($userToGroup[$row['userID']])) {
-                               $userToGroup[$row['userID']] = array();
+                               $userToGroup[$row['userID']] = [];
                        }
                        
                        $userToGroup[$row['userID']][] = $row['groupID'];
@@ -167,7 +167,7 @@ class UserClipboardAction extends AbstractClipboardAction {
        public function validateSendNewPassword() {
                // check permissions
                if (!WCF::getSession()->getPermission('admin.user.canEditPassword')) {
-                       return array();
+                       return [];
                }
                
                return $this->__validateAccessibleGroups(array_keys($this->objects));
@@ -182,10 +182,10 @@ class UserClipboardAction extends AbstractClipboardAction {
        protected function validateEnable() {
                // check permissions
                if (!WCF::getSession()->getPermission('admin.user.canEnableUser')) {
-                       return array();
+                       return [];
                }
                
-               $userIDs = array();
+               $userIDs = [];
                foreach ($this->objects as $user) {
                        if ($user->activationCode) $userIDs[] = $user->userID;
                }
@@ -202,11 +202,11 @@ class UserClipboardAction extends AbstractClipboardAction {
        protected function validateMerge() {
                // check permissions
                if (!WCF::getSession()->getPermission('admin.user.canEditUser')) {
-                       return array();
+                       return [];
                }
                
                $userIDs = array_keys($this->objects);
-               if (count($userIDs) < 2) return array();
+               if (count($userIDs) < 2) return [];
                
                return $userIDs;
        }
index 6103e289d5c554685cbf166bb459cf8dadec7c3e..3a0a11e5adff46f15a406e6aa2b383f96c01dd1e 100644 (file)
@@ -18,7 +18,7 @@ class UserContentClipboardAction extends AbstractClipboardAction {
        /**
         * @see \wcf\system\clipboard\action\AbstractClipboardAction::$supportedActions
         */
-       protected $supportedActions = array('revertContentChanges');
+       protected $supportedActions = ['revertContentChanges'];
        
        /**
         * @see \wcf\system\clipboard\action\IClipboardAction::execute()
@@ -61,15 +61,15 @@ class UserContentClipboardAction extends AbstractClipboardAction {
         */
        protected function validateRevertContentChanges() {
                if (!MODULE_EDIT_HISTORY) {
-                       return array();
+                       return [];
                }
                
                // check permissions
                if (!WCF::getSession()->getPermission('admin.content.canBulkRevertContentChanges')) {
-                       return array();
+                       return [];
                }
                
-               $userIDs = array();
+               $userIDs = [];
                foreach ($this->objects as $user) {
                        $userIDs[] = $user->userID;
                }
index 1def9d398613ca61c986663765bab166e61113c0..47e12dfb558f528a1e290d82fe27543c5d1f39dc 100644 (file)
@@ -44,12 +44,12 @@ class ModerationQueueCommentManager extends AbstractCommentManager {
        public function updateCounter($objectID, $value) {
                $entry = new ModerationQueue($objectID);
                $editor = new ModerationQueueEditor($entry);
-               $editor->updateCounters(array(
+               $editor->updateCounters([
                        'comments' => $value
-               ));
-               $editor->update(array(
+               ]);
+               $editor->update([
                        'lastChangeTime' => TIME_NOW
-               ));
+               ]);
        }
        
        /**
index 43e7b1f634654b47043228e5332da4f0e9817ed1..fb07321eb7ab3e8c64c32cdae716fb5342b6af19 100644 (file)
@@ -84,7 +84,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
         * @see \wcf\system\comment\manager\ICommentManager::getLink()
         */
        public function getLink($objectTypeID, $objectID) {
-               return LinkHandler::getInstance()->getLink('User', array('id' => $objectID));
+               return LinkHandler::getInstance()->getLink('User', ['id' => $objectID]);
        }
        
        /**
@@ -135,7 +135,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                
                $commentLikeObjectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.like.likeableObject', 'com.woltlab.wcf.comment');
                
-               $commentIDs = $responseIDs = array();
+               $commentIDs = $responseIDs = [];
                foreach ($likes as $like) {
                        if ($like->objectTypeID == $commentLikeObjectType->objectTypeID) {
                                $commentIDs[] = $like->objectID;
@@ -146,7 +146,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                }
                
                // fetch response
-               $userIDs = $responses = array();
+               $userIDs = $responses = [];
                if (!empty($responseIDs)) {
                        $responseList = new CommentResponseList();
                        $responseList->setObjectIDs($responseIDs);
@@ -168,7 +168,7 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                $comments = $commentList->getObjects();
                
                // fetch users
-               $users = array();
+               $users = [];
                foreach ($comments as $comment) {
                        $userIDs[] = $comment->objectID;
                        if ($comment->userID) {
@@ -190,11 +190,11 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                                                $like->setIsAccessible();
                                                
                                                // short output
-                                               $text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment', array(
+                                               $text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment', [
                                                        'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
                                                        'user' => $users[$comment->objectID],
                                                        'like' => $like
-                                               ));
+                                               ]);
                                                $like->setTitle($text);
                                                
                                                // output
@@ -212,12 +212,12 @@ class UserProfileCommentManager extends AbstractCommentManager implements IViewa
                                                $like->setIsAccessible();
                                                
                                                // short output
-                                               $text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment.response', array(
+                                               $text = WCF::getLanguage()->getDynamicVariable('wcf.like.title.com.woltlab.wcf.user.profileComment.response', [
                                                        'responseAuthor' => $comment->userID ? $users[$response->userID] : null,
                                                        'commentAuthor' => $comment->userID ? $users[$comment->userID] : null,
                                                        'user' => $users[$comment->objectID],
                                                        'like' => $like
-                                               ));
+                                               ]);
                                                $like->setTitle($text);
                                                
                                                // output
index 30c1cf9fb59b9343eb8431a3180b953ef50b46b7..4ec2f5fb98de46f018520a9bef47d688f22e4972 100644 (file)
@@ -25,7 +25,7 @@ class ConditionHandler extends SingletonFactory {
         * object type definition
         * @var array
         */
-       protected $conditions = array();
+       protected $conditions = [];
        
        /**
         * Creates condition objects for the object with the given id and based
@@ -38,13 +38,13 @@ class ConditionHandler extends SingletonFactory {
                foreach ($conditionObjectTypes as $objectType) {
                        $conditionData = $objectType->getProcessor()->getData();
                        if ($conditionData !== null) {
-                               $conditionAction = new ConditionAction(array(), 'create', array(
-                                       'data' => array(
+                               $conditionAction = new ConditionAction([], 'create', [
+                                       'data' => [
                                                'conditionData' => serialize($conditionData),
                                                'objectID' => $objectID,
                                                'objectTypeID' => $objectType->objectTypeID
-                                       )
-                               ));
+                                       ]
+                               ]);
                                $conditionAction->executeAction();
                        }
                }
@@ -66,7 +66,7 @@ class ConditionHandler extends SingletonFactory {
                }
                
                $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes($definitionName);
-               $objectTypeIDs = array();
+               $objectTypeIDs = [];
                foreach ($objectTypes as $objectType) {
                        $objectTypeIDs[] = $objectType->objectTypeID;
                }
@@ -74,8 +74,8 @@ class ConditionHandler extends SingletonFactory {
                if (empty($objectTypeIDs)) return;
                
                $conditionList = new ConditionList();
-               $conditionList->getConditionBuilder()->add('objectTypeID IN (?)', array($objectTypeIDs));
-               $conditionList->getConditionBuilder()->add('objectID IN (?)', array($objectIDs));
+               $conditionList->getConditionBuilder()->add('objectTypeID IN (?)', [$objectTypeIDs]);
+               $conditionList->getConditionBuilder()->add('objectID IN (?)', [$objectIDs]);
                $conditionList->readObjects();
                
                if (count($conditionList)) {
@@ -101,16 +101,16 @@ class ConditionHandler extends SingletonFactory {
                }
                
                if (!isset($this->conditions[$definition->definitionID])) {
-                       $this->conditions[$definition->definitionID] = ConditionCacheBuilder::getInstance()->getData(array(
+                       $this->conditions[$definition->definitionID] = ConditionCacheBuilder::getInstance()->getData([
                                'definitionID' => $definition->definitionID
-                       ));
+                       ]);
                }
                
                if (isset($this->conditions[$definition->definitionID][$objectID])) {
                        return $this->conditions[$definition->definitionID][$objectID];
                }
                
-               return array();
+               return [];
        }
        
        /**
index 4fc04164c319ba114803e7b23a1aa17f6a00fe2e..8b68b99cc5147f36322b505f2ebc6c32fe082ca6 100644 (file)
@@ -27,10 +27,10 @@ class AttachmentCleanUpCronjob extends AbstractCronjob {
                        WHERE   objectID = ?
                                AND uploadTime < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        0,
                        (TIME_NOW - 86400)
-               ));
+               ]);
                $attachmentIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($attachmentIDs)) {
index f295fd8784c02aa2ec68fc438594fa2a16bb8a03..4862e32e8b8d9c9d8881c58b2cd58cc46fc6773d 100644 (file)
@@ -23,13 +23,13 @@ class CronjobScheduler extends SingletonFactory {
         * cached times of the next and after next cronjob execution
         * @var integer[]
         */
-       protected $cache = array();
+       protected $cache = [];
        
        /**
         * list of editors for outstanding cronjobs
         * @var CronjobEditor[]
         */
-       protected $cronjobEditors = array();
+       protected $cronjobEditors = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -55,15 +55,15 @@ class CronjobScheduler extends SingletonFactory {
                
                foreach ($this->cronjobEditors as $cronjobEditor) {
                        // mark cronjob as being executed
-                       $cronjobEditor->update(array(
+                       $cronjobEditor->update([
                                'state' => Cronjob::EXECUTING
-                       ));
+                       ]);
                        
                        // create log entry
-                       $log = CronjobLogEditor::create(array(
+                       $log = CronjobLogEditor::create([
                                'cronjobID' => $cronjobEditor->cronjobID,
                                'execTime' => TIME_NOW
-                       ));
+                       ]);
                        $logEditor = new CronjobLogEditor($log);
                        
                        // check if all required options are set for cronjob to be executed
@@ -87,13 +87,13 @@ class CronjobScheduler extends SingletonFactory {
                        $afterNextExec = $cronjobEditor->getNextExec(($nextExec + 120));
                        
                        // mark cronjob as done
-                       $cronjobEditor->update(array(
+                       $cronjobEditor->update([
                                'lastExec' => TIME_NOW,
                                'afterNextExec' => $afterNextExec,
                                'failCount' => 0,
                                'nextExec' => $nextExec,
                                'state' => Cronjob::READY
-                       ));
+                       ]);
                }
        }
        
@@ -116,20 +116,20 @@ class CronjobScheduler extends SingletonFactory {
                                AND cronjob.isDisabled = ?
                                AND cronjob.failCount < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        TIME_NOW,
                        TIME_NOW,
                        0,
                        Cronjob::MAX_FAIL_COUNT
-               ));
+               ]);
                while ($row = $statement->fetchArray()) {
                        $cronjob = new Cronjob(null, $row);
                        $cronjobEditor = new CronjobEditor($cronjob);
                        $executeCronjob = true;
                        
-                       $data = array(
+                       $data = [
                                'state' => Cronjob::PENDING
-                       );
+                       ];
                        
                        // reset cronjob if it got stuck before and afterNextExec is in the past
                        if ($cronjobEditor->afterNextExec <= TIME_NOW) {
@@ -192,23 +192,23 @@ class CronjobScheduler extends SingletonFactory {
         */
        protected function logResult(CronjobLogEditor $logEditor, SystemException $exception = null) {
                if ($exception !== null) {
-                       $errString = implode("\n", array(
+                       $errString = implode("\n", [
                                $exception->getMessage(),
                                $exception->getCode(),
                                $exception->getFile(),
                                $exception->getLine(),
                                $exception->getTraceAsString()
-                       ));
+                       ]);
                        
-                       $logEditor->update(array(
+                       $logEditor->update([
                                'success' => 0,
                                'error' => $errString
-                       ));
+                       ]);
                }
                else {
-                       $logEditor->update(array(
+                       $logEditor->update([
                                'success' => 1
-                       ));
+                       ]);
                }
        }
        
index f4bfb8718e7ff2c7c885f0ca26a94806dfdb1cf1..108decb8ff949dbe7583fcba6529d8d068e3c095 100644 (file)
@@ -35,35 +35,35 @@ class DailyCleanUpCronjob extends AbstractCronjob {
                                WHERE           searches <= ?
                                                AND lastSearchTime < ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                floor($row['searches'] / 4),
                                (TIME_NOW - 86400 * 30)
-                       ));
+                       ]);
                }
                
                // clean up notifications
                $sql = "DELETE FROM     wcf".WCF_N."_user_notification
                        WHERE           time < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        (TIME_NOW - 86400 * USER_CLEANUP_NOTIFICATION_LIFETIME)
-               ));
+               ]);
                
                // clean up user activity events
                $sql = "DELETE FROM     wcf".WCF_N."_user_activity_event
                        WHERE           time < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        (TIME_NOW - 86400 * USER_CLEANUP_ACTIVITY_EVENT_LIFETIME)
-               ));
+               ]);
                
                // clean up profile visitors
                $sql = "DELETE FROM     wcf".WCF_N."_user_profile_visitor
                        WHERE           time < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        (TIME_NOW - 86400 * USER_CLEANUP_PROFILE_VISITOR_LIFETIME)
-               ));
+               ]);
                
                // tracked visits
                $sql = "DELETE FROM     wcf".WCF_N."_tracked_visit
@@ -81,14 +81,14 @@ class DailyCleanUpCronjob extends AbstractCronjob {
                        $lifetime = ($objectType->lifetime ?: VisitTracker::DEFAULT_LIFETIME);
                                
                        // delete data
-                       $statement1->execute(array(
+                       $statement1->execute([
                                $objectType->objectTypeID,
                                $lifetime
-                       ));
-                       $statement2->execute(array(
+                       ]);
+                       $statement2->execute([
                                $objectType->objectTypeID,
                                $lifetime
-                       ));
+                       ]);
                }
                WCF::getDB()->commitTransaction();
                
@@ -96,9 +96,9 @@ class DailyCleanUpCronjob extends AbstractCronjob {
                $sql = "DELETE FROM     wcf".WCF_N."_cronjob_log
                        WHERE           execTime < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        (TIME_NOW - (86400 * 7))
-               ));
+               ]);
                
                // clean up session access log
                $sql = "DELETE FROM     wcf".WCF_N."_acp_session_access_log
@@ -108,25 +108,25 @@ class DailyCleanUpCronjob extends AbstractCronjob {
                                                WHERE   lastActivityTime < ?
                                        )";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        (TIME_NOW - (86400 * 30))
-               ));
+               ]);
                
                // clean up session log
                $sql = "DELETE FROM     wcf".WCF_N."_acp_session_log
                        WHERE           lastActivityTime < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        (TIME_NOW - (86400 * 30))
-               ));
+               ]);
                
                // clean up search data
                $sql = "DELETE FROM     wcf".WCF_N."_search
                        WHERE           searchTime < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        (TIME_NOW - 86400)
-               ));
+               ]);
                
                // clean up expired edit history entries
                if (MODULE_EDIT_HISTORY) {
@@ -134,9 +134,9 @@ class DailyCleanUpCronjob extends AbstractCronjob {
                                $sql = "DELETE FROM     wcf".WCF_N."_edit_history_entry
                                        WHERE           obsoletedAt < ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(
+                               $statement->execute([
                                        (TIME_NOW - 86400 * EDIT_HISTORY_EXPIRATION)
-                               ));
+                               ]);
                        }
                }
                else {
@@ -151,9 +151,9 @@ class DailyCleanUpCronjob extends AbstractCronjob {
                        $sql = "DELETE FROM     wcf".WCF_N."_user_authentication_failure
                                WHERE           time < ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                (TIME_NOW - 86400 * USER_AUTHENTICATION_FAILURE_EXPIRATION)
-                       ));
+                       ]);
                }
                
                // clean up error logs
index 5510a26e4f29723809527c9e0ed3517aadd8ef24..9323e651b3ad7e3813d2f7cd757ca848d6f867b3 100644 (file)
@@ -38,11 +38,11 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                                AND time < ?
                                AND confirmTime = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        0,
                        TIME_NOW - 3600 * 23,
                        0
-               ));
+               ]);
                $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                if (empty($userIDs)) return;
                
@@ -54,9 +54,9 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                
                // get notifications
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("notification.userID IN (?)", array($userIDs));
-               $conditions->add("notification.mailNotified = ?", array(0));
-               $conditions->add("notification.confirmTime = ?", array(0));
+               $conditions->add("notification.userID IN (?)", [$userIDs]);
+               $conditions->add("notification.mailNotified = ?", [0]);
+               $conditions->add("notification.confirmTime = ?", [0]);
                
                $sql = "SELECT          notification.*, notification_event.eventID, object_type.objectType
                        FROM            wcf".WCF_N."_user_notification notification
@@ -71,8 +71,8 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                
                // mark notifications as done
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($userIDs));
-               $conditions->add("mailNotified = ?", array(0));
+               $conditions->add("userID IN (?)", [$userIDs]);
+               $conditions->add("mailNotified = ?", [0]);
                $sql = "UPDATE  wcf".WCF_N."_user_notification
                        SET     mailNotified = 1
                        ".$conditions;
@@ -80,19 +80,19 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                $statement2->execute($conditions->getParameters());
                
                // collect data
-               $eventsToUser = $objectTypes = $eventIDs = $notificationObjects = array();
+               $eventsToUser = $objectTypes = $eventIDs = $notificationObjects = [];
                $availableObjectTypes = UserNotificationHandler::getInstance()->getAvailableObjectTypes();
                while ($row = $statement->fetchArray()) {
-                       if (!isset($eventsToUser[$row['userID']])) $eventsToUser[$row['userID']] = array();
+                       if (!isset($eventsToUser[$row['userID']])) $eventsToUser[$row['userID']] = [];
                        $eventsToUser[$row['userID']][] = $row['notificationID'];
                        
                        // cache object types
                        if (!isset($objectTypes[$row['objectType']])) {
-                               $objectTypes[$row['objectType']] = array(
+                               $objectTypes[$row['objectType']] = [
                                        'objectType' => $availableObjectTypes[$row['objectType']],
-                                       'objectIDs' => array(),
-                                       'objects' => array()
-                               );
+                                       'objectIDs' => [],
+                                       'objects' => []
+                               ];
                        }
                        
                        $objectTypes[$row['objectType']]['objectIDs'][] = $row['objectID'];
@@ -103,21 +103,21 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                
                // load authors
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("notificationID IN (?)", array(array_keys($notificationObjects)));
+               $conditions->add("notificationID IN (?)", [array_keys($notificationObjects)]);
                $sql = "SELECT          notificationID, authorID
                        FROM            wcf".WCF_N."_user_notification_author
                        ".$conditions."
                        ORDER BY        time ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $authorIDs = $authorToNotification = array();
+               $authorIDs = $authorToNotification = [];
                while ($row = $statement->fetchArray()) {
                        if ($row['authorID']) {
                                $authorIDs[] = $row['authorID'];
                        }
                        
                        if (!isset($authorToNotification[$row['notificationID']])) {
-                               $authorToNotification[$row['notificationID']] = array();
+                               $authorToNotification[$row['notificationID']] = [];
                        }
                        
                        $authorToNotification[$row['notificationID']][] = $row['authorID'];
@@ -125,7 +125,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                
                // load authors
                $authors = UserProfileRuntimeCache::getInstance()->getObjects($authorIDs);
-               $unknownAuthor = new UserProfile(new User(null, array('userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest'))));
+               $unknownAuthor = new UserProfile(new User(null, ['userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest')]));
                
                // load objects associated with each object type
                foreach ($objectTypes as $objectType => $objectData) {
@@ -134,7 +134,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                
                // load required events
                $eventList = new UserNotificationEventList();
-               $eventList->getConditionBuilder()->add("user_notification_event.eventID IN (?)", array($eventIDs));
+               $eventList->getConditionBuilder()->add("user_notification_event.eventID IN (?)", [$eventIDs]);
                $eventList->readObjects();
                $eventObjects = $eventList->getObjects();
                
@@ -147,9 +147,9 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                        if ($user->banned) continue;
                        
                        // add mail header
-                       $message = $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.header', array(
+                       $message = $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.header', [
                                'user' => $user
-                       ));
+                       ]);
                        
                        foreach ($events as $notificationID) {
                                $notification = $notificationObjects[$notificationID];
@@ -165,7 +165,7 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                                $class->setLanguage($user->getLanguage());
                                
                                if (isset($authorToNotification[$notification->notificationID])) {
-                                       $eventAuthors = array();
+                                       $eventAuthors = [];
                                        foreach ($authorToNotification[$notification->notificationID] as $userID) {
                                                if (!$userID) {
                                                        $eventAuthors[0] = $unknownAuthor;
@@ -187,19 +187,19 @@ class DailyMailNotificationCronjob extends AbstractCronjob {
                        $token = $user->notificationMailToken;
                        if (!$token) {
                                // generate token if not present
-                               $token = mb_substr(StringUtil::getHash(serialize(array($user->userID, StringUtil::getRandomID()))), 0, 20);
+                               $token = mb_substr(StringUtil::getHash(serialize([$user->userID, StringUtil::getRandomID()])), 0, 20);
                                $editor = new UserEditor($user);
-                               $editor->update(array('notificationMailToken' => $token));
+                               $editor->update(['notificationMailToken' => $token]);
                        }
                        
                        $message .= "\n\n";
-                       $message .= $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.daily.footer', array(
+                       $message .= $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.daily.footer', [
                                'user' => $user,
                                'token' => $token
-                       ));
+                       ]);
                        
                        // build mail
-                       $mail = new Mail(array($user->username => $user->email), $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.daily.subject', array('count' => count($events))), $message);
+                       $mail = new Mail([$user->username => $user->email], $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.daily.subject', ['count' => count($events)]), $message);
                        $mail->setLanguage($user->getLanguage());
                        $mail->send();
                }
index d510170199777b43a0bda6a085b98126882691ec..dfe50d3cd6871937e24c72fcf948ada61b2ed435 100644 (file)
@@ -24,8 +24,8 @@ class HourlyCleanUpCronjob extends AbstractCronjob {
                // disable expired paid subscriptions
                if (MODULE_PAID_SUBSCRIPTION) {
                        $subscriptionUserList = new PaidSubscriptionUserList();
-                       $subscriptionUserList->getConditionBuilder()->add('isActive = ?', array(1));
-                       $subscriptionUserList->getConditionBuilder()->add('endDate > 0 AND endDate < ?', array(TIME_NOW));
+                       $subscriptionUserList->getConditionBuilder()->add('isActive = ?', [1]);
+                       $subscriptionUserList->getConditionBuilder()->add('endDate > 0 AND endDate < ?', [TIME_NOW]);
                        $subscriptionUserList->readObjects();
                        
                        if (count($subscriptionUserList->getObjects())) {
index fbf9dee4640d94ccaf97587a1d4076bdc2e117b2..4e85ee867789a28b81c1a8f0a301a5f31319873a 100644 (file)
@@ -28,15 +28,15 @@ class ModerationQueueCronjob extends AbstractCronjob {
                        WHERE   status = ?
                                AND lastChangeTime < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        ModerationQueue::STATUS_DONE,
                        (TIME_NOW - (86400 * 30))
-               ));
+               ]);
                $queueIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($queueIDs)) {
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("queueID IN (?)", array($queueIDs));
+                       $conditions->add("queueID IN (?)", [$queueIDs]);
                        
                        $sql = "DELETE FROM     wcf".WCF_N."_moderation_queue
                                ".$conditions;
index 093f1f6472f35a18b3b09d2c7c0c5b7c0a5685d0..38dbab0e10cb679781f9e72496aa91563847335f 100644 (file)
@@ -32,17 +32,17 @@ class RefreshSearchRobotsCronjob implements ICronjob {
                
                if (!empty($spiders)) {
                        $existingSpiders = SpiderCacheBuilder::getInstance()->getData();
-                       $statementParameters = array();
+                       $statementParameters = [];
                        foreach ($spiders as $spider) {
                                $identifier = mb_strtolower($spider->getAttribute('ident'));
                                $name = $xpath->query('ns:name', $spider)->item(0);
                                $info = $xpath->query('ns:url', $spider)->item(0);
                                
-                               $statementParameters[$identifier] = array(
+                               $statementParameters[$identifier] = [
                                        'spiderIdentifier' => $identifier,
                                        'spiderName' => $name->nodeValue,
                                        'spiderURL' => $info ? $info->nodeValue : ''
-                               );
+                               ];
                        }
                        
                        if (!empty($statementParameters)) {
@@ -55,11 +55,11 @@ class RefreshSearchRobotsCronjob implements ICronjob {
                                
                                WCF::getDB()->beginTransaction();
                                foreach ($statementParameters as $parameters) {
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                $parameters['spiderIdentifier'],
                                                $parameters['spiderName'],
                                                $parameters['spiderURL']
-                                       ));
+                                       ]);
                                }
                                WCF::getDB()->commitTransaction();
                        }
@@ -69,7 +69,7 @@ class RefreshSearchRobotsCronjob implements ICronjob {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($existingSpiders as $spider) {
                                if (!isset($statementParameters[$spider->spiderIdentifier])) {
-                                       $statement->execute(array($spider->spiderIdentifier));
+                                       $statement->execute([$spider->spiderIdentifier]);
                                }
                        }
                        
index 823d80d33a3b119b355db6bf77d7df4302988466..cebdd39e9849c3042e61006b14f73bb3b3f2cb23 100644 (file)
@@ -39,7 +39,7 @@ class StatDailyBuilderCronjob extends AbstractCronjob {
                foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.statDailyHandler') as $objectType) {
                        $data = $objectType->getProcessor()->getData($date);
                        
-                       $statement->execute(array($objectType->objectTypeID, $d->format('Y-m-d'), $data['counter'], $data['total']));
+                       $statement->execute([$objectType->objectTypeID, $d->format('Y-m-d'), $data['counter'], $data['total']]);
                }
        }
 }
index bcebe8b2c17b8cd480ca1eacd67f6ad396a47104..ae6763fe67e3f9ddba9dafef03e883c79e89390d 100644 (file)
@@ -28,13 +28,13 @@ class UserBanCronjob extends AbstractCronjob {
                                AND banExpires <> ?
                                AND banExpires <= ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        0,
                        0,
                        1,
                        0,
                        TIME_NOW
-               ));
+               ]);
                
                // enable avatars
                $sql = "UPDATE  wcf".WCF_N."_user
@@ -44,13 +44,13 @@ class UserBanCronjob extends AbstractCronjob {
                                AND disableAvatarExpires <> ?
                                AND disableAvatarExpires <= ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        0,
                        0,
                        1,
                        0,
                        TIME_NOW
-               ));
+               ]);
                
                // enable signatures
                $sql = "UPDATE  wcf".WCF_N."_user
@@ -60,12 +60,12 @@ class UserBanCronjob extends AbstractCronjob {
                                AND disableSignatureExpires <> ?
                                AND disableSignatureExpires <= ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        0,
                        0,
                        1,
                        0,
                        TIME_NOW
-               ));
+               ]);
        }
 }
index 89b899590096aa891e66cf7ce46a86f607c226e9..3125e0b3af497fe31c49fc2104ec0ba6b933b60f 100644 (file)
@@ -23,21 +23,21 @@ class UserGroupAssignmentCronjob extends AbstractCronjob {
                parent::execute($cronjob);
                
                $assignments = UserGroupAssignmentCacheBuilder::getInstance()->getData();
-               $usersToGroup = array();
+               $usersToGroup = [];
                foreach ($assignments as $assignment) {
                        if (!isset($usersToGroup[$assignment->groupID])) {
-                               $usersToGroup[$assignment->groupID] = array();
+                               $usersToGroup[$assignment->groupID] = [];
                        }
                        
                        $usersToGroup[$assignment->groupID] = array_merge($usersToGroup[$assignment->groupID], UserGroupAssignmentHandler::getInstance()->getUsers($assignment));
                }
                
                foreach ($usersToGroup as $groupID => $users) {
-                       $userAction = new UserAction(array_unique($users), 'addToGroups', array(
+                       $userAction = new UserAction(array_unique($users), 'addToGroups', [
                                'addDefaultGroups' => false,
                                'deleteOldGroups' => false,
-                               'groups' => array($groupID)
-                       ));
+                               'groups' => [$groupID]
+                       ]);
                        $userAction->executeAction();
                }
        }
index 829fad90e1e06b1c70cdb61e27dca5dbb2eb42a9..e7ef066d02aa7c1275ab12d852e25e5be3e89538 100644 (file)
@@ -26,10 +26,10 @@ class UserQuitCronjob extends AbstractCronjob {
                        WHERE   quitStarted > ?
                                AND quitStarted < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        0,
                        (TIME_NOW - 7 * 24 * 3600)
-               ));
+               ]);
                $userIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($userIDs)) {
index ea28c2b85a00e47f8de0974e797b7897121eb966..f2ce048b8962e00cef162c7b1067b49b542b84f3 100644 (file)
@@ -25,13 +25,13 @@ class MySQLDatabase extends Database {
                if (!$this->port) $this->port = 3306; // mysql default port
                
                try {
-                       $driverOptions = array(
+                       $driverOptions = [
                                \PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'"
-                       );
+                       ];
                        if (!$this->failsafeTest) {
-                               $driverOptions = array(
+                               $driverOptions = [
                                        \PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8', SESSION sql_mode = 'ANSI,ONLY_FULL_GROUP_BY,STRICT_ALL_TABLES'"
-                               );
+                               ];
                        }
                        
                        // disable prepared statement emulation since MySQL 5.1.17 is the minimum required version
index 6351cce293b7aaf30f89aa433e345ad60078078d..e5b12901fd8d6a954ca23be2aca7f7862e78422c 100644 (file)
@@ -86,8 +86,8 @@ class PostgreSQLDatabase extends Database {
         */
        public static function fixQuery($query) {
                // replace quotes
-               $query = preg_replace_callback('~\'([^\'\\\\]+|\\\\.)*\'~', array('self', 'replaceQuotesCallback'), $query);
-               $query = preg_replace_callback('~"([^"\\\\]+|\\\\.)*"~', array('self', 'replaceQuotesCallback'), $query);
+               $query = preg_replace_callback('~\'([^\'\\\\]+|\\\\.)*\'~', ['self', 'replaceQuotesCallback'], $query);
+               $query = preg_replace_callback('~"([^"\\\\]+|\\\\.)*"~', ['self', 'replaceQuotesCallback'], $query);
                
                // double quote identifiers (column & table names ...)
                $query = preg_replace('~(?<=^|\s|\.|\(|,)([A-Za-z0-9_-]*[a-z]{1}[A-Za-z0-9_-]*)(?=$|\s|\.|\)|,|=)~', '"\\1"', $query);
index 9e44eda6cb5c1bce7c4fcf410505d0f921bc09bc..d8bd356f7b8a20b2d54ced9bca7430116a03089a 100644 (file)
@@ -58,7 +58,7 @@ abstract class DatabaseEditor {
         * @param       array           $columns
         * @param       array           $indices
         */
-       abstract public function createTable($tableName, $columns, $indices = array());
+       abstract public function createTable($tableName, $columns, $indices = []);
        
        /**
         * Drops a database table.
index 99953b4a1aec06a5ca9980ffdf535a9c188ad338..1414281e07e7a8591e309bad89d09ab742e127d3 100644 (file)
@@ -17,7 +17,7 @@ class MySQLDatabaseEditor extends DatabaseEditor {
         * @see \wcf\system\database\editor\DatabaseEditor::getTableNames()
         */
        public function getTableNames() {
-               $existingTables = array();
+               $existingTables = [];
                $sql = "SHOW TABLES FROM `".$this->dbObj->getDatabaseName()."`";
                $statement = $this->dbObj->prepareStatement($sql);
                $statement->execute();
@@ -31,7 +31,7 @@ class MySQLDatabaseEditor extends DatabaseEditor {
         * @see \wcf\system\database\editor\DatabaseEditor::getColumns()
         */
        public function getColumns($tableName) {
-               $columns = array();
+               $columns = [];
                $regex = new Regex('([a-z]+)\(([0-9]+)\)', Regex::CASE_INSENSITIVE);
                
                $sql = "SHOW COLUMNS FROM `".$tableName."`";
@@ -41,14 +41,14 @@ class MySQLDatabaseEditor extends DatabaseEditor {
                        $regex->match($row['Type']);
                        $typeMatches = $regex->getMatches();
                        
-                       $columns[] = array('name' => $row['Field'], 'data' => array(
+                       $columns[] = ['name' => $row['Field'], 'data' => [
                                'type' => ((empty($typeMatches)) ? $row['Type'] : $typeMatches[1]),
                                'length' => ((empty($typeMatches)) ? '' : $typeMatches[2]),
                                'notNull' => (($row['Null'] == 'YES') ? false : true),
                                'key' => (($row['Key'] == 'PRI') ? 'PRIMARY' : (($row['Key'] == 'UNI') ? 'UNIQUE' : '')),
                                'default' => $row['Default'],
                                'autoIncrement' => ($row['Extra'] == 'auto_increment' ? true : false)
-                       ));
+                       ]];
                }
                
                return $columns;
@@ -58,7 +58,7 @@ class MySQLDatabaseEditor extends DatabaseEditor {
         * @see \wcf\system\database\editor\DatabaseEditor::getIndices()
         */
        public function getIndices($tableName) {
-               $indices = array();
+               $indices = [];
                $sql = "SHOW INDEX FROM `".$tableName."`";
                $statement = $this->dbObj->prepareStatement($sql);
                $statement->execute();
@@ -72,7 +72,7 @@ class MySQLDatabaseEditor extends DatabaseEditor {
        /**
         * @see \wcf\system\database\editor\DatabaseEditor::createTable()
         */
-       public function createTable($tableName, $columns, $indices = array()) {
+       public function createTable($tableName, $columns, $indices = []) {
                $columnDefinition = $indexDefinition = '';
                
                // build column definition
index 16e6124f791064e7f6d6522b9753f1f12dcdcbb8..cf18fa888bbb97ed3014b926621615a4f3b9cc7d 100644 (file)
@@ -18,7 +18,7 @@ class PostgreSQLDatabaseEditor extends DatabaseEditor {
         * @see \wcf\system\database\editor\DatabaseEditor::getTableNames()
         */
        public function getTableNames() {
-               $existingTables = array();
+               $existingTables = [];
                $sql = "SELECT          tablename
                        FROM            pg_catalog.pg_tables
                        WHERE           schemaname = 'public'
@@ -35,7 +35,7 @@ class PostgreSQLDatabaseEditor extends DatabaseEditor {
         * @see \wcf\system\database\editor\DatabaseEditor::getColumns()
         */
        public function getColumns($tableName) {
-               $columns = array();
+               $columns = [];
                $sql = "SELECT  pg_attribute.*, pg_type.typname, pg_constraint.contype, pg_attribute.adsrc
                        FROM    pg_attribute,
                                pg_class,
@@ -47,16 +47,16 @@ class PostgreSQLDatabaseEditor extends DatabaseEditor {
                                AND pg_attribute.attnum > 0
                                AND pg_class.relname = ?";
                $statement = $this->dbObj->prepareStatement($sql);
-               $statement->execute(array($tableName));
+               $statement->execute([$tableName]);
                while ($row = $statement->fetchArray()) {
-                       $columns[] = array('name' => $row['attname'], 'data' => array(
+                       $columns[] = ['name' => $row['attname'], 'data' => [
                                'type' => $row['typname'],
                                'length' => $row['attlen'],
                                'notNull' => $row['attnotnull'],
                                'key' => (($row['contype'] == 'p') ? 'PRIMARY' : (($row['contype'] == 'u') ? 'UNIQUE' : '')),
                                'default' => $row['adsrc'],
                                'autoIncrement' => ($row['contype'] == 'p')
-                       ));
+                       ]];
                }
                
                return $columns;
@@ -66,12 +66,12 @@ class PostgreSQLDatabaseEditor extends DatabaseEditor {
         * @see \wcf\system\database\editor\DatabaseEditor::getIndices()
         */
        public function getIndices($tableName) {
-               $indices = array();
+               $indices = [];
                $sql = "SELECT  indexname
                        FROM    pg_indexes
                        WHERE   tablename = ?";
                $statement = $this->dbObj->prepareStatement($sql);
-               $statement->execute(array($tableName));
+               $statement->execute([$tableName]);
                while ($row = $statement->fetchArray()) {
                        $indices[] = $row['indexname'];
                }
@@ -117,7 +117,7 @@ class PostgreSQLDatabaseEditor extends DatabaseEditor {
        /**
         * @see \wcf\system\database\editor\DatabaseEditor::createTable()
         */
-       public function createTable($tableName, $columns, $indices = array()) {
+       public function createTable($tableName, $columns, $indices = []) {
                $columnDefinition = $indexDefinition = '';
                
                // build column definition
index e4531f4cce89f29d2ddf212fbf998206abd5a6ac..afd91683f056e62747360e88918491be6cc594e8 100644 (file)
@@ -47,7 +47,7 @@ class ConditionBuilder {
         * @param       mixed           $conditions
         */
        public function add($conditions) {
-               if (!is_array($conditions)) $conditions = array($conditions);
+               if (!is_array($conditions)) $conditions = [$conditions];
                
                foreach ($conditions as $condition) {
                        if (!empty($this->conditions)) $this->conditions .= $this->concat;
index 8caabe48203ee10ae92e39a69a2484b379139e9e..09242d88ad3adb2f737ce181d2715ff6ec30d932 100644 (file)
@@ -17,7 +17,7 @@ class PreparedStatementConditionBuilder extends ConditionBuilder {
         * input parameters
         * @var array
         */
-       protected $parameters = array();
+       protected $parameters = [];
        
        /**
         * Adds a new condition. The parameters array has to be a numbered array.
@@ -25,7 +25,7 @@ class PreparedStatementConditionBuilder extends ConditionBuilder {
         * @param       string          $condition
         * @param       array           $parameters
         */
-       public function add($condition, array $parameters = array()) {
+       public function add($condition, array $parameters = []) {
                if (!empty($parameters)) {
                        $count = 0;
                        $callback = function ($matches) use (&$count, $parameters, $condition) {
index e2debfe752931087a13b9df22b28e94ba790b1bb..c534ba4c2721525829d6a43c6d91d3ce87dc0709 100644 (file)
@@ -21,7 +21,7 @@ class SQLParser {
         * list of sql queries
         * @var string[]
         */
-       protected $queryArray = array();
+       protected $queryArray = [];
        
        /**
         * Creates a new SQLParser object.
@@ -64,7 +64,7 @@ class SQLParser {
                                // get table name
                                if (preg_match('~^CREATE\s+TABLE\s+(\w+)\s*\(~i', $query, $match)) {
                                        $tableName = $match[1];
-                                       $columns = $indices = array();
+                                       $columns = $indices = [];
                                        
                                        // find columns
                                        if (preg_match_all("~(?:\(|,)\s*(\w+)\s+(\w+)(?:\s*\((\s*(?:\d+(?:\s*,\s*\d+)?|'[^']*'(?:\s*,\s*'[^']*')*))\s*\))?(?:\s+UNSIGNED)?(?:\s+(NOT NULL|NULL))?(?:\s+DEFAULT\s+(\d+.\d+|\d+|NULL|'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'))?(?:\s+(AUTO_INCREMENT))?(?:\s+(UNIQUE|PRIMARY)(?: KEY)?)?~i", $query, $matches)) {
@@ -72,15 +72,15 @@ class SQLParser {
                                                        $columName = strtoupper($matches[1][$i]);
                                                        if ($columName == 'UNIQUE' || $columName == 'KEY' || $columName == 'PRIMARY' || $columName == 'FULLTEXT') continue;
                                                        
-                                                       $column = array('name' => $matches[1][$i]);
+                                                       $column = ['name' => $matches[1][$i]];
                                                        $columnType = strtolower($matches[2][$i]);
-                                                       $column['data'] = array(
+                                                       $column['data'] = [
                                                                'type' => $columnType,
                                                                'notNull' => ((!empty($matches[4][$i]) && strtoupper($matches[4][$i]) == 'NOT NULL') ? true : false),
                                                                'default' => $matches[5][$i],
                                                                'autoIncrement' => (!empty($matches[6][$i]) ? true : false),
                                                                'key' => strtoupper($matches[7][$i])
-                                                       );
+                                                       ];
                                                        if (!empty($matches[3][$i])) {
                                                                if ($columnType == 'enum') $column['data']['values'] = $matches[3][$i];
                                                                else {
@@ -104,7 +104,7 @@ class SQLParser {
                                        // find indices
                                        if (preg_match_all('~(?:\(|,)\s*(?:(?:(?:(UNIQUE|FULLTEXT)(?:\s+(?:INDEX|KEY))?|(?:INDEX|KEY))(?:\s+(\w+))?)|(PRIMARY) KEY)\s+\((\s*\w+\s*(?:,\s*\w+\s*)*)\)~is', $query, $matches)) {
                                                for ($i = 0, $j = count($matches[0]); $i < $j; $i++) {
-                                                       $index = array('name' => $matches[2][$i], 'data' => array());
+                                                       $index = ['name' => $matches[2][$i], 'data' => []];
                                                        $index['data']['type'] = strtoupper((!empty($matches[1][$i]) ? $matches[1][$i] : $matches[3][$i]));
                                                        $index['data']['columns'] = $matches[4][$i];
                                                        $indices[] = $index;
@@ -118,28 +118,28 @@ class SQLParser {
                        case 'ALTER TABLE':
                                // add index
                                if (preg_match('~^ALTER\s+TABLE\s+(\w+)\s+ADD\s+(?:(UNIQUE|FULLTEXT)\s+)?(?:INDEX|KEY)\s+(?:(\w+)\s*)?\((\s*\w+\s*(?:,\s*\w+\s*)*)\)~is', $query, $match)) {
-                                       $this->executeAddIndexStatement($match[1], ($match[3] ?: self::getGenericIndexName($match[1], $match[4])), array('type' => strtoupper($match[2]), 'columns' => $match[4]));
+                                       $this->executeAddIndexStatement($match[1], ($match[3] ?: self::getGenericIndexName($match[1], $match[4])), ['type' => strtoupper($match[2]), 'columns' => $match[4]]);
                                }
                                // add foreign key
                                else if (preg_match('~^ALTER\s+TABLE\s+(\w+)\s+ADD\s+FOREIGN KEY\s+(?:(\w+)\s*)?\((\s*\w+\s*(?:,\s*\w+\s*)*)\)\s+REFERENCES\s+(\w+)\s+\((\s*\w+\s*(?:,\s*\w+\s*)*)\)(?:\s+ON\s+DELETE\s+(CASCADE|SET NULL|NO ACTION))?(?:\s+ON\s+UPDATE\s+(CASCADE|SET NULL|NO ACTION))?~is', $query, $match)) {
-                                       $this->executeAddForeignKeyStatement($match[1], ($match[2] ?: self::getGenericIndexName($match[1], $match[3], 'fk')), array(
+                                       $this->executeAddForeignKeyStatement($match[1], ($match[2] ?: self::getGenericIndexName($match[1], $match[3], 'fk')), [
                                                'columns' => $match[3],
                                                'referencedTable' => $match[4],
                                                'referencedColumns' => $match[5],
                                                'ON DELETE' => isset($match[6]) ? $match[6] : '',
                                                'ON UPDATE' => isset($match[7]) ? $match[7] : ''
-                                       ));
+                                       ]);
                                }
                                // add/change column
                                else if (preg_match("~^ALTER\s+TABLE\s+(\w+)\s+(?:(ADD)\s+(?:COLUMN\s+)?|(CHANGE)\s+(?:COLUMN\s+)?(\w+)\s+)(\w+)\s+(\w+)(?:\s*\((\s*(?:\d+(?:\s*,\s*\d+)?|'[^']*'(?:\s*,\s*'[^']*')*))\s*\))?(?:\s+UNSIGNED)?(?:\s+(NOT NULL|NULL))?(?:\s+DEFAULT\s+(-?\d+.\d+|-?\d+|NULL|'[^'\\\\]*(?:\\\\.[^'\\\\]*)*'))?(?:\s+(AUTO_INCREMENT))?(?:\s+(UNIQUE|PRIMARY)(?: KEY)?)?~is", $query, $match)) {
                                        $columnType = strtolower($match[6]);
-                                       $columnData = array(
+                                       $columnData = [
                                                'type' => $columnType,
                                                'notNull' => ((!empty($match[8]) && strtoupper($match[8]) == 'NOT NULL') ? true : false),
                                                'default' => (isset($match[9]) ? $match[9] : ''),
                                                'autoIncrement' => (!empty($match[10]) ? true : false),
                                                'key' => (!empty($match[11]) ? strtoupper($match[11]) : '')
-                                       );
+                                       ];
                                        if (!empty($match[7])) {
                                                if ($columnType == 'enum') $columnData['values'] = $match[7];
                                                else {
@@ -179,7 +179,7 @@ class SQLParser {
                        
                        case 'CREATE INDEX': 
                                if (preg_match('~^CREATE\s+(?:(UNIQUE|FULLTEXT)\s+)?INDEX\s+(\w+)\s+ON\s+(\w+)\s+\((\s*\w+\s*(?:,\s*\w+\s*)*)\)~is', $query, $match)) {
-                                       $this->executeAddIndexStatement($match[3], ($match[2] ?: self::getGenericIndexName($match[3], $match[4])), array('type' => strtoupper($match[1]), 'columns' => $match[4]));
+                                       $this->executeAddIndexStatement($match[3], ($match[2] ?: self::getGenericIndexName($match[3], $match[4])), ['type' => strtoupper($match[1]), 'columns' => $match[4]]);
                                }
                                else {
                                        throw new SystemException("Unsupported SQL statement '".$query."'");
@@ -220,7 +220,7 @@ class SQLParser {
         * @param       array           $columns
         * @param       array           $indices
         */
-       protected function executeCreateTableStatement($tableName, $columns, $indices = array()) {
+       protected function executeCreateTableStatement($tableName, $columns, $indices = []) {
                WCF::getDB()->getEditor()->createTable($tableName, $columns, $indices);
        }
        
index 872c69f3841de0250e5d80811ccc6d496cdb4b74..d23bc018a24b610c04c6975087fb873a6f8c9acd 100644 (file)
@@ -21,7 +21,7 @@ class EditHistoryManager extends SingletonFactory {
         * list of available object types
         * @var array
         */
-       protected $availableObjectTypes = array();
+       protected $availableObjectTypes = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -67,7 +67,7 @@ class EditHistoryManager extends SingletonFactory {
                                        (objectTypeID, objectID, message, time, obsoletedAt, userID, username, editReason, obsoletedByUserID)
                        VALUES          (?, ?, ?, ?, ?, ?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->getObjectTypeID($objectType), $objectID, $message, $time, TIME_NOW, $userID, $username, $editReason, $obsoletedByUserID));
+               $statement->execute([$this->getObjectTypeID($objectType), $objectID, $message, $time, TIME_NOW, $userID, $username, $editReason, $obsoletedByUserID]);
        }
        
        /**
@@ -85,7 +85,7 @@ class EditHistoryManager extends SingletonFactory {
                $statement = WCF::getDB()->prepareStatement($sql);
                WCF::getDB()->beginTransaction();
                foreach ($objectIDs as $objectID) {
-                       $statement->execute(array($objectTypeID, $objectID));
+                       $statement->execute([$objectTypeID, $objectID]);
                }
                WCF::getDB()->commitTransaction();
        }
@@ -127,9 +127,9 @@ class EditHistoryManager extends SingletonFactory {
                        GROUP BY revertTo.objectTypeID, revertTo.objectID";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute(array_merge(
-                       array(TIME_NOW - $timeframe),
+                       [TIME_NOW - $timeframe],
                        $userIDs,
-                       array(TIME_NOW - $timeframe),
+                       [TIME_NOW - $timeframe],
                        $userIDs
                ));
                
@@ -137,7 +137,7 @@ class EditHistoryManager extends SingletonFactory {
                if (empty($entryIDs)) return;
                
                $list = new EditHistoryEntryList();
-               $list->getConditionBuilder()->add('entryID IN(?)', array($entryIDs));
+               $list->getConditionBuilder()->add('entryID IN(?)', [$entryIDs]);
                $list->readObjects();
                foreach ($list as $entry) {
                        $entry->getObject()->revertVersion($entry);
index cf24bce1b59687e7cb0bb243a2d418d71d58c68c..d1cf312e1875bd701d8ef31ab35efc84f0c76d49 100644 (file)
@@ -160,7 +160,7 @@ class EventHandler extends SingletonFactory {
         * @param       array           &$parameters
         * @throws      SystemException
         */
-       public function fireAction($eventObj, $eventName, array &$parameters = array()) {
+       public function fireAction($eventObj, $eventName, array &$parameters = []) {
                // get class name
                if (is_object($eventObj)) $className = get_class($eventObj);
                else $className = $eventObj;
index 36713763d4b38a31f9bd4c6bc926fd4720d3b3e7..57e240feacce8c97ac9e56a8aae0af7fd507f899 100644 (file)
@@ -28,22 +28,22 @@ class SessionAccessLogListener implements IParameterizedEventListener {
                                WHERE   sessionID = ?
                                        AND lastActivityTime >= ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                WCF::getSession()->sessionID,
                                (TIME_NOW - SESSION_TIMEOUT)
-                       ));
+                       ]);
                        $row = $statement->fetchArray();
                        if (!empty($row['sessionLogID'])) {
                                $sessionLogID = $row['sessionLogID'];
                                
-                               $sessionLogEditor = new ACPSessionLogEditor(new ACPSessionLog(null, array('sessionLogID' => $sessionLogID)));
-                               $sessionLogEditor->update(array(
+                               $sessionLogEditor = new ACPSessionLogEditor(new ACPSessionLog(null, ['sessionLogID' => $sessionLogID]));
+                               $sessionLogEditor->update([
                                        'lastActivityTime' => TIME_NOW
-                               ));
+                               ]);
                        }
                        else {
                                // create new session log
-                               $sessionLog = ACPSessionLogEditor::create(array(
+                               $sessionLog = ACPSessionLogEditor::create([
                                        'sessionID' => WCF::getSession()->sessionID,
                                        'userID' => WCF::getUser()->userID,
                                        'ipAddress' => UserUtil::getIpAddress(),
@@ -51,7 +51,7 @@ class SessionAccessLogListener implements IParameterizedEventListener {
                                        'userAgent' => WCF::getSession()->userAgent,
                                        'time' => TIME_NOW,
                                        'lastActivityTime' => TIME_NOW
-                               ));
+                               ]);
                                $sessionLogID = $sessionLog->sessionLogID;
                        }
                        
@@ -64,14 +64,14 @@ class SessionAccessLogListener implements IParameterizedEventListener {
                        $requestURI = preg_replace('/(?:\?|&)s=[a-f0-9]{40}/', '', $requestURI);
                        
                        // save access
-                       ACPSessionAccessLogEditor::create(array(
+                       ACPSessionAccessLogEditor::create([
                                'sessionLogID' => $sessionLogID,
                                'ipAddress' => UserUtil::getIpAddress(),
                                'time' => TIME_NOW,
                                'requestURI' => $requestURI,
                                'requestMethod' => WCF::getSession()->requestMethod,
                                'className' => get_class($eventObj)
-                       ));
+                       ]);
                }
        }
 }
index 88f5b9c69058dadba671cf3486c3326a0ed47cc2..fe3fbcf792f345206ddc351fb0500aece621ea29 100644 (file)
@@ -59,14 +59,14 @@ class AJAXException extends LoggedException {
         * @param       mixed[]         $returnValues
         * @param       string          $exceptionID
         */
-       public function __construct($message, $errorType = self::INTERNAL_ERROR, $stacktrace = null, $returnValues = array(), $exceptionID = '') {
+       public function __construct($message, $errorType = self::INTERNAL_ERROR, $stacktrace = null, $returnValues = [], $exceptionID = '') {
                if ($stacktrace === null) $stacktrace = $this->getTraceAsString();
                
-               $responseData = array(
+               $responseData = [
                        'code' => $errorType,
                        'message' => $message,
                        'returnValues' => $returnValues
-               );
+               ];
                
                // include a stacktrace if:
                // - debug mode is enabled
index 0ae316833e2c42080e63f861acf289d3e0dd7942..da3f3f4b14bfc24b4bfe253d0e775024e2d3f7cf 100644 (file)
@@ -17,7 +17,7 @@ class NamedUserException extends UserException {
         * Shows a styled page with the given error message.
         */
        public function show() {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'name' => get_class($this),
                        'file' => $this->getFile(),
                        'line' => $this->getLine(),
@@ -25,7 +25,7 @@ class NamedUserException extends UserException {
                        'stacktrace' => $this->getTraceAsString(),
                        'templateName' => 'userException',
                        'templateNameApplication' => 'wcf'
-               ));
+               ]);
                WCF::getTPL()->display('userException');
        }
 }
index 012984c36f1ce0a195b35e19cda199a02147595e..be61596f2de7ef71a4df19473dee1377477730dd 100644 (file)
@@ -27,14 +27,14 @@ class PermissionDeniedException extends UserException {
        public function show() {
                @header('HTTP/1.0 403 Forbidden');
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'name' => get_class($this),
                        'file' => $this->getFile(),
                        'line' => $this->getLine(),
                        'stacktrace' => $this->getTraceAsString(),
                        'templateName' => 'permissionDenied',
                        'templateNameApplication' => 'wcf'
-               ));
+               ]);
                WCF::getTPL()->display('permissionDenied');
        }
 }
index 72216eef25d445da3d230e2ce3eb7288e0fe288b..ba1145575b0331ba34e7fcc920a41a4dd8caa8f0 100644 (file)
@@ -28,7 +28,7 @@ class UserInputException extends UserException {
         * variables for AJAX error handling
         * @var array
         */
-       protected $variables = array();
+       protected $variables = [];
        
        /**
         * Creates a new UserInputException.
@@ -37,7 +37,7 @@ class UserInputException extends UserException {
         * @param       string          $type           kind of this error
         * @param       array           $variables      additional variables for AJAX error handling
         */
-       public function __construct($field = '', $type = 'empty', array $variables = array()) {
+       public function __construct($field = '', $type = 'empty', array $variables = []) {
                $this->field = $field;
                $this->type = $type;
                $this->variables = $variables;
index 9e58f4b2febf57febe3eb7694bcbc3aa3f2b216d..053ea0bf2011671dffb214da882101d6f02887b2 100644 (file)
@@ -28,7 +28,7 @@ class ValidateActionException extends \Exception {
        /**
         * @see \Exception::__construct()
         */
-       public function __construct($fieldName, $errorMessage = 'empty', array $variables = array()) {
+       public function __construct($fieldName, $errorMessage = 'empty', array $variables = []) {
                $this->errorMessage = $errorMessage;
                if (mb_strpos($this->errorMessage, '.') === false) {
                        $this->errorMessage = WCF::getLanguage()->get('wcf.global.form.error.'.$this->errorMessage);
@@ -38,7 +38,7 @@ class ValidateActionException extends \Exception {
                }
                
                $this->fieldName = $fieldName;
-               $this->message = WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.invalidParameter', array('fieldName' => $this->fieldName));
+               $this->message = WCF::getLanguage()->getDynamicVariable('wcf.ajax.error.invalidParameter', ['fieldName' => $this->fieldName]);
        }
        
        /**
index 7093d15c4ae242b241718c728da6d1914305b1d3..71d2983a8c9e68fdaf83d39f47b97134afc6a38f 100644 (file)
@@ -19,7 +19,7 @@ abstract class AbstractExporter implements IExporter {
         * additional data
         * @var array
         */
-       public $additionalData = array();
+       public $additionalData = [];
        
        /**
         * database host name
@@ -67,13 +67,13 @@ abstract class AbstractExporter implements IExporter {
         * object type => method names
         * @var array
         */
-       protected $methods = array();
+       protected $methods = [];
        
        /**
         * limits for items per run
         * @var integer[]
         */
-       protected $limits = array();
+       protected $limits = [];
        
        /**
         * default limit for items per run
@@ -85,7 +85,7 @@ abstract class AbstractExporter implements IExporter {
         * selected import data
         * @var array
         */
-       protected $selectedData = array();
+       protected $selectedData = [];
        
        /**
         * @see \wcf\system\exporter\IExporter::setData()
@@ -137,7 +137,7 @@ abstract class AbstractExporter implements IExporter {
                        throw new SystemException("unknown object type '".$objectType."' given");
                }
                
-               $count = call_user_func(array($this, 'count'.$this->methods[$objectType]));
+               $count = call_user_func([$this, 'count'.$this->methods[$objectType]]);
                $limit = (isset($this->limits[$objectType]) ? $this->limits[$objectType] : $this->defaultLimit);
                return ceil($count / $limit);
        }
@@ -151,7 +151,7 @@ abstract class AbstractExporter implements IExporter {
                }
                
                $limit = (isset($this->limits[$objectType]) ? $this->limits[$objectType] : $this->defaultLimit);
-               call_user_func(array($this, 'export'.$this->methods[$objectType]), $loopCount * $limit, $limit);
+               call_user_func([$this, 'export'.$this->methods[$objectType]], $loopCount * $limit, $limit);
        }
        
        /**
index 4320d1ee530a0671e756520723d76c8d201e5a0f..dd5d3b431ef3f75242e8d07573697deb4dd27607 100644 (file)
@@ -17,7 +17,7 @@ class FormDocument {
         * list of FormElementContainer objects
         * @var IFormElementContainer[]
         */
-       protected $containers = array();
+       protected $containers = [];
        
        /**
         * form document name
@@ -106,7 +106,7 @@ class FormDocument {
         * Handles request input variables.
         */
        public function handleRequest() {
-               $variables = array();
+               $variables = [];
                
                foreach ($_REQUEST as $key => $value) {
                        if (mb_strpos($key, $this->getName().'_') !== false) {
index 00faca30237794f5f767e6451b9265683be6d274..2153b0f63e9b9a129e1f299b4d952804cb40c415 100644 (file)
@@ -20,7 +20,7 @@ abstract class AbstractFormElementContainer implements IFormElementContainer {
         * list of IFormElement objects
         * @var IFormElement[]
         */
-       protected $children = array();
+       protected $children = [];
        
        /**
         * element description or help text
index a2356917298b53f2222f753244112caa8c288dc4..5e9b07ba87e84e88eb175c3e92bf9511207c5e8d 100644 (file)
@@ -16,7 +16,7 @@ class MultipleSelectionFormElementContainer extends SelectionFormElementContaine
         * container value
         * @var array
         */
-       protected $value = array();
+       protected $value = [];
        
        /**
         * Sets container value.
index 84c0a139c74d3e46e816265d12856d123a8a4de8..d22339eff38548977058cd79c4fa66dbf0119e62 100644 (file)
@@ -26,7 +26,7 @@ class MultipleSelectionFormElement extends AbstractNamedFormElement {
                        parent::setValue($value);
                }
                else {
-                       $this->value = array_map(array('wcf\util\StringUtil', 'trim'), $value);
+                       $this->value = array_map(['wcf\util\StringUtil', 'trim'], $value);
                }
        }
        
index a9758fb2e10300c822f7561f332aa54b77c341e9..8d9aadb1c6e0faf2dc706e121957fd2b09de021a 100644 (file)
@@ -19,10 +19,10 @@ class ImageHandler extends SingletonFactory {
         * list of valid image adapters.
         * @var string[]
         */
-       protected $imageAdapters = array(
+       protected $imageAdapters = [
                'gd' => 'wcf\system\image\adapter\GDImageAdapter',
                'imagick' => 'wcf\system\image\adapter\ImagickImageAdapter'
-       );
+       ];
        
        /**
         * image adapter class name
@@ -39,7 +39,7 @@ class ImageHandler extends SingletonFactory {
                }
                
                $imageAdapter = $this->imageAdapters[IMAGE_ADAPTER_TYPE];
-               $isSupported = call_user_func(array($imageAdapter, 'isSupported'));
+               $isSupported = call_user_func([$imageAdapter, 'isSupported']);
                
                // fallback to GD if image adapter is not available
                if (!$isSupported) {
index 0dd5006adf259aed6fae9c0bd985da827c54f3d8..06a224efe244e59af12200ea53622d481135a5c5 100644 (file)
@@ -24,7 +24,7 @@ class GDImageAdapter implements IImageAdapter {
         * red, green, blue data of the active color
         * @var array
         */
-       protected $colorData = array();
+       protected $colorData = [];
        
        /**
         * image height
@@ -280,11 +280,11 @@ class GDImageAdapter implements IImageAdapter {
                $this->color = imagecolorallocate($this->image, $red, $green, $blue);
                
                // save data of the color
-               $this->colorData = array(
+               $this->colorData = [
                        'red' => $red,
                        'green' => $green,
                        'blue' => $blue
-               );
+               ];
        }
        
        /**
index 59a7ab5d02dad77eb44c4abdcb73cd97bfa80ded..95c420f533d54938cad6a581b3733b9536219c99 100644 (file)
@@ -23,7 +23,7 @@ class ImageAdapter implements IImageAdapter {
         * supported relative positions
         * @var string[]
         */
-       protected $relativePositions = array(
+       protected $relativePositions = [
                'topLeft',
                'topCenter',
                'topRight',
@@ -33,7 +33,7 @@ class ImageAdapter implements IImageAdapter {
                'bottomLeft',
                'bottomCenter',
                'bottomRight'
-       );
+       ];
        
        /**
         * Creates a new ImageAdapter instance.
index 5c81f854eb6c6dacbf22de3215a47db7a645f4dd..3b1421303e0bf9ad0388a3c139e04aa2b574b1e7 100644 (file)
@@ -29,7 +29,7 @@ class AbstractACLImporter extends AbstractImporter {
         * available options
         * @var array
         */
-       protected $options = array();
+       protected $options = [];
        
        /**
         * Creates an AbstractACLImporter object.
@@ -40,7 +40,7 @@ class AbstractACLImporter extends AbstractImporter {
                        FROM    wcf".WCF_N."_acl_option
                        WHERE   objectTypeID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->objectTypeID));
+               $statement->execute([$this->objectTypeID]);
                while ($row = $statement->fetchArray()) {
                        $this->options[$row['optionName']] = $row['optionID'];
                }
@@ -49,7 +49,7 @@ class AbstractACLImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                if (!isset($this->options[$additionalData['optionName']])) return 0;
                $data['optionID'] = $this->options[$additionalData['optionName']];
                
@@ -64,7 +64,7 @@ class AbstractACLImporter extends AbstractImporter {
                                                        (optionID, objectID, groupID, optionValue)
                                VALUES                  (?, ?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($data['optionID'], $data['objectID'], $data['groupID'], $data['optionValue']));
+                       $statement->execute([$data['optionID'], $data['objectID'], $data['groupID'], $data['optionValue']]);
                        
                        return 1;
                }
@@ -76,7 +76,7 @@ class AbstractACLImporter extends AbstractImporter {
                                                        (optionID, objectID, userID, optionValue)
                                VALUES                  (?, ?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($data['optionID'], $data['objectID'], $data['userID'], $data['optionValue']));
+                       $statement->execute([$data['optionID'], $data['objectID'], $data['userID'], $data['optionValue']]);
                                
                        return 1;
                }
index 53735052dbd0d1a816eefd3ba38c825d972957e5..d39fd65cae85afdafc06bf9ff1858a7f833144b9 100644 (file)
@@ -29,7 +29,7 @@ class AbstractAttachmentImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                // check file location
                if (!@file_exists($additionalData['fileLocation'])) return 0;
                
@@ -55,7 +55,7 @@ class AbstractAttachmentImporter extends AbstractImporter {
                }
                
                // save attachment
-               $attachment = AttachmentEditor::create(array_merge($data, array('objectTypeID' => $this->objectTypeID)));
+               $attachment = AttachmentEditor::create(array_merge($data, ['objectTypeID' => $this->objectTypeID]));
                
                // check attachment directory
                // and create subdirectory if necessary
index 76ed8b997f01f2704f81eeced9c151c90b025da4..265854b4d2e7f40a0f1c824ea76bfe0a0c79edf2 100644 (file)
@@ -33,10 +33,10 @@ class AbstractCategoryImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                if (!empty($data['parentCategoryID'])) $data['parentCategoryID'] = ImportHandler::getInstance()->getNewID($this->objectTypeName, $data['parentCategoryID']);
                
-               $category = CategoryEditor::create(array_merge($data, array('objectTypeID' => $this->objectTypeID)));
+               $category = CategoryEditor::create(array_merge($data, ['objectTypeID' => $this->objectTypeID]));
                
                ImportHandler::getInstance()->saveNewID($this->objectTypeName, $oldID, $category->categoryID);
                
index 5df90e5a90a4bdd6143298e483cb147d2dc969ef..1aba5c62e0359e095213cc945dd9bed4246690ea 100644 (file)
@@ -33,10 +33,10 @@ class AbstractCommentImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                
-               $comment = CommentEditor::create(array_merge($data, array('objectTypeID' => $this->objectTypeID)));
+               $comment = CommentEditor::create(array_merge($data, ['objectTypeID' => $this->objectTypeID]));
                
                ImportHandler::getInstance()->saveNewID($this->objectTypeName, $oldID, $comment->commentID);
                
index 87a704311c02687b3acb54ed86bb0fa1b4b0085b..0ed33eeb2534271b88b493ba0078bb414da7bd9a 100644 (file)
@@ -28,7 +28,7 @@ class AbstractCommentResponseImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                
                $data['commentID'] = ImportHandler::getInstance()->getNewID($this->objectTypeName, $data['commentID']);
@@ -41,7 +41,7 @@ class AbstractCommentResponseImporter extends AbstractImporter {
                        WHERE           commentID = ?
                        ORDER BY        time ASC, responseID ASC";
                $statement = WCF::getDB()->prepareStatement($sql, 5);
-               $statement->execute(array($response->commentID));
+               $statement->execute([$response->commentID]);
                $responseIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                // update parent comment
@@ -50,10 +50,10 @@ class AbstractCommentResponseImporter extends AbstractImporter {
                                responses = responses + 1
                        WHERE   commentID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        serialize($responseIDs),
                        $response->commentID
-               ));
+               ]);
                
                return $response->responseID;
        }
index 8bd3d13da936b0735f2754ec03dad0f3788c8dab..30e355537c7fe4ff04291f642eecac833de5fbe8 100644 (file)
@@ -27,7 +27,7 @@ class AbstractLikeImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                if ($data['objectUserID']) $data['objectUserID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['objectUserID']);
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                if (!$data['userID']) return 0;
@@ -37,14 +37,14 @@ class AbstractLikeImporter extends AbstractImporter {
                                                (objectID, objectTypeID, objectUserID, userID, time, likeValue)
                        VALUES                  (?, ?, ?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $data['objectID'],
                        $this->objectTypeID,
                        $data['objectUserID'],
                        $data['userID'],
                        $data['time'],
                        $data['likeValue']
-               ));
+               ]);
                
                return 0;
        }
index 26d7cdb2929d759fc581633f7c8aa3a75716439f..625ce7028f351f6ae691f6f9981d3783fb283e02 100644 (file)
@@ -33,8 +33,8 @@ class AbstractPollImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
-               $poll = PollEditor::create(array_merge($data, array('objectTypeID' => $this->objectTypeID)));
+       public function import($oldID, array $data, array $additionalData = []) {
+               $poll = PollEditor::create(array_merge($data, ['objectTypeID' => $this->objectTypeID]));
                
                ImportHandler::getInstance()->saveNewID($this->objectTypeName, $oldID, $poll->pollID);
                
index 48c6126a1d735afaef1bcbfc7cfa1cb7a7618736..71666c8427d847d09b126e3a40942b28ffff37d2 100644 (file)
@@ -33,7 +33,7 @@ class AbstractPollOptionImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['pollID'] = ImportHandler::getInstance()->getNewID($this->pollObjectTypeName, $data['pollID']);
                if (!$data['pollID']) return 0;
                
index b5cd8aae468062db861f2eec651ce613b3de1e02..b43e5369bb4faa1aeb58e4b1cb30f4208d402ac9 100644 (file)
@@ -28,7 +28,7 @@ class AbstractPollOptionVoteImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                if (!$data['userID']) return 0;
                
@@ -42,7 +42,7 @@ class AbstractPollOptionVoteImporter extends AbstractImporter {
                                                (pollID, optionID, userID)
                        VALUES                  (?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($data['pollID'], $data['optionID'], $data['userID']));
+               $statement->execute([$data['pollID'], $data['optionID'], $data['userID']]);
                
                return 1;
        }
index da014ca5c200b81b528e46df2862b06f495154ba..723ee8d341e3539512ee9c6148934dd5bee35281 100644 (file)
@@ -28,12 +28,12 @@ class AbstractWatchedObjectImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                if (!$data['userID']) return 0;
                
                try {
-                       $watch = UserObjectWatchEditor::create(array_merge($data, array('objectTypeID' => $this->objectTypeID)));
+                       $watch = UserObjectWatchEditor::create(array_merge($data, ['objectTypeID' => $this->objectTypeID]));
                        return $watch->watchID;
                }
                catch (DatabaseException $e) {
index 077be93a74f1d78d4bfc1d8f37805fad2419c45d..1a4d851df374e8ca7b532316e7a8325de0f068ed 100644 (file)
@@ -20,7 +20,7 @@ interface IImporter {
         * @param       array           $additionalData
         * @return      mixed           new id
         */
-       public function import($oldID, array $data, array $additionalData = array());
+       public function import($oldID, array $data, array $additionalData = []);
        
        /**
         * Returns database object class name.
index e7864512f7744c883d11a522b9d6b857860f885e..9631aaac45b6f416d1f3b92a3a6c933693cd6bb7 100644 (file)
@@ -23,19 +23,19 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction {
         * id map cache
         * @var array
         */
-       protected $idMappingCache = array();
+       protected $idMappingCache = [];
        
        /**
         * list of available importers
         * @var array
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * list of available importer processors
         * @var array
         */
-       protected $importers = array();
+       protected $importers = [];
        
        /**
         * user merge mode
@@ -53,7 +53,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction {
         * list of methods allowed for remote invoke
         * @var string[]
         */
-       public static $allowInvoke = array('resetMapping');
+       public static $allowInvoke = ['resetMapping'];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -97,8 +97,8 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction {
                        $importer = $this->getImporter($type);
                        $tableName = $indexName = '';
                        if ($importer->getClassName()) {
-                               $tableName = call_user_func(array($importer->getClassName(), 'getDatabaseTableName'));
-                               $indexName = call_user_func(array($importer->getClassName(), 'getDatabaseTableIndexName'));
+                               $tableName = call_user_func([$importer->getClassName(), 'getDatabaseTableName']);
+                               $indexName = call_user_func([$importer->getClassName(), 'getDatabaseTableIndexName']);
                        }
                        
                        $sql = "SELECT          import_mapping.newID
@@ -109,7 +109,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction {
                                                AND import_mapping.oldID = ?
                                                ".($tableName ? "AND object_table.".$indexName." IS NOT NULL" : '');
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->importHash, $objectTypeID, $oldID));
+                       $statement->execute([$this->importHash, $objectTypeID, $oldID]);
                        $row = $statement->fetchArray();
                        if ($row !== false) $this->idMappingCache[$objectTypeID][$oldID] = $row['newID'];
                }
@@ -131,7 +131,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction {
                                                (importHash, objectTypeID, oldID, newID)
                        VALUES                  (?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->importHash, $objectTypeID, $oldID, $newID));
+               $statement->execute([$this->importHash, $objectTypeID, $oldID, $newID]);
                
                unset($this->idMappingCache[$objectTypeID][$oldID]);
        }
@@ -140,7 +140,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction {
         * Validates accessibility of resetMapping().
         */
        public function validateResetMapping() {
-               WCF::getSession()->checkPermissions(array('admin.management.canImportData'));
+               WCF::getSession()->checkPermissions(['admin.management.canImportData']);
                
                // reset caches
                CacheHandler::getInstance()->flushAll();
@@ -155,7 +155,7 @@ class ImportHandler extends SingletonFactory implements IAJAXInvokeAction {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute();
                
-               $this->idMappingCache = array();
+               $this->idMappingCache = [];
        }
        
        /**
index e0d2bdd3592a8e19205e57e7d3a3d72a6c6d4939..edc451905f3efbd88ba7cb7f60ee47b7b681826b 100644 (file)
@@ -22,7 +22,7 @@ class LabelGroupImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                // save label group
                $labelGroup = LabelGroupEditor::create($data);
                
@@ -35,7 +35,7 @@ class LabelGroupImporter extends AbstractImporter {
                        
                        foreach ($additionalData['objects'] as $objectTypeID => $objectIDs) {
                                foreach ($objectIDs as $objectID) {
-                                       $statement->execute(array($labelGroup->groupID, $objectTypeID, $objectID));
+                                       $statement->execute([$labelGroup->groupID, $objectTypeID, $objectID]);
                                }
                        }
                }
index 25ee148993024280a32890785ea4d4b3f201d558..2cdd1bbbcb5b2389ae20834168949946629018c4 100644 (file)
@@ -21,7 +21,7 @@ class LabelImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['groupID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.label.group', $data['groupID']);
                if (!$data['groupID']) return 0;
                
index 4587454b15708e0dd30fb002beb1c87af78b7158..90ed222aab5fbcba90a5f4fbe0161ee33aae6b69 100644 (file)
@@ -25,7 +25,7 @@ class SmileyImporter extends AbstractImporter {
         * 
         * @var string[]
         */
-       public $knownCodes = array();
+       public $knownCodes = [];
        
        /**
         * Reads out known smiley codes.
@@ -37,7 +37,7 @@ class SmileyImporter extends AbstractImporter {
                $statement->execute();
                
                while ($row = $statement->fetchArray()) {
-                       $known = array();
+                       $known = [];
                        if (!empty($row['aliases'])) {
                                $known = explode("\n", $row['aliases']);
                        }
@@ -52,7 +52,7 @@ class SmileyImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                // copy smiley
                $data['smileyPath'] = 'images/smilies/'.basename($additionalData['fileLocation']);
                if (!@copy($additionalData['fileLocation'], WCF_DIR.$data['smileyPath'])) return 0;
@@ -64,7 +64,7 @@ class SmileyImporter extends AbstractImporter {
                if (!isset($data['aliases'])) $data['aliases'] = '';
                
                // check aliases
-               $aliases = array();
+               $aliases = [];
                if (!empty($data['aliases'])) {
                        $aliases = explode("\n", StringUtil::unifyNewlines($data['aliases']));
                        foreach ($aliases as $key => $alias) {
index 02e25cdbca67595b89b82f096de67761bf6b3e40..c37be1f20399a0b630ff62eefd81189d2e2164dc 100644 (file)
@@ -25,7 +25,7 @@ class UserAvatarImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                // check file location
                if (!@file_exists($additionalData['fileLocation'])) return 0;
                
@@ -64,7 +64,7 @@ class UserAvatarImporter extends AbstractImporter {
                        }
                        
                        // create thumbnails
-                       $action = new UserAvatarAction(array($avatar), 'generateThumbnails');
+                       $action = new UserAvatarAction([$avatar], 'generateThumbnails');
                        $action->executeAction();
                        
                        // update owner
@@ -72,7 +72,7 @@ class UserAvatarImporter extends AbstractImporter {
                                SET     avatarID = ?
                                WHERE   userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($avatar->avatarID, $data['userID']));
+                       $statement->execute([$avatar->avatarID, $data['userID']]);
                        
                        return $avatar->avatarID;
                }
index f1911bcd9115cc4bef980f2aa91de1f2392099fc..0fe34f27783e495db862b59afe05a24c0fbf61a1 100644 (file)
@@ -29,7 +29,7 @@ class UserCommentImporter extends AbstractCommentImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['objectID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['objectID']);
                if (!$data['objectID']) return 0;
                
index 2064c2b9fff2bb6faabc4ad4d2c74cfc925c4e48..fed01edb69d6f9c058e3117fb79f69e3e991648f 100644 (file)
@@ -21,7 +21,7 @@ class UserFollowerImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['userID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['userID']);
                $data['followUserID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user', $data['followUserID']);
                if (!$data['userID'] || !$data['followUserID']) return 0;
@@ -32,11 +32,11 @@ class UserFollowerImporter extends AbstractImporter {
                                                (userID, followUserID, time)
                        VALUES                  (?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $data['userID'],
                        $data['followUserID'],
                        $data['time']
-               ));
+               ]);
                
                return WCF::getDB()->getInsertID('wcf'.WCF_N.'_user_follow', 'followID');
        }
index c49cd52585f9d9fce556e0c443a00f8641dd681c..ffebbc139904b66e72632c93cfc1fc22c1d51067 100644 (file)
@@ -22,14 +22,14 @@ class UserGroupImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                if ($data['groupType'] < 4) {
                        $newGroupID = UserGroup::getGroupByType($data['groupType'])->groupID;
                }
                else {
-                       $action = new UserGroupAction(array(), 'create', array(
+                       $action = new UserGroupAction([], 'create', [
                                'data' => $data
-                       ));
+                       ]);
                        $returnValues = $action->executeAction();
                        $newGroupID = $returnValues['returnValues']->groupID;
                }
index 36cc858c9cba8d04418e809d6bc553d2b0c6d04f..244c2aaae627d1cf084598d35c36d282012f3e7a 100644 (file)
@@ -28,13 +28,13 @@ class UserImporter extends AbstractImporter {
         * ids of default notification events
         * @var integer[]
         */
-       protected $eventIDs = array();
+       protected $eventIDs = [];
        
        /**
         * list of user options
         * @var UserOption[]
         */
-       protected $userOptions = array();
+       protected $userOptions = [];
        
        const MERGE_MODE_EMAIL = 4;
        const MERGE_MODE_USERNAME_OR_EMAIL = 5;
@@ -48,7 +48,7 @@ class UserImporter extends AbstractImporter {
                        FROM    wcf".WCF_N."_user_notification_event
                        WHERE   preset = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(1));
+               $statement->execute([1]);
                $this->eventIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                $userOptionList = new UserOptionList();
@@ -59,7 +59,7 @@ class UserImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                // whether to perform a merge
                $performMerge = false;
                
@@ -103,7 +103,7 @@ class UserImporter extends AbstractImporter {
                }
                
                // handle user options
-               $userOptions = array();
+               $userOptions = [];
                if (isset($additionalData['options'])) {
                        foreach ($additionalData['options'] as $optionName => $optionValue) {
                                if (is_int($optionName)) $optionID = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user.option', $optionName);
@@ -146,7 +146,7 @@ class UserImporter extends AbstractImporter {
                        }
                }
                
-               $languageIDs = array();
+               $languageIDs = [];
                if (isset($additionalData['languages'])) {
                        foreach ($additionalData['languages'] as $languageCode) {
                                $language = LanguageFactory::getInstance()->getLanguageByCode($languageCode);
@@ -168,7 +168,7 @@ class UserImporter extends AbstractImporter {
                $userEditor->updateUserOptions($userOptions);
                
                // save user groups
-               $groupIDs = array();
+               $groupIDs = [];
                if (isset($additionalData['groupIDs'])) {
                        foreach ($additionalData['groupIDs'] as $oldGroupID) {
                                $newGroupID = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user.group', $oldGroupID);
@@ -176,8 +176,8 @@ class UserImporter extends AbstractImporter {
                        }
                }
                
-               if (!$user->activationCode) $defaultGroupIDs = UserGroup::getGroupIDsByType(array(UserGroup::EVERYONE, UserGroup::USERS));
-               else $defaultGroupIDs = UserGroup::getGroupIDsByType(array(UserGroup::EVERYONE, UserGroup::GUESTS));
+               if (!$user->activationCode) $defaultGroupIDs = UserGroup::getGroupIDsByType([UserGroup::EVERYONE, UserGroup::USERS]);
+               else $defaultGroupIDs = UserGroup::getGroupIDsByType([UserGroup::EVERYONE, UserGroup::GUESTS]);
                
                $groupIDs = array_merge($groupIDs, $defaultGroupIDs);
                $sql = "INSERT IGNORE INTO      wcf".WCF_N."_user_to_group
@@ -185,10 +185,10 @@ class UserImporter extends AbstractImporter {
                        VALUES                  (?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($groupIDs as $groupID) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $user->userID,
                                $groupID
-                       ));
+                       ]);
                }
                
                // save languages
@@ -197,10 +197,10 @@ class UserImporter extends AbstractImporter {
                        VALUES                  (?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($languageIDs as $languageID) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $user->userID,
                                $languageID
-                       ));
+                       ]);
                }
                
                // save default user events
@@ -209,10 +209,10 @@ class UserImporter extends AbstractImporter {
                        VALUES                  (?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($this->eventIDs as $eventID) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $user->userID,
                                $eventID
-                       ));
+                       ]);
                }
                
                // save mapping
@@ -238,7 +238,7 @@ class UserImporter extends AbstractImporter {
                                FROM    wcf".WCF_N."_user
                                WHERE   username = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($newUsername));
+                       $statement->execute([$newUsername]);
                        $row = $statement->fetchArray();
                        if (empty($row['userID'])) break;
                }
index 0e8fcf42db507e8f88a38541baff98e386a49a51..8b2f504b3375f4a5005310c17da68b3118ba79e0 100644 (file)
@@ -45,7 +45,7 @@ class UserOptionImporter extends AbstractImporter {
                        FROM    wcf".WCF_N."_language_category
                        WHERE   languageCategory = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array('wcf.user.option'));
+               $statement->execute(['wcf.user.option']);
                $row = $statement->fetchArray();
                $this->languageCategoryID = $row['languageCategoryID'];
        }
@@ -53,7 +53,7 @@ class UserOptionImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['packageID'] = 1;
                // set temporary option name
                $data['optionName'] = StringUtil::getRandomID();
@@ -68,29 +68,29 @@ class UserOptionImporter extends AbstractImporter {
                $this->createCategory($data['categoryName']);
                
                // save option
-               $action = new UserOptionAction(array(), 'create', array('data' => $data));
+               $action = new UserOptionAction([], 'create', ['data' => $data]);
                $returnValues = $action->executeAction();
                $userOption = $returnValues['returnValues'];
                
                // update generic option name
                $editor = new UserOptionEditor($userOption);
-               $editor->update(array(
+               $editor->update([
                        'optionName' => 'option'.$userOption->optionID
-               ));
+               ]);
                
                // save name
                $sql = "INSERT IGNORE INTO      wcf".WCF_N."_language_item
                                                (languageID, languageItem, languageItemValue, languageItemOriginIsSystem, languageCategoryID, packageID)
                        VALUES                  (?, ?, ?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        LanguageFactory::getInstance()->getDefaultLanguageID(),
                        'wcf.user.option.option'.$userOption->optionID,
                        $additionalData['name'],
                        0,
                        $this->languageCategoryID,
                        1
-               ));
+               ]);
                
                ImportHandler::getInstance()->saveNewID('com.woltlab.wcf.user.option', $oldID, $userOption->optionID);
                
@@ -106,18 +106,18 @@ class UserOptionImporter extends AbstractImporter {
                if ($this->categoryCache === null) {
                        // get existing categories
                        $list = new UserOptionCategoryList();
-                       $list->getConditionBuilder()->add('categoryName = ? OR parentCategoryName = ?', array('profile', 'profile'));
+                       $list->getConditionBuilder()->add('categoryName = ? OR parentCategoryName = ?', ['profile', 'profile']);
                        $list->readObjects();
                        foreach ($list->getObjects() as $category) $this->categoryCache[] = $category->categoryName;
                }
                
                if (!in_array($name, $this->categoryCache)) {
                        // create category
-                       UserOptionCategoryEditor::create(array(
+                       UserOptionCategoryEditor::create([
                                'packageID' => 1,
                                'categoryName' => $name,
                                'parentCategoryName' => 'profile'
-                       ));
+                       ]);
                        
                        $this->categoryCache[] = $name;
                }
index c42db78419c75919173677dc9dd72afe3a7b32da..cd0579a7d09c01dd10bfb697409546920ca75ab7 100644 (file)
@@ -22,7 +22,7 @@ class UserRankImporter extends AbstractImporter {
        /**
         * @see \wcf\system\importer\IImporter::import()
         */
-       public function import($oldID, array $data, array $additionalData = array()) {
+       public function import($oldID, array $data, array $additionalData = []) {
                $data['groupID'] = ImportHandler::getInstance()->getNewID('com.woltlab.wcf.user.group', $data['groupID']);
                if (!$data['groupID']) $data['groupID'] = UserGroup::getGroupByType(UserGroup::USERS)->groupID;
                
index 9db9a4e57b5144fa19ba6f4dc6e30cc3409868cf..71f89da3249a45007c980a70cdcef285db27bef1 100644 (file)
@@ -44,7 +44,7 @@ class File {
         * @param       array           $options
         * @throws      SystemException
         */
-       public function __construct($filename, $mode = 'wb', $options = array()) {
+       public function __construct($filename, $mode = 'wb', $options = []) {
                $this->filename = $filename;
                if (!empty($options)) {
                        $context = stream_context_create($options);
index 92e34c275f73ea3e0806148e36bdb2bc3efa33f2..ea6153432a8fcc6b121de092434cf09552b72b3d 100644 (file)
@@ -52,7 +52,7 @@ class RemoteFile extends File {
         * @param       array           $options
         * @throws      SystemException
         */
-       public function __construct($host, $port, $timeout = 30, $options = array()) {
+       public function __construct($host, $port, $timeout = 30, $options = []) {
                $this->host = $host;
                $this->port = $port;
                
index 70c5add8e06894311ce1eb8b57af0f5ca3ae7fe9..27838312374163cdfb2f8b1a989515ef50afc9bc 100644 (file)
@@ -32,7 +32,7 @@ class Tar implements IArchive {
         * content of the tar file
         * @var array
         */
-       protected $contentList = array();
+       protected $contentList = [];
        
        /**
         * indicates if tar file is opened
@@ -245,7 +245,7 @@ class Tar implements IArchive {
         * This does not get the entire to memory but only parts of it.
         */
        protected function readContent() {
-               $this->contentList = array();
+               $this->contentList = [];
                $this->read = true;
                $i = 0;
                
@@ -293,7 +293,7 @@ class Tar implements IArchive {
                        return false;
                }
                
-               $header = array();
+               $header = [];
                $checksum = 0;
                // First part of the header
                for ($i = 0; $i < 148; $i++) {
index ac218a69d6357dfb2c2673ad279c7c317395c335..b8fac1bee739ce599112d5512c3f74058433c4dd 100644 (file)
@@ -88,7 +88,7 @@ class TarWriter extends Tar {
         * @throws      SystemException
         */
        public function add($files, $addDir = '', $removeDir = '') {
-               if (!is_array($files)) $files = array($files);
+               if (!is_array($files)) $files = [$files];
                if (empty($files)) return false;
                
                $result = true;
index 07cbb3f1555bc0b85245999b7572db77f736ab1a..5f8118d9ff814f5c7d5d10322e18ee2aa0636baf 100644 (file)
@@ -172,7 +172,7 @@ class Zip extends File implements IArchive {
                }
                $this->seek(-4, SEEK_CUR);
                
-               $files = array();
+               $files = [];
                while ($this->read(4) === self::CENTRAL_DIRECTORY_SIGNATURE) {
                        $data = unpack('vversion/vminVersion/vgeneralPurposeBit/vcompression/vmtime/vmdate', $this->read(12));
                        // calculate timestamp
@@ -213,7 +213,7 @@ class Zip extends File implements IArchive {
                if ($eof['commentLength'] > 0) $eof['comment'] = $this->read($eof['commentLength']);
                else $eof['comment'] = '';
                
-               return array('files' => $files, 'eof' => $eof);
+               return ['files' => $files, 'eof' => $eof];
        }
        
        /**
@@ -318,7 +318,7 @@ class Zip extends File implements IArchive {
                        }
                }
                
-               return array('header' => $header, 'content' => $content);
+               return ['header' => $header, 'content' => $content];
        }
        
        /**
index a6ff54b719bfa9e6525f26a25aeba4fb593e5251..b298a2cd9159d58fdb8a5b6ef37b9923987cafd9 100644 (file)
@@ -14,8 +14,8 @@ use wcf\util\StringUtil;
  * @category   Community Framework
  */
 class ZipWriter {
-       protected $headers = array();
-       protected $data = array();
+       protected $headers = [];
+       protected $data = [];
        protected $endOfData = "\x50\x4b\x05\x06\x00\x00\x00\x00";
        protected $lastOffset = 0;
        protected $zipComment = '';
index dce83e4bf156dd3c4680cc3f18dd244333b310e2..a65bfc75f32845f4389bca2d786eeab2b558634f 100644 (file)
@@ -35,10 +35,10 @@ class LabelHandler extends SingletonFactory {
         * @see \wcf\system\SingletonFactory::init()
         */
        protected function init() {
-               $this->cache = array(
-                       'objectTypes' => array(),
-                       'objectTypeNames' => array()
-               );
+               $this->cache = [
+                       'objectTypes' => [],
+                       'objectTypeNames' => []
+               ];
                
                $cache = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.label.object');
                foreach ($cache as $objectType) {
@@ -115,12 +115,12 @@ class LabelHandler extends SingletonFactory {
        public function getPermissions($optionName, array $labelIDs) {
                if (empty($labelIDs)) {
                        // nothing to validate anyway
-                       return array();
+                       return [];
                }
                
                if (empty($this->labelGroups['groups'])) {
                        // pretend given label ids aren't valid
-                       $data = array();
+                       $data = [];
                        foreach ($labelIDs as $labelID) $data[$labelID] = false;
                        
                        return $data;
@@ -132,7 +132,7 @@ class LabelHandler extends SingletonFactory {
                }
                
                // validate each label
-               $data = array();
+               $data = [];
                foreach ($labelIDs as $labelID) {
                        $isValid = false;
                        
@@ -167,9 +167,9 @@ class LabelHandler extends SingletonFactory {
                
                // delete previous labels
                $conditions = new PreparedStatementConditionBuilder();
-               if ($validatePermissions) $conditions->add("labelID IN (?)", array($accessibleLabelIDs));
-               $conditions->add("objectTypeID = ?", array($objectTypeID));
-               $conditions->add("objectID = ?", array($objectID));
+               if ($validatePermissions) $conditions->add("labelID IN (?)", [$accessibleLabelIDs]);
+               $conditions->add("objectTypeID = ?", [$objectTypeID]);
+               $conditions->add("objectID = ?", [$objectID]);
                
                if (!$validatePermissions || ($validatePermissions && !empty($accessibleLabelIDs))) {
                        $sql = "DELETE FROM     wcf".WCF_N."_label_object
@@ -185,11 +185,11 @@ class LabelHandler extends SingletonFactory {
                                VALUES          (?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($labelIDs as $labelID) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $labelID,
                                        $objectTypeID,
                                        $objectID
-                               ));
+                               ]);
                        }
                }
        }
@@ -204,18 +204,18 @@ class LabelHandler extends SingletonFactory {
         */
        public function getAssignedLabels($objectTypeID, array $objectIDs, $validatePermissions = true) {
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectTypeID = ?", array($objectTypeID));
-               $conditions->add("objectID IN (?)", array($objectIDs));
+               $conditions->add("objectTypeID = ?", [$objectTypeID]);
+               $conditions->add("objectID IN (?)", [$objectIDs]);
                $sql = "SELECT  objectID, labelID
                        FROM    wcf".WCF_N."_label_object
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
                
-               $labels = array();
+               $labels = [];
                while ($row = $statement->fetchArray()) {
                        if (!isset($labels[$row['labelID']])) {
-                               $labels[$row['labelID']] = array();
+                               $labels[$row['labelID']] = [];
                        }
                        
                        $labels[$row['labelID']][] = $row['objectID'];
@@ -234,11 +234,11 @@ class LabelHandler extends SingletonFactory {
                }
                
                // reorder the array by object id
-               $data = array();
+               $data = [];
                foreach ($labels as $labelID => $objectIDs) {
                        foreach ($objectIDs as $objectID) {
                                if (!isset($data[$objectID])) {
-                                       $data[$objectID] = array();
+                                       $data[$objectID] = [];
                                }
                                
                                foreach ($this->labelGroups['groups'] as $group) {
@@ -278,8 +278,8 @@ class LabelHandler extends SingletonFactory {
         * @return      ViewableLabelGroup[]
         * @throws      SystemException
         */
-       public function getLabelGroups(array $groupIDs = array(), $validatePermissions = true, $permission = 'canSetLabel') {
-               $data = array();
+       public function getLabelGroups(array $groupIDs = [], $validatePermissions = true, $permission = 'canSetLabel') {
+               $data = [];
                
                if ($validatePermissions) {
                        $optionID = $this->getOptionID($permission);
@@ -305,7 +305,7 @@ class LabelHandler extends SingletonFactory {
                        $data[$groupID] = $this->labelGroups['groups'][$groupID];
                }
                
-               uasort($data, array('\wcf\data\label\group\LabelGroup', 'sortLabelGroups'));
+               uasort($data, ['\wcf\data\label\group\LabelGroup', 'sortLabelGroups']);
                
                return $data;
        }
@@ -316,7 +316,7 @@ class LabelHandler extends SingletonFactory {
         * @return      integer[]
         */
        public function getAccessibleLabelIDs() {
-               $labelIDs = array();
+               $labelIDs = [];
                $groups = $this->getLabelGroups();
                
                foreach ($groups as $group) {
@@ -348,8 +348,8 @@ class LabelHandler extends SingletonFactory {
         */
        public function removeLabels($objectTypeID, array $objectIDs) {
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectTypeID = ?", array($objectTypeID));
-               $conditions->add("objectID IN (?)", array($objectIDs));
+               $conditions->add("objectTypeID = ?", [$objectTypeID]);
+               $conditions->add("objectID IN (?)", [$objectIDs]);
                $sql = "DELETE FROM     wcf".WCF_N."_label_object
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
index 1a30785186807018bb29569458082ea70a7729ea..8416ac60b8c5c0a03023b70c330a3d0b067e5f58 100644 (file)
@@ -20,7 +20,7 @@ abstract class AbstractLabelObjectHandler extends SingletonFactory implements IL
         * list of available label groups
         * @var ViewableLabelGroup[]
         */
-       protected $labelGroups = array();
+       protected $labelGroups = [];
        
        /**
         * object type name
@@ -50,22 +50,22 @@ abstract class AbstractLabelObjectHandler extends SingletonFactory implements IL
        /**
         * @see \wcf\system\label\manager\ILabelObjectHandler::getLabelGroupIDs()
         */
-       public function getLabelGroupIDs(array $parameters = array()) {
+       public function getLabelGroupIDs(array $parameters = []) {
                return array_keys($this->labelGroups);
        }
        
        /**
         * @see \wcf\system\label\manager\ILabelObjectHandler::getLabelGroups()
         */
-       public function getLabelGroups(array $parameters = array()) {
+       public function getLabelGroups(array $parameters = []) {
                $groupIDs = $this->getLabelGroupIDs($parameters);
                
-               $data = array();
+               $data = [];
                foreach ($groupIDs as $groupID) {
                        $data[$groupID] = $this->labelGroups[$groupID];
                }
                
-               uasort($data, array('\wcf\data\label\group\LabelGroup', 'sortLabelGroups'));
+               uasort($data, ['\wcf\data\label\group\LabelGroup', 'sortLabelGroups']);
                
                return $data;
        }
@@ -82,8 +82,8 @@ abstract class AbstractLabelObjectHandler extends SingletonFactory implements IL
                        }
                }
                
-               $validationErrors = array();
-               $satisfiedGroups = array();
+               $validationErrors = [];
+               $satisfiedGroups = [];
                foreach ($labelIDs as $groupID => $labelID) {
                        // only one label per group is allowed
                        if (is_array($labelID)) {
index 834f0e0232b5bb68e6e7c90e110b60de1c61a0a9..1c407b81f329affa38b0bf7e3fe764837f3bf964 100644 (file)
@@ -20,7 +20,7 @@ interface ILabelObjectHandler {
         * @param       array           $parameters
         * @return      integer[]
         */
-       public function getLabelGroupIDs(array $parameters = array());
+       public function getLabelGroupIDs(array $parameters = []);
        
        /**
         * Returns a list of label groups.
@@ -28,7 +28,7 @@ interface ILabelObjectHandler {
         * @param       array           $parameters
         * @return      ViewableLabelGroup[]
         */
-       public function getLabelGroups(array $parameters = array());
+       public function getLabelGroups(array $parameters = []);
        
        /**
         * Returns true, if all given label ids are valid and accessible.
index 159c5825fd1e80360ded44a731b3d98161910a78..c2fbef7cf61eb9ad12d676a2ada56bbd4666b099 100644 (file)
@@ -24,7 +24,7 @@ class LabelObjectTypeContainer implements \Countable, \Iterator {
         * list of object types
         * @var ObjectType[]
         */
-       public $objectTypes = array();
+       public $objectTypes = [];
        
        /**
         * object type id
index a1e0b62093195b324945d9315e1f59642b2bd7e1..65ea6552e3377e1b274efafa9eb86fa61383ef73 100644 (file)
@@ -29,7 +29,7 @@ class LanguageFactory extends SingletonFactory {
         * initialized languages
         * @var Language[]
         */
-       protected $languages = array();
+       protected $languages = [];
        
        /**
         * active template scripting compiler
@@ -92,7 +92,7 @@ class LanguageFactory extends SingletonFactory {
                                FROM    wcf".WCF_N."_language
                                WHERE   languageCode = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($languageCode));
+                       $statement->execute([$languageCode]);
                        $row = $statement->fetchArray();
                        if (isset($row['languageID'])) return new Language($row['languageID']);
                }
@@ -155,7 +155,7 @@ class LanguageFactory extends SingletonFactory {
         */
        protected function findPreferredLanguage() {
                // get available language codes
-               $availableLanguageCodes = array();
+               $availableLanguageCodes = [];
                foreach ($this->getLanguages() as $language) {
                        $availableLanguageCodes[] = $language->languageCode;
                }
@@ -272,7 +272,7 @@ class LanguageFactory extends SingletonFactory {
         * @return      Language[]
         */
        public function getContentLanguages() {
-               $availableLanguages = array();
+               $availableLanguages = [];
                foreach ($this->getLanguages() as $languageID => $language) {
                        if ($language->hasContent) {
                                $availableLanguages[$languageID] = $language;
@@ -300,7 +300,7 @@ class LanguageFactory extends SingletonFactory {
                        SET     isDefault = 1
                        WHERE   languageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($languageID));
+               $statement->execute([$languageID]);
                
                // rebuild language cache
                $this->clearCache();
index 5892881af1b8b7c31d062f92e88b045624716a9c..3bfd7e74a65683cb162786cc4cf5af196f975f35 100644 (file)
@@ -42,7 +42,7 @@ class LikeHandler extends SingletonFactory {
         * loaded like objects
         * @var LikeObject[][]
         */
-       protected $likeObjectCache = array();
+       protected $likeObjectCache = [];
        
        /**
         * cached object types
@@ -97,7 +97,7 @@ class LikeHandler extends SingletonFactory {
                        return $this->likeObjectCache[$objectType->objectTypeID];
                }
                
-               return array();
+               return [];
        }
        
        /**
@@ -116,8 +116,8 @@ class LikeHandler extends SingletonFactory {
                $i = 0;
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("like_object.objectTypeID = ?", array($objectType->objectTypeID));
-               $conditions->add("like_object.objectID IN (?)", array($objectIDs));
+               $conditions->add("like_object.objectTypeID = ?", [$objectType->objectTypeID]);
+               $conditions->add("like_object.objectID IN (?)", [$objectIDs]);
                $parameters = $conditions->getParameters();
                
                if (WCF::getUser()->userID) {
@@ -175,7 +175,7 @@ class LikeHandler extends SingletonFactory {
                        // like data
                        $cumulativeLikes = 0;
                        $newValue = $oldValue = null;
-                       $users = array();
+                       $users = [];
                        
                        // update existing object
                        if ($likeObject->likeObjectID) {
@@ -216,16 +216,16 @@ class LikeHandler extends SingletonFactory {
                                }
                                
                                // build update date
-                               $updateData = array(
+                               $updateData = [
                                        'likes' => $likes,
                                        'dislikes' => $dislikes,
                                        'cumulativeLikes' => $cumulativeLikes
-                               );
+                               ];
                                
                                if ($likeValue == 1) {
                                        $users = unserialize($likeObject->cachedUsers);
                                        if (count($users) < 3) {
-                                               $users[$user->userID] = array('userID' => $user->userID, 'username' => $user->username);
+                                               $users[$user->userID] = ['userID' => $user->userID, 'username' => $user->username];
                                                $updateData['cachedUsers'] = serialize($users);
                                        }
                                }
@@ -244,11 +244,11 @@ class LikeHandler extends SingletonFactory {
                        else {
                                $cumulativeLikes = $likeValue;
                                $newValue = $likeValue;
-                               $users = array();
-                               if ($likeValue == 1) $users = array($user->userID => array('userID' => $user->userID, 'username' => $user->username));
+                               $users = [];
+                               if ($likeValue == 1) $users = [$user->userID => ['userID' => $user->userID, 'username' => $user->username]];
                                
                                // create cache
-                               $likeObject = LikeObjectEditor::create(array(
+                               $likeObject = LikeObjectEditor::create([
                                        'objectTypeID' => $likeable->getObjectType()->objectTypeID,
                                        'objectID' => $likeable->getObjectID(),
                                        'objectUserID' => ($likeable->getUserID() ?: null),
@@ -256,35 +256,35 @@ class LikeHandler extends SingletonFactory {
                                        'dislikes' => ($likeValue == Like::DISLIKE) ? 1 : 0,
                                        'cumulativeLikes' => $cumulativeLikes,
                                        'cachedUsers' => serialize($users)
-                               ));
+                               ]);
                        }
                        
                        // update owner's like counter
                        if ($likeable->getUserID()) {
                                if ($like->likeID) {
                                        $userEditor = new UserEditor(new User($likeable->getUserID()));
-                                       $userEditor->updateCounters(array(
+                                       $userEditor->updateCounters([
                                                'likesReceived' => ($like->likeValue == Like::LIKE ? -1 : 1)
-                                       ));
+                                       ]);
                                }
                                else if ($likeValue == Like::LIKE) {
                                        $userEditor = new UserEditor(new User($likeable->getUserID()));
-                                       $userEditor->updateCounters(array(
+                                       $userEditor->updateCounters([
                                                'likesReceived' => 1
-                                       ));
+                                       ]);
                                }
                        }
                        
                        if (!$like->likeID) {
                                // save like
-                               $like = LikeEditor::create(array(
+                               $like = LikeEditor::create([
                                        'objectID' => $likeable->getObjectID(),
                                        'objectTypeID' => $likeable->getObjectType()->objectTypeID,
                                        'objectUserID' => ($likeable->getUserID() ?: null),
                                        'userID' => $user->userID,
                                        'time' => $time,
                                        'likeValue' => $likeValue
-                               ));
+                               ]);
                                
                                if ($likeValue == Like::LIKE && $likeable->getUserID()) {
                                        UserActivityPointHandler::getInstance()->fireEvent('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $like->likeID, $likeable->getUserID());
@@ -293,14 +293,14 @@ class LikeHandler extends SingletonFactory {
                        }
                        else {
                                $likeEditor = new LikeEditor($like);
-                               $likeEditor->update(array(
+                               $likeEditor->update([
                                        'time' => $time,
                                        'likeValue' => $likeValue
-                               ));
+                               ]);
                                
                                if ($likeable->getUserID()) {
                                        if ($likeValue == Like::DISLIKE) {
-                                               UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', array($likeable->getUserID() => 1));
+                                               UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', [$likeable->getUserID() => 1]);
                                        }
                                        else {
                                                UserActivityPointHandler::getInstance()->fireEvent('com.woltlab.wcf.like.activityPointEvent.receivedLikes', $like->likeID, $likeable->getUserID());
@@ -318,13 +318,13 @@ class LikeHandler extends SingletonFactory {
                        WCF::getDB()->rollBackTransaction();
                }
                
-               return array(
+               return [
                        'data' => $this->loadLikeStatus($likeObject, $user),
                        'like' => $like,
                        'newValue' => $newValue,
                        'oldValue' => $oldValue,
                        'users' => $users
-               );
+               ];
        }
        
        /**
@@ -359,16 +359,16 @@ class LikeHandler extends SingletonFactory {
                        }
                        
                        // build update data
-                       $updateData = array(
+                       $updateData = [
                                'likes' => $likes,
                                'dislikes' => $dislikes,
                                'cumulativeLikes' => $cumulativeLikes
-                       );
+                       ];
                        
                        $users = $likeObject->getUsers();
-                       $usersArray = array();
+                       $usersArray = [];
                        foreach ($users as $user2) {
-                               $usersArray[$user2->userID] = array('userID' => $user2->userID, 'username' => $user2->username);
+                               $usersArray[$user2->userID] = ['userID' => $user2->userID, 'username' => $user2->username];
                        }
                        
                        if (isset($usersArray[$user->userID])) {
@@ -390,11 +390,11 @@ class LikeHandler extends SingletonFactory {
                        if ($likeable->getUserID()) {
                                if ($like->likeValue == Like::LIKE) {
                                        $userEditor = new UserEditor(new User($likeable->getUserID()));
-                                       $userEditor->updateCounters(array(
+                                       $userEditor->updateCounters([
                                                'likesReceived' => -1
-                                       ));
+                                       ]);
                                        
-                                       UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', array($likeable->getUserID() => 1));
+                                       UserActivityPointHandler::getInstance()->removeEvents('com.woltlab.wcf.like.activityPointEvent.receivedLikes', [$likeable->getUserID() => 1]);
                                }
                        }
                        
@@ -407,12 +407,12 @@ class LikeHandler extends SingletonFactory {
                        WCF::getDB()->rollBackTransaction();
                }
                
-               return array(
+               return [
                        'data' => $this->loadLikeStatus($likeObject, $user),
                        'newValue' => null,
                        'oldValue' => $like->likeValue,
                        'users' => $usersArray
-               );
+               ];
        }
        
        /**
@@ -422,19 +422,19 @@ class LikeHandler extends SingletonFactory {
         * @param       integer[]               $objectIDs
         * @param       string[]                $notificationObjectTypes
         */
-       public function removeLikes($objectType, array $objectIDs, array $notificationObjectTypes = array()) {
+       public function removeLikes($objectType, array $objectIDs, array $notificationObjectTypes = []) {
                $objectTypeObj = $this->getObjectType($objectType);
                
                // get like objects
                $likeObjectList = new LikeObjectList();
-               $likeObjectList->getConditionBuilder()->add('like_object.objectTypeID = ?', array($objectTypeObj->objectTypeID));
-               $likeObjectList->getConditionBuilder()->add('like_object.objectID IN (?)', array($objectIDs));
+               $likeObjectList->getConditionBuilder()->add('like_object.objectTypeID = ?', [$objectTypeObj->objectTypeID]);
+               $likeObjectList->getConditionBuilder()->add('like_object.objectID IN (?)', [$objectIDs]);
                $likeObjectList->readObjects();
                $likeObjects = $likeObjectList->getObjects();
                $likeObjectIDs = $likeObjectList->getObjectIDs();
                
                // reduce count of received users
-               $users = array();
+               $users = [];
                foreach ($likeObjects as $likeObject) {
                        if ($likeObject->likes) {
                                if (!isset($users[$likeObject->objectUserID])) $users[$likeObject->objectUserID] = 0;
@@ -442,20 +442,20 @@ class LikeHandler extends SingletonFactory {
                        }
                }
                foreach ($users as $userID => $receivedLikes) {
-                       $userEditor = new UserEditor(new User(null, array('userID' => $userID)));
-                       $userEditor->updateCounters(array(
+                       $userEditor = new UserEditor(new User(null, ['userID' => $userID]));
+                       $userEditor->updateCounters([
                                'likesReceived' => $receivedLikes * -1
-                       ));
+                       ]);
                }
                
                // get like ids
                $likeList = new LikeList();
-               $likeList->getConditionBuilder()->add('like_table.objectTypeID = ?', array($objectTypeObj->objectTypeID));
-               $likeList->getConditionBuilder()->add('like_table.objectID IN (?)', array($objectIDs));
+               $likeList->getConditionBuilder()->add('like_table.objectTypeID = ?', [$objectTypeObj->objectTypeID]);
+               $likeList->getConditionBuilder()->add('like_table.objectID IN (?)', [$objectIDs]);
                $likeList->readObjects();
                
                if (count($likeList)) {
-                       $likeData = array();
+                       $likeData = [];
                        foreach ($likeList as $like) {
                                $likeData[$like->likeID] = $like->userID;
                        }
@@ -505,10 +505,10 @@ class LikeHandler extends SingletonFactory {
                                        AND like_table.userID = ?)
                        WHERE           like_object.likeObjectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $user->userID,
                        $likeObject->likeObjectID
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                return $row;
index 6583ec3b035bdbcf3d2014de17c16189259e91e5..3e0d8672a5b3fc2248cab9689c73d5502e7c0cc8 100644 (file)
@@ -25,7 +25,7 @@ class ModificationLogHandler extends SingletonFactory {
         * list of object types
         * @var ObjectType[]
         */
-       protected $cache = array();
+       protected $cache = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -63,7 +63,7 @@ class ModificationLogHandler extends SingletonFactory {
         * @return      ModificationLog
         * @throws      SystemException
         */
-       protected function _add($objectType, $objectID, $action, array $additionalData = array(), $time = TIME_NOW, $userID = null, $username = null) {
+       protected function _add($objectType, $objectID, $action, array $additionalData = [], $time = TIME_NOW, $userID = null, $username = null) {
                $objectTypeObj = $this->getObjectType($objectType);
                if ($objectTypeObj === null) {
                        throw new SystemException("Object type '".$objectType."' not found within definition 'com.woltlab.wcf.modifiableContent'");
@@ -82,7 +82,7 @@ class ModificationLogHandler extends SingletonFactory {
                        else $username = '';
                }
                
-               return ModificationLogEditor::create(array(
+               return ModificationLogEditor::create([
                        'objectTypeID' => $objectTypeObj->objectTypeID,
                        'objectID' => $objectID,
                        'action' => $action,
@@ -90,7 +90,7 @@ class ModificationLogHandler extends SingletonFactory {
                        'username' => $username,
                        'time' => $time,
                        'additionalData' => serialize($additionalData)
-               ));
+               ]);
        }
        
        /**
@@ -107,8 +107,8 @@ class ModificationLogHandler extends SingletonFactory {
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectTypeID = ?", array($objectTypeObj->objectTypeID));
-               $conditions->add("objectID IN (?)", array($objectIDs));
+               $conditions->add("objectTypeID = ?", [$objectTypeObj->objectTypeID]);
+               $conditions->add("objectID IN (?)", [$objectIDs]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_modification_log
                        ".$conditions;
index e81109a6849d99d5a8d7bd1e81c9db5007abe86d..e690ba8e7cf12aab6d72e26ad6a606ec62ad6743 100644 (file)
@@ -45,7 +45,7 @@ class Mail {
         * mail recipients
         * @var string[]
         */
-       protected $to = array();
+       protected $to = [];
        
        /**
         * mail subject
@@ -69,19 +69,19 @@ class Mail {
         * mail carbon copy
         * @var string[]
         */
-       protected $cc = array();
+       protected $cc = [];
        
        /**
         * mail blind carbon copy
         * @var string[]
         */
-       protected $bcc = array();
+       protected $bcc = [];
        
        /**
         * mail attachments
         * @var array
         */
-       protected $attachments = array();
+       protected $attachments = [];
        
        /**
         * priority of the mail
@@ -114,10 +114,10 @@ class Mail {
         * @param       integer         $priority
         * @param       string          $header
         */
-       public function __construct($to = '', $subject = '', $message = '', $from = '', $cc = '', $bcc = '', $attachments = array(), $priority = '', $header = '') {
+       public function __construct($to = '', $subject = '', $message = '', $from = '', $cc = '', $bcc = '', $attachments = [], $priority = '', $header = '') {
                $this->setBoundary();
                
-               if (empty($from)) $from = array(MAIL_FROM_NAME => MAIL_FROM_ADDRESS);
+               if (empty($from)) $from = [MAIL_FROM_NAME => MAIL_FROM_ADDRESS];
                if (empty($priority)) $priority = 3;
                
                $this->setFrom($from);
@@ -438,7 +438,7 @@ class Mail {
         * @param       string          $name           filename
         */
        public function addAttachment($path, $name = '') {
-               $this->attachments[] = array('path' => $path, 'name' => ($name ?: basename($path)));
+               $this->attachments[] = ['path' => $path, 'name' => ($name ?: basename($path))];
        }
        
        /**
index 8bbce40a06c3fdd9863b291bbc9da4a3a687dc3a..46b507d14cd88815a43702124adc01b2dfbd4f3b 100644 (file)
@@ -38,7 +38,7 @@ class SMTPMailSender extends MailSender {
         * mail recipients
         * @var array
         */
-       protected $recipients = array();
+       protected $recipients = [];
        
        /**
         * Creates a new SMTPMailSender object.
@@ -160,7 +160,7 @@ class SMTPMailSender extends MailSender {
         * @see \wcf\system\mail\MailSender::sendMail()
         */
        public function sendMail(Mail $mail) {
-               $this->recipients = array();
+               $this->recipients = [];
                if (count($mail->getTo()) > 0) $this->recipients = $mail->getTo();
                if (count($mail->getCC()) > 0) $this->recipients = array_merge($this->recipients, $mail->getCC());
                if (count($mail->getBCC())> 0) $this->recipients = array_merge($this->recipients, $mail->getBCC());
index 8831a90cca0a7bb63534140438bcdc02dede5208..5358f4192d121c474003b5bafe605d3a759fad1e 100644 (file)
@@ -19,13 +19,13 @@ abstract class TreeMenu extends SingletonFactory {
         * list of visible menu items
         * @var ITreeMenuItem[]
         */
-       public $menuItemList = array();
+       public $menuItemList = [];
        
        /**
         * list of the names of the active menu items
         * @var string[]
         */
-       public $activeMenuItems = array();
+       public $activeMenuItems = [];
        
        /**
         * list of all menu items
@@ -60,7 +60,7 @@ abstract class TreeMenu extends SingletonFactory {
                // call loadCache event
                EventHandler::getInstance()->fireAction($this, 'loadCache');
                
-               $this->menuItems = array();
+               $this->menuItems = [];
        }
        
        /**
@@ -161,7 +161,7 @@ abstract class TreeMenu extends SingletonFactory {
         * @param       string          $menuItem       name of the active menu item
         */
        public function setActiveMenuItem($menuItem) {
-               $newActiveMenuItems = array();
+               $newActiveMenuItems = [];
                while (isset($this->menuItemList[$menuItem])) {
                        $newActiveMenuItems[] = $menuItem;
                        $menuItem = $this->menuItemList[$menuItem]->parentMenuItem;
@@ -203,6 +203,6 @@ abstract class TreeMenu extends SingletonFactory {
        public function getMenuItems($parentMenuItem = null) {
                if ($parentMenuItem === null) return $this->menuItems;
                if (isset($this->menuItems[$parentMenuItem])) return $this->menuItems[$parentMenuItem];
-               return array();
+               return [];
        }
 }
index 891888329c45d2f22213621745712342a7c6104c..7d01223e28125013657725ac2529e3c63e095c98 100644 (file)
@@ -35,10 +35,10 @@ class AboutUserProfileMenuContent extends SingletonFactory implements IUserProfi
                $user = new User($userID);
                $this->optionHandler->setUser($user);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'options' => $this->optionHandler->getOptionTree(),
                        'userID' => $user->userID,
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('userProfileAbout');
        }
index b885e60750377e95c9a4c503e719ee3a032b9671..e3dc3c1b3847c5dac83ba69ebf60c1c5c4324faf 100644 (file)
@@ -40,14 +40,14 @@ class CommentUserProfileMenuContent extends SingletonFactory implements IUserPro
                $commentList = CommentHandler::getInstance()->getCommentList($this->commentManager, $this->objectTypeID, $userID);
                
                // assign variables
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'commentCanAdd' => $this->commentManager->canAdd($userID),
                        'commentList' => $commentList,
                        'commentObjectTypeID' => $this->objectTypeID,
                        'userID' => $userID,
                        'lastCommentTime' => $commentList->getMinCommentTime(),
-                       'likeData' => (MODULE_LIKE ? $commentList->getLikeData() : array())
-               ));
+                       'likeData' => (MODULE_LIKE ? $commentList->getLikeData() : [])
+               ]);
                
                return WCF::getTPL()->fetch('userProfileCommentList');
        }
index 4e274cdbda69c7a3078ce48c73796a776133418f..65cf75f1632ba6e7aa59d337f9fe35eaa897d752 100644 (file)
@@ -21,15 +21,15 @@ class LikesUserProfileMenuContent extends SingletonFactory implements IUserProfi
         */
        public function getContent($userID) {
                $likeList = new ViewableLikeList();
-               $likeList->getConditionBuilder()->add("like_table.objectUserID = ?", array($userID));
-               $likeList->getConditionBuilder()->add("like_table.likeValue = ?", array(Like::LIKE));
+               $likeList->getConditionBuilder()->add("like_table.objectUserID = ?", [$userID]);
+               $likeList->getConditionBuilder()->add("like_table.likeValue = ?", [Like::LIKE]);
                $likeList->readObjects();
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'likeList' => $likeList,
                        'userID' => $userID,
                        'lastLikeTime' => $likeList->getLastLikeTime(),
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('userProfileLikes');
        }
index ea22c0732176395de2b53c67f7e7ae7ee100ff92..0c9f23ecc83f217e48aba628472e5351427f5294 100644 (file)
@@ -21,7 +21,7 @@ class RecentActivityUserProfileMenuContent extends SingletonFactory implements I
         */
        public function getContent($userID) {
                $eventList = new ViewableUserActivityEventList();
-               $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", array($userID));
+               $eventList->getConditionBuilder()->add("user_activity_event.userID = ?", [$userID]);
                $eventList->readObjects();
                
                $lastEventTime = $eventList->getLastEventTime();
@@ -29,12 +29,12 @@ class RecentActivityUserProfileMenuContent extends SingletonFactory implements I
                        UserActivityEventHandler::validateEvents($eventList);
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'eventList' => $eventList,
                        'lastEventTime' => $lastEventTime,
                        'placeholder' => WCF::getLanguage()->get('wcf.user.profile.content.recentActivity.noEntries'),
                        'userID' => $userID
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('recentActivities');
        }
index 067af85f1e6131a4ec12c6b7935a320ae8035673..7d152c7d5c79557a3be0c29d85b6703a76b8e99d 100644 (file)
@@ -63,10 +63,10 @@ class MessageFormSettingsHandler {
                        $enableBBCodes = $preParse = ($object->enableBBCodes) ? 1 : 0;
                }
                
-               return array(
+               return [
                        'enableSmilies' => $enableSmilies,
                        'enableBBCodes' => $enableBBCodes,
                        'preParse' => $preParse
-               );
+               ];
        }
 }
index 8b3c01d798eb4fbf1f218ddf75a9dec6dabbee6b..3d338dd96547b852c0256cfe5618b7c578c5e76d 100644 (file)
@@ -147,7 +147,7 @@ class QuickReplyManager extends SingletonFactory {
                $object->validateMessage($this->container, $parameters['data']['message']);
                
                // check for message quote ids
-               $parameters['removeQuoteIDs'] = (isset($parameters['removeQuoteIDs']) && is_array($parameters['removeQuoteIDs'])) ? ArrayUtil::trim($parameters['removeQuoteIDs']) : array();
+               $parameters['removeQuoteIDs'] = (isset($parameters['removeQuoteIDs']) && is_array($parameters['removeQuoteIDs'])) ? ArrayUtil::trim($parameters['removeQuoteIDs']) : [];
                
                // check for tmp hash (attachments)
                $parameters['tmpHash'] = '';
@@ -177,10 +177,10 @@ class QuickReplyManager extends SingletonFactory {
         * @return      array
         */
        public function createMessage(IMessageQuickReplyAction $object, array &$parameters, $containerActionClassName, $sortOrder, $templateName, $application = 'wcf') {
-               $additionalFields = array();
+               $additionalFields = [];
                EventHandler::getInstance()->fireAction($this, 'createMessage', $additionalFields);
                
-               $tableIndexName = call_user_func(array($this->container, 'getDatabaseTableIndexName'));
+               $tableIndexName = call_user_func([$this->container, 'getDatabaseTableIndexName']);
                $parameters['data'][$tableIndexName] = $parameters['objectID'];
                $parameters['data']['time'] = TIME_NOW;
                $parameters['data']['userID'] = WCF::getUser()->userID ?: null;
@@ -200,13 +200,13 @@ class QuickReplyManager extends SingletonFactory {
                }
                
                $message = $object->create();
-               $eventParameters = array('message' => $message);
+               $eventParameters = ['message' => $message];
                EventHandler::getInstance()->fireAction($this, 'createdMessage', $eventParameters);
                
                if ($message instanceof IMessage && !$message->isVisible()) {
-                       return array(
+                       return [
                                'isVisible' => false
-                       );
+                       ];
                }
                
                // resolve the page no
@@ -220,13 +220,13 @@ class QuickReplyManager extends SingletonFactory {
                        // calculate start index
                        $startIndex = $count - (count($messageList) - 1);
                        
-                       WCF::getTPL()->assign(array(
+                       WCF::getTPL()->assign([
                                'attachmentList' => $messageList->getAttachmentList(),
                                'container' => $this->container,
                                'objects' => $messageList,
                                'startIndex' => $startIndex,
                                'sortOrder' => $sortOrder,
-                       ));
+                       ]);
                        
                        // assign 'to top' link
                        if (isset($parameters['anchor'])) {
@@ -235,20 +235,20 @@ class QuickReplyManager extends SingletonFactory {
                        
                        // update visit time (messages shouldn't occur as new upon next visit)
                        if (is_subclass_of($containerActionClassName, 'wcf\data\IVisitableObjectAction')) {
-                               $containerAction = new $containerActionClassName(array(($this->container instanceof DatabaseObjectDecorator ? $this->container->getDecoratedObject() : $this->container)), 'markAsRead');
+                               $containerAction = new $containerActionClassName([($this->container instanceof DatabaseObjectDecorator ? $this->container->getDecoratedObject() : $this->container)], 'markAsRead');
                                $containerAction->executeAction();
                        }
                        
-                       return array(
+                       return [
                                'lastPostTime' => $message->time,
                                'template' => WCF::getTPL()->fetch($templateName, $application)
-                       );
+                       ];
                }
                else {
                        // redirect
-                       return array(
+                       return [
                                'url' => $object->getRedirectUrl($this->container, $message)
-                       );
+                       ];
                }
        }
        
index 4b5f7a3f82e5f25b2f6d53a4b71d5f4408e256f2..09de69f4b88c86f28227a32bd431e0ee7e86a45e 100644 (file)
@@ -18,7 +18,7 @@ class Censorship extends SingletonFactory {
         * censored words
         * @var string[]
         */
-       protected $censoredWords = array();
+       protected $censoredWords = [];
        
        /**
         * word delimiters
@@ -30,13 +30,13 @@ class Censorship extends SingletonFactory {
         * list of words
         * @var string[]
         */
-       protected $words = array();
+       protected $words = [];
        
        /**
         * list of matches
         * @var array
         */
-       protected $matches = array();
+       protected $matches = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -52,7 +52,7 @@ class Censorship extends SingletonFactory {
                                continue;
                        }
                        
-                       $displayedCensoredWord = str_replace(array('~', '*'), '', $censoredWord);
+                       $displayedCensoredWord = str_replace(['~', '*'], '', $censoredWord);
                        
                        // check if censored word contains at least one delimiter
                        if (preg_match('!'.$this->delimiters.'+!', $displayedCensoredWord)) {
@@ -75,7 +75,7 @@ class Censorship extends SingletonFactory {
         */
        public function test($text) {
                // reset values
-               $this->matches = $this->words = array();
+               $this->matches = $this->words = [];
                
                // string to lower case
                $text = mb_strtolower($text);
index 958d1b40315ddfed81c93a78bca664962d8ada0a..5de5fa32681dc1ce9b63a7f9370de36d7abc4365 100644 (file)
@@ -21,14 +21,14 @@ class AttachmentMessageEmbeddedObjectHandler extends AbstractMessageEmbeddedObje
        public function parseMessage($message) {
                $parsedAttachmentIDs = array_unique(ArrayUtil::toIntegerArray(array_merge(self::getFirstParameters($message, 'attach'), self::getTextParameters($message, 'attach'))));
                if (!empty($parsedAttachmentIDs)) {
-                       $attachmentIDs = array();
+                       $attachmentIDs = [];
                        foreach ($parsedAttachmentIDs as $parsedAttachmentID) {
                                if ($parsedAttachmentID) $attachmentIDs[] = $parsedAttachmentID;
                        }
                        
                        if (!empty($attachmentIDs)) {
                                $attachmentList = new AttachmentList();
-                               $attachmentList->getConditionBuilder()->add("attachment.attachmentID IN (?)", array($attachmentIDs));
+                               $attachmentList->getConditionBuilder()->add("attachment.attachmentID IN (?)", [$attachmentIDs]);
                                $attachmentList->readObjectIDs();
                                
                                return $attachmentList->getObjectIDs();
@@ -47,9 +47,9 @@ class AttachmentMessageEmbeddedObjectHandler extends AbstractMessageEmbeddedObje
                $attachmentList->readObjects();
                
                // group attachments by object type
-               $groupedAttachments = array();
+               $groupedAttachments = [];
                foreach ($attachmentList->getObjects() as $attachment) {
-                       if (!isset($groupedAttachments[$attachment->objectTypeID])) $groupedAttachments[$attachment->objectTypeID] = array();
+                       if (!isset($groupedAttachments[$attachment->objectTypeID])) $groupedAttachments[$attachment->objectTypeID] = [];
                        $groupedAttachments[$attachment->objectTypeID][] = $attachment;
                }
                
index fc9796879f39a038948b4e6367401b76b3f851ce..d6eba386988290d01f0515b7d54eb8088e373f6a 100644 (file)
@@ -21,13 +21,13 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
         * caches message to embedded object assignments
         * @var array
         */
-       protected $messageEmbeddedObjects = array();
+       protected $messageEmbeddedObjects = [];
        
        /**
         * caches embedded objects
         * @var array
         */
-       protected $embeddedObjects = array();
+       protected $embeddedObjects = [];
        
        /**
         * object type of the active message
@@ -60,7 +60,7 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
                $message = BBCodeParser::getInstance()->removeCodeTags($message);
                
                // delete existing assignments
-               $this->removeObjects($messageObjectType, array($messageID));
+               $this->removeObjects($messageObjectType, [$messageID]);
                
                // get object type id
                $messageObjectTypeID = ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message', $messageObjectType);
@@ -79,7 +79,7 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
                        if (!empty($objectIDs)) {
                                $returnValue = true;
                                foreach ($objectIDs as $objectID) {
-                                       $statement->execute(array($messageObjectTypeID, $messageID, $handler->objectTypeID, $objectID));
+                                       $statement->execute([$messageObjectTypeID, $messageID, $handler->objectTypeID, $objectID]);
                                }
                        }
                }
@@ -96,8 +96,8 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
         */
        public function removeObjects($messageObjectType, array $messageIDs) {
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add('messageObjectTypeID = ?', array(ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message', $messageObjectType)));
-               $conditionBuilder->add('messageID IN (?)', array($messageIDs));
+               $conditionBuilder->add('messageObjectTypeID = ?', [ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message', $messageObjectType)]);
+               $conditionBuilder->add('messageID IN (?)', [$messageIDs]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_message_embedded_object
                        ".$conditionBuilder;
@@ -113,8 +113,8 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
         */
        public function loadObjects($messageObjectType, array $messageIDs) {
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add('messageObjectTypeID = ?', array(ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message', $messageObjectType)));
-               $conditionBuilder->add('messageID IN (?)', array($messageIDs));
+               $conditionBuilder->add('messageObjectTypeID = ?', [ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message', $messageObjectType)]);
+               $conditionBuilder->add('messageID IN (?)', [$messageIDs]);
                
                // get object ids
                $sql = "SELECT  *
@@ -122,7 +122,7 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
                        ".$conditionBuilder;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditionBuilder->getParameters());
-               $embeddedObjects = array();
+               $embeddedObjects = [];
                while ($row = $statement->fetchArray()) {
                        if (isset($this->embeddedObjects[$row['embeddedObjectTypeID']][$row['embeddedObjectID']])) {
                                // embedded object already loaded
@@ -130,19 +130,19 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
                        }
                        
                        // group objects by object type
-                       if (!isset($embeddedObjects[$row['embeddedObjectTypeID']])) $embeddedObjects[$row['embeddedObjectTypeID']] = array();
+                       if (!isset($embeddedObjects[$row['embeddedObjectTypeID']])) $embeddedObjects[$row['embeddedObjectTypeID']] = [];
                        $embeddedObjects[$row['embeddedObjectTypeID']][] = $row['embeddedObjectID'];
                        
                        // store message to embedded object assignment
                        if (!isset($this->messageEmbeddedObjects[$row['messageObjectTypeID']][$row['messageID']][$row['embeddedObjectTypeID']])) {
-                               $this->messageEmbeddedObjects[$row['messageObjectTypeID']][$row['messageID']][$row['embeddedObjectTypeID']] = array();
+                               $this->messageEmbeddedObjects[$row['messageObjectTypeID']][$row['messageID']][$row['embeddedObjectTypeID']] = [];
                        }
                        $this->messageEmbeddedObjects[$row['messageObjectTypeID']][$row['messageID']][$row['embeddedObjectTypeID']][] = $row['embeddedObjectID'];
                }
                
                // load objects
                foreach ($embeddedObjects as $embeddedObjectTypeID => $objectIDs) {
-                       if (!isset($this->embeddedObjects[$embeddedObjectTypeID])) $this->embeddedObjects[$embeddedObjectTypeID] = array();
+                       if (!isset($this->embeddedObjects[$embeddedObjectTypeID])) $this->embeddedObjects[$embeddedObjectTypeID] = [];
                        foreach ($this->getEmbeddedObjectHandler($embeddedObjectTypeID)->loadObjects(array_unique($objectIDs)) as $objectID => $object) {
                                $this->embeddedObjects[$embeddedObjectTypeID][$objectID] = $object;
                        }
@@ -168,7 +168,7 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
         */
        public function getObjects($embeddedObjectType) {
                $embeddedObjectTypeID = ObjectTypeCache::getInstance()->getObjectTypeIDByName('com.woltlab.wcf.message.embeddedObject', $embeddedObjectType);
-               $returnValue = array();
+               $returnValue = [];
                if (!empty($this->messageEmbeddedObjects[$this->activeMessageObjectTypeID][$this->activeMessageID][$embeddedObjectTypeID])) {
                        foreach ($this->messageEmbeddedObjects[$this->activeMessageObjectTypeID][$this->activeMessageID][$embeddedObjectTypeID] as $embeddedObjectID) {
                                if (isset($this->embeddedObjects[$embeddedObjectTypeID][$embeddedObjectID])) {
@@ -235,7 +235,7 @@ class MessageEmbeddedObjectManager extends SingletonFactory {
         */
        protected function getEmbeddedObjectHandlers() {
                if ($this->embeddedObjectHandlers === null) {
-                       $this->embeddedObjectHandlers = array();
+                       $this->embeddedObjectHandlers = [];
                        foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.message.embeddedObject') as $objectType) {
                                $this->embeddedObjectHandlers[$objectType->objectTypeID] = $objectType->getProcessor();
                        }
index bdefc4bc03468514833882462cb1bbc396b13eae..125b245429eb1ea3a145ca1f949cc451b0aebc86 100644 (file)
@@ -25,14 +25,14 @@ abstract class AbstractMessageQuoteHandler extends SingletonFactory implements I
         * list of quoted message
         * @var QuotedMessage[]
         */
-       public $quotedMessages = array();
+       public $quotedMessages = [];
        
        /**
         * @see \wcf\system\message\quote\IMessageQuoteHandler::render()
         */
        public function render(array $data, $supportPaste = false) {
                $messages = $this->getMessages($data);
-               $userIDs = $userProfiles = array();
+               $userIDs = $userProfiles = [];
                foreach ($messages as $message) {
                        $userID = $message->getUserID();
                        if ($userID) {
@@ -45,11 +45,11 @@ abstract class AbstractMessageQuoteHandler extends SingletonFactory implements I
                        $userProfiles = UserProfileRuntimeCache::getInstance()->getObjects($userIDs);
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'messages' => $this->getMessages($data),
                        'supportPaste' => $supportPaste,
                        'userProfiles' => $userProfiles
-               ));
+               ]);
                
                return WCF::getTPL()->fetch($this->templateName);
        }
@@ -60,7 +60,7 @@ abstract class AbstractMessageQuoteHandler extends SingletonFactory implements I
        public function renderQuotes(array $data, $render = true, $renderAsString = true) {
                $messages = $this->getMessages($data);
                
-               $renderedQuotes = array();
+               $renderedQuotes = [];
                foreach ($messages as $message) {
                        foreach ($message as $quoteID => $quote) {
                                $quotedMessage = $message->getFullQuote($quoteID);
index 2b5ded43bba109db77e655b17350b1d009ac44b9..c46cc1989c53e40a1c9b32ed58e454eb096c3567 100644 (file)
@@ -17,7 +17,7 @@ class QuotedMessage implements \Countable, \Iterator {
         * list of full quotes for insertation
         * @var string[]
         */
-       public $fullQuotes = array();
+       public $fullQuotes = [];
        
        /**
         * quotable database object
@@ -29,7 +29,7 @@ class QuotedMessage implements \Countable, \Iterator {
         * list of quotes (shortened)
         * @var string[]
         */
-       public $quotes = array();
+       public $quotes = [];
        
        /**
         * current iterator index
index 6353beb685d3d5ed0af1bd05c6f205d47e538648..ebeee961932cf0fa65da035e8e85259e37ad398b 100644 (file)
@@ -53,11 +53,11 @@ abstract class AbstractModerationQueueHandler implements IModerationQueueHandler
                        throw new SystemException("DatabaseObject class name '" . $this->className . "' is missing or invalid");
                }
                
-               $indexName = call_user_func(array($this->className, 'getDatabaseTableIndexName'));
-               $tableName = call_user_func(array($this->className, 'getDatabaseTableName'));
+               $indexName = call_user_func([$this->className, 'getDatabaseTableIndexName']);
+               $tableName = call_user_func([$this->className, 'getDatabaseTableName']);
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add($indexName . " IN (?)", array(array_keys($queues)));
+               $conditions->add($indexName . " IN (?)", [array_keys($queues)]);
                
                $sql = "SELECT  " . $indexName . "
                        FROM    " . $tableName . "
@@ -81,8 +81,8 @@ abstract class AbstractModerationQueueHandler implements IModerationQueueHandler
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectTypeID = ?", array($objectTypeID));
-               $conditions->add("objectID IN (?)", array($objectIDs));
+               $conditions->add("objectTypeID = ?", [$objectTypeID]);
+               $conditions->add("objectID IN (?)", [$objectIDs]);
                
                $sql = "SELECT  queueID
                        FROM    wcf".WCF_N."_moderation_queue
index ab4a4de0fad704c8522938cf12cf89a62113fe89..316a68659d2830b5f2517dac087815e765465e14 100644 (file)
@@ -80,41 +80,41 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement
         * @param       integer         $containerID
         * @param       array           $additionalData
         */
-       protected function addEntry($objectTypeID, $objectID, $containerID = 0, array $additionalData = array()) {
+       protected function addEntry($objectTypeID, $objectID, $containerID = 0, array $additionalData = []) {
                $sql = "SELECT  queueID
                        FROM    wcf".WCF_N."_moderation_queue
                        WHERE   objectTypeID = ?
                                AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        $objectID
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                if ($row === false) {
-                       $objectAction = new ModerationQueueAction(array(), 'create', array(
-                               'data' => array(
+                       $objectAction = new ModerationQueueAction([], 'create', [
+                               'data' => [
                                        'objectTypeID' => $objectTypeID,
                                        'objectID' => $objectID,
                                        'containerID' => $containerID,
                                        'userID' => (WCF::getUser()->userID ?: null),
                                        'time' => TIME_NOW,
                                        'additionalData' => serialize($additionalData)
-                               )
-                       ));
+                               ]
+                       ]);
                        $objectAction->executeAction();
                }
                else {
-                       $objectAction = new ModerationQueueAction(array($row['queueID']), 'update', array(
-                               'data' => array(
+                       $objectAction = new ModerationQueueAction([$row['queueID']], 'update', [
+                               'data' => [
                                        'status' => ModerationQueue::STATUS_OUTSTANDING,
                                        'containerID' => $containerID,
                                        'userID' => (WCF::getUser()->userID ?: null),
                                        'time' => TIME_NOW,
                                        'additionalData' => serialize($additionalData)
-                               )
-                       ));
+                               ]
+                       ]);
                        $objectAction->executeAction();
                }
                
@@ -129,8 +129,8 @@ abstract class AbstractModerationQueueManager extends SingletonFactory implement
         */
        protected function removeEntries($objectTypeID, array $objectIDs) {
                $queueList = new ModerationQueueList();
-               $queueList->getConditionBuilder()->add("moderation_queue.objectTypeID = ?", array($objectTypeID));
-               $queueList->getConditionBuilder()->add("moderation_queue.objectID IN (?)", array($objectIDs));
+               $queueList->getConditionBuilder()->add("moderation_queue.objectTypeID = ?", [$objectTypeID]);
+               $queueList->getConditionBuilder()->add("moderation_queue.objectID IN (?)", [$objectIDs]);
                $queueList->readObjects();
                
                if (count($queueList)) {
index 5617958d4268e317afa67ed71d5bcb0f770c4a26..72c6adee7908fca3cd05c2e4ae1f07d6f42bb498 100644 (file)
@@ -44,7 +44,7 @@ class ModerationQueueActivationManager extends AbstractModerationQueueManager {
         * @see \wcf\system\moderation\queue\IModerationQueueManager::getLink()
         */
        public function getLink($queueID) {
-               return LinkHandler::getInstance()->getLink('ModerationActivation', array('id' => $queueID));
+               return LinkHandler::getInstance()->getLink('ModerationActivation', ['id' => $queueID]);
        }
        
        /**
@@ -55,7 +55,7 @@ class ModerationQueueActivationManager extends AbstractModerationQueueManager {
         * @param       array           $additionalData
         * @throws      SystemException
         */
-       public function addModeratedContent($objectType, $objectID, array $additionalData = array()) {
+       public function addModeratedContent($objectType, $objectID, array $additionalData = []) {
                if (!$this->isValid($objectType)) {
                        throw new SystemException("Object type '".$objectType."' is not valid for definition 'com.woltlab.wcf.moderation.activation'");
                }
index ac003f0cbc30f9cb78592d8699bc3abcc5a60beb..533746080643c2513f6696ed35fe7d6e115226b5 100644 (file)
@@ -27,25 +27,25 @@ class ModerationQueueManager extends SingletonFactory {
         * list of definition names by definition id
         * @var string[]
         */
-       protected $definitions = array();
+       protected $definitions = [];
        
        /**
         * list of moderation types
         * @var ObjectType[]
         */
-       protected $moderationTypes = array();
+       protected $moderationTypes = [];
        
        /**
         * list of object type names categorized by type
         * @var integer[][]
         */
-       protected $objectTypeNames = array();
+       protected $objectTypeNames = [];
        
        /**
         * list of object types
         * @var ObjectType[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -65,7 +65,7 @@ class ModerationQueueManager extends SingletonFactory {
                        }
                        
                        $this->definitions[$definition->definitionID] = $definition->definitionName;
-                       $this->objectTypeNames[$definition->definitionName] = array();
+                       $this->objectTypeNames[$definition->definitionName] = [];
                        
                        $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes($definition->definitionName);
                        foreach ($objectTypes as $objectType) {
@@ -170,7 +170,7 @@ class ModerationQueueManager extends SingletonFactory {
         * @return      integer[]
         */
        public function getObjectTypeIDs(array $definitionIDs) {
-               $objectTypeIDs = array();
+               $objectTypeIDs = [];
                foreach ($definitionIDs as $definitionID) {
                        if (isset($this->definitions[$definitionID])) {
                                foreach ($this->objectTypeNames[$this->definitions[$definitionID]] as $objectTypeID) {
@@ -222,9 +222,9 @@ class ModerationQueueManager extends SingletonFactory {
                        
                        // count outstanding and assigned queues
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("moderation_queue_to_user.userID = ?", array(WCF::getUser()->userID));
-                       $conditions->add("moderation_queue_to_user.isAffected = ?", array(1));
-                       $conditions->add("moderation_queue.status IN (?)", array(array(ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING)));
+                       $conditions->add("moderation_queue_to_user.userID = ?", [WCF::getUser()->userID]);
+                       $conditions->add("moderation_queue_to_user.isAffected = ?", [1]);
+                       $conditions->add("moderation_queue.status IN (?)", [[ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING]]);
                        
                        $sql = "SELECT          COUNT(*)
                                FROM            wcf".WCF_N."_moderation_queue_to_user moderation_queue_to_user
@@ -259,10 +259,10 @@ class ModerationQueueManager extends SingletonFactory {
                        
                        // count outstanding and assigned queues
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("moderation_queue_to_user.userID = ?", array(WCF::getUser()->userID));
-                       $conditions->add("moderation_queue_to_user.isAffected = ?", array(1));
-                       $conditions->add("moderation_queue.status IN (?)", array(array(ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING)));
-                       $conditions->add("moderation_queue.time > ?", array(VisitTracker::getInstance()->getVisitTime('com.woltlab.wcf.moderation.queue')));
+                       $conditions->add("moderation_queue_to_user.userID = ?", [WCF::getUser()->userID]);
+                       $conditions->add("moderation_queue_to_user.isAffected = ?", [1]);
+                       $conditions->add("moderation_queue.status IN (?)", [[ModerationQueue::STATUS_OUTSTANDING, ModerationQueue::STATUS_PROCESSING]]);
+                       $conditions->add("moderation_queue.time > ?", [VisitTracker::getInstance()->getVisitTime('com.woltlab.wcf.moderation.queue')]);
                        $conditions->add("(moderation_queue.time > tracked_visit.visitTime OR tracked_visit.visitTime IS NULL)");
                        
                        $sql = "SELECT          COUNT(*)
@@ -293,10 +293,10 @@ class ModerationQueueManager extends SingletonFactory {
                $queueList->readObjects();
                
                if (count($queueList)) {
-                       $queues = array();
+                       $queues = [];
                        foreach ($queueList as $queue) {
                                if (!isset($queues[$queue->objectTypeID])) {
-                                       $queues[$queue->objectTypeID] = array();
+                                       $queues[$queue->objectTypeID] = [];
                                }
                                
                                $queues[$queue->objectTypeID][$queue->queueID] = $queue;
@@ -325,11 +325,11 @@ class ModerationQueueManager extends SingletonFactory {
                
                WCF::getDB()->beginTransaction();
                foreach ($assignments as $queueID => $isAffected) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $queueID,
                                WCF::getUser()->userID,
                                ($isAffected ? 1 : 0)
-                       ));
+                       ]);
                }
                WCF::getDB()->commitTransaction();
        }
@@ -346,24 +346,24 @@ class ModerationQueueManager extends SingletonFactory {
                                        AND moderation_queue_to_user.isAffected = ?
                                        AND moderation_queue.status <> ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        WCF::getUser()->userID,
                        1,
                        ModerationQueue::STATUS_DONE
-               ));
+               ]);
                
-               $queues = array();
+               $queues = [];
                while ($row = $statement->fetchArray()) {
                        $objectTypeID = $row['objectTypeID'];
                        if (!isset($queues[$objectTypeID])) {
-                               $queues[$objectTypeID] = array();
+                               $queues[$objectTypeID] = [];
                        }
                        
                        $queues[$objectTypeID][$row['objectID']] = $row['queueID'];
                }
                
                if (!empty($queues)) {
-                       $queueIDs = array();
+                       $queueIDs = [];
                        foreach ($queues as $objectTypeID => $objectQueues) {
                                $queueIDs = array_merge($queueIDs, $this->getProcessor($this->definitions[$this->objectTypes[$objectTypeID]->definitionID], null, $objectTypeID)->identifyOrphans($objectQueues));
                        }
@@ -380,7 +380,7 @@ class ModerationQueueManager extends SingletonFactory {
        public function removeOrphans(array $queueIDs) {
                if (!empty($queueIDs)) {
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("queueID IN (?)", array($queueIDs));
+                       $conditions->add("queueID IN (?)", [$queueIDs]);
                        $sql = "DELETE FROM     wcf".WCF_N."_moderation_queue
                                ".$conditions;
                        $statement = WCF::getDB()->prepareStatement($sql);
@@ -401,8 +401,8 @@ class ModerationQueueManager extends SingletonFactory {
                        UserStorageHandler::getInstance()->resetAll('unreadModerationCount');
                }
                else {
-                       UserStorageHandler::getInstance()->reset(array($userID), 'outstandingModerationCount');
-                       UserStorageHandler::getInstance()->reset(array($userID), 'unreadModerationCount');
+                       UserStorageHandler::getInstance()->reset([$userID], 'outstandingModerationCount');
+                       UserStorageHandler::getInstance()->reset([$userID], 'unreadModerationCount');
                }
        }
        
@@ -412,7 +412,7 @@ class ModerationQueueManager extends SingletonFactory {
         * @return      string[]
         */
        public function getDefinitionNamesByObjectTypeIDs() {
-               $definitionNames = array();
+               $definitionNames = [];
                foreach ($this->objectTypeNames as $definitionName => $objectTypes) {
                        foreach ($objectTypes as $objectTypeID) {
                                $definitionNames[$objectTypeID] = $definitionName;
@@ -429,7 +429,7 @@ class ModerationQueueManager extends SingletonFactory {
         * @return      string[]
         */
        public function getDefinitionNamesByObjectType($objectType) {
-               $definitionNames = array();
+               $definitionNames = [];
                foreach ($this->objectTypeNames as $definitionName => $objectTypes) {
                        if (isset($objectTypes[$objectType])) {
                                $definitionNames[] = $definitionName;
index 3e706f8a353542d72a705429ba7a0de2896d7fd9..52eb533f20a7fa2dd07a8f01ef8bade819dcd330 100644 (file)
@@ -38,10 +38,10 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager {
                        WHERE   objectTypeID = ?
                                AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        $objectID
-               ));
+               ]);
                
                return $statement->fetchSingleColumn() > 0;
        }
@@ -63,12 +63,12 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager {
                                AND objectID = ?
                                AND status IN (?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        $objectID,
                        ModerationQueue::STATUS_OUTSTANDING,
                        ModerationQueue::STATUS_PROCESSING
-               ));
+               ]);
                
                return $statement->fetchColumn() > 0;
        }
@@ -88,7 +88,7 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager {
         * @see \wcf\system\moderation\queue\IModerationQueueManager::getLink()
         */
        public function getLink($queueID) {
-               return LinkHandler::getInstance()->getLink('ModerationReport', array('id' => $queueID));
+               return LinkHandler::getInstance()->getLink('ModerationReport', ['id' => $queueID]);
        }
        
        /**
@@ -121,7 +121,7 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager {
         * @param       array           $additionalData
         * @throws      SystemException
         */
-       public function addReport($objectType, $objectID, $message, array $additionalData = array()) {
+       public function addReport($objectType, $objectID, $message, array $additionalData = []) {
                if (!$this->isValid($objectType)) {
                        throw new SystemException("Object type '".$objectType."' is not valid for definition 'com.woltlab.wcf.moderation.report'");
                }
@@ -138,43 +138,43 @@ class ModerationQueueReportManager extends AbstractModerationQueueManager {
        /**
         * @see \wcf\system\moderation\queue\AbstractModerationQueueManager::addEntry()
         */
-       protected function addEntry($objectTypeID, $objectID, $containerID = 0, array $additionalData = array()) {
+       protected function addEntry($objectTypeID, $objectID, $containerID = 0, array $additionalData = []) {
                $sql = "SELECT  queueID
                        FROM    wcf".WCF_N."_moderation_queue
                        WHERE   objectTypeID = ?
                                AND objectID = ?
                                AND status <> ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        $objectID,
                        ModerationQueue::STATUS_DONE
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                if ($row === false) {
-                       $objectAction = new ModerationQueueAction(array(), 'create', array(
-                               'data' => array(
+                       $objectAction = new ModerationQueueAction([], 'create', [
+                               'data' => [
                                        'objectTypeID' => $objectTypeID,
                                        'objectID' => $objectID,
                                        'containerID' => $containerID,
                                        'userID' => (WCF::getUser()->userID ?: null),
                                        'time' => TIME_NOW,
                                        'additionalData' => serialize($additionalData)
-                               )
-                       ));
+                               ]
+                       ]);
                        $objectAction->executeAction();
                }
                else {
-                       $objectAction = new ModerationQueueAction(array($row['queueID']), 'update', array(
-                               'data' => array(
+                       $objectAction = new ModerationQueueAction([$row['queueID']], 'update', [
+                               'data' => [
                                        'status' => ModerationQueue::STATUS_OUTSTANDING,
                                        'containerID' => $containerID,
                                        'userID' => (WCF::getUser()->userID ?: null),
                                        'time' => TIME_NOW,
                                        'additionalData' => serialize($additionalData)
-                               )
-                       ));
+                               ]
+                       ]);
                        $objectAction->executeAction();
                }
                
index 0cdb23acab08fa2429ce6c369af3014b39bcc678..263e756f23cba28acc2eba9b98dcb190fd523854 100644 (file)
@@ -19,7 +19,7 @@ class NoticeHandler extends SingletonFactory {
         * list with all enabled notices
         * @var Notice[]
         */
-       protected $notices = array();
+       protected $notices = [];
        
        /**
         * @see \wcf\system\SingletonFacetory::init()
@@ -34,7 +34,7 @@ class NoticeHandler extends SingletonFactory {
         * @return      Notice[]
         */
        public function getVisibleNotices() {
-               $notices = array();
+               $notices = [];
                foreach ($this->notices as $notice) {
                        if ($notice->isDismissed()) continue;
                        
index 3ffcb340235dee7dc1f56fe52a512ce72e47849a..454f1bc989147cc2b28d2e1f3ea8937fe4192bc6 100644 (file)
@@ -37,11 +37,11 @@ abstract class AbstractCategoryMultiSelectOptionType extends AbstractOptionType
                $categoryList = $categoryTree->getIterator();
                $categoryList->setMaxDepth(0);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'categoryList' => $categoryList,
                        'option' => $option,
                        'value' => (!is_array($value) ? explode("\n", $value) : $value)
-               ));
+               ]);
                return WCF::getTPL()->fetch('categoryMultiSelectOptionType');
        }
        
@@ -49,7 +49,7 @@ abstract class AbstractCategoryMultiSelectOptionType extends AbstractOptionType
         * @see \wcf\system\option\IOptionType::validate()
         */
        public function validate(Option $option, $newValue) {
-               if (!is_array($newValue)) $newValue = array();
+               if (!is_array($newValue)) $newValue = [];
                $newValue = ArrayUtil::toIntegerArray($newValue);
                
                foreach ($newValue as $categoryID) {
@@ -63,7 +63,7 @@ abstract class AbstractCategoryMultiSelectOptionType extends AbstractOptionType
         * @see \wcf\system\option\IOptionType::getData()
         */
        public function getData(Option $option, $newValue) {
-               if (!is_array($newValue)) $newValue = array();
+               if (!is_array($newValue)) $newValue = [];
                return implode("\n", ArrayUtil::toIntegerArray($newValue));
        }
 }
index 7c7ee1367da1bd0e243320ce34aab09420e3257d..37ae8d52357a165925d44ac5ff434b3c84ba2488 100644 (file)
@@ -62,11 +62,11 @@ class BirthdayOptionType extends DateOptionType {
                if (!empty($value['ageFrom'])) $ageFrom = intval($value['ageFrom']);
                if (!empty($value['ageTo'])) $ageTo = intval($value['ageTo']);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'valueAgeFrom' => $ageFrom,
                        'valueAgeTo' => $ageTo
-               ));
+               ]);
                return WCF::getTPL()->fetch('birthdaySearchableOptionType');
        }
        
@@ -84,16 +84,16 @@ class BirthdayOptionType extends DateOptionType {
                $dateFrom = DateUtil::getDateTimeByTimestamp(TIME_NOW)->sub(new \DateInterval('P'.($ageTo + 1).'Y'))->add(new \DateInterval('P1D'));
                $dateTo = DateUtil::getDateTimeByTimestamp(TIME_NOW)->sub(new \DateInterval('P'.$ageFrom.'Y'));
                
-               $conditions->add('option_value.userOption'.User::getUserOptionID('birthdayShowYear').' = ?', array(1));
+               $conditions->add('option_value.userOption'.User::getUserOptionID('birthdayShowYear').' = ?', [1]);
                
                if ($ageFrom && $ageTo) {
-                       $conditions->add('option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', array($dateFrom->format('Y-m-d'), $dateTo->format('Y-m-d')));
+                       $conditions->add('option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', [$dateFrom->format('Y-m-d'), $dateTo->format('Y-m-d')]);
                }
                else if ($ageFrom) {
-                       $conditions->add('option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', array('1893-01-01', $dateTo->format('Y-m-d')));
+                       $conditions->add('option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', ['1893-01-01', $dateTo->format('Y-m-d')]);
                }
                else {
-                       $conditions->add('option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', array($dateFrom->format('Y-m-d'), DateUtil::getDateTimeByTimestamp(TIME_NOW)->add(new \DateInterval('P1D'))->format('Y-m-d')));
+                       $conditions->add('option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', [$dateFrom->format('Y-m-d'), DateUtil::getDateTimeByTimestamp(TIME_NOW)->add(new \DateInterval('P1D'))->format('Y-m-d')]);
                }
                
                return true;
@@ -111,16 +111,16 @@ class BirthdayOptionType extends DateOptionType {
                $dateFrom = DateUtil::getDateTimeByTimestamp(TIME_NOW)->sub(new \DateInterval('P'.($ageTo + 1).'Y'))->add(new \DateInterval('P1D'));
                $dateTo = DateUtil::getDateTimeByTimestamp(TIME_NOW)->sub(new \DateInterval('P'.$ageFrom.'Y'));
                
-               $userList->getConditionBuilder()->add('user_option_value.userOption'.User::getUserOptionID('birthdayShowYear').' = ?', array(1));
+               $userList->getConditionBuilder()->add('user_option_value.userOption'.User::getUserOptionID('birthdayShowYear').' = ?', [1]);
                
                if ($ageFrom && $ageTo) {
-                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', array($dateFrom->format('Y-m-d'), $dateTo->format('Y-m-d')));
+                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', [$dateFrom->format('Y-m-d'), $dateTo->format('Y-m-d')]);
                }
                else if ($ageFrom) {
-                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', array('1893-01-01', $dateTo->format('Y-m-d')));
+                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', ['1893-01-01', $dateTo->format('Y-m-d')]);
                }
                else {
-                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', array($dateFrom->format('Y-m-d'), DateUtil::getDateTimeByTimestamp(TIME_NOW)->add(new \DateInterval('P1D'))->format('Y-m-d')));
+                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' BETWEEN DATE(?) AND DATE(?)', [$dateFrom->format('Y-m-d'), DateUtil::getDateTimeByTimestamp(TIME_NOW)->add(new \DateInterval('P1D'))->format('Y-m-d')]);
                }
        }
        
index 923406c004676afe2f490b9910a659890549e2f7..579a45bd93b5d85cc90dfc494f35847c125df73e 100644 (file)
@@ -23,12 +23,12 @@ class BooleanOptionType extends AbstractOptionType implements ISearchableUserOpt
        public function getFormElement(Option $option, $value) {
                $options = Option::parseEnableOptions($option->enableOptions);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'disableOptions' => $options['disableOptions'],
                        'enableOptions' => $options['enableOptions'],
                        'option' => $option,
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('booleanOptionType');
        }
        
@@ -54,7 +54,7 @@ class BooleanOptionType extends AbstractOptionType implements ISearchableUserOpt
                $value = intval($value);
                if (!$value) return false;
                
-               $conditions->add("option_value.userOption".$option->optionID." = ?", array(1));
+               $conditions->add("option_value.userOption".$option->optionID." = ?", [1]);
                return true;
        }
        
@@ -65,7 +65,7 @@ class BooleanOptionType extends AbstractOptionType implements ISearchableUserOpt
                $value = intval($value);
                if (!$value) return;
                
-               $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' = ?', array(1));
+               $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' = ?', [1]);
        }
        
        /**
index f3d88e55adc2b625af41a22abfe306b13b398a3e..f17308b411e7ff2a2ba611384e0054e35bb40b17 100644 (file)
@@ -23,18 +23,18 @@ class CaptchaSelectOptionType extends AbstractOptionType {
                $selectOptions = CaptchaHandler::getInstance()->getCaptchaSelection();
                if ($option->allowemptyvalue) {
                        $selectOptions = array_merge(
-                               array(
+                               [
                                        '' => WCF::getLanguage()->get('wcf.captcha.useNoCaptcha')
-                               ),
+                               ],
                                $selectOptions
                        );
                }
                
-               return WCF::getTPL()->fetch('selectOptionType', 'wcf', array(
+               return WCF::getTPL()->fetch('selectOptionType', 'wcf', [
                        'selectOptions' => $selectOptions,
                        'option' => $option,
                        'value' => $value
-               ));
+               ]);
        }
        
        /**
index 8eaab3080e76c013ac5a3c9fc45276777afa1daa..78e5e27db8fbfe002070b84d55d52ecb694e20b2 100644 (file)
@@ -24,7 +24,7 @@ class FileOptionType extends AbstractOptionType {
         * upload handler for option files
         * @var UploadHandler[]
         */
-       protected $uploadHandlers = array();
+       protected $uploadHandlers = [];
        
        /**
         * Creates the upload handler for the given option.
@@ -81,10 +81,10 @@ class FileOptionType extends AbstractOptionType {
         * @see \wcf\system\option\IOptionType::getFormElement()
         */
        public function getFormElement(Option $option, $value) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'value' => $value
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('fileOptionType');
        }
index 51ab66551c48fc6b4e9d4fd440e527cd40951c24..348879f33c094e5ff5a5e68aaa5ff3415065d23a 100644 (file)
@@ -24,11 +24,11 @@ class IntegerOptionType extends TextOptionType {
         * @see \wcf\system\option\IOptionType::getFormElement()
         */
        public function getFormElement(Option $option, $value) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'inputClass' => $this->inputClass,
                        'value' => $value
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('integerOptionType');
        }
index 2ccbcbbb0015663324cb2ec77c356217b6e029f5..2ff7c0e4e372fa360653d8c01d08c2b67f69b6d1 100644 (file)
@@ -34,7 +34,7 @@ class MessageOptionType extends TextareaOptionType {
         * @see \wcf\system\option\IOptionType::getFormElement()
         */
        public function getFormElement(Option $option, $value) {
-               $allowedBBCodes = array();
+               $allowedBBCodes = [];
                if ($option->allowedbbcodepermission) {
                        $allowedBBCodes = explode(',', WCF::getSession()->getPermission($option->allowedbbcodepermission));
                }
@@ -43,11 +43,11 @@ class MessageOptionType extends TextareaOptionType {
                }
                BBCodeHandler::getInstance()->setAllowedBBCodes($allowedBBCodes);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'defaultSmilies' => SmileyCache::getInstance()->getCategorySmilies(),
                        'option' => $option,
                        'value' => $value
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('messageOptionType');
        }
index 61a41a1194fd04d9a8616c1ec48c03bd92cb54f5..9d3835543b75bc8550d297e3739158a2ce7fc97d 100644 (file)
@@ -35,11 +35,11 @@ class MultiSelectOptionType extends SelectOptionType {
         * @see \wcf\system\option\IOptionType::getFormElement()
         */
        public function getFormElement(Option $option, $value) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'selectOptions' => $this->getSelectOptions($option),
                        'value' => (!is_array($value) ? explode("\n", $value) : $value)
-               ));
+               ]);
                return WCF::getTPL()->fetch($this->formElementTemplate);
        }
        
@@ -47,12 +47,12 @@ class MultiSelectOptionType extends SelectOptionType {
         * @see \wcf\system\option\ISearchableUserOption::getSearchFormElement()
         */
        public function getSearchFormElement(Option $option, $value) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'searchOption' => $value !== null && ($value !== $option->defaultValue || isset($_POST['searchOptions'][$option->optionName])),
                        'selectOptions' => $this->getSelectOptions($option),
                        'value' => (!is_array($value) ? explode("\n", $value) : $value)
-               ));
+               ]);
                return WCF::getTPL()->fetch($this->searchableFormElementTemplate);
        }
        
@@ -60,7 +60,7 @@ class MultiSelectOptionType extends SelectOptionType {
         * @see \wcf\system\option\IOptionType::validate()
         */
        public function validate(Option $option, $newValue) {
-               if (!is_array($newValue)) $newValue = array();
+               if (!is_array($newValue)) $newValue = [];
                $options = $this->getSelectOptions($option);
                foreach ($newValue as $value) {
                        if (!isset($options[$value])) {
@@ -73,7 +73,7 @@ class MultiSelectOptionType extends SelectOptionType {
         * @see \wcf\system\option\IOptionType::getData()
         */
        public function getData(Option $option, $newValue) {
-               if (!is_array($newValue)) $newValue = array();
+               if (!is_array($newValue)) $newValue = [];
                return implode("\n", $newValue);
        }
        
index 34f50ca548718f40c66af7b52ed7ac52e10b7242..4e67813ee4414e1d8110868789569bca388f8b7e 100644 (file)
@@ -66,13 +66,13 @@ class OptionHandler implements IOptionHandler {
         * options of the active category
         * @var Option[]
         */
-       public $options = array();
+       public $options = [];
        
        /**
         * type object cache
         * @var IOptionType[]
         */
-       public $typeObjects = array();
+       public $typeObjects = [];
        
        /**
         * language item pattern
@@ -84,13 +84,13 @@ class OptionHandler implements IOptionHandler {
         * option values
         * @var mixed[]
         */
-       public $optionValues = array();
+       public $optionValues = [];
        
        /**
         * raw option values
         * @var mixed[]
         */
-       public $rawValues = array();
+       public $rawValues = [];
        
        /**
         * true, if options support i18n
@@ -137,7 +137,7 @@ class OptionHandler implements IOptionHandler {
         * @see \wcf\system\option\IOptionHandler::validate()
         */
        public function validate() {
-               $errors = array();
+               $errors = [];
                
                foreach ($this->options as $option) {
                        try {
@@ -155,17 +155,17 @@ class OptionHandler implements IOptionHandler {
         * @see \wcf\system\option\IOptionHandler::getOptionTree()
         */
        public function getOptionTree($parentCategoryName = '', $level = 0) {
-               $tree = array();
+               $tree = [];
                
                if (isset($this->cachedCategoryStructure[$parentCategoryName])) {
                        // get super categories
                        foreach ($this->cachedCategoryStructure[$parentCategoryName] as $superCategoryName) {
                                $superCategoryObject = $this->cachedCategories[$superCategoryName];
-                               $superCategory = array(
+                               $superCategory = [
                                        'object' => $superCategoryObject,
-                                       'categories' => array(),
-                                       'options' => array()
-                               );
+                                       'categories' => [],
+                                       'options' => []
+                               ];
                                
                                if ($this->checkCategory($superCategoryObject)) {
                                        if ($level <= 1) {
@@ -193,7 +193,7 @@ class OptionHandler implements IOptionHandler {
         * @see \wcf\system\option\IOptionHandler::getCategoryOptions()
         */
        public function getCategoryOptions($categoryName = '', $inherit = true) {
-               $children = array();
+               $children = [];
                
                // get sub categories
                if ($inherit && isset($this->cachedCategoryStructure[$categoryName])) {
@@ -236,7 +236,7 @@ class OptionHandler implements IOptionHandler {
         * @see \wcf\system\option\IOptionHandler::save()
         */
        public function save($categoryName = null, $optionPrefix = null) {
-               $saveOptions = array();
+               $saveOptions = [];
                
                if ($this->supportI18n && ($categoryName === null || $optionPrefix === null)) {
                        throw new SystemException("category name or option prefix missing");
@@ -275,12 +275,12 @@ class OptionHandler implements IOptionHandler {
                // get form element html
                $html = $this->getFormElement($option->optionType, $option);
                
-               return array(
+               return [
                        'object' => $option,
                        'html' => $html,
                        'cssClassName' => $this->getTypeObject($option->optionType)->getCSSClassName(),
                        'hideLabelInSearch' => $this->getTypeObject($option->optionType)->hideLabelInSearch()
-               );
+               ];
        }
        
        /**
@@ -356,7 +356,7 @@ class OptionHandler implements IOptionHandler {
                }
                else {
                        if ($this->abbreviations === null) {
-                               $this->abbreviations = array();
+                               $this->abbreviations = [];
                                
                                $applications = ApplicationHandler::getInstance()->getApplications();
                                foreach ($applications as $application) {
@@ -389,13 +389,13 @@ class OptionHandler implements IOptionHandler {
         * Gets all options and option categories from cache.
         */
        protected function readCache() {
-               $cache = call_user_func(array($this->cacheClass, 'getInstance'));
+               $cache = call_user_func([$this->cacheClass, 'getInstance']);
                
                // get cache contents
-               $this->cachedCategories = $cache->getData(array(), 'categories');
-               $this->cachedOptions = $cache->getData(array(), 'options');
-               $this->cachedCategoryStructure = $cache->getData(array(), 'categoryStructure');
-               $this->cachedOptionToCategories = $cache->getData(array(), 'optionToCategories');
+               $this->cachedCategories = $cache->getData([], 'categories');
+               $this->cachedOptions = $cache->getData([], 'options');
+               $this->cachedCategoryStructure = $cache->getData([], 'categoryStructure');
+               $this->cachedOptionToCategories = $cache->getData([], 'optionToCategories');
                
                // allow option manipulation
                EventHandler::getInstance()->fireAction($this, 'afterReadCache');
index 559c48c6fabd5ec11e4dcd6b3efbc0bf1c794870..97a76f67ba67d97d67fa143c1f9e080119847bbc 100644 (file)
@@ -22,11 +22,11 @@ class PaymentMethodSelectOptionType extends AbstractOptionType {
        public function getFormElement(Option $option, $value) {
                $selectOptions = PaymentMethodHandler::getInstance()->getPaymentMethodSelection();
                
-               return WCF::getTPL()->fetch('paymentMethodSelectOptionType', 'wcf', array(
+               return WCF::getTPL()->fetch('paymentMethodSelectOptionType', 'wcf', [
                        'selectOptions' => $selectOptions,
                        'option' => $option,
                        'value' => explode(',', $value)
-               ));
+               ]);
        }
        
        /**
@@ -34,7 +34,7 @@ class PaymentMethodSelectOptionType extends AbstractOptionType {
         */
        public function validate(Option $option, $newValue) {
                if (!is_array($newValue)) {
-                       $newValue = array();
+                       $newValue = [];
                }
                
                $selectOptions = PaymentMethodHandler::getInstance()->getPaymentMethodSelection();
index 1e22d16ed68dc32c617d0eb1274b1643450e822b..8923eedc904cdd2a21b5e37ccb5aa3e5efdb32fa 100644 (file)
@@ -30,10 +30,10 @@ class RadioButtonOptionType extends AbstractOptionType implements ISearchableCon
         */
        public function getFormElement(Option $option, $value) {
                $availableOptions = $option->parseMultipleEnableOptions();
-               $options = array(
-                       'disableOptions' => array(),
-                       'enableOptions' => array()
-               );
+               $options = [
+                       'disableOptions' => [],
+                       'enableOptions' => []
+               ];
                
                foreach ($availableOptions as $key => $enableOptions) {
                        $optionData = Option::parseEnableOptions($enableOptions);
@@ -42,13 +42,13 @@ class RadioButtonOptionType extends AbstractOptionType implements ISearchableCon
                        $options['enableOptions'][$key] = $optionData['enableOptions'];
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'disableOptions' => $options['disableOptions'],
                        'enableOptions' => $options['enableOptions'],
                        'option' => $option,
                        'selectOptions' => $this->getSelectOptions($option),
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch($this->templateName);
        }
        
@@ -80,7 +80,7 @@ class RadioButtonOptionType extends AbstractOptionType implements ISearchableCon
        public function getCondition(PreparedStatementConditionBuilder &$conditions, Option $option, $value) {
                if (!isset($_POST['searchOptions'][$option->optionName])) return false;
                
-               $conditions->add("option_value.userOption".$option->optionID." = ?", array(StringUtil::trim($value)));
+               $conditions->add("option_value.userOption".$option->optionID." = ?", [StringUtil::trim($value)]);
                return true;
        }
        
@@ -88,7 +88,7 @@ class RadioButtonOptionType extends AbstractOptionType implements ISearchableCon
         * @inheritDoc
         */
        public function addCondition(UserList $userList, Option $option, $value) {
-               $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' = ?', array(StringUtil::trim($value)));
+               $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' = ?', [StringUtil::trim($value)]);
        }
        
        /**
index 58c4ec49cce7457f78fa3074c043d9d8d40ecc19..84ee147be3c5ef95c375e1fccfeb7dc2c4cc607e 100644 (file)
@@ -22,14 +22,14 @@ class SelectOptionType extends RadioButtonOptionType {
        public function getFormElement(Option $option, $value) {
                $options = $this->parseEnableOptions($option);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'disableOptions' => $options['disableOptions'],
                        'enableOptions' => $options['enableOptions'],
                        'option' => $option,
                        'selectOptions' => $this->getSelectOptions($option),
                        'value' => $value,
                        'allowEmptyValue' => ($this->allowEmptyValue || $option->allowEmptyValue)
-               ));
+               ]);
                return WCF::getTPL()->fetch('selectOptionType');
        }
        
@@ -39,14 +39,14 @@ class SelectOptionType extends RadioButtonOptionType {
        public function getSearchFormElement(Option $option, $value) {
                $options = $this->parseEnableOptions($option);
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'disableOptions' => $options['disableOptions'],
                        'enableOptions' => $options['enableOptions'],
                        'option' => $option,
                        'searchOption' => ($value !== null && $value !== $option->defaultValue) || isset($_POST['searchOptions'][$option->optionName]),
                        'selectOptions' => $this->getSelectOptions($option),
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('selectSearchableOptionType');
        }
        
@@ -78,10 +78,10 @@ class SelectOptionType extends RadioButtonOptionType {
                        }
                }
                
-               return array(
+               return [
                        'disableOptions' => $disableOptions,
                        'enableOptions' => $enableOptions
-               );
+               ];
        }
        
        /**
index 8b90e4e0b0a375784f4644ab1a2778960065f050..ad4c5979c92a8b5ddc6941cb8a976bc91c3a56ad 100644 (file)
@@ -27,11 +27,11 @@ class TextI18nOptionType extends TextOptionType {
        public function getFormElement(Option $option, $value) {
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'inputType' => $this->inputType,
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('textI18nOptionType');
        }
        
index 8cb9216a0371fd05d85fc5ad59376949e992bd5d..34c01fb064e1f956895db8e80363bc3fbf35bbe1 100644 (file)
@@ -35,12 +35,12 @@ class TextOptionType extends AbstractOptionType implements ISearchableConditionU
         * @see \wcf\system\option\IOptionType::getFormElement()
         */
        public function getFormElement(Option $option, $value) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'inputType' => $this->inputType,
                        'inputClass' => $this->inputClass,
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('textOptionType');
        }
        
@@ -48,13 +48,13 @@ class TextOptionType extends AbstractOptionType implements ISearchableConditionU
         * @see \wcf\system\option\ISearchableUserOption::getSearchFormElement()
         */
        public function getSearchFormElement(Option $option, $value) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'inputType' => $this->inputType,
                        'inputClass' => $this->inputClass,
                        'searchOption' => $value !== null && ($value !== $option->defaultValue || isset($_POST['searchOptions'][$option->optionName])),
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('textSearchableOptionType');
        }
        
@@ -66,10 +66,10 @@ class TextOptionType extends AbstractOptionType implements ISearchableConditionU
                
                $value = StringUtil::trim($value);
                if ($value == '') {
-                       $conditions->add("option_value.userOption".$option->optionID." = ?", array(''));
+                       $conditions->add("option_value.userOption".$option->optionID." = ?", ['']);
                }
                else {
-                       $conditions->add("option_value.userOption".$option->optionID." LIKE ?", array('%'.addcslashes($value, '_%').'%'));
+                       $conditions->add("option_value.userOption".$option->optionID." LIKE ?", ['%'.addcslashes($value, '_%').'%']);
                }
                
                return true;
@@ -120,10 +120,10 @@ class TextOptionType extends AbstractOptionType implements ISearchableConditionU
        public function addCondition(UserList $userList, Option $option, $value) {
                $value = StringUtil::trim($value);
                if ($value == '') {
-                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' = ?', array(''));
+                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' = ?', ['']);
                }
                else {
-                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' LIKE ?', array('%'.addcslashes($value, '_%').'%'));
+                       $userList->getConditionBuilder()->add('user_option_value.userOption'.$option->optionID.' LIKE ?', ['%'.addcslashes($value, '_%').'%']);
                }
        }
        
index 058dd5a7d01cf26c8eb5b53f4ec8ca823632dbaa..0a1b613f0baca3765de60b053915e0f69194a616 100644 (file)
@@ -27,10 +27,10 @@ class TextareaI18nOptionType extends TextareaOptionType {
        public function getFormElement(Option $option, $value) {
                I18nHandler::getInstance()->assignVariables(!empty($_POST));
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('textareaI18nOptionType');
        }
        
index 66c3fedfee38a741aee380699184ce6751c8c2a8..c9a98e7fc563364606c82752cc2451d35fb26ade 100644 (file)
@@ -33,10 +33,10 @@ class TextareaIpAddressOptionType extends TextOptionType {
                        $value = implode("\n", $ips);
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('textareaOptionType');
        }
        
index 2dc974282060dd0cde1638bbb544681ba48a4a7f..6d4d2eb14e15e9d89295d6480d8ca5dd9b797116 100644 (file)
@@ -19,10 +19,10 @@ class TextareaOptionType extends TextOptionType {
         * @see \wcf\system\option\IOptionType::getFormElement()
         */
        public function getFormElement(Option $option, $value) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('textareaOptionType');
        }
        
@@ -30,11 +30,11 @@ class TextareaOptionType extends TextOptionType {
         * @see \wcf\system\option\ISearchableUserOption::getSearchFormElement()
         */
        public function getSearchFormElement(Option $option, $value) {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'searchOption' => $value !== null && ($value !== $option->defaultValue || isset($_POST['searchOptions'][$option->optionName])),
                        'value' => $value
-               ));
+               ]);
                return WCF::getTPL()->fetch('textareaSearchableOptionType');
        }
        
index c0bc67febb1ff9a2297b1195e5ea5f08172223cf..bcace59e8285b76d94aebc0567ec3fabd3c61396 100644 (file)
@@ -20,16 +20,16 @@ class TimezoneOptionType extends AbstractOptionType {
         * @see \wcf\system\option\IOptionType::getFormElement()
         */
        public function getFormElement(Option $option, $value) {
-               $timezoneOptions = array();
+               $timezoneOptions = [];
                foreach (DateUtil::getAvailableTimezones() as $timezone) {
                        $timezoneOptions[$timezone] = WCF::getLanguage()->get('wcf.date.timezone.'.str_replace('/', '.', strtolower($timezone)));
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'selectOptions' => $timezoneOptions,
                        'value' => ($value ?: TIMEZONE)
-               ));
+               ]);
                return WCF::getTPL()->fetch('selectOptionType');
        }
        
index f9248e00e65829e51d0309884621e0458a6696d6..f19c0cc8f7f8fc42ecd1987275d44b675ecc2279 100644 (file)
@@ -44,6 +44,6 @@ class DateUserOptionOutput implements IUserOptionOutput {
                if (isset($optionValue[1])) $month = intval($optionValue[1]);
                if (isset($optionValue[2])) $day = intval($optionValue[2]);
                
-               return array('year' => $year, 'month' => $month, 'day' => $day);
+               return ['year' => $year, 'month' => $month, 'day' => $day];
        }
 }
index 28d98dd722c23bf7d6f5a29c66ff31f1a0c8ab27..810ccdbda2c4b27951fdebddc547c5a61801727c 100644 (file)
@@ -28,10 +28,10 @@ class MessageUserOptionOutput implements IUserOptionOutput {
                
                MessageParser::getInstance()->setOutputType('text/html');
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'option' => $option,
                        'value' => MessageParser::getInstance()->parse($value),
-               ));
+               ]);
                return WCF::getTPL()->fetch('messageUserOptionOutput');
        }
 }
index cbbae396ea6f002150a93b9437401ac3607247ed..eaae0fbb576d99d47f9ba5f98870891ba1b5e57f 100644 (file)
@@ -51,7 +51,7 @@ class SelectOptionsUserOptionOutput implements IUserOptionOutput {
                // multiselect
                if (mb_strpos($value, "\n") !== false) {
                        $values = explode("\n", $value);
-                       $result = array();
+                       $result = [];
                        foreach ($values as $value) {
                                if (isset($options[$value])) {
                                        $result[] = $options[$value];
index fb7d5812237769e8191bed2be2ef40f05b32b00a..4976da3b81d12a57ed0f5098db1a424f9171d967 100644 (file)
@@ -105,7 +105,7 @@ class UserOptionHandler extends OptionHandler {
         * @param       \wcf\data\user\User     $user
         */
        public function setUser(User $user) {
-               $this->optionValues = array();
+               $this->optionValues = [];
                $this->user = $user;
                
                $this->init();
@@ -119,7 +119,7 @@ class UserOptionHandler extends OptionHandler {
         * Resets the option values.
         */
        public function resetOptionValues() {
-               $this->optionValues = array();
+               $this->optionValues = [];
        }
        
        /**
index 9b9349cfc8bade7aae0f7509cf4fdcdb8e8281ce..5f9be1638836b9f205bd039348c8a72aa1a6fdfa 100644 (file)
@@ -29,7 +29,7 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
         */
        public function getData(Option $option, $newValue) {
                if (!is_array($newValue)) {
-                       $newValue = array();
+                       $newValue = [];
                }
                
                return implode(',', $newValue);
@@ -43,7 +43,7 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
                        $this->loadBBCodeSelection();
                }
                
-               $selectedBBCodes = array();
+               $selectedBBCodes = [];
                if ($value == 'all') {
                        $selectedBBCodes = $this->bbCodes;
                }
@@ -51,11 +51,11 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
                        $selectedBBCodes = explode(',', $value);
                }
                
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'bbCodes' => $this->bbCodes,
                        'option' => $option,
                        'selectedBBCodes' => $selectedBBCodes
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('bbCodeSelectOptionType');
        }
@@ -82,7 +82,7 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
                        $defaultValue = $this->bbCodes;
                }
                else if (empty($defaultValue) || $defaultValue == 'none') {
-                       $defaultValue = array();
+                       $defaultValue = [];
                }
                else {
                        $defaultValue = explode(',', StringUtil::unifyNewlines($defaultValue));
@@ -91,7 +91,7 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
                        $groupValue = $this->bbCodes;
                }
                else if (empty($groupValue) || $groupValue == 'none') {
-                       $groupValue = array();
+                       $groupValue = [];
                }
                else {
                        $groupValue = explode(',', StringUtil::unifyNewlines($groupValue));
@@ -108,7 +108,7 @@ class BBCodeSelectUserGroupOptionType extends AbstractOptionType implements IUse
         */
        public function validate(Option $option, $newValue) {
                if (!is_array($newValue)) {
-                       $newValue = array();
+                       $newValue = [];
                }
                
                if ($this->bbCodes === null) {
index b2db2e291094ae8ff8fd91795acfa993018615ee..43b9cdc85786598e97e0c801938a430743678a17 100644 (file)
@@ -23,8 +23,8 @@ class TextUserGroupOptionType extends TextOptionType implements IUserGroupOption
         * @see \wcf\system\option\user\group\IUserGroupOptionType::merge()
         */
        public function merge($defaultValue, $groupValue) {
-               $defaultValue = empty($defaultValue) ? array() : explode("\n", StringUtil::unifyNewlines($defaultValue));
-               $groupValue = empty($groupValue) ? array() : explode("\n", StringUtil::unifyNewlines($groupValue));
+               $defaultValue = empty($defaultValue) ? [] : explode("\n", StringUtil::unifyNewlines($defaultValue));
+               $groupValue = empty($groupValue) ? [] : explode("\n", StringUtil::unifyNewlines($groupValue));
                
                return implode("\n", array_unique(array_merge($defaultValue, $groupValue)));
        }
index 230e3e6c683ba82752713491ac67ffcaed65a742..90091cc4df69c1ede7bef516aed298823287225c 100644 (file)
@@ -20,8 +20,8 @@ class TextareaUserGroupOptionType extends TextareaOptionType implements IUserGro
         * @see \wcf\system\option\user\group\IUserGroupOptionType::merge()
         */
        public function merge($defaultValue, $groupValue) {
-               $defaultValue = empty($defaultValue) ? array() : explode("\n", StringUtil::unifyNewlines($defaultValue));
-               $groupValue = empty($groupValue) ? array() : explode("\n", StringUtil::unifyNewlines($groupValue));
+               $defaultValue = empty($defaultValue) ? [] : explode("\n", StringUtil::unifyNewlines($defaultValue));
+               $groupValue = empty($groupValue) ? [] : explode("\n", StringUtil::unifyNewlines($groupValue));
                
                return implode("\n", array_unique(array_merge($defaultValue, $groupValue)));
        }
index 4c5ba1c4ea60192494177abb89edcda3d249b65a..223a7b5f1f41a467b59f7731468c6da5cf1fb5f1 100644 (file)
@@ -45,7 +45,7 @@ class UserGroupsUserGroupOptionType extends AbstractOptionType implements IUserG
                $groups = UserGroup::getGroupsByType();
                
                // get new value
-               if (!is_array($newValue)) $newValue = array();
+               if (!is_array($newValue)) $newValue = [];
                $selectedGroups = ArrayUtil::toIntegerArray($newValue);
                
                // check groups
@@ -60,7 +60,7 @@ class UserGroupsUserGroupOptionType extends AbstractOptionType implements IUserG
         * @see \wcf\system\option\IOptionType::getData()
         */
        public function getData(Option $option, $newValue) {
-               if (!is_array($newValue)) $newValue = array();
+               if (!is_array($newValue)) $newValue = [];
                $newValue = ArrayUtil::toIntegerArray($newValue);
                sort($newValue, SORT_NUMERIC);
                return implode(',', $newValue);
@@ -70,8 +70,8 @@ class UserGroupsUserGroupOptionType extends AbstractOptionType implements IUserG
         * @see \wcf\system\option\user\group\IUserGroupOptionType::merge()
         */
        public function merge($defaultValue, $groupValue) {
-               $defaultValue = empty($defaultValue) ? array() : explode(',', StringUtil::unifyNewlines($defaultValue));
-               $groupValue = empty($groupValue) ? array() : explode(',', StringUtil::unifyNewlines($groupValue));
+               $defaultValue = empty($defaultValue) ? [] : explode(',', StringUtil::unifyNewlines($defaultValue));
+               $groupValue = empty($groupValue) ? [] : explode(',', StringUtil::unifyNewlines($groupValue));
                
                return implode(',', array_unique(array_merge($defaultValue, $groupValue)));
        }
@@ -80,8 +80,8 @@ class UserGroupsUserGroupOptionType extends AbstractOptionType implements IUserG
         * @see \wcf\system\option\IOptionType::compare()
         */
        public function compare($value1, $value2) {
-               $value1 = ($value1) ? explode(',', $value1) : array();
-               $value2 = ($value2) ? explode(',', $value2) : array();
+               $value1 = ($value1) ? explode(',', $value1) : [];
+               $value2 = ($value2) ? explode(',', $value2) : [];
                
                // check if value1 contains more elements than value2
                $diff = array_diff($value1, $value2);
index b62d9ae3017c1fefc8881697c9cca701e9b2eb97..635f1e81f23c201198d69dd31d6106a4f3fce870 100644 (file)
@@ -42,9 +42,9 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler {
                                
                                // get by other packages registered files
                                $conditions = new PreparedStatementConditionBuilder();
-                               $conditions->add('packageID <> ?', array($this->packageInstallation->getPackageID()));
-                               $conditions->add('templateName IN (?)', array($files));
-                               $conditions->add('application = ?', array($this->application));
+                               $conditions->add('packageID <> ?', [$this->packageInstallation->getPackageID()]);
+                               $conditions->add('templateName IN (?)', [$files]);
+                               $conditions->add('application = ?', [$this->application]);
                                if ($this->supportsTemplateGroups) {
                                        $conditions->add("templateGroupID IS NULL");
                                }
@@ -55,7 +55,7 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler {
                                $statement = WCF::getDB()->prepareStatement($sql);
                                $statement->execute($conditions->getParameters());
                                
-                               $lockedFiles = array();
+                               $lockedFiles = [];
                                while ($row = $statement->fetchArray()) {
                                        $lockedFiles[$row['templateName']] = $row['packageID'];
                                }
@@ -88,9 +88,9 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler {
                
                // fetch already installed acp templates
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add('packageID = ?', array($this->packageInstallation->getPackageID()));
-               $conditions->add('templateName IN (?)', array($files));
-               $conditions->add('application = ?', array($this->application));
+               $conditions->add('packageID = ?', [$this->packageInstallation->getPackageID()]);
+               $conditions->add('templateName IN (?)', [$files]);
+               $conditions->add('application = ?', [$this->application]);
                
                $sql = "SELECT  templateName
                        FROM    wcf".WCF_N."_".$this->tableName."
@@ -113,11 +113,11 @@ class ACPTemplatesFileHandler extends PackageInstallationFileHandler {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($files as $file) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $this->packageInstallation->getPackageID(),
                                        $file,
                                        $this->application
-                               ));
+                               ]);
                        }
                }
        }
index 8aff4e9d9d3b7b138a5153a200437e6f7846c66b..4ae31239baac6ebd9f35f36188d082b556519d1c 100644 (file)
@@ -25,16 +25,16 @@ class FilesFileHandler extends PackageInstallationFileHandler {
                                // get registered files of other packages for the
                                // same application
                                $conditions = new PreparedStatementConditionBuilder();
-                               $conditions->add('packageID <> ?', array($this->packageInstallation->getPackageID()));
-                               $conditions->add('filename IN (?)', array($files));
-                               $conditions->add('application = ?', array($this->application));
+                               $conditions->add('packageID <> ?', [$this->packageInstallation->getPackageID()]);
+                               $conditions->add('filename IN (?)', [$files]);
+                               $conditions->add('application = ?', [$this->application]);
                                
                                $sql = "SELECT  filename, packageID
                                        FROM    wcf".WCF_N."_package_installation_file_log
                                        ".$conditions;
                                $statement = WCF::getDB()->prepareStatement($sql);
                                $statement->execute($conditions->getParameters());
-                               $lockedFiles = array();
+                               $lockedFiles = [];
                                while ($row = $statement->fetchArray()) {
                                        $lockedFiles[$row['filename']] = $row['packageID'];
                                }
@@ -68,11 +68,11 @@ class FilesFileHandler extends PackageInstallationFileHandler {
                
                WCF::getDB()->beginTransaction();
                foreach ($files as $file) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->packageInstallation->getPackageID(),
                                $file,
                                $this->application
-                       ));
+                       ]);
                }
                WCF::getDB()->commitTransaction();
        }
index d04325dd6155210e5b5e7aa0550ed83e26f9bde5..5b8784140be22e065fbb1cee0f61bb945758f352 100644 (file)
@@ -42,46 +42,46 @@ class PackageArchive {
         * general package information
         * @var array
         */
-       protected $packageInfo = array();
+       protected $packageInfo = [];
        
        /**
         * author information
         * @var array
         */
-       protected $authorInfo = array();
+       protected $authorInfo = [];
        
        /**
         * list of requirements
         * @var array
         */
-       protected $requirements = array();
+       protected $requirements = [];
        
        /**
         * list of optional packages
         * @var array
         */
-       protected $optionals = array();
+       protected $optionals = [];
        
        /**
         * list of excluded packages
         * @var array
         */
-       protected $excludedPackages = array();
+       protected $excludedPackages = [];
        
        /**
         * list of instructions
         * @var mixed[][]
         */
-       protected $instructions = array(
-               'install' => array(),
-               'update' => array()
-       );
+       protected $instructions = [
+               'install' => [],
+               'update' => []
+       ];
        
        /**
         * list of php requirements
         * @var mixed[][]
         */
-       protected $phpRequirements = array();
+       protected $phpRequirements = [];
        
        /**
         * default name of the package.xml file
@@ -134,7 +134,7 @@ class PackageArchive {
        public function openArchive() {
                // check whether archive exists and is a TAR archive
                if (!file_exists($this->archive)) {
-                       throw new PackageValidationException(PackageValidationException::FILE_NOT_FOUND, array('archive' => $this->archive));
+                       throw new PackageValidationException(PackageValidationException::FILE_NOT_FOUND, ['archive' => $this->archive]);
                }
                
                // open archive and read package information
@@ -149,7 +149,7 @@ class PackageArchive {
                // search package.xml in package archive
                // throw error message if not found
                if ($this->tar->getIndexByFilename(self::INFO_FILE) === false) {
-                       throw new PackageValidationException(PackageValidationException::MISSING_PACKAGE_XML, array('archive' => $this->archive));
+                       throw new PackageValidationException(PackageValidationException::MISSING_PACKAGE_XML, ['archive' => $this->archive]);
                }
                
                // extract package.xml, parse XML
@@ -171,7 +171,7 @@ class PackageArchive {
                $packageName = $package->getAttribute('name');
                if (!Package::isValidPackageName($packageName)) {
                        // package name is not a valid package identifier
-                       throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_NAME, array('packageName' => $packageName));
+                       throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_NAME, ['packageName' => $packageName]);
                }
                
                $this->packageInfo['name'] = $packageName;
@@ -186,7 +186,7 @@ class PackageArchive {
                                case 'packagedescription':
                                case 'readme':
                                case 'license':
-                                       if (!isset($this->packageInfo[$element->tagName])) $this->packageInfo[$element->tagName] = array();
+                                       if (!isset($this->packageInfo[$element->tagName])) $this->packageInfo[$element->tagName] = [];
                                        
                                        $languageCode = 'default';
                                        if ($element->hasAttribute('language')) {
@@ -217,7 +217,7 @@ class PackageArchive {
                                
                                case 'version':
                                        if (!Package::isValidVersion($element->nodeValue)) {
-                                               throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_VERSION, array('packageVersion' => $element->nodeValue));
+                                               throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_VERSION, ['packageVersion' => $element->nodeValue]);
                                        }
                                        
                                        $this->packageInfo['version'] = $element->nodeValue;
@@ -243,11 +243,11 @@ class PackageArchive {
                $elements = $xpath->query('child::ns:requiredpackages/ns:requiredpackage', $package);
                foreach ($elements as $element) {
                        if (!Package::isValidPackageName($element->nodeValue)) {
-                               throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_NAME, array('packageName' => $element->nodeValue));
+                               throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_NAME, ['packageName' => $element->nodeValue]);
                        }
                        
                        // read attributes
-                       $data = array('name' => $element->nodeValue);
+                       $data = ['name' => $element->nodeValue];
                        $attributes = $xpath->query('attribute::*', $element);
                        foreach ($attributes as $attribute) {
                                $data[$attribute->name] = $attribute->value;
@@ -260,11 +260,11 @@ class PackageArchive {
                $elements = $xpath->query('child::ns:optionalpackages/ns:optionalpackage', $package);
                foreach ($elements as $element) {
                        if (!Package::isValidPackageName($element->nodeValue)) {
-                               throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_NAME, array('packageName' => $element->nodeValue));
+                               throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_NAME, ['packageName' => $element->nodeValue]);
                        }
                        
                        // read attributes
-                       $data = array('name' => $element->nodeValue);
+                       $data = ['name' => $element->nodeValue];
                        $attributes = $xpath->query('attribute::*', $element);
                        foreach ($attributes as $attribute) {
                                $data[$attribute->name] = $attribute->value;
@@ -277,11 +277,11 @@ class PackageArchive {
                $elements = $xpath->query('child::ns:excludedpackages/ns:excludedpackage', $package);
                foreach ($elements as $element) {
                        if (!Package::isValidPackageName($element->nodeValue)) {
-                               throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_NAME, array('packageName' => $element->nodeValue));
+                               throw new PackageValidationException(PackageValidationException::INVALID_PACKAGE_NAME, ['packageName' => $element->nodeValue]);
                        }
                        
                        // read attributes
-                       $data = array('name' => $element->nodeValue);
+                       $data = ['name' => $element->nodeValue];
                        $attributes = $xpath->query('attribute::*', $element);
                        foreach ($attributes as $attribute) {
                                $data[$attribute->name] = $attribute->value;
@@ -293,21 +293,21 @@ class PackageArchive {
                // get instructions
                $elements = $xpath->query('./ns:instructions', $package);
                foreach ($elements as $element) {
-                       $instructionData = array();
+                       $instructionData = [];
                        $instructions = $xpath->query('./ns:instruction', $element);
                        /** @var \DOMElement $instruction */
                        foreach ($instructions as $instruction) {
-                               $data = array();
+                               $data = [];
                                $attributes = $xpath->query('attribute::*', $instruction);
                                foreach ($attributes as $attribute) {
                                        $data[$attribute->name] = $attribute->value;
                                }
                                
-                               $instructionData[] = array(
+                               $instructionData[] = [
                                        'attributes' => $data,
                                        'pip' => $instruction->getAttribute('type'),
                                        'value' => $instruction->nodeValue
-                               );
+                               ];
                        }
                        
                        $fromVersion = $element->getAttribute('fromversion');
@@ -352,7 +352,7 @@ class PackageArchive {
                
                // add com.woltlab.wcf to package requirements
                if (!isset($this->requirements['com.woltlab.wcf']) && $this->packageInfo['name'] != 'com.woltlab.wcf') {
-                       $this->requirements['com.woltlab.wcf'] = array('name' => 'com.woltlab.wcf');
+                       $this->requirements['com.woltlab.wcf'] = ['name' => 'com.woltlab.wcf'];
                }
                
                if ($this->package != null) {
@@ -377,7 +377,7 @@ class PackageArchive {
                }
                
                if ($validFromVersion === null) {
-                       $this->instructions['update'] = array();
+                       $this->instructions['update'] = [];
                }
                else {
                        $this->instructions['update'] = $this->instructions['update'][$validFromVersion];
@@ -467,7 +467,7 @@ class PackageArchive {
                        FROM    wcf".WCF_N."_package
                        WHERE   package = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->packageInfo['name']));
+               $statement->execute([$this->packageInfo['name']]);
                
                return $statement->fetchSingleColumn() > 0;
        }
@@ -487,10 +487,10 @@ class PackageArchive {
                        WHERE   isApplication = ?
                                AND package LIKE ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        1,
                        '%.'.Package::getAbbreviation($this->packageInfo['name'])
-               ));
+               ]);
                
                return $statement->fetchSingleColumn() > 0;
        }
@@ -590,8 +590,8 @@ class PackageArchive {
         * @return      array
         */
        public function getAllExistingRequirements() {
-               $existingRequirements = array();
-               $existingPackages = array();
+               $existingRequirements = [];
+               $existingPackages = [];
                if ($this->package !== null) {
                        $sql = "SELECT          package.*
                                FROM            wcf".WCF_N."_package_requirement requirement
@@ -599,18 +599,18 @@ class PackageArchive {
                                ON              (package.packageID = requirement.requirement)
                                WHERE           requirement.packageID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->package->packageID));
+                       $statement->execute([$this->package->packageID]);
                        while ($row = $statement->fetchArray()) {
                                $existingRequirements[$row['package']] = $row;
                        }
                }
                
                // build sql
-               $packageNames = array();
+               $packageNames = [];
                $requirements = $this->getRequirements();
                foreach ($requirements as $requirement) {
                        if (isset($existingRequirements[$requirement['name']])) {
-                               $existingPackages[$requirement['name']] = array();
+                               $existingPackages[$requirement['name']] = [];
                                $existingPackages[$requirement['name']][$existingRequirements[$requirement['name']]['packageID']] = $existingRequirements[$requirement['name']];
                        }
                        else {
@@ -621,7 +621,7 @@ class PackageArchive {
                // check whether the required packages do already exist
                if (!empty($packageNames)) {
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("package.package IN (?)", array($packageNames));
+                       $conditions->add("package.package IN (?)", [$packageNames]);
                        
                        $sql = "SELECT  package.*
                                FROM    wcf".WCF_N."_package package
@@ -635,7 +635,7 @@ class PackageArchive {
                                }
                                
                                if (!isset($existingPackages[$row['package']])) {
-                                       $existingPackages[$row['package']] = array();
+                                       $existingPackages[$row['package']] = [];
                                }
                                
                                $existingPackages[$row['package']][$row['packageID']] = $row;
@@ -653,16 +653,16 @@ class PackageArchive {
         */
        public function getExistingRequirements() {
                // build sql
-               $packageNames = array();
+               $packageNames = [];
                foreach ($this->requirements as $requirement) {
                        $packageNames[] = $requirement['name'];
                }
                
                // check whether the required packages do already exist
-               $existingPackages = array();
+               $existingPackages = [];
                if (!empty($packageNames)) {
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("package IN (?)", array($packageNames));
+                       $conditions->add("package IN (?)", [$packageNames]);
                        
                        $sql = "SELECT  *
                                FROM    wcf".WCF_N."_package
@@ -671,7 +671,7 @@ class PackageArchive {
                        $statement->execute($conditions->getParameters());
                        while ($row = $statement->fetchArray()) {
                                if (!isset($existingPackages[$row['package']])) {
-                                       $existingPackages[$row['package']] = array();
+                                       $existingPackages[$row['package']] = [];
                                }
                                
                                $existingPackages[$row['package']][$row['packageVersion']] = $row;
@@ -679,7 +679,7 @@ class PackageArchive {
                        
                        // sort multiple packages by version number
                        foreach ($existingPackages as $packageName => $instances) {
-                               uksort($instances, array('wcf\data\package\Package', 'compareVersion'));
+                               uksort($instances, ['wcf\data\package\Package', 'compareVersion']);
                                
                                // get package with highest version number (get last package)
                                $existingPackages[$packageName] = array_pop($instances);
@@ -699,7 +699,7 @@ class PackageArchive {
                $existingPackages = $this->getExistingRequirements();
                
                // check for open requirements
-               $openRequirements = array();
+               $openRequirements = [];
                foreach ($this->requirements as $requirement) {
                        if (isset($existingPackages[$requirement['name']])) {
                                // package does already exist
@@ -747,10 +747,10 @@ class PackageArchive {
                // search the requested tar archive in our package archive.
                // throw error message if not found.
                if (($fileIndex = $this->tar->getIndexByFilename($filename)) === false) {
-                       throw new PackageValidationException(PackageValidationException::FILE_NOT_FOUND, array(
+                       throw new PackageValidationException(PackageValidationException::FILE_NOT_FOUND, [
                                'archive' => $this->archive,
                                'targetArchive' => $filename
-                       ));
+                       ]);
                }
                
                // requested tar archive was found
@@ -788,14 +788,14 @@ class PackageArchive {
         * @return      Package[]
         */
        public function getConflictedExcludingPackages() {
-               $conflictedPackages = array();
+               $conflictedPackages = [];
                $sql = "SELECT          package.*, package_exclusion.*
                        FROM            wcf".WCF_N."_package_exclusion package_exclusion
                        LEFT JOIN       wcf".WCF_N."_package package
                        ON              (package.packageID = package_exclusion.packageID)
                        WHERE           excludedPackage = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->packageInfo['name']));
+               $statement->execute([$this->packageInfo['name']]);
                while ($row = $statement->fetchArray()) {
                        if (!empty($row['excludedPackageVersion'])) {
                                if (Package::compareVersion($this->packageInfo['version'], $row['excludedPackageVersion'], '<')) {
@@ -815,15 +815,15 @@ class PackageArchive {
         * @return      Package[]
         */
        public function getConflictedExcludedPackages() {
-               $conflictedPackages = array();
+               $conflictedPackages = [];
                if (!empty($this->excludedPackages)) {
-                       $excludedPackages = array();
+                       $excludedPackages = [];
                        foreach ($this->excludedPackages as $excludedPackageData) {
                                $excludedPackages[$excludedPackageData['name']] = $excludedPackageData['version'];
                        }
                        
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("package IN (?)", array(array_keys($excludedPackages)));
+                       $conditions->add("package IN (?)", [array_keys($excludedPackages)]);
                        
                        $sql = "SELECT  *
                                FROM    wcf".WCF_N."_package
index 191b7e8362c6916f1234bb1a25d68156b5064c1a..5f931b565cc13c763cae6eb3757fc6be6b185931 100644 (file)
@@ -462,7 +462,7 @@ class PackageInstallationDispatcher {
                                FROM    wcf".WCF_N."_language_category
                                WHERE   languageCategory = ?";
                        $statement2 = WCF::getDB()->prepareStatement($sql);
-                       $statement2->execute(array('wcf.acp.package'));
+                       $statement2->execute(['wcf.acp.package']);
                        $languageCategory = $statement2->fetchObject('wcf\data\language\category\LanguageCategory');
                }
                else {
@@ -477,10 +477,10 @@ class PackageInstallationDispatcher {
                
                // update description and name
                $packageEditor = new PackageEditor($package);
-               $packageEditor->update(array(
+               $packageEditor->update([
                        'packageDescription' => 'wcf.acp.package.packageDescription.package'.$this->queue->packageID,
                        'packageName' => 'wcf.acp.package.packageName.package'.$this->queue->packageID
-               ));
+               ]);
        }
        
        /**
@@ -519,13 +519,13 @@ class PackageInstallationDispatcher {
                                $value = $infoValues[$language->languageCode];
                        }
                        
-                       $statement->execute(array(
+                       $statement->execute([
                                $language->languageID,
                                'wcf.acp.package.'.$infoName.'.package'.$package->packageID,
                                $value,
                                $languageCategory->languageCategoryID,
                                1
-                       ));
+                       ]);
                }
        }
        
@@ -624,7 +624,7 @@ class PackageInstallationDispatcher {
                                                $shiftNodes = true;
                                        }
                                        
-                                       $queue = PackageInstallationQueueEditor::create(array(
+                                       $queue = PackageInstallationQueueEditor::create([
                                                'parentQueueID' => $queue->queueID,
                                                'processNo' => $this->queue->processNo,
                                                'userID' => WCF::getUser()->userID,
@@ -632,7 +632,7 @@ class PackageInstallationDispatcher {
                                                'packageName' => $package['packageName'],
                                                'archive' => $package['archive'],
                                                'action' => $queue->action
-                                       ));
+                                       ]);
                                        
                                        $installation = new PackageInstallationDispatcher($queue);
                                        $installation->nodeBuilder->setParentNode($node);
@@ -704,7 +704,7 @@ class PackageInstallationDispatcher {
                                FROM    wcf".WCF_N."_package
                                WHERE   packageDir = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array('../'));
+                       $statement->execute(['../']);
                        if ($statement->fetchSingleColumn()) {
                                // use abbreviation
                                $defaultPath .= strtolower(Package::getAbbreviation($this->getPackage()->package)) . '/';
@@ -740,9 +740,9 @@ class PackageInstallationDispatcher {
                                
                                // set package dir
                                $packageEditor = new PackageEditor($this->getPackage());
-                               $packageEditor->update(array(
+                               $packageEditor->update([
                                        'packageDir' => FileUtil::getRelativePath(WCF_DIR, $packageDir)
-                               ));
+                               ]);
                                
                                // determine domain path, in some environments (e.g. ISPConfig) the $_SERVER paths are
                                // faked and differ from the real filesystem path
@@ -754,7 +754,7 @@ class PackageInstallationDispatcher {
                                                FROM    wcf".WCF_N."_application
                                                WHERE   packageID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                       $statement->execute(array(1));
+                                       $statement->execute([1]);
                                        $row = $statement->fetchArray();
                                        
                                        $wcfDomainPath = $row['domainPath'];
@@ -766,10 +766,10 @@ class PackageInstallationDispatcher {
                                // update application path
                                $application = new Application($this->getPackage()->packageID);
                                $applicationEditor = new ApplicationEditor($application);
-                               $applicationEditor->update(array(
+                               $applicationEditor->update([
                                        'domainPath' => $domainPath,
                                        'cookiePath' => $domainPath
-                               ));
+                               ]);
                                
                                // create directory and set permissions
                                @mkdir($packageDir, 0777, true);
@@ -856,10 +856,10 @@ class PackageInstallationDispatcher {
         */
        public static function openQueue($parentQueueID = 0, $processNo = 0) {
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID = ?", array(WCF::getUser()->userID));
-               $conditions->add("parentQueueID = ?", array($parentQueueID));
-               if ($processNo != 0) $conditions->add("processNo = ?", array($processNo));
-               $conditions->add("done = ?", array(0));
+               $conditions->add("userID = ?", [WCF::getUser()->userID]);
+               $conditions->add("parentQueueID = ?", [$parentQueueID]);
+               if ($processNo != 0) $conditions->add("processNo = ?", [$processNo]);
+               $conditions->add("done = ?", [0]);
                
                $sql = "SELECT          *
                        FROM            wcf".WCF_N."_package_installation_queue
@@ -875,7 +875,7 @@ class PackageInstallationDispatcher {
                        exit;
                }
                else {
-                       $url = LinkHandler::getInstance()->getLink('PackageInstallationConfirm', array(), 'queueID='.$packageInstallation['queueID']);
+                       $url = LinkHandler::getInstance()->getLink('PackageInstallationConfirm', [], 'queueID='.$packageInstallation['queueID']);
                        HeaderUtil::redirect($url);
                        exit;
                }
@@ -894,7 +894,7 @@ class PackageInstallationDispatcher {
                                        AND done = 0
                        ORDER BY        queueID ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(WCF::getUser()->userID));
+               $statement->execute([WCF::getUser()->userID]);
                $row = $statement->fetchArray();
                
                if (!$row) {
@@ -913,7 +913,7 @@ class PackageInstallationDispatcher {
                        FROM    wcf".WCF_N."_package_installation_queue
                        WHERE   processNo = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->queue->processNo));
+               $statement->execute([$this->queue->processNo]);
                while ($row = $statement->fetchArray()) {
                        @unlink($row['archive']);
                }
@@ -922,7 +922,7 @@ class PackageInstallationDispatcher {
                $sql = "DELETE FROM     wcf".WCF_N."_package_installation_queue
                        WHERE           processNo = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->queue->processNo));
+               $statement->execute([$this->queue->processNo]);
                
                // clear language files once whole installation is completed
                LanguageEditor::deleteLanguageFiles();
@@ -937,9 +937,9 @@ class PackageInstallationDispatcher {
        public function updatePackage() {
                if (empty($this->queue->packageName)) {
                        $queueEditor = new PackageInstallationQueueEditor($this->queue);
-                       $queueEditor->update(array(
+                       $queueEditor->update([
                                'packageName' => $this->getArchive()->getLocalizedPackageInfo('packageName')
-                       ));
+                       ]);
                        
                        // reload queue
                        $this->queue = new PackageInstallationQueue($this->queue->queueID);
@@ -953,7 +953,7 @@ class PackageInstallationDispatcher {
         * @return      mixed[][]
         */
        public static function validatePHPRequirements(array $requirements) {
-               $errors = array();
+               $errors = [];
                
                // validate php version
                if (isset($requirements['version'])) {
@@ -963,10 +963,10 @@ class PackageInstallationDispatcher {
                        }
                        
                        if (!$passed) {
-                               $errors['version'] = array(
+                               $errors['version'] = [
                                        'required' => $requirements['version'],
                                        'installed' => PHP_VERSION
-                               );
+                               ];
                        }
                }
                
@@ -976,9 +976,9 @@ class PackageInstallationDispatcher {
                                $passed = (extension_loaded($extension)) ? true : false;
                                
                                if (!$passed) {
-                                       $errors['extension'][] = array(
+                                       $errors['extension'][] = [
                                                'extension' => $extension
-                                       );
+                                       ];
                                }
                        }
                }
@@ -990,11 +990,11 @@ class PackageInstallationDispatcher {
                                
                                $passed = self::compareSetting($setting, $value, $iniValue);
                                if (!$passed) {
-                                       $errors['setting'][] = array(
+                                       $errors['setting'][] = [
                                                'setting' => $setting,
                                                'required' => $value,
                                                'installed' => ($iniValue === false) ? '(unknown)' : $iniValue
-                                       );
+                                       ];
                                }
                        }
                }
@@ -1006,9 +1006,9 @@ class PackageInstallationDispatcher {
                                
                                $passed = self::functionExists($function);
                                if (!$passed) {
-                                       $errors['function'][] = array(
+                                       $errors['function'][] = [
                                                'function' => $function
-                                       );
+                                       ];
                                }
                        }
                }
@@ -1028,9 +1028,9 @@ class PackageInstallationDispatcher {
                                }
                                
                                if (!$passed) {
-                                       $errors['class'][] = array(
+                                       $errors['class'][] = [
                                                'class' => $class
-                                       );
+                                       ];
                                }
                        }
                                
@@ -1076,8 +1076,8 @@ class PackageInstallationDispatcher {
                if ($compareValue === false) return false;
                
                $value = mb_strtolower($value);
-               $trueValues = array('1', 'on', 'true');
-               $falseValues = array('0', 'off', 'false');
+               $trueValues = ['1', 'on', 'true'];
+               $falseValues = ['0', 'off', 'false'];
                
                // handle values considered as 'true'
                if (in_array($value, $trueValues)) {
index d3e10c658e390e2f4ab55e69f2bcf92d4f54a9c0..ca4a512232fd4e1b03bd5fda539bfb5d5ca86c91 100644 (file)
@@ -62,10 +62,10 @@ abstract class PackageInstallationFormManager {
                        WHERE   queueID = ?
                                AND formName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $queue->queueID,
                        $formName
-               ));
+               ]);
                
                return $statement->fetchSingleColumn() > 0;
        }
@@ -81,11 +81,11 @@ abstract class PackageInstallationFormManager {
                                        (queueID, formName, document)
                        VALUES          (?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $queue->queueID,
                        $document->getName(),
                        base64_encode(serialize($document))
-               ));
+               ]);
        }
        
        /**
@@ -100,11 +100,11 @@ abstract class PackageInstallationFormManager {
                        WHERE   queueID = ?
                                AND formName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        base64_encode(serialize($document)),
                        $queue->queueID,
                        $document->formName // TODO: FormDocument::$formName does not exist, FormDocument::getName()?
-               ));
+               ]);
        }
        
        /**
@@ -116,7 +116,7 @@ abstract class PackageInstallationFormManager {
                $sql = "DELETE FROM     wcf".WCF_N."_package_installation_form
                        WHERE           queueID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($queue->queueID));
+               $statement->execute([$queue->queueID]);
        }
        
        /**
@@ -132,10 +132,10 @@ abstract class PackageInstallationFormManager {
                        WHERE   queueID = ?
                                AND formName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $queue->queueID,
                        $formName
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                if ($row) {
index c04a0c51ff9877f6be4071f864ce07d224c279fd..9dbea513628ae8b8c15226099765b6a919a9f1c8 100644 (file)
@@ -48,7 +48,7 @@ class PackageInstallationNodeBuilder {
         * list of requirements to be checked before package installation
         * @var mixed[][]
         */
-       public $requirements = array();
+       public $requirements = [];
        
        /**
         * current sequence number within one node
@@ -60,7 +60,7 @@ class PackageInstallationNodeBuilder {
         * list of packages about to be installed
         * @var string[]
         */
-       protected static $pendingPackages = array();
+       protected static $pendingPackages = [];
        
        /**
         * Creates a new instance of PackageInstallationNodeBuilder
@@ -123,10 +123,10 @@ class PackageInstallationNodeBuilder {
                        WHERE   processNo = ?
                                AND parentNode = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->processNo,
                        $parentNode
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                if (!$row) {
@@ -147,7 +147,7 @@ class PackageInstallationNodeBuilder {
                        FROM    wcf".WCF_N."_package_installation_queue
                        WHERE   queueID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($queueID));
+               $statement->execute([$queueID]);
                $row = $statement->fetchArray();
                
                if (!$row) {
@@ -168,7 +168,7 @@ class PackageInstallationNodeBuilder {
                        FROM    wcf".WCF_N."_package_installation_queue
                        WHERE   queueID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($queueID));
+               $statement->execute([$queueID]);
                $row = $statement->fetchArray();
                
                return $row['action'];
@@ -187,11 +187,11 @@ class PackageInstallationNodeBuilder {
                                        AND node = ?
                        ORDER BY        sequenceNo ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->processNo,
                        $node
-               ));
-               $data = array();
+               ]);
+               $data = [];
                while ($row = $statement->fetchArray()) {
                        $data[] = $row;
                }
@@ -210,10 +210,10 @@ class PackageInstallationNodeBuilder {
                        WHERE   processNo = ?
                                AND node = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->processNo,
                        $node
-               ));
+               ]);
        }
        
        /**
@@ -225,16 +225,16 @@ class PackageInstallationNodeBuilder {
                $sql = "DELETE FROM     wcf".WCF_N."_package_installation_node
                        WHERE           processNo = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->processNo
-               ));
+               ]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_package_installation_form
                        WHERE           queueID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->queueID
-               ));
+               ]);
        }
        
        /**
@@ -244,18 +244,18 @@ class PackageInstallationNodeBuilder {
         * @return      integer
         */
        public function calculateProgress($node) {
-               $progress = array(
+               $progress = [
                        'done' => 0,
                        'outstanding' => 0
-               );
+               ];
                
                $sql = "SELECT  done
                        FROM    wcf".WCF_N."_package_installation_node
                        WHERE   processNo = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->processNo
-               ));
+               ]);
                while ($row = $statement->fetchArray()) {
                        if ($row['done']) {
                                $progress['done']++;
@@ -292,11 +292,11 @@ class PackageInstallationNodeBuilder {
                        WHERE   parentNode = ?
                                AND processNo = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $newNode,
                        $node,
                        $this->installation->queue->processNo
-               ));
+               ]);
                
                // create a copy of current node (prevents empty nodes)
                $sql = "SELECT  nodeType, nodeData, done
@@ -305,18 +305,18 @@ class PackageInstallationNodeBuilder {
                                AND processNo = ?
                                AND sequenceNo = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $node,
                        $this->installation->queue->processNo,
                        $sequenceNo
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                $sql = "INSERT INTO     wcf".WCF_N."_package_installation_node
                                        (queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData, done)
                        VALUES          (?, ?, ?, ?, ?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->queueID,
                        $this->installation->queue->processNo,
                        0,
@@ -325,7 +325,7 @@ class PackageInstallationNodeBuilder {
                        $row['nodeType'],
                        $row['nodeData'],
                        $row['done']
-               ));
+               ]);
                
                // move other child-nodes greater than $sequenceNo into new node
                $sql = "UPDATE  wcf".WCF_N."_package_installation_node
@@ -336,14 +336,14 @@ class PackageInstallationNodeBuilder {
                                AND processNo = ?
                                AND sequenceNo > ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $node,
                        $newNode,
                        $sequenceNo,
                        $node,
                        $this->installation->queue->processNo,
                        $sequenceNo
-               ));
+               ]);
        }
        
        /**
@@ -363,11 +363,11 @@ class PackageInstallationNodeBuilder {
                        WHERE   parentNode = ?
                                AND processNo = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $newNode,
                        $beforeNode,
                        $this->installation->queue->processNo
-               ));
+               ]);
                
                // execute callback
                $callback($beforeNode, $newNode);
@@ -385,11 +385,11 @@ class PackageInstallationNodeBuilder {
                        WHERE   parentNode = ?
                                AND processNo = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $newParentNode,
                        $oldParentNode,
                        $this->installation->queue->processNo
-               ));
+               ]);
        }
        
        /**
@@ -408,14 +408,14 @@ class PackageInstallationNodeBuilder {
                                        (queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
                        VALUES          (?, ?, ?, ?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->queueID,
                        $this->installation->queue->processNo,
                        $this->sequenceNo,
                        $this->node,
                        $this->parentNode,
                        'package',
-                       serialize(array(
+                       serialize([
                                'package' => $this->installation->getArchive()->getPackageInfo('name'),
                                'packageName' => $this->installation->getArchive()->getLocalizedPackageInfo('packageName'),
                                'packageDescription' => $this->installation->getArchive()->getLocalizedPackageInfo('packageDescription'),
@@ -428,8 +428,8 @@ class PackageInstallationNodeBuilder {
                                'installDate' => TIME_NOW,
                                'updateDate' => TIME_NOW,
                                'requirements' => $this->requirements
-                       ))
-               ));
+                       ])
+               ]);
        }
        
        /**
@@ -454,10 +454,10 @@ class PackageInstallationNodeBuilder {
                                }
                                
                                // requirements will be checked once package is about to be installed
-                               $this->requirements[$packageName] = array(
+                               $this->requirements[$packageName] = [
                                        'minVersion' => (isset($package['minversion'])) ? $package['minversion'] : '',
                                        'packageID' => $package['packageID']
-                               );
+                               ];
                                
                                continue;
                        }
@@ -499,7 +499,7 @@ class PackageInstallationNodeBuilder {
                                FROM    wcf".WCF_N."_package
                                WHERE   package = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($archive->getPackageInfo('name')));
+                       $statement->execute([$archive->getPackageInfo('name')]);
                        $row = $statement->fetchArray();
                        $packageID = ($row === false) ? null : $row['packageID'];
                        
@@ -519,7 +519,7 @@ class PackageInstallationNodeBuilder {
                        }
                        
                        // create new queue
-                       $queue = PackageInstallationQueueEditor::create(array(
+                       $queue = PackageInstallationQueueEditor::create([
                                'parentQueueID' => $queue->queueID,
                                'processNo' => $queue->processNo,
                                'userID' => WCF::getUser()->userID,
@@ -528,7 +528,7 @@ class PackageInstallationNodeBuilder {
                                'packageName' => $archive->getLocalizedPackageInfo('packageName'),
                                'archive' => $fileName,
                                'action' => ($packageID ? 'update' : 'install')
-                       ));
+                       ]);
                        
                        self::$pendingPackages[$archive->getPackageInfo('name')] = $archive->getPackageInfo('version');
                        
@@ -563,7 +563,7 @@ class PackageInstallationNodeBuilder {
                
                $this->node = $this->getToken();
                
-               $pluginNodes = array();
+               $pluginNodes = [];
                
                $this->emptyNode = true;
                $instructions = ($this->installation->getAction() == 'install') ? $this->installation->getArchive()->getInstallInstructions() : $this->installation->getArchive()->getUpdateInstructions();
@@ -579,12 +579,12 @@ class PackageInstallationNodeBuilder {
                                        $this->node = $this->getToken();
                                        $this->sequenceNo = 0;
                                }
-                               $pluginNodes[] = array(
+                               $pluginNodes[] = [
                                        'data' => $pip,
                                        'node' => $this->node,
                                        'parentNode' => $this->parentNode,
                                        'sequenceNo' => $this->sequenceNo
-                               );
+                               ];
                                
                                // create a new node for following PIPs, unless it is the last one
                                if ($i < $count) {
@@ -598,12 +598,12 @@ class PackageInstallationNodeBuilder {
                        else {
                                $this->sequenceNo++;
                                
-                               $pluginNodes[] = array(
+                               $pluginNodes[] = [
                                        'data' => $pip,
                                        'node' => $this->node,
                                        'parentNode' => $this->parentNode,
                                        'sequenceNo' => $this->sequenceNo
-                               );
+                               ];
                                
                                $this->emptyNode = false;
                        }
@@ -617,7 +617,7 @@ class PackageInstallationNodeBuilder {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($pluginNodes as $index => $nodeData) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $this->installation->queue->queueID,
                                        $this->installation->queue->processNo,
                                        $nodeData['sequenceNo'],
@@ -625,7 +625,7 @@ class PackageInstallationNodeBuilder {
                                        $nodeData['parentNode'],
                                        'pip',
                                        serialize($nodeData['data'])
-                               ));
+                               ]);
                        }
                }
        }
@@ -636,7 +636,7 @@ class PackageInstallationNodeBuilder {
         * not really matter at this point).
         */
        protected function buildOptionalNodes() {
-               $packages = array();
+               $packages = [];
                
                $optionalPackages = $this->installation->getArchive()->getOptionals();
                foreach ($optionalPackages as $package) {
@@ -681,14 +681,14 @@ class PackageInstallationNodeBuilder {
                                $isInstallable = false;
                        }
                        
-                       $packages[] = array(
+                       $packages[] = [
                                'archive' => $fileName,
                                'isInstallable' => $isInstallable,
                                'package' => $archive->getPackageInfo('name'),
                                'packageName' => $archive->getLocalizedPackageInfo('packageName'),
                                'packageDescription' => $archive->getLocalizedPackageInfo('packageDescription'),
                                'selected' => 0
-                       );
+                       ];
                        
                        self::$pendingPackages[$archive->getPackageInfo('name')] = $archive->getPackageInfo('version');
                }
@@ -702,7 +702,7 @@ class PackageInstallationNodeBuilder {
                                                (queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
                                VALUES          (?, ?, ?, ?, ?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->installation->queue->queueID,
                                $this->installation->queue->processNo,
                                $this->sequenceNo,
@@ -710,7 +710,7 @@ class PackageInstallationNodeBuilder {
                                $this->parentNode,
                                'optionalPackages',
                                serialize($packages)
-                       ));
+                       ]);
                }
        }
        
@@ -719,7 +719,7 @@ class PackageInstallationNodeBuilder {
         */
        protected function buildChildQueues() {
                $queueList = new PackageInstallationQueueList();
-               $queueList->getConditionBuilder()->add("package_installation_queue.parentQueueID = ?", array($this->installation->queue->queueID));
+               $queueList->getConditionBuilder()->add("package_installation_queue.parentQueueID = ?", [$this->installation->queue->queueID]);
                $queueList->getConditionBuilder()->add("package_installation_queue.queueID NOT IN (SELECT queueID FROM wcf".WCF_N."_package_installation_node)");
                $queueList->readObjects();
                
@@ -728,10 +728,10 @@ class PackageInstallationNodeBuilder {
                        
                        // work-around for iterative package updates
                        if ($this->installation->queue->action == 'update' && $queue->package == $this->installation->queue->package) {
-                               $installation->setPreviousPackage(array(
+                               $installation->setPreviousPackage([
                                        'package' => $this->installation->getArchive()->getPackageInfo('name'),
                                        'packageVersion' => $this->installation->getArchive()->getPackageInfo('version')
-                               ));
+                               ]);
                        }
                        
                        $installation->nodeBuilder->setParentNode($this->node);
@@ -762,10 +762,10 @@ class PackageInstallationNodeBuilder {
                        WHERE   processNo = ?
                                AND node = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $processNo,
                        $node
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                return $row['queueID'];
index 268c7e53477bf6184d2a2fa755bfc9ba8740e823..ea0244cf1d62b2a370f34f8cff4d52ecc823fc0b 100644 (file)
@@ -38,37 +38,37 @@ class PackageInstallationSQLParser extends SQLParser {
         * list of existing database tables
         * @var array
         */
-       protected $existingTables = array();
+       protected $existingTables = [];
        
        /**
         * list of logged tables
         * @var array
         */
-       protected $knownTables = array();
+       protected $knownTables = [];
        
        /**
         * list of conflicted database tables
         * @var array
         */
-       protected $conflicts = array();
+       protected $conflicts = [];
        
        /**
         * list of created/deleted tables
         * @var array
         */
-       protected $tableLog = array();
+       protected $tableLog = [];
        
        /**
         * list of created/deleted columns
         * @var array
         */
-       protected $columnLog = array();
+       protected $columnLog = [];
        
        /**
         * list of created/deleted indices
         * @var array
         */
-       protected $indexLog = array();
+       protected $indexLog = [];
        
        /**
         * Creates a new PackageInstallationSQLParser object.
@@ -90,7 +90,7 @@ class PackageInstallationSQLParser extends SQLParser {
         * @return      array           conflicts
         */
        public function test() {
-               $this->conflicts = array();
+               $this->conflicts = [];
                
                // get all existing tables from database
                $this->existingTables = WCF::getDB()->getEditor()->getTableNames();
@@ -120,17 +120,17 @@ class PackageInstallationSQLParser extends SQLParser {
                        $sql = "DELETE FROM     wcf".WCF_N."_package_installation_sql_log
                                WHERE           sqlTable = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($logEntry['tableName']));
+                       $statement->execute([$logEntry['tableName']]);
                        
                        if ($logEntry['action'] == 'insert') {
                                $sql = "INSERT INTO     wcf".WCF_N."_package_installation_sql_log
                                                        (packageID, sqlTable)
                                        VALUES          (?, ?)";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(
+                               $statement->execute([
                                        $logEntry['packageID'],
                                        $logEntry['tableName']
-                               ));
+                               ]);
                        }
                }
                
@@ -147,17 +147,17 @@ class PackageInstallationSQLParser extends SQLParser {
                        $insertStatement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($this->columnLog as $logEntry) {
-                               $deleteStatement->execute(array(
+                               $deleteStatement->execute([
                                        $logEntry['tableName'],
                                        $logEntry['columnName']
-                               ));
+                               ]);
                                
                                if ($logEntry['action'] == 'insert') {
-                                       $insertStatement->execute(array(
+                                       $insertStatement->execute([
                                                $logEntry['packageID'],
                                                $logEntry['tableName'],
                                                $logEntry['columnName']
-                                       ));
+                                       ]);
                                }
                        }
                }
@@ -175,17 +175,17 @@ class PackageInstallationSQLParser extends SQLParser {
                        $insertStatement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($this->indexLog as $logEntry) {
-                               $deleteStatement->execute(array(
+                               $deleteStatement->execute([
                                        $logEntry['tableName'],
                                        $logEntry['indexName']
-                               ));
+                               ]);
                                
                                if ($logEntry['action'] == 'insert') {
-                                       $insertStatement->execute(array(
+                                       $insertStatement->execute([
                                                $logEntry['packageID'],
                                                $logEntry['tableName'],
                                                $logEntry['indexName']
-                                       ));
+                                       ]);
                                }
                        }
                }
@@ -219,10 +219,10 @@ class PackageInstallationSQLParser extends SQLParser {
                        WHERE   sqlTable = ?
                                AND sqlColumn = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $tableName,
                        $columnName
-               ));
+               ]);
                $row = $statement->fetchArray();
                if (!empty($row['packageID'])) return $row['packageID'];
                else if (isset($this->knownTables[$tableName])) return $this->knownTables[$tableName];
@@ -242,10 +242,10 @@ class PackageInstallationSQLParser extends SQLParser {
                        WHERE   sqlTable = ?
                                AND sqlIndex = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $tableName,
                        $indexName
-               ));
+               ]);
                $row = $statement->fetchArray();
                if (!empty($row['packageID'])) return $row['packageID'];
                else if (isset($this->knownTables[$tableName])) return $this->knownTables[$tableName];
@@ -255,21 +255,21 @@ class PackageInstallationSQLParser extends SQLParser {
        /**
         * @see \wcf\system\database\util\SQLParser::executeCreateTableStatement()
         */
-       protected function executeCreateTableStatement($tableName, $columns, $indices = array()) {
+       protected function executeCreateTableStatement($tableName, $columns, $indices = []) {
                if ($this->test) {
                        if (in_array($tableName, $this->existingTables)) {
                                if (isset($this->knownTables[$tableName]) && $this->knownTables[$tableName] != $this->package->packageID) {
                                        throw new SystemException("Cannot recreate table '".$tableName."'. A package can only overwrite own tables.");
                                }
                                else {
-                                       if (!isset($this->conflicts['CREATE TABLE'])) $this->conflicts['CREATE TABLE'] = array();
+                                       if (!isset($this->conflicts['CREATE TABLE'])) $this->conflicts['CREATE TABLE'] = [];
                                        $this->conflicts['CREATE TABLE'][] = $tableName;
                                }
                        }
                }
                else {
                        // log
-                       $this->tableLog[] = array('tableName' => $tableName, 'packageID' => $this->package->packageID, 'action' => 'insert');
+                       $this->tableLog[] = ['tableName' => $tableName, 'packageID' => $this->package->packageID, 'action' => 'insert'];
                        
                        // execute
                        parent::executeCreateTableStatement($tableName, $columns, $indices);
@@ -287,7 +287,7 @@ class PackageInstallationSQLParser extends SQLParser {
                }
                else {
                        // log
-                       $this->columnLog[] = array('tableName' => $tableName, 'columnName' => $columnName, 'packageID' => $this->package->packageID, 'action' => 'insert');
+                       $this->columnLog[] = ['tableName' => $tableName, 'columnName' => $columnName, 'packageID' => $this->package->packageID, 'action' => 'insert'];
                        
                        // execute
                        parent::executeAddColumnStatement($tableName, $columnName, $columnData);
@@ -308,8 +308,8 @@ class PackageInstallationSQLParser extends SQLParser {
                else {
                        // log
                        if ($oldColumnName != $newColumnName) {
-                               $this->columnLog[] = array('tableName' => $tableName, 'columnName' => $oldColumnName, 'packageID' => $this->package->packageID, 'action' => 'delete');
-                               $this->columnLog[] = array('tableName' => $tableName, 'columnName' => $newColumnName, 'packageID' => $this->package->packageID, 'action' => 'insert');
+                               $this->columnLog[] = ['tableName' => $tableName, 'columnName' => $oldColumnName, 'packageID' => $this->package->packageID, 'action' => 'delete'];
+                               $this->columnLog[] = ['tableName' => $tableName, 'columnName' => $newColumnName, 'packageID' => $this->package->packageID, 'action' => 'insert'];
                        }
                        
                        // execute
@@ -323,7 +323,7 @@ class PackageInstallationSQLParser extends SQLParser {
        protected function executeAddIndexStatement($tableName, $indexName, $indexData) {
                if (!$this->test) {
                        // log
-                       $this->indexLog[] = array('tableName' => $tableName, 'indexName' => $indexName, 'packageID' => $this->package->packageID, 'action' => 'insert');
+                       $this->indexLog[] = ['tableName' => $tableName, 'indexName' => $indexName, 'packageID' => $this->package->packageID, 'action' => 'insert'];
                        
                        // execute
                        parent::executeAddIndexStatement($tableName, $indexName, $indexData);
@@ -336,7 +336,7 @@ class PackageInstallationSQLParser extends SQLParser {
        protected function executeAddForeignKeyStatement($tableName, $indexName, $indexData) {
                if (!$this->test) {
                        // log
-                       $this->indexLog[] = array('tableName' => $tableName, 'indexName' => $indexName, 'packageID' => $this->package->packageID, 'action' => 'insert');
+                       $this->indexLog[] = ['tableName' => $tableName, 'indexName' => $indexName, 'packageID' => $this->package->packageID, 'action' => 'insert'];
                        
                        // execute
                        parent::executeAddForeignKeyStatement($tableName, $indexName, $indexData);
@@ -356,7 +356,7 @@ class PackageInstallationSQLParser extends SQLParser {
                }
                else {
                        // log
-                       $this->columnLog[] = array('tableName' => $tableName, 'columnName' => $columnName, 'packageID' => $this->package->packageID, 'action' => 'delete');
+                       $this->columnLog[] = ['tableName' => $tableName, 'columnName' => $columnName, 'packageID' => $this->package->packageID, 'action' => 'delete'];
                        
                        // execute
                        parent::executeDropColumnStatement($tableName, $columnName);
@@ -376,7 +376,7 @@ class PackageInstallationSQLParser extends SQLParser {
                }
                else {
                        // log
-                       $this->indexLog[] = array('tableName' => $tableName, 'indexName' => $indexName, 'packageID' => $this->package->packageID, 'action' => 'delete');
+                       $this->indexLog[] = ['tableName' => $tableName, 'indexName' => $indexName, 'packageID' => $this->package->packageID, 'action' => 'delete'];
                        
                        // execute
                        parent::executeDropIndexStatement($tableName, $indexName);
@@ -396,7 +396,7 @@ class PackageInstallationSQLParser extends SQLParser {
                }
                else {
                        // log
-                       $this->indexLog[] = array('tableName' => $tableName, 'indexName' => $indexName, 'packageID' => $this->package->packageID, 'action' => 'delete');
+                       $this->indexLog[] = ['tableName' => $tableName, 'indexName' => $indexName, 'packageID' => $this->package->packageID, 'action' => 'delete'];
                        
                        // execute
                        parent::executeDropForeignKeyStatement($tableName, $indexName);
@@ -416,7 +416,7 @@ class PackageInstallationSQLParser extends SQLParser {
                }
                else {
                        // log
-                       $this->tableLog[] = array('tableName' => $tableName, 'packageID' => $this->package->packageID, 'action' => 'delete');
+                       $this->tableLog[] = ['tableName' => $tableName, 'packageID' => $this->package->packageID, 'action' => 'delete'];
                        
                        // execute
                        parent::executeDropTableStatement($tableName);
index 1cbf68af8f70e5c5e0f6d901b61c6948816bfb6b..7dd6d40c90980525052a52997b9f5a86b66d4eb9 100644 (file)
@@ -27,25 +27,25 @@ class PackageInstallationScheduler {
         * stack of package installations / updates
         * @var array
         */
-       protected $packageInstallationStack = array();
+       protected $packageInstallationStack = [];
        
        /**
         * list of package update servers
         * @var PackageUpdateServer[]
         */
-       protected $packageUpdateServers = array();
+       protected $packageUpdateServers = [];
        
        /**
         * list of packages to update or install
         * @var array
         */
-       protected $selectedPackages = array();
+       protected $selectedPackages = [];
        
        /**
         * virtual package versions
         * @var array
         */
-       protected $virtualPackageVersions = array();
+       protected $virtualPackageVersions = [];
        
        /**
         * Creates a new instance of PackageInstallationScheduler
@@ -128,14 +128,14 @@ class PackageInstallationScheduler {
                $download = $this->downloadPackage($package, $packageUpdateVersions, $validateInstallInstructions);
                
                // add to stack
-               $data = array(
+               $data = [
                        'packageName' => $packageUpdateVersions[0]['packageName'],
                        'packageVersion' => $packageUpdateVersions[0]['packageVersion'],
                        'package' => $package,
                        'packageID' => 0,
                        'archive' => $download,
                        'action' => 'install'
-               );
+               ];
                if ($stackPosition == -1) $this->packageInstallationStack[] = $data;
                else $this->packageInstallationStack[$stackPosition] = $data;
                
@@ -151,13 +151,13 @@ class PackageInstallationScheduler {
         */
        protected function resolveRequirements($packageUpdateVersionID) {
                // resolve requirements
-               $requiredPackages = array();
-               $requirementsCache = array();
+               $requiredPackages = [];
+               $requirementsCache = [];
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_package_update_requirement
                        WHERE   packageUpdateVersionID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageUpdateVersionID));
+               $statement->execute([$packageUpdateVersionID]);
                while ($row = $statement->fetchArray()) {
                        $requiredPackages[] = $row['package'];
                        $requirementsCache[] = $row;
@@ -166,16 +166,16 @@ class PackageInstallationScheduler {
                if (!empty($requiredPackages)) {
                        // find installed packages
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("package IN (?)", array($requiredPackages));
+                       $conditions->add("package IN (?)", [$requiredPackages]);
                        
-                       $installedPackages = array();
+                       $installedPackages = [];
                        $sql = "SELECT  packageID, package, packageVersion
                                FROM    wcf".WCF_N."_package
                                ".$conditions;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditions->getParameters());
                        while ($row = $statement->fetchArray()) {
-                               if (!isset($installedPackages[$row['package']])) $installedPackages[$row['package']] = array();
+                               if (!isset($installedPackages[$row['package']])) $installedPackages[$row['package']] = [];
                                $installedPackages[$row['package']][$row['packageID']] = (isset($this->virtualPackageVersions[$row['packageID']]) ? $this->virtualPackageVersions[$row['packageID']] : $row['packageVersion']);
                        }
                        
@@ -184,7 +184,7 @@ class PackageInstallationScheduler {
                                if (isset($installedPackages[$row['package']])) {
                                        // package already installed -> check version
                                        // sort multiple instances by version number
-                                       uasort($installedPackages[$row['package']], array('wcf\data\package\Package', 'compareVersion'));
+                                       uasort($installedPackages[$row['package']], ['wcf\data\package\Package', 'compareVersion']);
                                        
                                        foreach ($installedPackages[$row['package']] as $packageID => $packageVersion) {
                                                if (empty($row['minversion']) || Package::compareVersion($row['minversion'], $packageVersion, '<=')) {
@@ -226,22 +226,22 @@ class PackageInstallationScheduler {
                        if ($packageUpdateVersion['filename']) {
                                $request = new HTTPRequest(
                                        $packageUpdateVersion['filename'],
-                                       (!empty($authData) ? array('auth' => $authData) : array()),
-                                       array(
+                                       (!empty($authData) ? ['auth' => $authData] : []),
+                                       [
                                                'apiVersion' => PackageUpdate::API_VERSION
-                                       )
+                                       ]
                                );
                        }
                        else {
                                // create request
                                $request = new HTTPRequest(
                                        $this->packageUpdateServers[$packageUpdateVersion['packageUpdateServerID']]->getDownloadURL(),
-                                       (!empty($authData) ? array('auth' => $authData) : array()),
-                                       array(
+                                       (!empty($authData) ? ['auth' => $authData] : []),
+                                       [
                                                'apiVersion' => PackageUpdate::API_VERSION,
                                                'packageName' => $packageUpdateVersion['package'],
                                                'packageVersion' => $packageUpdateVersion['packageVersion']
-                                       )
+                                       ]
                                );
                        }
                        
@@ -256,7 +256,7 @@ class PackageInstallationScheduler {
                        
                        // check response
                        if ($response['statusCode'] != 200) {
-                               throw new SystemException(WCF::getLanguage()->getDynamicVariable('wcf.acp.package.error.downloadFailed', array('__downloadPackage' => $package)) . ' ('.$response['body'].')');
+                               throw new SystemException(WCF::getLanguage()->getDynamicVariable('wcf.acp.package.error.downloadFailed', ['__downloadPackage' => $package]) . ' ('.$response['body'].')');
                        }
                        
                        // write content to tmp file
@@ -295,11 +295,11 @@ class PackageInstallationScheduler {
         * @return      array
         */
        public function getExcludedPackages() {
-               $excludedPackages = array();
+               $excludedPackages = [];
                
                if (!empty($this->packageInstallationStack)) {
-                       $packageInstallations = array();
-                       $packageIdentifier = array();
+                       $packageInstallations = [];
+                       $packageIdentifier = [];
                        foreach ($this->packageInstallationStack as $packageInstallation) {
                                $packageInstallation['newVersion'] = ($packageInstallation['action'] == 'update' ? $packageInstallation['toVersion'] : $packageInstallation['packageVersion']);
                                $packageInstallations[] = $packageInstallation;
@@ -309,7 +309,7 @@ class PackageInstallationScheduler {
                        // check exclusions of the new packages
                        // get package update ids
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("package IN (?)", array($packageIdentifier));
+                       $conditions->add("package IN (?)", [$packageIdentifier]);
                        
                        $sql = "SELECT  packageUpdateID, package
                                FROM    wcf".WCF_N."_package_update
@@ -327,7 +327,7 @@ class PackageInstallationScheduler {
                        // get exclusions of the new packages
                        // build conditions
                        $conditions = '';
-                       $statementParameters = array();
+                       $statementParameters = [];
                        foreach ($packageInstallations as $packageInstallation) {
                                if (!empty($conditions)) $conditions .= ' OR ';
                                $conditions .= "(packageUpdateID = ? AND packageVersion = ?)";
@@ -357,9 +357,9 @@ class PackageInstallationScheduler {
                                foreach ($packageInstallations as $key => $packageInstallation) {
                                        if ($packageInstallation['package'] == $row['package']) {
                                                if (!isset($packageInstallations[$key]['excludedPackages'])) {
-                                                       $packageInstallations[$key]['excludedPackages'] = array();
+                                                       $packageInstallations[$key]['excludedPackages'] = [];
                                                }
-                                               $packageInstallations[$key]['excludedPackages'][$row['excludedPackage']] = array('package' => $row['excludedPackage'], 'version' => $row['excludedPackageVersion']);
+                                               $packageInstallations[$key]['excludedPackages'][$row['excludedPackage']] = ['package' => $row['excludedPackage'], 'version' => $row['excludedPackageVersion']];
                                                
                                                // check version
                                                if (!empty($row['excludedPackageVersion'])) {
@@ -368,7 +368,7 @@ class PackageInstallationScheduler {
                                                        }
                                                }
                                                
-                                               $excludedPackages[] = array(
+                                               $excludedPackages[] = [
                                                        'package' => $row['package'],
                                                        'packageName' => $packageInstallations[$key]['packageName'],
                                                        'packageVersion' => $packageInstallations[$key]['newVersion'],
@@ -377,14 +377,14 @@ class PackageInstallationScheduler {
                                                        'existingPackage' => $row['excludedPackage'],
                                                        'existingPackageName' => WCF::getLanguage()->get($row['packageName']),
                                                        'existingPackageVersion' => $row['packageVersion']
-                                               );
+                                               ];
                                        }
                                }
                        }
                        
                        // check excluded packages of the existing packages
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("excludedPackage IN (?)", array($packageIdentifier));
+                       $conditions->add("excludedPackage IN (?)", [$packageIdentifier]);
                        
                        $sql = "SELECT          package.*, package_exclusion.*
                                FROM            wcf".WCF_N."_package_exclusion package_exclusion
@@ -413,7 +413,7 @@ class PackageInstallationScheduler {
                                                        }
                                                }
                                                
-                                               $excludedPackages[] = array(
+                                               $excludedPackages[] = [
                                                        'package' => $row['excludedPackage'],
                                                        'packageName' => $packageInstallation['packageName'],
                                                        'packageVersion' => $packageInstallation['newVersion'],
@@ -422,7 +422,7 @@ class PackageInstallationScheduler {
                                                        'existingPackage' => $row['package'],
                                                        'existingPackageName' => WCF::getLanguage()->get($row['packageName']),
                                                        'existingPackageVersion' => $row['packageVersion']
-                                               );
+                                               ];
                                        }
                                }
                        }
@@ -473,15 +473,15 @@ class PackageInstallationScheduler {
                                        )
                                        AND packageVersion LIKE ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $package->package,
                                $match[1].'%'
-                       ));
+                       ]);
                        $packageVersions = $statement->fetchAll(\PDO::FETCH_COLUMN);
                        
                        if (count($packageVersions) > 1) {
                                // sort by version number
-                               usort($packageVersions, array('wcf\data\package\Package', 'compareVersion'));
+                               usort($packageVersions, ['wcf\data\package\Package', 'compareVersion']);
                                
                                // get highest version
                                $version = array_pop($packageVersions);
@@ -489,7 +489,7 @@ class PackageInstallationScheduler {
                }
                
                // get all fromversion
-               $fromversions = array();
+               $fromversions = [];
                $sql = "SELECT          puv.packageVersion, puf.fromversion
                        FROM            wcf".WCF_N."_package_update_fromversion puf
                        LEFT JOIN       wcf".WCF_N."_package_update_version puv
@@ -504,14 +504,14 @@ class PackageInstallationScheduler {
                                                )
                                        )";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($package->package));
+               $statement->execute([$package->package]);
                while ($row = $statement->fetchArray()) {
-                       if (!isset($fromversions[$row['packageVersion']])) $fromversions[$row['packageVersion']] = array();
+                       if (!isset($fromversions[$row['packageVersion']])) $fromversions[$row['packageVersion']] = [];
                        $fromversions[$row['packageVersion']][$row['fromversion']] = $row['fromversion'];
                }
                
                // sort by version number
-               uksort($fromversions, array('wcf\data\package\Package', 'compareVersion'));
+               uksort($fromversions, ['wcf\data\package\Package', 'compareVersion']);
                
                // find shortest update thread
                $updateThread = $this->findShortestUpdateThread($package->package, $fromversions, $packageVersion, $version);
@@ -527,7 +527,7 @@ class PackageInstallationScheduler {
                        $download = $this->downloadPackage($package->package, $packageUpdateVersions);
                        
                        // add to stack
-                       $this->packageInstallationStack[] = array(
+                       $this->packageInstallationStack[] = [
                                'packageName' => $package->getName(),
                                'fromversion' => $fromversion,
                                'toVersion' => $toVersion,
@@ -535,7 +535,7 @@ class PackageInstallationScheduler {
                                'packageID' => $packageID,
                                'archive' => $download,
                                'action' => 'update'
-                       );
+                       ];
                        
                        // update virtual versions
                        $this->virtualPackageVersions[$packageID] = $toVersion;
@@ -560,25 +560,25 @@ class PackageInstallationScheduler {
                // find direct update
                foreach ($fromversions[$newVersion] as $fromversion) {
                        if (Package::checkFromversion($currentVersion, $fromversion)) {
-                               return array($currentVersion => $newVersion);
+                               return [$currentVersion => $newVersion];
                        }
                }
                
                // find intermediate update
                $packageVersions = array_keys($fromversions);
-               $updateThreadList = array();
+               $updateThreadList = [];
                foreach ($fromversions[$newVersion] as $fromversion) {
-                       $innerUpdateThreadList = array();
+                       $innerUpdateThreadList = [];
                        // find matching package versions
                        foreach ($packageVersions as $packageVersion) {
                                if (Package::checkFromversion($packageVersion, $fromversion) && Package::compareVersion($packageVersion, $currentVersion, '>') && Package::compareVersion($packageVersion, $newVersion, '<')) {
-                                       $innerUpdateThreadList[] = $this->findShortestUpdateThread($package, $fromversions, $currentVersion, $packageVersion) + array($packageVersion => $newVersion);
+                                       $innerUpdateThreadList[] = $this->findShortestUpdateThread($package, $fromversions, $currentVersion, $packageVersion) + [$packageVersion => $newVersion];
                                }
                        }
                        
                        if (!empty($innerUpdateThreadList)) {
                                // sort by length
-                               usort($innerUpdateThreadList, array($this, 'compareUpdateThreadLists'));
+                               usort($innerUpdateThreadList, [$this, 'compareUpdateThreadLists']);
                                
                                // add to thread list
                                $updateThreadList[] = array_shift($innerUpdateThreadList);
@@ -590,7 +590,7 @@ class PackageInstallationScheduler {
                }
                
                // sort by length
-               usort($updateThreadList, array($this, 'compareUpdateThreadLists'));
+               usort($updateThreadList, [$this, 'compareUpdateThreadLists']);
                
                // take shortest
                return array_shift($updateThreadList);
index 0aff2c66878759c636a0e6685ce718ad66dba8a0..103fc5fc5acd1557f773277773ceb74c3590284f 100644 (file)
@@ -37,7 +37,7 @@ class PackageUninstallationNodeBuilder extends PackageInstallationNodeBuilder {
                }
                
                // fetch ordered pips
-               $pips = array();
+               $pips = [];
                $sql = "SELECT          pluginName, className,
                                        CASE pluginName WHEN 'packageinstallationplugin' THEN 1 WHEN 'file' THEN 2 ELSE 0 END AS pluginOrder
                        FROM            wcf".WCF_N."_package_installation_plugin
@@ -56,18 +56,18 @@ class PackageUninstallationNodeBuilder extends PackageInstallationNodeBuilder {
                $sequenceNo = 0;
                
                foreach ($pips as $pip) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->installation->queue->queueID,
                                $this->installation->queue->processNo,
                                $sequenceNo,
                                $this->node,
                                $this->parentNode,
                                'pip',
-                               serialize(array(
+                               serialize([
                                        'pluginName' => $pip['pluginName'],
                                        'className' => $pip['className']
-                               ))
-                       ));
+                               ])
+                       ]);
                        
                        $sequenceNo++;
                }
@@ -84,7 +84,7 @@ class PackageUninstallationNodeBuilder extends PackageInstallationNodeBuilder {
                                        (queueID, processNo, sequenceNo, node, parentNode, nodeType, nodeData)
                        VALUES          (?, ?, ?, ?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $this->installation->queue->queueID,
                        $this->installation->queue->processNo,
                        0,
@@ -92,6 +92,6 @@ class PackageUninstallationNodeBuilder extends PackageInstallationNodeBuilder {
                        $this->parentNode,
                        'package',
                        'a:0:{}'
-               ));
+               ]);
        }
 }
index 436b691106317dabf4396f29c573db02ca31fcda..c53b37afa7749cd4bcfb8b84651954633bfa9893 100644 (file)
@@ -32,12 +32,12 @@ class PackageUpdateDispatcher extends SingletonFactory {
         * @param       integer[]               $packageUpdateServerIDs
         * @param       boolean                 $ignoreCache
         */
-       public function refreshPackageDatabase(array $packageUpdateServerIDs = array(), $ignoreCache = false) {
+       public function refreshPackageDatabase(array $packageUpdateServerIDs = [], $ignoreCache = false) {
                // get update server data
                $tmp = PackageUpdateServer::getActiveUpdateServers($packageUpdateServerIDs);
                
                // loop servers
-               $updateServers = array();
+               $updateServers = [];
                $foundWoltLabServer = false;
                foreach ($tmp as $updateServer) {
                        if ($ignoreCache || $updateServer->lastUpdateTime < TIME_NOW - 600) {
@@ -73,10 +73,10 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        if ($errorMessage) {
                                // save error status
                                $updateServerEditor = new PackageUpdateServerEditor($updateServer);
-                               $updateServerEditor->update(array(
+                               $updateServerEditor->update([
                                        'status' => 'offline',
                                        'errorMessage' => $errorMessage
-                               ));
+                               ]);
                        }
                }
                
@@ -94,7 +94,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
         * @throws      SystemException
         */
        protected function getPackageUpdateXML(PackageUpdateServer $updateServer, $forceHTTP = false) {
-               $settings = array();
+               $settings = [];
                $authData = $updateServer->getAuthData();
                if ($authData) $settings['auth'] = $authData;
                
@@ -141,11 +141,11 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        $allNewPackages = $this->parsePackageUpdateXML($reply['body']);
                }
                
-               $data = array(
+               $data = [
                        'lastUpdateTime' => TIME_NOW,
                        'status' => 'online',
                        'errorMessage' => ''
-               );
+               ];
                
                // check if server indicates support for a newer API
                if ($updateServer->apiVersion == '2.0' && !empty($reply['httpHeaders']['wcf-update-server-api'])) {
@@ -155,7 +155,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        }
                }
                
-               $metaData = array();
+               $metaData = [];
                if ($updateServer->apiVersion == '2.1' || (isset($data['apiVersion']) && $data['apiVersion'] == '2.1')) {
                        if (empty($reply['httpHeaders']['etag']) && empty($reply['httpHeaders']['last-modified'])) {
                                throw new SystemException("Missing required HTTP headers 'etag' and 'last-modified'.");
@@ -164,7 +164,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                throw new SystemException("Missing required HTTP header 'wcf-update-server-ssl'.");
                        }
                        
-                       $metaData['list'] = array();
+                       $metaData['list'] = [];
                        if (!empty($reply['httpHeaders']['etag'])) $metaData['list']['etag'] = reset($reply['httpHeaders']['etag']);
                        if (!empty($reply['httpHeaders']['last-modified'])) $metaData['list']['lastModified'] = reset($reply['httpHeaders']['last-modified']);
                        
@@ -179,7 +179,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        $sql = "DELETE FROM     wcf".WCF_N."_package_update
                                WHERE           packageUpdateServerID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($updateServer->packageUpdateServerID));
+                       $statement->execute([$updateServer->packageUpdateServerID]);
                        
                        // save packages
                        if (!empty($allNewPackages)) {
@@ -206,7 +206,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                $xml->loadXML('packageUpdateServer.xml', $content);
                $xpath = $xml->xpath();
                
-               $allNewPackages = array();
+               $allNewPackages = [];
                $packages = $xpath->query('/ns:section/ns:package');
                foreach ($packages as $package) {
                        if (!Package::isValidPackageName($package->getAttribute('name'))) {
@@ -228,13 +228,13 @@ class PackageUpdateDispatcher extends SingletonFactory {
         */
        protected function parsePackageUpdateXMLBlock(\DOMXPath $xpath, \DOMNode $package) {
                // define default values
-               $packageInfo = array(
+               $packageInfo = [
                        'author' => '',
                        'authorURL' => '',
                        'isApplication' => 0,
                        'packageDescription' => '',
-                       'versions' => array()
-               );
+                       'versions' => []
+               ];
                
                // parse package information
                $elements = $xpath->query('./ns:packageinformation/*', $package);
@@ -272,10 +272,10 @@ class PackageUpdateDispatcher extends SingletonFactory {
                $elements = $xpath->query('./ns:versions/ns:version', $package);
                foreach ($elements as $element) {
                        $versionNo = $element->getAttribute('name');
-                       $packageInfo['versions'][$versionNo] = array(
+                       $packageInfo['versions'][$versionNo] = [
                                'isAccessible' => ($element->getAttribute('accessible') == 'true' ? true : false),
                                'isCritical' => ($element->getAttribute('critical') == 'true' ? true : false)
-                       );
+                       ];
                        
                        $children = $xpath->query('child::*', $element);
                        foreach ($children as $child) {
@@ -301,7 +301,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                                        $minVersion = $requiredPackage->getAttribute('minversion');
                                                        $required = $requiredPackage->nodeValue;
                                                        
-                                                       $packageInfo['versions'][$versionNo]['requiredPackages'][$required] = array();
+                                                       $packageInfo['versions'][$versionNo]['requiredPackages'][$required] = [];
                                                        if (!empty($minVersion)) {
                                                                $packageInfo['versions'][$versionNo]['requiredPackages'][$required]['minversion'] = $minVersion;
                                                        }
@@ -309,7 +309,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                        break;
                                        
                                        case 'optionalpackages':
-                                               $packageInfo['versions'][$versionNo]['optionalPackages'] = array();
+                                               $packageInfo['versions'][$versionNo]['optionalPackages'] = [];
                                                
                                                $optionalPackages = $xpath->query('child::*', $child);
                                                foreach ($optionalPackages as $optionalPackage) {
@@ -323,7 +323,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                                        $exclusion = $excludedPackage->nodeValue;
                                                        $version = $excludedPackage->getAttribute('version');
                                                        
-                                                       $packageInfo['versions'][$versionNo]['excludedPackages'][$exclusion] = array();
+                                                       $packageInfo['versions'][$versionNo]['excludedPackages'][$exclusion] = [];
                                                        if (!empty($version)) {
                                                                $packageInfo['versions'][$versionNo]['excludedPackages'][$exclusion]['version'] = $version;
                                                        }
@@ -331,10 +331,10 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                        break;
                                        
                                        case 'license':
-                                               $packageInfo['versions'][$versionNo]['license'] = array(
+                                               $packageInfo['versions'][$versionNo]['license'] = [
                                                        'license' => $child->nodeValue,
                                                        'licenseURL' => ($child->hasAttribute('url') ? $child->getAttribute('url') : '')
-                                               );
+                                               ];
                                        break;
                                }
                        }
@@ -351,11 +351,11 @@ class PackageUpdateDispatcher extends SingletonFactory {
         */
        protected function savePackageUpdates(array &$allNewPackages, $packageUpdateServerID) {
                // insert updates
-               $excludedPackagesParameters = $fromversionParameters = $insertParameters = $optionalInserts = $requirementInserts = array();
+               $excludedPackagesParameters = $fromversionParameters = $insertParameters = $optionalInserts = $requirementInserts = [];
                WCF::getDB()->beginTransaction();
                foreach ($allNewPackages as $identifier => $packageData) {
                        // create new database entry
-                       $packageUpdate = PackageUpdateEditor::create(array(
+                       $packageUpdate = PackageUpdateEditor::create([
                                'packageUpdateServerID' => $packageUpdateServerID,
                                'package' => $identifier,
                                'packageName' => $packageData['packageName'],
@@ -363,7 +363,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                'author' => $packageData['author'],
                                'authorURL' => $packageData['authorURL'],
                                'isApplication' => $packageData['isApplication']
-                       ));
+                       ]);
                        
                        $packageUpdateID = $packageUpdate->packageUpdateID;
                        
@@ -374,7 +374,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                        else $packageFile = '';
                                        
                                        // create new database entry
-                                       $version = PackageUpdateVersionEditor::create(array(
+                                       $version = PackageUpdateVersionEditor::create([
                                                'filename' => $packageFile,
                                                'license' => (isset($versionData['license']['license']) ? $versionData['license']['license'] : ''),
                                                'licenseURL' => (isset($versionData['license']['license']) ? $versionData['license']['licenseURL'] : ''),
@@ -383,49 +383,49 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                                'packageDate' => $versionData['packageDate'],
                                                'packageUpdateID' => $packageUpdateID,
                                                'packageVersion' => $packageVersion
-                                       ));
+                                       ]);
                                        
                                        $packageUpdateVersionID = $version->packageUpdateVersionID;
                                        
                                        // register requirement(s) of this update package version.
                                        if (isset($versionData['requiredPackages'])) {
                                                foreach ($versionData['requiredPackages'] as $requiredIdentifier => $required) {
-                                                       $requirementInserts[] = array(
+                                                       $requirementInserts[] = [
                                                                'packageUpdateVersionID' => $packageUpdateVersionID,
                                                                'package' => $requiredIdentifier,
                                                                'minversion' => (isset($required['minversion']) ? $required['minversion'] : '')
-                                                       );
+                                                       ];
                                                }
                                        }
                                        
                                        // register optional packages of this update package version
                                        if (isset($versionData['optionalPackages'])) {
                                                foreach ($versionData['optionalPackages'] as $optionalPackage) {
-                                                       $optionalInserts[] = array(
+                                                       $optionalInserts[] = [
                                                                'packageUpdateVersionID' => $packageUpdateVersionID,
                                                                'package' => $optionalPackage
-                                                       );
+                                                       ];
                                                }
                                        }
                                        
                                        // register excluded packages of this update package version.
                                        if (isset($versionData['excludedPackages'])) {
                                                foreach ($versionData['excludedPackages'] as $excludedIdentifier => $exclusion) {
-                                                       $excludedPackagesParameters[] = array(
+                                                       $excludedPackagesParameters[] = [
                                                                'packageUpdateVersionID' => $packageUpdateVersionID,
                                                                'excludedPackage' => $excludedIdentifier,
                                                                'excludedPackageVersion' => (isset($exclusion['version']) ? $exclusion['version'] : '')
-                                                       );
+                                                       ];
                                                }
                                        }
                                        
                                        // register fromversions of this update package version.
                                        if (isset($versionData['fromversions'])) {
                                                foreach ($versionData['fromversions'] as $fromversion) {
-                                                       $fromversionInserts[] = array(
+                                                       $fromversionInserts[] = [
                                                                'packageUpdateVersionID' => $packageUpdateVersionID,
                                                                'fromversion' => $fromversion
-                                                       );
+                                                       ];
                                                }
                                        }
                                }
@@ -442,11 +442,11 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        WCF::getDB()->beginTransaction();
                        foreach ($requirementInserts as $requirement) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $requirement['packageUpdateVersionID'],
                                        $requirement['package'],
                                        $requirement['minversion']
-                               ));
+                               ]);
                        }
                        WCF::getDB()->commitTransaction();
                }
@@ -459,10 +459,10 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        WCF::getDB()->beginTransaction();
                        foreach ($optionalInserts as $requirement) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $requirement['packageUpdateVersionID'],
                                        $requirement['package']
-                               ));
+                               ]);
                        }
                        WCF::getDB()->commitTransaction();
                }
@@ -475,11 +475,11 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        WCF::getDB()->beginTransaction();
                        foreach ($excludedPackagesParameters as $excludedPackage) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $excludedPackage['packageUpdateVersionID'],
                                        $excludedPackage['excludedPackage'],
                                        $excludedPackage['excludedPackageVersion']
-                               ));
+                               ]);
                        }
                        WCF::getDB()->commitTransaction();
                }
@@ -492,10 +492,10 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        WCF::getDB()->beginTransaction();
                        foreach ($fromversionInserts as $fromversion) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $fromversion['packageUpdateVersionID'],
                                        $fromversion['fromversion']
-                               ));
+                               ]);
                        }
                        WCF::getDB()->commitTransaction();
                }
@@ -509,7 +509,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
         * @return      array
         */
        public function getAvailableUpdates($removeRequirements = true, $removeOlderMinorReleases = false) {
-               $updates = array();
+               $updates = [];
                
                // get update server data
                $updateServers = PackageUpdateServer::getActiveUpdateServers();
@@ -517,7 +517,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                if (empty($packageUpdateServerIDs)) return $updates;
                
                // get existing packages and their versions
-               $existingPackages = array();
+               $existingPackages = [];
                $sql = "SELECT  packageID, package, packageDescription, packageName,
                                packageVersion, packageDate, author, authorURL, isApplication
                        FROM    wcf".WCF_N."_package";
@@ -530,7 +530,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                
                // get all update versions
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("pu.packageUpdateServerID IN (?)", array($packageUpdateServerIDs));
+               $conditions->add("pu.packageUpdateServerID IN (?)", [$packageUpdateServerIDs]);
                $conditions->add("package IN (SELECT DISTINCT package FROM wcf".WCF_N."_package)");
                
                $sql = "SELECT          pu.packageUpdateID, pu.packageUpdateServerID, pu.package,
@@ -547,27 +547,27 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                if (Package::compareVersion($existingVersion['packageVersion'], $row['packageVersion'], '<')) {
                                        // package data
                                        if (!isset($updates[$existingVersion['packageID']])) {
-                                               $existingVersion['versions'] = array();
+                                               $existingVersion['versions'] = [];
                                                $updates[$existingVersion['packageID']] = $existingVersion;
                                        }
                                        
                                        // version data
                                        if (!isset($updates[$existingVersion['packageID']]['versions'][$row['packageVersion']])) {
-                                               $updates[$existingVersion['packageID']]['versions'][$row['packageVersion']] = array(
+                                               $updates[$existingVersion['packageID']]['versions'][$row['packageVersion']] = [
                                                        'isCritical' => $row['isCritical'],
                                                        'packageDate' => $row['packageDate'],
                                                        'packageVersion' => $row['packageVersion'],
-                                                       'servers' => array()
-                                               );
+                                                       'servers' => []
+                                               ];
                                        }
                                        
                                        // server data
-                                       $updates[$existingVersion['packageID']]['versions'][$row['packageVersion']]['servers'][] = array(
+                                       $updates[$existingVersion['packageID']]['versions'][$row['packageVersion']]['servers'][] = [
                                                'packageUpdateID' => $row['packageUpdateID'],
                                                'packageUpdateServerID' => $row['packageUpdateServerID'],
                                                'packageUpdateVersionID' => $row['packageUpdateVersionID'],
                                                'filename' => $row['filename']
-                                       );
+                                       ];
                                }
                        }
                }
@@ -575,7 +575,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                // sort package versions
                // and remove old versions
                foreach ($updates as $packageID => $data) {
-                       uksort($updates[$packageID]['versions'], array('wcf\data\package\Package', 'compareVersion'));
+                       uksort($updates[$packageID]['versions'], ['wcf\data\package\Package', 'compareVersion']);
                        $updates[$packageID]['version'] = end($updates[$packageID]['versions']);
                }
                
@@ -593,7 +593,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                // remove older minor releases from list, e.g. only display 1.0.2, even if 1.0.1 is available
                if ($removeOlderMinorReleases) {
                        foreach ($updates as &$updateData) {
-                               $highestVersions = array();
+                               $highestVersions = [];
                                foreach ($updateData['versions'] as $versionNumber => $dummy) {
                                        if (preg_match('~^(\d+\.\d+)\.~', $versionNumber, $matches)) {
                                                $major = $matches[1];
@@ -634,7 +634,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                        ON              (p.package = pur.package)
                        WHERE           pur.packageUpdateVersionID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageUpdateVersionID));
+               $statement->execute([$packageUpdateVersionID]);
                while ($row = $statement->fetchArray()) {
                        if (isset($updates[$row['packageID']])) {
                                $updates = $this->removeUpdateRequirements($updates, $updates[$row['packageID']]['version']['servers'][0]['packageUpdateVersionID']);
@@ -672,7 +672,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
                }
                
                // get versions
-               $versions = array();
+               $versions = [];
                $sql = "SELECT          puv.*, pu.*, pus.loginUsername, pus.loginPassword
                        FROM            wcf".WCF_N."_package_update_version puv
                        LEFT JOIN       wcf".WCF_N."_package_update pu
@@ -683,11 +683,11 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                        AND puv.packageVersion = ?
                                        AND pus.isDisabled = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $package,
                        $version,
                        0
-               ));
+               ]);
                while ($row = $statement->fetchArray()) {
                        $versions[] = $row;
                }
@@ -707,7 +707,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
         */
        public function getNewestPackageVersion($package) {
                // get all versions
-               $versions = array();
+               $versions = [];
                $sql = "SELECT  packageVersion
                        FROM    wcf".WCF_N."_package_update_version
                        WHERE   packageUpdateID IN (
@@ -716,13 +716,13 @@ class PackageUpdateDispatcher extends SingletonFactory {
                                        WHERE   package = ?
                                )";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($package));
+               $statement->execute([$package]);
                while ($row = $statement->fetchArray()) {
                        $versions[$row['packageVersion']] = $row['packageVersion'];
                }
                
                // sort by version number
-               usort($versions, array('wcf\data\package\Package', 'compareVersion'));
+               usort($versions, ['wcf\data\package\Package', 'compareVersion']);
                
                // take newest (last)
                return array_pop($versions);
@@ -738,7 +738,7 @@ class PackageUpdateDispatcher extends SingletonFactory {
        public function cacheDownload($package, $version, $filename) {
                $cachedDownloads = WCF::getSession()->getVar('cachedPackageUpdateDownloads');
                if (!is_array($cachedDownloads)) {
-                       $cachedDownloads = array();
+                       $cachedDownloads = [];
                }
                
                // store in session
index eb32740b3542d3d535c037407eed95b0d123acbd..484c7d4fc24ba8b682629262c5123471fe117812 100644 (file)
@@ -20,7 +20,7 @@ class PackageUpdateUnauthorizedException extends UserException {
         * package update version
         * @var array
         */
-       protected $packageUpdateVersion = array();
+       protected $packageUpdateVersion = [];
        
        /**
         * HTTP request object
@@ -41,7 +41,7 @@ class PackageUpdateUnauthorizedException extends UserException {
         * @param       \wcf\data\package\update\server\PackageUpdateServer     $updateServer
         * @param       array                                                   $packageUpdateVersion
         */
-       public function __construct(HTTPRequest $request, PackageUpdateServer $updateServer, array $packageUpdateVersion = array()) {
+       public function __construct(HTTPRequest $request, PackageUpdateServer $updateServer, array $packageUpdateVersion = []) {
                $this->request = $request;
                $this->updateServer = $updateServer;
                $this->packageUpdateVersion = $packageUpdateVersion;
@@ -53,11 +53,11 @@ class PackageUpdateUnauthorizedException extends UserException {
         * @return      string
         */
        public function getRenderedTemplate() {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'packageUpdateVersion' => $this->packageUpdateVersion,
                        'request' => $this->request,
                        'updateServer' => $this->updateServer
-               ));
+               ]);
                
                return WCF::getTPL()->fetch('packageUpdateUnauthorized');
        }
index da6d7962a4be516180d95bf7836773e3d07e95d7..40c47b1def28c477001fc39b55890cf493d92eec 100644 (file)
@@ -37,14 +37,14 @@ class TemplatesFileHandler extends ACPTemplatesFileHandler {
                unset($file);
                
                // get existing templates
-               $existingTemplates = $updateTemplateIDs = array();
+               $existingTemplates = $updateTemplateIDs = [];
                $sql = "SELECT  templateName, templateID
                        FROM    wcf".WCF_N."_template
                        WHERE   packageID = ?
                                AND application = ?
                                AND templateGroupID IS NULL";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($packageID, $this->application));
+               $statement->execute([$packageID, $this->application]);
                while ($row = $statement->fetchArray()) {
                        $existingTemplates[$row['templateName']] = $row['templateID'];
                }
@@ -60,24 +60,24 @@ class TemplatesFileHandler extends ACPTemplatesFileHandler {
                                continue;
                        }
                        
-                       $statement->execute(array(
+                       $statement->execute([
                                $packageID,
                                $file,
                                TIME_NOW,
                                $this->application
-                       ));
+                       ]);
                }
                
                if (!empty($updateTemplateIDs)) {
                        // update old templates
                        $conditionBuilder = new PreparedStatementConditionBuilder();
-                       $conditionBuilder->add('templateID IN (?)', array($updateTemplateIDs));
+                       $conditionBuilder->add('templateID IN (?)', [$updateTemplateIDs]);
                        
                        $sql = "UPDATE  wcf".WCF_N."_template
                                SET     lastModificationTime = ?
                                ".$conditionBuilder;
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array_merge(array(TIME_NOW), $conditionBuilder->getParameters()));
+                       $statement->execute(array_merge([TIME_NOW], $conditionBuilder->getParameters()));
                }
        }
 }
index d4685fb01e8bc3ff48896c2684b0ed8f6fa4c11c..243916cfd9b6b3a4b70d325d5359f6332cc9e727 100644 (file)
@@ -23,7 +23,7 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati
         * list of loaded acl object type ids sorted by their option type name
         * @var integer[]
         */
-       protected $optionTypeIDs = array();
+       protected $optionTypeIDs = [];
        
        /**
         * @see \wcf\system\package\plugin\AbstractPackageInstallationPlugin::$tableName
@@ -41,7 +41,7 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati
        protected function importCategories(\DOMXPath $xpath) {
                $elements = $xpath->query('/ns:data/ns:import/ns:categories/ns:category');
                foreach ($elements as $element) {
-                       $data = array('categoryName' => $element->getAttribute('name'));
+                       $data = ['categoryName' => $element->getAttribute('name')];
                                
                        // get child elements
                        $children = $xpath->query('child::*', $element);
@@ -66,11 +66,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati
                                AND objectTypeID = ?
                                AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $category['categoryName'],
                        $objectTypeID,
                        $this->installation->getPackageID()
-               ));
+               ]);
                $row = $statement->fetchArray();
                if (!$row) {
                        // insert new category
@@ -78,11 +78,11 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati
                                                (packageID, objectTypeID, categoryName)
                                VALUES          (?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->installation->getPackageID(),
                                $objectTypeID,
                                $category['categoryName']
-                       ));
+                       ]);
                }
        }
        
@@ -95,7 +95,7 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati
        protected function importOptions(\DOMXPath $xpath) {
                $elements = $xpath->query('/ns:data/ns:import/ns:options/ns:option');
                foreach ($elements as $element) {
-                       $data = array();
+                       $data = [];
                        $children = $xpath->query('child::*', $element);
                        foreach ($children as $child) {
                                $data[$child->tagName] = $child->nodeValue;
@@ -110,21 +110,21 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati
                                        WHERE   categoryName = ?
                                                AND objectTypeID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(
+                               $statement->execute([
                                        $data['categoryname'],
                                        $objectTypeID
-                               ));
+                               ]);
                                
                                if (!$statement->fetchSingleColumn()) {
                                        throw new SystemException("unknown category '".$data['categoryname']."' for acl object type '".$data['objecttype']."' given");
                                }
                        }
                        
-                       $data = array(
+                       $data = [
                                'categoryName' => (isset($data['categoryname'])) ? $data['categoryname'] : '',
                                'optionName' => $element->getAttribute('name'),
                                'objectTypeID' => $objectTypeID
-                       );
+                       ];
                        
                        // check for option existence
                        $sql = "SELECT  optionID
@@ -133,33 +133,33 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati
                                        AND objectTypeID = ?
                                        AND packageID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $data['optionName'],
                                $data['objectTypeID'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                        $row = $statement->fetchArray();
                        if (!$row) {
                                $sql = "INSERT INTO     wcf".WCF_N."_".$this->tableName."
                                                        (packageID, objectTypeID, optionName, categoryName)
                                        VALUES          (?, ?, ?, ?)";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(
+                               $statement->execute([
                                        $this->installation->getPackageID(),
                                        $data['objectTypeID'],
                                        $data['optionName'],
                                        $data['categoryName']
-                               ));
+                               ]);
                        }
                        else {
                                $sql = "UPDATE  wcf".WCF_N."_".$this->tableName."
                                        SET     categoryName = ?
                                        WHERE   optionID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(
+                               $statement->execute([
                                        $data['categoryName'],
                                        $row['optionID']
-                               ));
+                               ]);
                        }
                }
        }
@@ -190,7 +190,7 @@ class ACLOptionPackageInstallationPlugin extends AbstractOptionPackageInstallati
                                                WHERE   definitionName = 'com.woltlab.wcf.acl'
                                        )";
                        $statement = WCF::getDB()->prepareStatement($sql, 1);
-                       $statement->execute(array($optionType));
+                       $statement->execute([$optionType]);
                        $row = $statement->fetchArray();
                        if (!$row) {
                                throw new SystemException("unknown object type '".$optionType."' given");
index d315bf091a48958073dc15706784ff030d4b4c77..e64cf587f06c2729248d94259f9c7bcdfa546b7d 100644 (file)
@@ -30,10 +30,10 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta
                
                WCF::getDB()->beginTransaction();
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
                WCF::getDB()->commitTransaction();
        }
@@ -46,11 +46,11 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta
                $showOrder = (isset($data['elements']['showorder'])) ? $data['elements']['showorder'] : null;
                $showOrder = $this->getShowOrder($showOrder);
                
-               return array(
+               return [
                        'className' => $data['elements']['classname'],
                        'providerName' => $data['attributes']['name'],
                        'showOrder' => $showOrder
-               );
+               ];
        }
        
        /**
@@ -61,15 +61,15 @@ class ACPSearchProviderPackageInstallationPlugin extends AbstractXMLPackageInsta
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   providerName = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['providerName'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
index 7e83a8bd680e2b086b36531eaf208e6ca3d9b7fc..2ef0f9bf061570a8c9e03c23ece47ce833f82ec9 100644 (file)
@@ -61,12 +61,12 @@ class ACPTemplatePackageInstallationPlugin extends AbstractPackageInstallationPl
                        FROM    wcf".WCF_N."_acp_template
                        WHERE   packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
                
-               $templates = array();
+               $templates = [];
                while ($row = $statement->fetchArray()) {
                        if (!isset($templates[$row['application']])) {
-                               $templates[$row['application']] = array();
+                               $templates[$row['application']] = [];
                        }
                        
                        $templates[$row['application']][] = 'acp/templates/'.$row['templateName'].'.tpl';
index 9ad13b0cd7474c261745a2c20e2fe07e218678e5..26b091273fd69fd9bf2e506f3274361bd53606da 100644 (file)
@@ -23,10 +23,10 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -40,7 +40,7 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI
                $showOrder = $this->getShowOrder($showOrder, $parent, 'parentMenuItem');
                
                // merge values and default values
-               return array(
+               return [
                        'menuItem' => $data['attributes']['name'],
                        'menuItemController' => isset($data['elements']['controller']) ? $data['elements']['controller'] : '',
                        'menuItemLink' => (isset($data['elements']['link'])) ? $data['elements']['link'] : '',
@@ -48,7 +48,7 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI
                        'parentMenuItem' => (isset($data['elements']['parent'])) ? $data['elements']['parent'] : '',
                        'permissions' => (isset($data['elements']['permissions'])) ? $data['elements']['permissions'] : '',
                        'showOrder' => $showOrder
-               );
+               ];
        }
        
        /**
@@ -63,7 +63,7 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI
                        FROM    ".$this->application.WCF_N."_".$this->tableName."
                        WHERE   menuItem = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($data['parentMenuItem']));
+               $statement->execute([$data['parentMenuItem']]);
                
                if (!$statement->fetchSingleColumn()) {
                        throw new SystemException("Unable to find parent 'menu item' with name '".$data['parentMenuItem']."' for 'menu item' with name '".$data['menuItem']."'.");
@@ -78,14 +78,14 @@ abstract class AbstractMenuPackageInstallationPlugin extends AbstractXMLPackageI
                        FROM    ".$this->application.WCF_N."_".$this->tableName."
                        WHERE   menuItem = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['menuItem'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
 }
index 4604fd7fd54d01d013ba5195101f0125526fede3..7deb85c73d819ee42d3886b863ce6a37d9915596 100644 (file)
@@ -41,7 +41,7 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
        protected function deleteItems(\DOMXPath $xpath) {
                // delete options
                $elements = $xpath->query('/ns:data/ns:delete/ns:option');
-               $options = array();
+               $options = [];
                foreach ($elements as $element) {
                        $options[] = $element->getAttribute('name');
                }
@@ -53,16 +53,16 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($options as $option) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $option,
                                        $this->installation->getPackageID()
-                               ));
+                               ]);
                        }
                }
                
                // delete categories
                $elements = $xpath->query('/ns:data/ns:delete/ns:optioncategory');
-               $categories = array();
+               $categories = [];
                foreach ($elements as $element) {
                        $categories[] = $element->getAttribute('name');
                }
@@ -74,10 +74,10 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                                                AND packageID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($categories as $category) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $category,
                                        $this->installation->getPackageID()
-                               ));
+                               ]);
                        }
                        
                        // delete categories
@@ -87,10 +87,10 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($categories as $category) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $category,
                                        $this->installation->getPackageID()
-                               ));
+                               ]);
                        }
                }
        }
@@ -104,7 +104,7 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
        protected function importCategories(\DOMXPath $xpath) {
                $elements = $xpath->query('/ns:data/ns:import/ns:categories/ns:category');
                foreach ($elements as $element) {
-                       $data = array();
+                       $data = [];
                        
                        // get child elements
                        $children = $xpath->query('child::*', $element);
@@ -113,13 +113,13 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                        }
                        
                        // build data block with defaults
-                       $data = array(
+                       $data = [
                                'categoryName' => $element->getAttribute('name'),
                                'options' => (isset($data['options'])) ? $data['options'] : '',
                                'parentCategoryName' => (isset($data['parent'])) ? $data['parent'] : '',
                                'permissions' => (isset($data['permissions'])) ? $data['permissions'] : '',
                                'showOrder' => (isset($data['showorder'])) ? intval($data['showorder']) : null
-                       );
+                       ];
                        
                        // adjust show order
                        if ($data['showOrder'] !== null || $this->installation->getAction() != 'update') {
@@ -132,7 +132,7 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                                        FROM    ".$this->application.WCF_N."_".$this->tableName."_category
                                        WHERE   categoryName = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array($data['parentCategoryName']));
+                               $statement->execute([$data['parentCategoryName']]);
                                
                                if (!$statement->fetchSingleColumn()) {
                                        throw new SystemException("Unable to find parent 'option category' with name '".$data['parentCategoryName']."' for category with name '".$data['categoryName']."'.");
@@ -153,7 +153,7 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
        protected function importOptions(\DOMXPath $xpath) {
                $elements = $xpath->query('/ns:data/ns:import/ns:options/ns:option');
                foreach ($elements as $element) {
-                       $data = array();
+                       $data = [];
                        $children = $xpath->query('child::*', $element);
                        foreach ($children as $child) {
                                $data[$child->tagName] = $child->nodeValue;
@@ -162,7 +162,7 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                        $data['name'] = $element->getAttribute('name');
                        
                        if (!preg_match("/^[\w-\.]+$/", $data['name'])) {
-                               $matches = array();
+                               $matches = [];
                                preg_match_all("/(\W)/", $data['name'], $matches);
                                throw new SystemException("The option '".$data['name']."' has at least one non-alphanumeric character (underscore is permitted): (".implode("), ( ", $matches[1]).").");
                        }
@@ -180,7 +180,7 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                        FROM    ".$this->application.WCF_N."_".$this->tableName."_category
                        WHERE   packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
                
                return ($hasUninstallOptions || $statement->fetchSingleColumn() > 0);
        }
@@ -196,7 +196,7 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                $sql = "DELETE FROM     ".$this->application.WCF_N."_".$this->tableName."_category
                        WHERE           packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
        }
        
        /**
@@ -211,9 +211,9 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                        FROM    ".$this->application.WCF_N."_".$this->tableName."_category
                        WHERE   categoryName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $category['categoryName']
-               ));
+               ]);
                $row = $statement->fetchArray();
                if (empty($row['categoryID'])) {
                        // insert new category
@@ -223,13 +223,13 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                                VALUES          (?, ?, ?, ?, ?".($category['showOrder'] !== null ? ", ?" : "").")";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
-                       $data = array(
+                       $data = [
                                $this->installation->getPackageID(),
                                $category['categoryName'],
                                $category['parentCategoryName'],
                                $category['permissions'],
                                $category['options']
-                       );
+                       ];
                        if ($category['showOrder'] !== null) $data[] = $category['showOrder'];
                        
                        $statement->execute($data);
@@ -248,11 +248,11 @@ abstract class AbstractOptionPackageInstallationPlugin extends AbstractXMLPackag
                                WHERE   categoryID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
-                       $data = array(
+                       $data = [
                                $category['parentCategoryName'],
                                $category['permissions'],
                                $category['options']
-                       );
+                       ];
                        if ($category['showOrder'] !== null) $data[] = $category['showOrder'];
                        $data[] = $row['categoryID'];
                        
index d48b6df7d3d0f4faadfc91b953750f64da742fd5..5cad28189e95bbaec18f53d361826f37fe12c7c9 100644 (file)
@@ -38,7 +38,7 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation
         * install/update instructions
         * @var array
         */
-       public $instruction = array();
+       public $instruction = [];
        
        /**
         * Creates a new AbstractPackageInstallationPlugin object.
@@ -46,7 +46,7 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation
         * @param       \wcf\system\package\PackageInstallationDispatcher       $installation
         * @param       array                                                   $instruction
         */
-       public function __construct(PackageInstallationDispatcher $installation, $instruction = array()) {
+       public function __construct(PackageInstallationDispatcher $installation, $instruction = []) {
                $this->installation = $installation;
                $this->instruction = $instruction;
                
@@ -83,7 +83,7 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation
                        FROM    ".$this->application.WCF_N."_".$this->tableName."
                        WHERE   packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
                
                return $statement->fetchSingleColumn() > 0;
        }
@@ -98,7 +98,7 @@ abstract class AbstractPackageInstallationPlugin implements IPackageInstallation
                $sql = "DELETE FROM     ".$this->application.WCF_N."_".$this->tableName."
                        WHERE           packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
        }
        
        /**
index 2555aed7a5d97a7510d28fe2da19eb6d5fcbc92e..5c99dc32dc6a94983b512427f4d8f9834876a695 100644 (file)
@@ -35,12 +35,12 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
        /**
         * @see \wcf\system\package\plugin\AbstractPackageInstallationPlugin::install()
         */
-       public function __construct(PackageInstallationDispatcher $installation, $instruction = array()) {
+       public function __construct(PackageInstallationDispatcher $installation, $instruction = []) {
                parent::__construct($installation, $instruction);
                
                // autoset 'tableName' property
                if (empty($this->tableName) && !empty($this->className)) {
-                       $this->tableName = call_user_func(array($this->className, 'getDatabaseTableAlias'));
+                       $this->tableName = call_user_func([$this->className, 'getDatabaseTableAlias']);
                }
                
                // autoset 'tagName' property
@@ -88,13 +88,13 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
         */
        protected function deleteItems(\DOMXPath $xpath) {
                $elements = $xpath->query('/ns:data/ns:delete/ns:'.$this->tagName);
-               $items = array();
+               $items = [];
                foreach ($elements as $element) {
-                       $data = array(
-                               'attributes' => array(),
-                               'elements' => array(),
+                       $data = [
+                               'attributes' => [],
+                               'elements' => [],
                                'value' => $element->nodeValue
-                       );
+                       ];
                        
                        // get attributes
                        $attributes = $xpath->query('attribute::*', $element);
@@ -125,11 +125,11 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
        protected function importItems(\DOMXPath $xpath) {
                $elements = $xpath->query('/ns:data/ns:import/ns:'.$this->tagName);
                foreach ($elements as $element) {
-                       $data = array(
-                               'attributes' => array(),
-                               'elements' => array(),
+                       $data = [
+                               'attributes' => [],
+                               'elements' => [],
                                'nodeValue' => ''
-                       );
+                       ];
                        
                        // fetch attributes
                        $attributes = $xpath->query('attribute::*', $element);
@@ -166,7 +166,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
                        }
                        
                        // ensure a valid parameter for import()
-                       if ($row === false) $row = array();
+                       if ($row === false) $row = [];
                        
                        // import items
                        $this->import($row, $data);
@@ -252,11 +252,11 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
                        // create new item
                        $this->prepareCreate($data);
                        
-                       return call_user_func(array($this->className, 'create'), $data);
+                       return call_user_func([$this->className, 'create'], $data);
                }
                else {
                        // update existing item
-                       $baseClass = call_user_func(array($this->className, 'getBaseClass'));
+                       $baseClass = call_user_func([$this->className, 'getBaseClass']);
                        
                        /** @var \wcf\data\DatabaseObjectEditor $itemEditor */
                        $itemEditor = new $this->className(new $baseClass(null, $row));
@@ -374,7 +374,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
                if ($showOrder === null) {
                        // get greatest showOrder value
                        $conditions = new PreparedStatementConditionBuilder();
-                       if ($columnName !== null) $conditions->add($columnName." = ?", array($parentName));
+                       if ($columnName !== null) $conditions->add($columnName." = ?", [$parentName]);
                        
                        $sql = "SELECT  MAX(showOrder) AS showOrder
                                FROM    ".$this->application.WCF_N."_".$this->tableName.$tableNameExtension."
@@ -392,7 +392,7 @@ abstract class AbstractXMLPackageInstallationPlugin extends AbstractPackageInsta
                                ".($columnName !== null ? "AND ".$columnName." = ?" : "");
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
-                       $data = array($showOrder);
+                       $data = [$showOrder];
                        if ($columnName !== null) $data[] = $parentName;
                        
                        $statement->execute($data);
index c2d8216712b67203847185e4f5ef6e22f7fcd3c9..bd71e3ac68c24ead98ffc12065bab40334284067 100644 (file)
@@ -22,7 +22,7 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall
         * list of pages per action id
         * @var mixed[][]
         */
-       protected $pages = array();
+       protected $pages = [];
        
        /**
         * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::$tagName
@@ -39,11 +39,11 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $item['elements']['actionclassname'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -55,7 +55,7 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall
                
                // read pages
                if ($element->tagName == 'pages') {
-                       $nodeValue = array();
+                       $nodeValue = [];
                        
                        $pages = $xpath->query('child::ns:page', $element);
                        foreach ($pages as $page) {
@@ -73,12 +73,12 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall
                $showOrder = (isset($data['elements']['showorder'])) ? intval($data['elements']['showorder']) : null;
                $showOrder = $this->getShowOrder($showOrder, $data['elements']['actionclassname'], 'actionClassName');
                
-               return array(
+               return [
                        'actionClassName' => $data['elements']['actionclassname'],
                        'actionName' => $data['attributes']['name'],
                        'pages' => $data['elements']['pages'],
                        'showOrder' => $showOrder
-               );
+               ];
        }
        
        /**
@@ -90,16 +90,16 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall
                        WHERE   actionName = ?
                                AND actionClassName = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['actionName'],
                        $data['actionClassName'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
@@ -125,7 +125,7 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall
                $sql = "DELETE FROM     wcf".WCF_N."_clipboard_page
                        WHERE           packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
                
                if (!empty($this->pages)) {
                        // insert pages
@@ -135,11 +135,11 @@ class ClipboardActionPackageInstallationPlugin extends AbstractXMLPackageInstall
                        $statement = WCF::getDB()->prepareStatement($sql);
                        foreach ($this->pages as $actionID => $pages) {
                                foreach ($pages as $pageClassName) {
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                $pageClassName,
                                                $this->installation->getPackageID(),
                                                $actionID
-                                       ));
+                                       ]);
                                }
                        }
                }
index 476b554ed63670079835adf9c439592843ee928c..57fab8f70c38e44d85babfc3516c63dba6bbdde7 100644 (file)
@@ -28,10 +28,10 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -39,9 +39,9 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation
         * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
         */
        protected function prepareImport(array $data) {
-               return array(
+               return [
                        'objectName' => $data['elements']['objectname']
-               );
+               ];
        }
        
        /**
@@ -52,15 +52,15 @@ class CoreObjectPackageInstallationPlugin extends AbstractXMLPackageInstallation
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   objectName = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['objectName'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
index ac5527ab2fda4705d867b0e2b2c9020741b8909b..b0a913455cf25a62775330643a059d01c72805a4 100644 (file)
@@ -27,7 +27,7 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
        protected function getElement(\DOMXPath $xpath, array &$elements, \DOMElement $element) {
                if ($element->tagName == 'description') {
                        if (!isset($elements['description'])) {
-                               $elements['description'] = array();
+                               $elements['description'] = [];
                        }
                        
                        $elements['description'][$element->getAttribute('language')] = $element->nodeValue;
@@ -53,16 +53,16 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
                
                foreach ($items as $item) {
                        if (!isset($item['attributes']['name'])) {
-                               $legacyStatement->execute(array(
+                               $legacyStatement->execute([
                                        $item['elements']['classname'],
                                        $this->installation->getPackageID()
-                               ));
+                               ]);
                        }
                        else {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $item['attributes']['name'],
                                        $this->installation->getPackageID()
-                               ));
+                               ]);
                        }
                }
        }
@@ -71,7 +71,7 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
         * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
         */
        protected function prepareImport(array $data) {
-               return array(
+               return [
                        'canBeDisabled' => (isset($data['elements']['canbedisabled'])) ? intval($data['elements']['canbedisabled']) : 1,
                        'canBeEdited' => (isset($data['elements']['canbeedited'])) ? intval($data['elements']['canbeedited']) : 1,
                        'className' => (isset($data['elements']['classname'])) ? $data['elements']['classname'] : '',
@@ -84,7 +84,7 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
                        'startHour' => $data['elements']['starthour'],
                        'startMinute' => $data['elements']['startminute'],
                        'startMonth' => $data['elements']['startmonth']
-               );
+               ];
        }
        
        /**
@@ -109,9 +109,9 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
                // update cronjob name
                if (!$cronjob->cronjobName) {
                        $cronjobEditor = new CronjobEditor($cronjob);
-                       $cronjobEditor->update(array(
+                       $cronjobEditor->update([
                                'cronjobName' => Cronjob::AUTOMATIC_NAME_PREFIX.$cronjob->cronjobID
-                       ));
+                       ]);
                        
                        $cronjob = new Cronjob($cronjob->cronjobID);
                }
@@ -129,15 +129,15 @@ class CronjobPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   packageID = ?
                                AND cronjobName = ?";
-               $parameters = array(
+               $parameters = [
                        $this->installation->getPackageID(),
                        $data['cronjobName']
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
index 4af83f14c1d9d46fd2038ba1759eacdadd60744f..66bbcd9b1e20ae3be35e07d3bf083084dc1bfb43 100644 (file)
@@ -46,20 +46,20 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat
                
                foreach ($items as $item) {
                        if (!isset($item['attributes']['name'])) {
-                               $legacyStatement->execute(array(
+                               $legacyStatement->execute([
                                        $this->installation->getPackageID(),
                                        (isset($item['elements']['environment']) ? $item['elements']['environment'] : 'user'),
                                        $item['elements']['eventclassname'],
                                        $item['elements']['eventname'],
                                        (isset($item['elements']['inherit'])) ? $item['elements']['inherit'] : 0,
                                        $item['elements']['listenerclassname']
-                               ));
+                               ]);
                        }
                        else {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $this->installation->getPackageID(),
                                        $item['attributes']['name']
-                               ));
+                               ]);
                        }
                }
        }
@@ -72,7 +72,7 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat
                if ($nice < -128) $nice = -128;
                else if ($nice > 127) $nice = 127;
                
-               return array(
+               return [
                        'environment' => (isset($data['elements']['environment']) ? $data['elements']['environment'] : 'user'),
                        'eventClassName' => $data['elements']['eventclassname'],
                        'eventName' => $data['elements']['eventname'],
@@ -82,7 +82,7 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat
                        'niceValue' => $nice,
                        'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : ''),
                        'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : '')
-               );
+               ];
        }
        
        /**
@@ -100,9 +100,9 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat
                // update event listener name
                if (!$eventListener->listenerName) {
                        $eventListenerEditor = new EventListenerEditor($eventListener);
-                       $eventListenerEditor->update(array(
+                       $eventListenerEditor->update([
                                'listenerName' => EventListener::AUTOMATIC_NAME_PREFIX.$eventListener->listenerID
-                       ));
+                       ]);
                        
                        $eventListener = new EventListener($eventListener->listenerID);
                }
@@ -122,29 +122,29 @@ class EventListenerPackageInstallationPlugin extends AbstractXMLPackageInstallat
                                        AND eventClassName = ?
                                        AND eventName = ?
                                        AND listenerClassName = ?";
-                       $parameters = array(
+                       $parameters = [
                                $this->installation->getPackageID(),
                                $data['environment'],
                                $data['eventClassName'],
                                $data['eventName'],
                                $data['listenerClassName']
-                       );
+                       ];
                }
                else {
                        $sql = "SELECT  *
                                FROM    wcf".WCF_N."_".$this->tableName."
                                WHERE   packageID = ?
                                        AND listenerName = ?";
-                       $parameters = array(
+                       $parameters = [
                                $this->installation->getPackageID(),
                                $data['listenerName']
-                       );
+                       ];
                }
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
index c41c485ae88e2ac30598937223a5ff741ec26077..7d57ce6d4838c2f09b102a76f298fbcb831cf35d 100644 (file)
@@ -63,11 +63,11 @@ class FilePackageInstallationPlugin extends AbstractPackageInstallationPlugin {
                                                (packageID, filename, application)
                                VALUES          (?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->installation->getPackageID(),
                                'config.inc.php',
                                Package::getAbbreviation($this->installation->getPackage()->package)
-                       ));
+                       ]);
                        
                        // load application
                        WCF::loadRuntimeApplication($this->installation->getPackageID());
@@ -89,12 +89,12 @@ class FilePackageInstallationPlugin extends AbstractPackageInstallationPlugin {
                        FROM    wcf".WCF_N."_package_installation_file_log
                        WHERE   packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
                
-               $files = array();
+               $files = [];
                while ($row = $statement->fetchArray()) {
                        if (!isset($files[$row['application']])) {
-                               $files[$row['application']] = array();
+                               $files[$row['application']] = [];
                        }
                        
                        $files[$row['application']][] = $row['filename'];
index b8950e513fd66ca42de2444a466d5fb7b673291f..456942675d7436cb5a6b83cef9086e3e6be48757 100644 (file)
@@ -31,7 +31,7 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl
                AbstractPackageInstallationPlugin::install();
                
                // get language files
-               $languageFiles = array();
+               $languageFiles = [];
                $multipleFiles = false;
                $filename = $this->instruction['value'];
                if (strpos($filename, '*') !== false) {
@@ -69,7 +69,7 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl
                }
                
                // get installed languages
-               $installedLanguages = array();
+               $installedLanguages = [];
                $sql = "SELECT          *
                        FROM            wcf".WCF_N."_language
                        ORDER BY        isDefault DESC";
@@ -149,9 +149,9 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl
                        FROM    wcf".WCF_N."_language_item
                        WHERE   packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
-               $itemIDs = array();
-               $categoryIDs = array();
+               $statement->execute([$this->installation->getPackageID()]);
+               $itemIDs = [];
+               $categoryIDs = [];
                while ($row = $statement->fetchArray()) {
                        $itemIDs[] = $row['languageItemID'];
                        
@@ -166,10 +166,10 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($itemIDs as $itemID) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $itemID,
                                        $this->installation->getPackageID()
-                               ));
+                               ]);
                        }
                        
                        $this->deleteEmptyCategories(array_keys($categoryIDs), $this->installation->getPackageID());
@@ -207,7 +207,7 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl
        protected function deleteEmptyCategories(array $categoryIDs, $packageID) {
                // Get empty categories which where changed by this package.
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("language_category.languageCategoryID IN (?)", array($categoryIDs));
+               $conditions->add("language_category.languageCategoryID IN (?)", [$categoryIDs]);
                
                $sql = "SELECT          COUNT(item.languageItemID) AS count,
                                        language_category.languageCategoryID,
@@ -220,7 +220,7 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl
                                        language_category.languageCategory ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $categoriesToDelete = array();
+               $categoriesToDelete = [];
                while ($row = $statement->fetchArray()) {
                        if ($row['count'] == 0) {
                                $categoriesToDelete[$row['languageCategoryID']] = $row['languageCategory'];
@@ -234,7 +234,7 @@ class LanguagePackageInstallationPlugin extends AbstractXMLPackageInstallationPl
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($categoriesToDelete as $category) {
-                               $statement->execute(array($category));
+                               $statement->execute([$category]);
                        }
                }
        }
index f1827131643044eaa59d339114c2a9be4bcfabf2..d61d6f77a059346450be2a416843edd05949aea1 100644 (file)
@@ -156,15 +156,15 @@ class MenuItemPackageInstallationPlugin extends AbstractXMLPackageInstallationPl
                        FROM    wcf".WCF_N."_menu_item
                        WHERE   identifier = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['identifier'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
index 69f9f2c78e47eda955b60218990ff8d99a0364e6..2e33f206c0ddeb3939dd21a4c2a2e42aad38c286 100644 (file)
@@ -161,15 +161,15 @@ class MenuPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin
                        FROM    wcf".WCF_N."_menu
                        WHERE   identifier = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['identifier'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
index 56bef31660ac0c39879b29dcdc96a654d8e5f3fe..2c7f003cb17b88d6ac07ed1a3c9b7d0d6765ced5 100644 (file)
@@ -32,10 +32,10 @@ class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageIn
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -43,11 +43,11 @@ class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageIn
         * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
         */
        protected function prepareImport(array $data) {
-               return array(
+               return [
                        'interfaceName' => (isset($data['elements']['interfacename']) ? $data['elements']['interfacename'] : ''),
                        'definitionName' => $data['elements']['name'],
                        'categoryName' => (isset($data['elements']['categoryname']) ? $data['elements']['categoryname'] : '')
-               );
+               ];
        }
        
        /**
@@ -57,11 +57,11 @@ class ObjectTypeDefinitionPackageInstallationPlugin extends AbstractXMLPackageIn
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   definitionName = ?";
-               $parameters = array($data['definitionName']);
+               $parameters = [$data['definitionName']];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
 }
index 96005cfe065f0309f461e4ffab4d415f642ba506..9e2ad9f73c5e4341adba59b686f70f0b16d302bf 100644 (file)
@@ -28,7 +28,7 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation
         * list of names of tags which aren't considered as additional data
         * @var string[]
         */
-       public static $reservedTags = array('classname', 'definitionname', 'name');
+       public static $reservedTags = ['classname', 'definitionname', 'name'];
        
        /**
         * Gets the definition id by name
@@ -43,7 +43,7 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation
                        FROM    wcf".WCF_N."_object_type_definition
                        WHERE   definitionName = ?";
                $statement = WCF::getDB()->prepareStatement($sql, 1);
-               $statement->execute(array($definitionName));
+               $statement->execute([$definitionName]);
                $row = $statement->fetchArray();
                if (empty($row['definitionID'])) throw new SystemException("unknown object type definition '".$definitionName."' given");
                return $row['definitionID'];
@@ -59,11 +59,11 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->getDefinitionID($item['elements']['definitionname']),
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -71,17 +71,17 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation
         * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
         */
        protected function prepareImport(array $data) {
-               $additionalData = array();
+               $additionalData = [];
                foreach ($data['elements'] as $tagName => $nodeValue) {
                        if (!in_array($tagName, self::$reservedTags)) $additionalData[$tagName] = $nodeValue;
                }
                
-               return array(
+               return [
                        'definitionID' => $this->getDefinitionID($data['elements']['definitionname']),
                        'objectType' => $data['elements']['name'],
                        'className' => (isset($data['elements']['classname']) ? $data['elements']['classname'] : ''),
                        'additionalData' => serialize($additionalData)
-               );
+               ];
        }
        
        /**
@@ -93,15 +93,15 @@ class ObjectTypePackageInstallationPlugin extends AbstractXMLPackageInstallation
                        WHERE   objectType = ?
                                AND definitionID = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['objectType'],
                        $data['definitionID'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
 }
index f322915fda4067118b086cde76b92e40e7f6ab0b..2e50ff3f8fa848ad1328a82c04003cb4331c21c4 100644 (file)
@@ -26,7 +26,7 @@ class OptionPackageInstallationPlugin extends AbstractOptionPackageInstallationP
         * list of names of tags which aren't considered as additional data
         * @var string[]
         */
-       public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'enableoptions', 'showorder', 'hidden', 'selectoptions', 'categoryname', 'permissions', 'options', 'attrs', 'cdata', 'supporti18n', 'requirei18n');
+       public static $reservedTags = ['name', 'optiontype', 'defaultvalue', 'validationpattern', 'enableoptions', 'showorder', 'hidden', 'selectoptions', 'categoryname', 'permissions', 'options', 'attrs', 'cdata', 'supporti18n', 'requirei18n'];
        
        /**
         * @see \wcf\system\package\plugin\AbstractOptionPackageInstallationPlugin::saveOption()
@@ -53,13 +53,13 @@ class OptionPackageInstallationPlugin extends AbstractOptionPackageInstallationP
                if (isset($option['requirei18n'])) $requireI18n = $option['requirei18n'];
                
                // collect additional tags and their values
-               $additionalData = array();
+               $additionalData = [];
                foreach ($option as $tag => $value) {
                        if (!in_array($tag, self::$reservedTags)) $additionalData[$tag] = $value;
                }
                
                // build update or create data
-               $data = array(
+               $data = [
                        'categoryName' => $categoryName,
                        'optionType' => $optionType,
                        'validationPattern' => $validationPattern,
@@ -72,16 +72,16 @@ class OptionPackageInstallationPlugin extends AbstractOptionPackageInstallationP
                        'supportI18n' => $supportI18n,
                        'requireI18n' => $requireI18n,
                        'additionalData' => serialize($additionalData)
-               );
+               ];
                
                // try to find an existing option for updating
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   optionName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $optionName
-               ));
+               ]);
                $row = $statement->fetchArray();
                
                // result was 'false' thus create a new item
index 0b8a65d6621eee8a80d77973c07c3d4ea661b124..15efd7be457a02fec9f712bb833c774d0fc01d22 100644 (file)
@@ -32,10 +32,10 @@ class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -43,11 +43,11 @@ class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin
         * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
         */
        protected function prepareImport(array $data) {
-               return array(
+               return [
                        'className' => $data['nodeValue'],
                        'pluginName' => $data['attributes']['name'],
                        'priority' => ($this->installation->getPackage()->package == 'com.woltlab.wcf' ? 1 : 0)
-               );
+               ];
        }
        
        /**
@@ -66,14 +66,14 @@ class PIPPackageInstallationPlugin extends AbstractXMLPackageInstallationPlugin
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   pluginName = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['pluginName'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
 }
index 360f4dff0153e5336b733fd35c13303335b1eca0..61ac9a54de1bd7894819dd5e45af8a3bf653f715 100644 (file)
@@ -34,7 +34,7 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin {
                        // replace app1_ with app{WCF_N}_ in the table names for
                        // all applications
                        $packageList = new PackageList();
-                       $packageList->getConditionBuilder()->add('package.isApplication = ?', array(1));
+                       $packageList->getConditionBuilder()->add('package.isApplication = ?', [1]);
                        $packageList->readObjects();
                        foreach ($packageList as $package) {
                                $abbreviation = Package::getAbbreviation($package->package);
@@ -46,8 +46,8 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin {
                        $parser = new PackageInstallationSQLParser($queries, $this->installation->getPackage(), $this->installation->getAction());
                        $conflicts = $parser->test();
                        if (!empty($conflicts) && (isset($conflicts['CREATE TABLE']) || isset($conflicts['DROP TABLE']))) {
-                               $unknownCreateTable = isset($conflicts['CREATE TABLE']) ? $conflicts['CREATE TABLE'] : array();
-                               $unknownDropTable = isset($conflicts['DROP TABLE']) ? $conflicts['DROP TABLE'] : array();
+                               $unknownCreateTable = isset($conflicts['CREATE TABLE']) ? $conflicts['CREATE TABLE'] : [];
+                               $unknownDropTable = isset($conflicts['DROP TABLE']) ? $conflicts['DROP TABLE'] : [];
                                
                                $errorMessage = "Can't";
                                if (!empty($unknownDropTable)) {
@@ -90,8 +90,8 @@ class SQLPackageInstallationPlugin extends AbstractPackageInstallationPlugin {
                        WHERE           packageID = ?
                        ORDER BY        sqlIndex DESC, sqlColumn DESC";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
-               $entries = array();
+               $statement->execute([$this->installation->getPackageID()]);
+               $entries = [];
                while ($row = $statement->fetchArray()) {
                        $entries[] = $row;
                }
index bed9141c32b5000d9c02eaecdecd5f90602f3de8..c7cccb3886ca829e93956addfc257027e8cf0c32 100644 (file)
@@ -53,10 +53,10 @@ class ScriptPackageInstallationPlugin extends AbstractPackageInstallationPlugin
                                WHERE           packageID = ?
                                                AND filename = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->installation->getPackageID(),
                                $this->instruction['value']
-                       ));
+                       ]);
                }
        }
        
index cdd0fef676c29873cda8b4a91c89e2bf353a0942..bb1538440b2e12fdf75d2342016c2bbe9dd7de2d 100644 (file)
@@ -28,10 +28,10 @@ class SitemapPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -42,13 +42,13 @@ class SitemapPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
                $showOrder = (isset($data['elements']['showOrder'])) ? intval($data['elements']['showOrder']) : null;
                $showOrder = $this->getShowOrder($showOrder, null, 'showOrder');
                
-               return array(
+               return [
                        'sitemapName' => $data['attributes']['name'],
                        'className' => $data['elements']['classname'],
                        'showOrder' => $showOrder,
                        'options' => (isset($data['elements']['options'])) ? $data['elements']['options'] : '',
                        'permissions' => (isset($data['elements']['permissions'])) ? $data['elements']['permissions'] : ''
-               );
+               ];
        }
        
        /**
@@ -59,15 +59,15 @@ class SitemapPackageInstallationPlugin extends AbstractXMLPackageInstallationPlu
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   sitemapName = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['sitemapName'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
index dff628fe8c3e75081cc8934ad9dcff3866fc5a4b..10cd79266f49c2912a6f3d4a6c4650d3dd2d14cb 100644 (file)
@@ -37,10 +37,10 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -48,12 +48,12 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug
         * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::prepareImport()
         */
        protected function prepareImport(array $data) {
-               return array(
+               return [
                        'smileyCode' => $data['attributes']['name'],
                        'smileyTitle' => $data['elements']['title'],
                        'smileyPath' => $data['elements']['path'],
                        'aliases' => (isset($data['elements']['aliases']) ? $data['elements']['aliases'] : '')
-               );
+               ];
        }
        
        /**
@@ -64,14 +64,14 @@ class SmileyPackageInstallationPlugin extends AbstractXMLPackageInstallationPlug
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   smileyCode = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['smileyCode'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
 }
index 4cec3b5a47e18820258f4c669b928900515baa4e..fc69f14c59fbe582e78e3748d09a6f24737e2934 100644 (file)
@@ -55,7 +55,7 @@ class StylePackageInstallationPlugin extends AbstractPackageInstallationPlugin {
                // get all style of this package
                $isDefault = false;
                $styleList = new StyleList();
-               $styleList->getConditionBuilder()->add("packageID = ?", array($this->installation->getPackageID()));
+               $styleList->getConditionBuilder()->add("packageID = ?", [$this->installation->getPackageID()]);
                $styleList->readObjects();
                
                foreach ($styleList->getObjects() as $style) {
index 2b5bab46edde29fd901e24c0bae87b760231807a..a5567e445f0ec8a482278679bb0807a8e4b2fe7a 100644 (file)
@@ -31,13 +31,13 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal
                                        AND templateName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->installation->getPackageID(),
                                $item['elements']['environment'],
                                $item['elements']['eventname'],
                                $item['attributes']['name'],
                                $item['elements']['templatename']
-                       ));
+                       ]);
                }
        }
        
@@ -53,7 +53,7 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal
                        $niceValue = 127;
                }
                
-               return array(
+               return [
                        'environment' => $data['elements']['environment'],
                        'eventName' => $data['elements']['eventname'],
                        'niceValue' => $niceValue,
@@ -62,7 +62,7 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal
                        'permissions' => (isset($data['elements']['permissions']) ? $data['elements']['permissions'] : ''),
                        'templateCode' => $data['elements']['templatecode'],
                        'templateName' => $data['elements']['templatename']
-               );
+               ];
        }
        
        /**
@@ -76,18 +76,18 @@ class TemplateListenerPackageInstallationPlugin extends AbstractXMLPackageInstal
                                AND templateName = ?
                                AND eventName = ?
                                AND environment = ?";
-               $parameters = array(
+               $parameters = [
                        $this->installation->getPackageID(),
                        $data['name'],
                        $data['templateName'],
                        $data['eventName'],
                        $data['environment']
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
        
        /**
index 817588c72dd9cce3afd581ced7ccb17c9f1afb07..3ff138ce108bde3e29c6a7ee32196b92066b4437 100644 (file)
@@ -63,12 +63,12 @@ class TemplatePackageInstallationPlugin extends AbstractPackageInstallationPlugi
                        ON              (template_group.templateGroupID = template.templateGroupID)
                        WHERE           packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
                
-               $templates = array();
+               $templates = [];
                while ($row = $statement->fetchArray()) {
                        if (!isset($templates[$row['application']])) {
-                               $templates[$row['application']] = array();
+                               $templates[$row['application']] = [];
                        }
                        
                        $templates[$row['application']][] = 'templates/'.$row['templateGroupFolderName'].$row['templateName'].'.tpl';
index 162245492c05bff89d6f3e048064e7bed29ed218..099737e3eed739dd50736a6f9451c98168d58293 100644 (file)
@@ -31,7 +31,7 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst
         * list of names of tags which aren't considered as additional data
         * @var string[]
         */
-       public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'admindefaultvalue', 'userdefaultvalue', 'moddefaultvalue', 'validationpattern', 'showorder', 'categoryname', 'selectoptions', 'enableoptions', 'permissions', 'options', 'attrs', 'cdata', 'usersonly');
+       public static $reservedTags = ['name', 'optiontype', 'defaultvalue', 'admindefaultvalue', 'userdefaultvalue', 'moddefaultvalue', 'validationpattern', 'showorder', 'categoryname', 'selectoptions', 'enableoptions', 'permissions', 'options', 'attrs', 'cdata', 'usersonly'];
        
        /**
         * @see \wcf\system\package\plugin\AbstractOptionPackageInstallationPlugin::saveOption()
@@ -58,7 +58,7 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst
                if (isset($option['usersonly'])) $usersOnly = $option['usersonly'];
                
                // collect additional tags and their values
-               $additionalData = array();
+               $additionalData = [];
                foreach ($option as $tag => $value) {
                        if (!in_array($tag, self::$reservedTags)) $additionalData[$tag] = $value;
                }
@@ -69,13 +69,13 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst
                        WHERE   optionName = ?
                        AND     packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $optionName,
                        $this->installation->getPackageID()
-               ));
+               ]);
                $row = $statement->fetchArray();
                
-               $data = array(
+               $data = [
                        'categoryName' => $categoryName,
                        'optionType' => $optionType,
                        'defaultValue' => (isset($option['userdefaultvalue']) ? $userDefaultValue : $defaultValue),
@@ -86,7 +86,7 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst
                        'options' => $options,
                        'usersOnly' => $usersOnly,
                        'additionalData' => serialize($additionalData)
-               );
+               ];
                
                if (!empty($row['optionID'])) {
                        $groupOption = new UserGroupOption(null, $row);
@@ -102,7 +102,7 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst
                        $optionID = $groupOptionEditor->optionID;
                        
                        $this->getGroupIDs();
-                       $values = array();
+                       $values = [];
                        foreach ($this->groupIDs['all'] as $groupID) {
                                $values[$groupID] = $defaultValue;
                        }
@@ -129,11 +129,11 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst
                        $statement = WCF::getDB()->prepareStatement($sql);
                        WCF::getDB()->beginTransaction();
                        foreach ($values as $groupID => $value) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $groupID,
                                        $optionID,
                                        $value
-                               ));
+                               ]);
                        }
                        WCF::getDB()->commitTransaction();
                }
@@ -146,12 +146,12 @@ class UserGroupOptionPackageInstallationPlugin extends AbstractOptionPackageInst
         */
        protected function getGroupIDs() {
                if ($this->groupIDs === null) {
-                       $this->groupIDs = array(
-                               'admin' => array(),
-                               'mod' => array(),
-                               'all' => array(),
-                               'registered' => array()
-                       );
+                       $this->groupIDs = [
+                               'admin' => [],
+                               'mod' => [],
+                               'all' => [],
+                               'registered' => []
+                       ];
                        
                        $sql = "SELECT  groupID, groupType
                                FROM    wcf".WCF_N."_user_group";
index 358f78d8a8d101c7bac5404502c81af07878589b..9b8e054f8bbe5d289beb8df899a5f8cfb807ce65 100644 (file)
@@ -33,7 +33,7 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI
         * preset event ids
         * @var integer[]
         */
-       protected $presetEventIDs = array();
+       protected $presetEventIDs = [];
        
        /**
         * @see \wcf\system\package\plugin\AbstractXMLPackageInstallationPlugin::handleDelete()
@@ -44,10 +44,10 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI
                                        AND eventName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $this->installation->getPackageID(),
                                $item['elements']['name']
-                       ));
+                       ]);
                }
        }
        
@@ -65,7 +65,7 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI
                                        WHERE   definitionName = 'com.woltlab.wcf.notification.objectType'
                                )";
                $statement = WCF::getDB()->prepareStatement($sql, 1);
-               $statement->execute(array($data['elements']['objecttype']));
+               $statement->execute([$data['elements']['objecttype']]);
                $row = $statement->fetchArray();
                if (empty($row['objectTypeID'])) throw new SystemException("unknown notification object type '".$data['elements']['objecttype']."' given");
                $objectTypeID = $row['objectTypeID'];
@@ -75,7 +75,7 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI
                        $presetMailNotificationType = $data['elements']['presetmailnotificationtype'];
                }
                
-               return array(
+               return [
                        'eventName' => $data['elements']['name'],
                        'className' => $data['elements']['classname'],
                        'objectTypeID' => $objectTypeID,
@@ -83,7 +83,7 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI
                        'options' => (isset($data['elements']['options']) ? $data['elements']['options'] : ''),
                        'preset' => (!empty($data['elements']['preset']) ? 1 : 0),
                        'presetMailNotificationType' => $presetMailNotificationType
-               );
+               ];
        }
        
        /**
@@ -112,7 +112,7 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI
                $statement = WCF::getDB()->prepareStatement($sql);
                WCF::getDB()->beginTransaction();
                foreach ($this->presetEventIDs as $eventID => $mailNotificationType) {
-                       $statement->execute(array($eventID, $mailNotificationType));
+                       $statement->execute([$eventID, $mailNotificationType]);
                }
                WCF::getDB()->commitTransaction();
        }
@@ -125,14 +125,14 @@ class UserNotificationEventPackageInstallationPlugin extends AbstractXMLPackageI
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   objectTypeID = ?
                                AND eventName = ?";
-               $parameters = array(
+               $parameters = [
                        $data['objectTypeID'],
                        $data['eventName']
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
 }
index 4c424591181e5f41438da2ceacee9c77124a500b..d33379f2c32e5c2a58f023e2e0f44b4cb8bf764d 100644 (file)
@@ -27,18 +27,18 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat
         * list of names of tags which aren't considered as additional data
         * @var string[]
         */
-       public static $reservedTags = array('name', 'optiontype', 'defaultvalue', 'validationpattern', 'required', 'editable', 'visible', 'searchable', 'showorder', 'outputclass', 'selectoptions', 'enableoptions', 'isdisabled', 'categoryname', 'permissions', 'options', 'attrs', 'cdata');
+       public static $reservedTags = ['name', 'optiontype', 'defaultvalue', 'validationpattern', 'required', 'editable', 'visible', 'searchable', 'showorder', 'outputclass', 'selectoptions', 'enableoptions', 'isdisabled', 'categoryname', 'permissions', 'options', 'attrs', 'cdata'];
        
        /**
         * @see \wcf\system\package\plugin\AbstractOptionPackageInstallationPlugin::saveCategory()
         */
        protected function saveCategory($category, $categoryXML = null) {
                // use for create and update
-               $data = array(
+               $data = [
                        'parentCategoryName' => $category['parentCategoryName'],
                        'permissions' => $category['permissions'],
                        'options' => $category['options']
-               );
+               ];
                // append show order if explicitly stated
                if ($category['showOrder'] !== null) $data['showOrder'] = $category['showOrder'];
                
@@ -89,7 +89,7 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat
                if (isset($option['options'])) $options = $option['options'];
                
                // collect additional tags and their values
-               $additionalData = array();
+               $additionalData = [];
                foreach ($option as $tag => $value) {
                        if (!in_array($tag, self::$reservedTags)) $additionalData[$tag] = $value;
                }
@@ -100,14 +100,14 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat
                        WHERE   optionName = ?
                        AND     packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $optionName,
                        $this->installation->getPackageID()
-               ));
+               ]);
                $result = $statement->fetchArray();
                
                // build data array
-               $data = array(
+               $data = [
                        'categoryName' => $categoryName,
                        'optionType' => $optionType,
                        'defaultValue' => $defaultValue,
@@ -126,7 +126,7 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat
                        'options' => $options,
                        'additionalData' => serialize($additionalData),
                        'originIsSystem' => 1
-               );
+               ];
                
                // update option
                if (!empty($result['optionID']) && $this->installation->getAction() == 'update') {
@@ -152,7 +152,7 @@ class UserOptionPackageInstallationPlugin extends AbstractOptionPackageInstallat
                        FROM    wcf".WCF_N."_user_option
                        WHERE   packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->installation->getPackageID()));
+               $statement->execute([$this->installation->getPackageID()]);
                while ($row = $statement->fetchArray()) {
                        WCF::getDB()->getEditor()->dropColumn('wcf'.WCF_N.'_user_option_value', 'userOption'.$row['optionID']);
                }
index ff27f5541bd3a5af4a2afcaa2c5e5161bd09614e..9951388fc3b6441f39567a4a58b608209bf6accc 100644 (file)
@@ -37,10 +37,10 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall
                                        AND packageID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($items as $item) {
-                       $statement->execute(array(
+                       $statement->execute([
                                $item['attributes']['name'],
                                $this->installation->getPackageID()
-                       ));
+                       ]);
                }
        }
        
@@ -53,13 +53,13 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall
                $showOrder = $this->getShowOrder($showOrder);
                
                // merge values and default values
-               return array(
+               return [
                        'menuItem' => $data['attributes']['name'],
                        'options' => (isset($data['elements']['options'])) ? $data['elements']['options'] : '',
                        'permissions' => (isset($data['elements']['permissions'])) ? $data['elements']['permissions'] : '',
                        'showOrder' => $showOrder,
                        'className' => $data['elements']['classname']
-               );
+               ];
        }
        
        /**
@@ -70,14 +70,14 @@ class UserProfileMenuPackageInstallationPlugin extends AbstractXMLPackageInstall
                        FROM    wcf".WCF_N."_".$this->tableName."
                        WHERE   menuItem = ?
                                AND packageID = ?";
-               $parameters = array(
+               $parameters = [
                        $data['menuItem'],
                        $this->installation->getPackageID()
-               );
+               ];
                
-               return array(
+               return [
                        'sql' => $sql,
                        'parameters' => $parameters
-               );
+               ];
        }
 }
index dc1fa26025d25f4b5d36d4bec2f0617251f17f0c..018e09dcd92dbd94ae64d2bdb656577fc3d067b6 100644 (file)
@@ -21,7 +21,7 @@ class PackageValidationArchive implements \RecursiveIterator {
         * list of excluded packages grouped by package
         * @var string[]
         */
-       protected static $excludedPackages = array();
+       protected static $excludedPackages = [];
        
        /**
         * package archive object
@@ -33,7 +33,7 @@ class PackageValidationArchive implements \RecursiveIterator {
         * list of direct requirements delivered by this package
         * @var PackageValidationArchive[]
         */
-       protected $children = array();
+       protected $children = [];
        
        /**
         * nesting depth
@@ -108,11 +108,11 @@ class PackageValidationArchive implements \RecursiveIterator {
                                PackageValidationManager::getInstance()->addVirtualPackage($package, $this->archive->getPackageInfo('version'));
                                
                                // cache excluded packages
-                               self::$excludedPackages[$package] = array();
+                               self::$excludedPackages[$package] = [];
                                $excludedPackages = $this->archive->getExcludedPackages();
                                for ($i = 0, $count = count($excludedPackages); $i < $count; $i++) {
                                        if (!isset(self::$excludedPackages[$package][$excludedPackages[$i]['name']])) {
-                                               self::$excludedPackages[$package][$excludedPackages[$i]['name']] = array();
+                                               self::$excludedPackages[$package][$excludedPackages[$i]['name']] = [];
                                        }
                                        
                                        self::$excludedPackages[$package][$excludedPackages[$i]['name']][] = $excludedPackages[$i]['version'];
@@ -128,14 +128,14 @@ class PackageValidationArchive implements \RecursiveIterator {
                                                                FROM    wcf".WCF_N."_package
                                                                WHERE   package = ?";
                                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                                       $statement->execute(array($requirement['name']));
+                                                       $statement->execute([$requirement['name']]);
                                                        $package = $statement->fetchObject('wcf\data\package\Package');
                                                        
-                                                       throw new PackageValidationException(PackageValidationException::MISSING_REQUIREMENT, array(
+                                                       throw new PackageValidationException(PackageValidationException::MISSING_REQUIREMENT, [
                                                                'package' => $package,
                                                                'packageName' => $requirement['name'],
                                                                'packageVersion' => $requirement['minversion']
-                                                       ));
+                                                       ]);
                                                }
                                                
                                                $archive = $this->archive->extractTar($requirement['file']);
@@ -192,18 +192,18 @@ class PackageValidationArchive implements \RecursiveIterator {
                
                // delivered package does not provide the minimum required version
                if (Package::compareVersion($requiredVersion, $this->archive->getPackageInfo('version'), '>')) {
-                       throw new PackageValidationException(PackageValidationException::INSUFFICIENT_VERSION, array(
+                       throw new PackageValidationException(PackageValidationException::INSUFFICIENT_VERSION, [
                                'packageName' => $package->packageName,
                                'packageVersion' => $package->packageVersion,
                                'deliveredPackageVersion' => $this->archive->getPackageInfo('version')
-                       ));
+                       ]);
                }
                
                // package is not installed yet
                if ($package === null) {
                        $instructions = $this->archive->getInstallInstructions();
                        if (empty($instructions)) {
-                               throw new PackageValidationException(PackageValidationException::NO_INSTALL_PATH, array('packageName' => $this->archive->getPackageInfo('name')));
+                               throw new PackageValidationException(PackageValidationException::NO_INSTALL_PATH, ['packageName' => $this->archive->getPackageInfo('name')]);
                        }
                        
                        if ($validationMode == PackageValidationManager::VALIDATION_RECURSIVE) {
@@ -213,11 +213,11 @@ class PackageValidationArchive implements \RecursiveIterator {
                else {
                        // package is already installed, check update path
                        if (!$this->archive->isValidUpdate($package)) {
-                               throw new PackageValidationException(PackageValidationException::NO_UPDATE_PATH, array(
+                               throw new PackageValidationException(PackageValidationException::NO_UPDATE_PATH, [
                                        'packageName' => $package->packageName,
                                        'packageVersion' => $package->packageVersion,
                                        'deliveredPackageVersion' => $this->archive->getPackageInfo('version')
-                               ));
+                               ]);
                        }
                        
                        if ($validationMode === PackageValidationManager::VALIDATION_RECURSIVE) {
@@ -237,11 +237,11 @@ class PackageValidationArchive implements \RecursiveIterator {
                for ($i = 0, $length = count($instructions); $i < $length; $i++) {
                        $instruction = $instructions[$i];
                        if (!PackageValidationManager::getInstance()->validatePackageInstallationPluginInstruction($this->archive, $instruction['pip'], $instruction['value'])) {
-                               throw new PackageValidationException(PackageValidationException::MISSING_INSTRUCTION_FILE, array(
+                               throw new PackageValidationException(PackageValidationException::MISSING_INSTRUCTION_FILE, [
                                        'pip' => $instruction['pip'],
                                        'type' => $type,
                                        'value' => $instruction['value']
-                               ));
+                               ]);
                        }
                }
        }
@@ -262,8 +262,8 @@ class PackageValidationArchive implements \RecursiveIterator {
                        ON              (package.packageID = package_exclusion.packageID)
                        WHERE           excludedPackage = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($this->getArchive()->getPackageInfo('name')));
-               $excludingPackages = array();
+               $statement->execute([$this->getArchive()->getPackageInfo('name')]);
+               $excludingPackages = [];
                while ($row = $statement->fetchArray()) {
                        $excludingPackage = $row['package'];
                        
@@ -291,25 +291,25 @@ class PackageValidationArchive implements \RecursiveIterator {
                }
                
                if (!empty($excludingPackages)) {
-                       throw new PackageValidationException(PackageValidationException::EXCLUDING_PACKAGES, array('packages' => $excludingPackages));
+                       throw new PackageValidationException(PackageValidationException::EXCLUDING_PACKAGES, ['packages' => $excludingPackages]);
                }
                
                // excluded packages: current -> installed
                if (!empty(self::$excludedPackages[$package])) {
                        // get installed packages
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("package IN (?)", array(array_keys(self::$excludedPackages[$package])));
+                       $conditions->add("package IN (?)", [array_keys(self::$excludedPackages[$package])]);
                        $sql = "SELECT  *
                                FROM    wcf".WCF_N."_package
                                ".$conditions;
                        $statement = WCF::getDB()->prepareStatement($sql);
                        $statement->execute($conditions->getParameters());
-                       $packages = array();
+                       $packages = [];
                        while ($row = $statement->fetchArray()) {
                                $packages[$row['package']] = new Package(null, $row);
                        }
                        
-                       $excludedPackages = array();
+                       $excludedPackages = [];
                        foreach ($packages as $excludedPackage => $packageObj) {
                                $version = PackageValidationManager::getInstance()->getVirtualPackage($excludedPackage);
                                if ($version === null) {
@@ -326,7 +326,7 @@ class PackageValidationArchive implements \RecursiveIterator {
                        }
                        
                        if (!empty($excludedPackages)) {
-                               throw new PackageValidationException(PackageValidationException::EXCLUDED_PACKAGES, array('packages' => $excludedPackages));
+                               throw new PackageValidationException(PackageValidationException::EXCLUDED_PACKAGES, ['packages' => $excludedPackages]);
                        }
                }
        }
index a7da497366ad2671b9c980d6e48fd017efc6416a..c7c86712e9ce904664c25e32616a9b58b041f797 100644 (file)
@@ -20,7 +20,7 @@ class PackageValidationException extends SystemException {
         * list of additional details for each subtype
         * @var string[]
         */
-       protected $details = array();
+       protected $details = [];
        
        /**
         * missing archive, expects the detail 'archive' and optionally 'targetArchive' (extracting archive from the archive)
@@ -95,7 +95,7 @@ class PackageValidationException extends SystemException {
         * @param       integer         $code
         * @param       string[]        $details
         */
-       public function __construct($code, array $details = array()) {
+       public function __construct($code, array $details = []) {
                $this->details = $details;
                
                parent::__construct($this->getLegacyMessage($code), $code);
index 46c3a87e8da158036f1934c59dd1d154d39a46e5..92027f2c9b803230428b26bf9f57d97b6cf30529 100644 (file)
@@ -20,7 +20,7 @@ class PackageValidationManager extends SingletonFactory {
         * list of known package installation plugins
         * @var string[]
         */
-       protected $packageInstallationPlugins = array();
+       protected $packageInstallationPlugins = [];
        
        /**
         * package validation archive object
@@ -32,7 +32,7 @@ class PackageValidationManager extends SingletonFactory {
         * virtual package list containing package => packageVersion
         * @var string[]
         */
-       protected $virtualPackageList = array();
+       protected $virtualPackageList = [];
        
        /**
         * validation will only check if the primary package looks like it can be installed or updated
@@ -74,7 +74,7 @@ class PackageValidationManager extends SingletonFactory {
         * @return      boolean
         */
        public function validate($archive, $deepInspection) {
-               $this->virtualPackageList = array();
+               $this->virtualPackageList = [];
                $this->packageValidationArchive = new PackageValidationArchive($archive);
                
                if ($deepInspection) {
@@ -138,7 +138,7 @@ class PackageValidationManager extends SingletonFactory {
         */
        public function getPackageValidationArchiveList() {
                $packageValidationArchive = new PackageValidationArchive('');
-               $packageValidationArchive->setChildren(array($this->packageValidationArchive));
+               $packageValidationArchive->setChildren([$this->packageValidationArchive]);
                
                return new \RecursiveIteratorIterator($packageValidationArchive, \RecursiveIteratorIterator::SELF_FIRST);
        }
@@ -185,7 +185,7 @@ class PackageValidationManager extends SingletonFactory {
         */
        public function validatePackageInstallationPluginInstruction(PackageArchive $archive, $pip, $instruction) {
                if (isset($this->packageInstallationPlugins[$pip])) {
-                       return call_user_func(array($this->packageInstallationPlugins[$pip], 'isValid'), $archive, $instruction);
+                       return call_user_func([$this->packageInstallationPlugins[$pip], 'isValid'], $archive, $instruction);
                }
                
                return true;
index 0d846bc6c481830df9933d6f87804d2545a32415..2f7a5069496afcb335a9687066467e4919164e17 100644 (file)
@@ -22,7 +22,7 @@ class PageManager extends SingletonFactory {
         * list of available page object types
         * @var ObjectType[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -75,11 +75,11 @@ class PageManager extends SingletonFactory {
                        }
                }
                
-               $selection = array();
+               $selection = [];
                foreach ($objectTypes as $objectType) {
                        $categoryName = WCF::getLanguage()->get('wcf.page.category.'.$objectType->categoryname);
                        if (!isset($selection[$categoryName])) {
-                               $selection[$categoryName] = array();
+                               $selection[$categoryName] = [];
                        }
                        
                        $selection[$categoryName][$objectType->objectTypeID] = WCF::getLanguage()->get('wcf.page.'.$objectType->objectType);
index 4f4d7088453c725830d5b8a569e1de19288da390..6c601174e9396b861170085552202e2a4e65b552 100644 (file)
@@ -19,13 +19,13 @@ class PaymentMethodHandler extends SingletonFactory {
         * payment methods
         * @var array
         */
-       protected $paymentMethods = array();
+       protected $paymentMethods = [];
        
        /**
         * payment method object types
         * @var array
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -55,7 +55,7 @@ class PaymentMethodHandler extends SingletonFactory {
         * @return      string[]
         */
        public function getPaymentMethodSelection() {
-               $selection = array();
+               $selection = [];
                foreach ($this->objectTypes as $objectType) {
                        $selection[$objectType->objectType] = WCF::getLanguage()->get('wcf.payment.'.$objectType->objectType);
                }
index d502ed740583c158975fbd53cbb5618097ec09ec..2dd1d64c0c84194c238da02ba9a3998f00cba87d 100644 (file)
@@ -26,7 +26,7 @@ class PaypalPaymentMethod extends AbstractPaymentMethod {
         * @see \wcf\system\payment\method\IPaymentMethod::getSupportedCurrencies()
         */
        public function getSupportedCurrencies() {
-               return array(
+               return [
                        'AUD', // Australian Dollar
                        'BRL', // Brazilian Real
                        'CAD', // Canadian Dollar
@@ -52,7 +52,7 @@ class PaypalPaymentMethod extends AbstractPaymentMethod {
                        'THB', // Thai Baht
                        'TRY', // Turkish Lira
                        'USD'  // U.S. Dollar
-               );
+               ];
        }
        
        /**
@@ -77,7 +77,7 @@ class PaypalPaymentMethod extends AbstractPaymentMethod {
                                        <input type="hidden" name="lc" value="'.strtoupper(WCF::getLanguage()->languageCode).'" />
                                        <input type="hidden" name="no_note" value="1" />
                                        <input type="hidden" name="no_shipping" value="1" />
-                                       <input type="hidden" name="notify_url" value="'.StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('PaypalCallback', array('appendSession' => false))).'" />
+                                       <input type="hidden" name="notify_url" value="'.StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('PaypalCallback', ['appendSession' => false])).'" />
                                        <input type="hidden" name="quantity" value="1" />
                                        <input type="hidden" name="return" value="'.StringUtil::encodeHTML($returnURL).'" />
                        
@@ -98,7 +98,7 @@ class PaypalPaymentMethod extends AbstractPaymentMethod {
                                        <input type="hidden" name="lc" value="'.strtoupper(WCF::getLanguage()->languageCode).'" />
                                        <input type="hidden" name="no_note" value="1" />
                                        <input type="hidden" name="no_shipping" value="1" />
-                                       <input type="hidden" name="notify_url" value="'.StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('PaypalCallback', array('appendSession' => false))).'" />
+                                       <input type="hidden" name="notify_url" value="'.StringUtil::encodeHTML(LinkHandler::getInstance()->getLink('PaypalCallback', ['appendSession' => false])).'" />
                                        <input type="hidden" name="quantity" value="1" />
                                        <input type="hidden" name="return" value="'.StringUtil::encodeHTML($returnURL).'" />    
                                        
index efc55e118761ac6dff327b03d582f01b7d61a9f7..00b986cbaf8f79cfb13e946cc88523712818d342 100644 (file)
@@ -16,9 +16,9 @@ class SofortUeberweisungPaymentMethod extends AbstractPaymentMethod {
         * @see \wcf\system\payment\method\IPaymentMethod::getSupportedCurrencies()
         */
        public function getSupportedCurrencies() {
-               return array(
+               return [
                        'EUR' // Euro
-               );
+               ];
        }
        
        /**
index ad0ea3d05e551005a09d2ac6f2ccdcdd6f85477b..04fb8466ee51e6f50d9003c83b3f4bf255628480 100644 (file)
@@ -62,16 +62,16 @@ class PaidSubscriptionPaymentType extends AbstractPaymentType {
                                // active/extend subscription
                                if ($userSubscription === null) {
                                        // create new subscription
-                                       $action = new PaidSubscriptionUserAction(array(), 'create', array(
+                                       $action = new PaidSubscriptionUserAction([], 'create', [
                                                'user' => $user,
                                                'subscription' => $subscription
-                                       ));
+                                       ]);
                                        $returnValues = $action->executeAction();
                                        $userSubscription = $returnValues['returnValues'];
                                }
                                else {
                                        // extend existing subscription
-                                       $action = new PaidSubscriptionUserAction(array($userSubscription), 'extend');
+                                       $action = new PaidSubscriptionUserAction([$userSubscription], 'extend');
                                        $action->executeAction();
                                }
                                $logMessage = 'payment completed';
@@ -79,7 +79,7 @@ class PaidSubscriptionPaymentType extends AbstractPaymentType {
                        if ($status == 'reversed') {
                                if ($userSubscription !== null) {
                                        // revoke subscription
-                                       $action = new PaidSubscriptionUserAction(array($userSubscription), 'revoke');
+                                       $action = new PaidSubscriptionUserAction([$userSubscription], 'revoke');
                                        $action->executeAction();
                                }
                                $logMessage = 'payment reversed';
@@ -87,14 +87,14 @@ class PaidSubscriptionPaymentType extends AbstractPaymentType {
                        if ($status == 'canceled_reversal') {
                                if ($userSubscription !== null) {
                                        // restore subscription
-                                       $action = new PaidSubscriptionUserAction(array($userSubscription), 'restore');
+                                       $action = new PaidSubscriptionUserAction([$userSubscription], 'restore');
                                        $action->executeAction();
                                }
                                $logMessage = 'reversal canceled';
                        }
                        
                        // log success
-                       $action = new PaidSubscriptionTransactionLogAction(array(), 'create', array('data' => array(
+                       $action = new PaidSubscriptionTransactionLogAction([], 'create', ['data' => [
                                'subscriptionUserID' => $userSubscription->subscriptionUserID,
                                'userID' => $user->userID,
                                'subscriptionID' => $subscription->subscriptionID,
@@ -103,12 +103,12 @@ class PaidSubscriptionPaymentType extends AbstractPaymentType {
                                'transactionID' => $transactionID,
                                'logMessage' => $logMessage,
                                'transactionDetails' => serialize($transactionDetails)
-                       )));
+                       ]]);
                        $action->executeAction();
                }
                catch (SystemException $e) {
                        // log failure
-                       $action = new PaidSubscriptionTransactionLogAction(array(), 'create', array('data' => array(
+                       $action = new PaidSubscriptionTransactionLogAction([], 'create', ['data' => [
                                'subscriptionUserID' => ($userSubscription !== null ? $userSubscription->subscriptionUserID : null),
                                'userID' => ($user !== null ? $user->userID : null),
                                'subscriptionID' => ($subscription !== null ? $subscription->subscriptionID : null),
@@ -117,7 +117,7 @@ class PaidSubscriptionPaymentType extends AbstractPaymentType {
                                'transactionID' => $transactionID,
                                'logMessage' => $e->getMessage(),
                                'transactionDetails' => serialize($transactionDetails)
-                       )));
+                       ]]);
                        $action->executeAction();
                        throw $e;
                }
index 2571a0b6edc78b21d461d7a7215a12fbef8f7d14..ac849cb50d597b5fcd445e181f9305d54998b183 100644 (file)
@@ -28,7 +28,7 @@ class PollManager extends SingletonFactory {
         * list of object types
         * @var ObjectType[]
         */
-       protected $cache = array();
+       protected $cache = [];
        
        /**
         * current object id
@@ -52,7 +52,7 @@ class PollManager extends SingletonFactory {
         * poll data
         * @var mixed[]
         */
-       protected $pollData = array(
+       protected $pollData = [
                'endTime' => '',
                'isChangeable' => 0,
                'isPublic' => 0,
@@ -60,7 +60,7 @@ class PollManager extends SingletonFactory {
                'question' => '',
                'resultsRequireVote' => 0,
                'sortByVotes' => 0
-       );
+       ];
        
        /**
         * poll id
@@ -72,7 +72,7 @@ class PollManager extends SingletonFactory {
         * list of poll options
         * @var string[]
         */
-       protected $pollOptions = array();
+       protected $pollOptions = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -91,7 +91,7 @@ class PollManager extends SingletonFactory {
         */
        public function removePolls(array $pollIDs) {
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("pollID IN (?)", array($pollIDs));
+               $conditions->add("pollID IN (?)", [$pollIDs]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_poll
                        ".$conditions;
@@ -128,7 +128,7 @@ class PollManager extends SingletonFactory {
                        }
                        
                        // populate poll data
-                       $this->pollData = array(
+                       $this->pollData = [
                                'endTime' => $this->poll->endTime,
                                'isChangeable' => $this->poll->isChangeable,
                                'isPublic' => $this->poll->isPublic,
@@ -136,7 +136,7 @@ class PollManager extends SingletonFactory {
                                'question' => $this->poll->question,
                                'resultsRequireVote' => $this->poll->resultsRequireVote,
                                'sortByVotes' => $this->poll->sortByVotes
-                       );
+                       ];
                        
                        // load poll options
                        $sql = "SELECT          optionID, optionValue
@@ -144,7 +144,7 @@ class PollManager extends SingletonFactory {
                                WHERE           pollID = ?
                                ORDER BY        showOrder ASC";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->poll->pollID));
+                       $statement->execute([$this->poll->pollID]);
                        while ($row = $statement->fetchArray()) {
                                $this->pollOptions[] = $row;
                        }
@@ -158,7 +158,7 @@ class PollManager extends SingletonFactory {
         */
        public function readFormParameters() {
                // reset poll data and options prior to reading form input
-               $this->pollData = $this->pollOptions = array();
+               $this->pollData = $this->pollOptions = [];
                
                // poll data
                if (isset($_POST['pollEndTime'])) {
@@ -186,10 +186,10 @@ class PollManager extends SingletonFactory {
                if (isset($_POST['pollOptions']) && is_array($_POST['pollOptions'])) {
                        foreach ($_POST['pollOptions'] as $showOrder => $value) {
                                list($optionID, $optionValue) = explode('_', $value, 2);
-                               $this->pollOptions[$showOrder] = array(
+                               $this->pollOptions[$showOrder] = [
                                        'optionID' => intval($optionID),
                                        'optionValue' => StringUtil::trim($optionValue)
-                               );
+                               ];
                        }
                }
        }
@@ -262,17 +262,17 @@ class PollManager extends SingletonFactory {
                        $data['objectTypeID'] = $this->cache[$this->objectType]->objectTypeID;
                        $data['time'] = TIME_NOW;
                        
-                       $action = new PollAction(array(), 'create', array(
+                       $action = new PollAction([], 'create', [
                                'data' => $data,
                                'options' => $this->pollOptions
-                       ));
+                       ]);
                        $returnValues = $action->executeAction();
                        $this->poll = $returnValues['returnValues'];
                }
                else {
                        // remove poll
                        if (empty($this->pollData['question'])) {
-                               $action = new PollAction(array($this->poll), 'delete');
+                               $action = new PollAction([$this->poll], 'delete');
                                $action->executeAction();
                                $this->poll = null;
                                
@@ -280,10 +280,10 @@ class PollManager extends SingletonFactory {
                        }
                        else {
                                // update existing poll
-                               $action = new PollAction(array($this->poll), 'update', array(
+                               $action = new PollAction([$this->poll], 'update', [
                                        'data' => $this->pollData,
                                        'options' => $this->pollOptions
-                               ));
+                               ]);
                                $action->executeAction();
                        }
                }
@@ -295,11 +295,11 @@ class PollManager extends SingletonFactory {
         * Assigns variables for poll management or display.
         */
        public function assignVariables() {
-               $variables = array(
+               $variables = [
                        '__showPoll' => true,
                        'pollID' => ($this->poll === null ? 0 : $this->poll->pollID),
                        'pollOptions' => $this->pollOptions
-               );
+               ];
                foreach ($this->pollData as $key => $value) {
                        if ($key == 'endTime') {
                                if (!$value) $value = '';
@@ -340,7 +340,7 @@ class PollManager extends SingletonFactory {
                
                // invalid poll ids
                if (empty($polls)) {
-                       return array();
+                       return [];
                }
                
                // fetch options for every poll
@@ -362,7 +362,7 @@ class PollManager extends SingletonFactory {
         */
        public function getPollOptions(array $pollIDs) {
                $optionList = new PollOptionList();
-               $optionList->getConditionBuilder()->add("poll_option.pollID IN (?)", array($pollIDs));
+               $optionList->getConditionBuilder()->add("poll_option.pollID IN (?)", [$pollIDs]);
                
                // check for user votes
                if (WCF::getUser()->userID) {
@@ -428,7 +428,7 @@ class PollManager extends SingletonFactory {
                        throw new SystemException("'".$className."' does not extend 'wcf\system\SingletonFactory'");
                }
                
-               $object = call_user_func(array($className, 'getInstance'));
+               $object = call_user_func([$className, 'getInstance']);
                return $object;
        }
 }
index 20062d2accf57234e098dbd106a0ca2c0abb0142..1c5f6a0ed698ff642e14ddb9451b21ed7ceef4d5 100644 (file)
@@ -30,7 +30,7 @@ class RecaptchaHandlerV2 extends SingletonFactory {
                        throw new UserInputException('recaptchaString', 'false');
                }
                
-               $request = new HTTPRequest('https://www.google.com/recaptcha/api/siteverify?secret='.rawurlencode(RECAPTCHA_PRIVATEKEY).'&response='.rawurlencode($response).'&remoteip='.rawurlencode(UserUtil::getIpAddress()), array('timeout' => 10));
+               $request = new HTTPRequest('https://www.google.com/recaptcha/api/siteverify?secret='.rawurlencode(RECAPTCHA_PRIVATEKEY).'&response='.rawurlencode($response).'&remoteip='.rawurlencode(UserUtil::getIpAddress()), ['timeout' => 10]);
                
                try {
                        $request->execute();
index 500c789a03e959fcbf815bf62dbdc9ef8d32fd7b..3bbbe939c7cc7dcf05d543fdbec3d699306c79ab 100644 (file)
@@ -20,7 +20,7 @@ class FlexibleRoute implements IRoute {
         * schema for outgoing links
         * @var mixed[][]
         */
-       protected $buildSchema = array();
+       protected $buildSchema = [];
        
        /**
         * route is restricted to ACP
@@ -38,13 +38,13 @@ class FlexibleRoute implements IRoute {
         * list of required components
         * @var string[]
         */
-       protected $requireComponents = array();
+       protected $requireComponents = [];
        
        /**
         * parsed request data
         * @var mixed[]
         */
-       protected $routeData = array();
+       protected $routeData = [];
        
        /**
         * Creates a new flexible route instace.
@@ -77,11 +77,11 @@ class FlexibleRoute implements IRoute {
         * @param       string          $buildSchema
         */
        public function setBuildSchema($buildSchema) {
-               $this->buildSchema = array();
+               $this->buildSchema = [];
                
                $buildSchema = ltrim($buildSchema, '/');
                $components = preg_split('~({(?:[a-z]+)})~', $buildSchema, -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
-               $delimiters = array('/', '-', '.', '_');
+               $delimiters = ['/', '-', '.', '_'];
                
                foreach ($components as $component) {
                        $type = 'component';
@@ -92,10 +92,10 @@ class FlexibleRoute implements IRoute {
                                $type = 'separator';
                        }
                        
-                       $this->buildSchema[] = array(
+                       $this->buildSchema[] = [
                                'type' => $type,
                                'value' => $component
-                       );
+                       ];
                }
        }
        
index 199a5d4e632b1d317d6d8dd8daa79e75fc5fb155..cad79a2b44828c69fa3b42d5a7d3fdfd1472b466 100644 (file)
@@ -79,10 +79,10 @@ class RequestHandler extends SingletonFactory {
                                        }
                                        else {
                                                @header('HTTP/1.1 503 Service Unavailable');
-                                               WCF::getTPL()->assign(array(
+                                               WCF::getTPL()->assign([
                                                        'templateName' => 'offline',
                                                        'templateNameApplication' => 'wcf'
-                                               ));
+                                               ]);
                                                WCF::getTPL()->display('offline');
                                        }
                                        
index 299b63d1d49f259c3b9928bf8a14b21e32dcb56b..0e6846571c661c4d82fbadd55a9ff5cf9ba52e02 100644 (file)
@@ -34,7 +34,7 @@ class Route implements IRoute {
         * schema component options
         * @var array
         */
-       protected $parameterOptions = array();
+       protected $parameterOptions = [];
        
        /**
         * route name
@@ -46,7 +46,7 @@ class Route implements IRoute {
         * route schema data
         * @var array
         */
-       protected $routeSchema = array();
+       protected $routeSchema = [];
        
        /**
         * parsed route data
@@ -58,7 +58,7 @@ class Route implements IRoute {
         * cached list of transformed controller names
         * @var string[]
         */
-       protected static $controllerNames = array();
+       protected static $controllerNames = [];
        
        /**
         * list of application abbreviation and default controller name
@@ -99,7 +99,7 @@ class Route implements IRoute {
                                throw new SystemException("Placeholder expected, but invalid string '" . $part . "' given.");
                        }
                        
-                       $part = str_replace(array('{', '}'), '', $part);
+                       $part = str_replace(['{', '}'], '', $part);
                        if ($part == 'controller') {
                                if ($this->controller !== null) {
                                        throw new SystemException('Controller may not be part of the scheme if a route controller is given.');
@@ -126,11 +126,11 @@ class Route implements IRoute {
         * @param       boolean         $isOptional
         */
        public function setParameterOption($key, $default = null, $regexPattern = null, $isOptional = false) {
-               $this->parameterOptions[$key] = array(
+               $this->parameterOptions[$key] = [
                        'default' => $default,
                        'isOptional' => $isOptional,
                        'regexPattern' => $regexPattern
-               );
+               ];
        }
        
        /**
@@ -138,7 +138,7 @@ class Route implements IRoute {
         */
        public function matches($requestURL) {
                $urlParts = $this->getParts($requestURL);
-               $data = array();
+               $data = [];
                
                // handle each route schema component
                for ($i = 0, $size = count($this->routeSchema); $i < $size; $i++) {
@@ -380,7 +380,7 @@ class Route implements IRoute {
         */
        protected static function loadDefaultControllers() {
                if (self::$defaultControllers === null) {
-                       self::$defaultControllers = array();
+                       self::$defaultControllers = [];
                        
                        foreach (ApplicationHandler::getInstance()->getApplications() as $application) {
                                $app = WCF::getApplicationObject($application);
index eef7151216d405c85235c68024a66f985775ca0b..9ca7f39ddc1b21b9eb84f3d4060ef72a56167232 100644 (file)
@@ -69,7 +69,7 @@ class RouteHandler extends SingletonFactory {
         * list of available routes
         * @var IRoute[]
         */
-       protected $routes = array();
+       protected $routes = [];
        
        /**
         * parsed route data
@@ -263,7 +263,7 @@ class RouteHandler extends SingletonFactory {
         * @param       array           $removeComponents
         * @return      string
         */
-       public static function getPath(array $removeComponents = array()) {
+       public static function getPath(array $removeComponents = []) {
                if (empty(self::$path)) {
                        self::$path = FileUtil::addTrailingSlash(dirname($_SERVER['SCRIPT_NAME']));
                }
@@ -368,7 +368,7 @@ class RouteHandler extends SingletonFactory {
         */
        protected function loadDefaultControllers() {
                if ($this->defaultControllers === null) {
-                       $this->defaultControllers = array();
+                       $this->defaultControllers = [];
                        
                        foreach (ApplicationHandler::getInstance()->getApplications() as $application) {
                                $app = WCF::getApplicationObject($application);
index d77cf4992268d31422a156c64f79b1c721970890..cc851b94625f0cda7a8fcb38ad9b4d88015e80f0 100644 (file)
@@ -26,11 +26,11 @@ abstract class AbstractSearchIndexManager extends SingletonFactory implements IS
                        FROM    wcf".WCF_N."_object_type_definition
                        WHERE   definitionName = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array('com.woltlab.wcf.searchableObjectType'));
+               $statement->execute(['com.woltlab.wcf.searchableObjectType']);
                $row = $statement->fetchArray();
                
                $objectTypeList = new ObjectTypeList();
-               $objectTypeList->getConditionBuilder()->add("object_type.definitionID = ?", array($row['definitionID']));
+               $objectTypeList->getConditionBuilder()->add("object_type.definitionID = ?", [$row['definitionID']]);
                $objectTypeList->readObjects();
                
                foreach ($objectTypeList as $objectType) {
index 6ee79a2491cf9e982e874c56b6886df15052f240..24f9c9196b2155e731bb440cdcd0165608795ad3 100644 (file)
@@ -59,5 +59,5 @@ interface ISearchEngine {
         * @param       integer                                                         $limit
         * @return      array
         */
-       public function search($q, array $objectTypes, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, array $additionalConditions = array(), $orderBy = 'time DESC', $limit = 1000);
+       public function search($q, array $objectTypes, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, array $additionalConditions = [], $orderBy = 'time DESC', $limit = 1000);
 }
index 5f3a52ac906337b9c962d10012a6ec816e4bd13d..b93011953d747327ed2e10d1fe322b1dc9758641 100644 (file)
@@ -26,7 +26,7 @@ class SearchEngine extends SingletonFactory implements ISearchEngine {
         * list of available object types
         * @var array
         */
-       protected $availableObjectTypes = array();
+       protected $availableObjectTypes = [];
        
        /**
         * search engine object
@@ -90,7 +90,7 @@ class SearchEngine extends SingletonFactory implements ISearchEngine {
                                $className = 'wcf\system\search\mysql\MysqlSearchEngine';
                        }
                                
-                       $this->searchEngine = call_user_func(array($className, 'getInstance'));
+                       $this->searchEngine = call_user_func([$className, 'getInstance']);
                }
                
                return $this->searchEngine;
@@ -99,7 +99,7 @@ class SearchEngine extends SingletonFactory implements ISearchEngine {
        /**
         * @see \wcf\system\search\ISearchEngine::search()
         */
-       public function search($q, array $objectTypes, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, array $additionalConditions = array(), $orderBy = 'time DESC', $limit = 1000) {
+       public function search($q, array $objectTypes, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, array $additionalConditions = [], $orderBy = 'time DESC', $limit = 1000) {
                return $this->getSearchEngine()->search($q, $objectTypes, $subjectOnly, $searchIndexCondition, $additionalConditions, $orderBy, $limit);
        }
        
index 402ef3d74d4b9db610647336f598692b78ce6821..a7dc9e383fea19f610dee21347abfe56dc1dd390 100644 (file)
@@ -22,13 +22,13 @@ class SearchIndexManager extends SingletonFactory implements ISearchIndexManager
         * list of available object types
         * @var array
         */
-       protected $availableObjectTypes = array();
+       protected $availableObjectTypes = [];
        
        /**
         * list of application packages
         * @var Package[]
         */
-       protected static $packages = array();
+       protected static $packages = [];
        
        /**
         * search index manager object
@@ -94,7 +94,7 @@ class SearchIndexManager extends SingletonFactory implements ISearchIndexManager
                                $className = 'wcf\system\search\mysql\MysqlSearchIndexManager';
                        }
                        
-                       $this->searchIndexManager = call_user_func(array($className, 'getInstance'));
+                       $this->searchIndexManager = call_user_func([$className, 'getInstance']);
                }
                
                return $this->searchIndexManager;
@@ -174,7 +174,7 @@ class SearchIndexManager extends SingletonFactory implements ISearchIndexManager
                        if (!empty($tableName)) {
                                if (empty(self::$packages)) {
                                        $packageList = new PackageList();
-                                       $packageList->getConditionBuilder()->add('package.isApplication = ?', array(1));
+                                       $packageList->getConditionBuilder()->add('package.isApplication = ?', [1]);
                                        $packageList->readObjects();
                                        
                                        self::$packages = $packageList->getObjects();
index f6d7525ef331d6e40287a1c0e4eda7cd604200ce..567dbf5c78f93a9ebd92956daf738de8e6ecc40a 100644 (file)
@@ -28,20 +28,20 @@ class SearchKeywordManager extends SingletonFactory {
                        FROM    wcf".WCF_N."_search_keyword
                        WHERE   keyword = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($keyword));
+               $statement->execute([$keyword]);
                if (($object = $statement->fetchObject('wcf\data\search\keyword\SearchKeyword')) !== null) {
-                       $action = new SearchKeywordAction(array($object), 'update', array('data' => array(
+                       $action = new SearchKeywordAction([$object], 'update', ['data' => [
                                'searches' => $object->searches + 1,
                                'lastSearchTime' => TIME_NOW
-                       )));
+                       ]]);
                        $action->executeAction();
                }
                else {
-                       $action = new SearchKeywordAction(array(), 'create', array('data' => array(
+                       $action = new SearchKeywordAction([], 'create', ['data' => [
                                'keyword' => mb_substr($keyword, 0, 255),
                                'searches' => 1,
                                'lastSearchTime' => TIME_NOW
-                       )));
+                       ]]);
                        $action->executeAction();
                }
        }
index 16e681fd7e02282db62e969bfadf7ab88d35a954..10a1bed2f64c325e0c17e1246488052820377090 100644 (file)
@@ -117,14 +117,14 @@ class SearchResultTextParser extends SingletonFactory {
                                        }
                                }
                                else {
-                                       $matches = array();
+                                       $matches = [];
                                        $shiftLength = static::MAX_LENGTH;
                                        // find first match of each keyword
                                        foreach ($this->searchQuery as $keyword) {
                                                $start = mb_strripos($text, $keyword);
                                                if ($start !== false) {
                                                        $shiftLength -= mb_strlen($keyword);
-                                                       $matches[$keyword] = array('start' => $start, 'end' => $start + mb_strlen($keyword));
+                                                       $matches[$keyword] = ['start' => $start, 'end' => $start + mb_strlen($keyword)];
                                                }
                                        }
                                        
index 92df82d6ad4e8af03ae8e24e8c6098b8e308d6a2..6e88051a347feb6a5dadac81398c21903dce91b0 100644 (file)
@@ -21,7 +21,7 @@ class ACPSearchHandler extends SingletonFactory {
         * list of application abbreviations
         * @var string[]
         */
-       public $abbreviations = array();
+       public $abbreviations = [];
        
        /**
         * list of acp search provider
@@ -45,7 +45,7 @@ class ACPSearchHandler extends SingletonFactory {
         * @throws      SystemException
         */
        public function search($query, $limit = 10) {
-               $data = array();
+               $data = [];
                $maxResultsPerProvider = ceil($limit / 2);
                $totalResultCount = 0;
                
@@ -130,7 +130,7 @@ class ACPSearchHandler extends SingletonFactory {
                }
                
                if (!empty($suffix)) {
-                       $abbreviations = array();
+                       $abbreviations = [];
                        foreach ($this->abbreviations as $abbreviation) {
                                $abbreviations[] = $abbreviation . $suffix;
                        }
index 0798fb88d07385d8b00dee003a219910781e48e6..638dbc90f56dbffde4fd96451acc94a4f8c16719 100644 (file)
@@ -29,7 +29,7 @@ class ACPSearchResultList implements \Countable, \Iterator {
         * result list
         * @var ACPSearchResult[]
         */
-       protected $results = array();
+       protected $results = [];
        
        /**
         * Creates a new ACPSearchResultList.
@@ -58,7 +58,7 @@ class ACPSearchResultList implements \Countable, \Iterator {
        public function reduceResults($count) {
                // more results than available should be whiped, just set it to 0
                if ($count >= count($this->results)) {
-                       $this->results = array();
+                       $this->results = [];
                }
                else {
                        while ($count > 0) {
index 1e2be6888bf4d8b4fbd415bcc9c8cc688a7dfa2d..be07a935426db7ae7ee1cc36d266f0f881306fcc 100644 (file)
@@ -18,7 +18,7 @@ abstract class AbstractCategorizedACPSearchResultProvider extends AbstractACPSea
         * list of categories
         * @var DatabaseObject[]
         */
-       protected $categories = array();
+       protected $categories = [];
        
        /**
         * class name for category list
@@ -30,7 +30,7 @@ abstract class AbstractCategorizedACPSearchResultProvider extends AbstractACPSea
         * list of top category names (level 1 and 2)
         * @var string[]
         */
-       protected $topCategories = array();
+       protected $topCategories = [];
        
        /**
         * Creates a new categorized ACP search result provider.
@@ -112,7 +112,7 @@ abstract class AbstractCategorizedACPSearchResultProvider extends AbstractACPSea
                }
                
                // create level 2 categories
-               $topCategories = array();
+               $topCategories = [];
                foreach ($this->categories as $category) {
                        if ($category->parentCategoryName && in_array($category->parentCategoryName, $this->topCategories)) {
                                $topCategories[] = $category->categoryName;
index 3fabb36b7c99a843e318b766bacd208f07f979a7..867f16ae5413721b07d4bd4c02a56f9ed7a5a117 100644 (file)
@@ -19,22 +19,22 @@ class MenuItemACPSearchResultProvider extends AbstractACPSearchResultProvider im
         * @see \wcf\system\search\acp\IACPSearchResultProvider::search()
         */
        public function search($query) {
-               $results = array();
+               $results = [];
                
                // search by language item
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
+               $conditions->add("languageID = ?", [WCF::getLanguage()->languageID]);
                
                // filter by language item
                $languageItemsConditions = '';
-               $languageItemsParameters = array();
+               $languageItemsParameters = [];
                foreach (ACPSearchHandler::getInstance()->getAbbreviations('.acp.menu.link.%') as $abbreviation) {
                        if (!empty($languageItemsConditions)) $languageItemsConditions .= " OR ";
                        $languageItemsConditions .= "languageItem LIKE ?";
                        $languageItemsParameters[] = $abbreviation;
                }
                $conditions->add("(".$languageItemsConditions.")", $languageItemsParameters);
-               $conditions->add("languageItemValue LIKE ?", array('%'.$query.'%'));
+               $conditions->add("languageItemValue LIKE ?", ['%'.$query.'%']);
                
                $sql = "SELECT          languageItem, languageItemValue
                        FROM            wcf".WCF_N."_language_item
@@ -42,17 +42,17 @@ class MenuItemACPSearchResultProvider extends AbstractACPSearchResultProvider im
                        ORDER BY        languageItemValue ASC";
                $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here
                $statement->execute($conditions->getParameters());
-               $languageItems = array();
+               $languageItems = [];
                while ($row = $statement->fetchArray()) {
                        $languageItems[$row['languageItem']] = $row['languageItemValue'];
                }
                
                if (empty($languageItems)) {
-                       return array();
+                       return [];
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("menuItem IN (?)", array(array_keys($languageItems)));
+               $conditions->add("menuItem IN (?)", [array_keys($languageItems)]);
                $conditions->add("menuItemController <> ''");
                
                $sql = "SELECT  *
@@ -70,15 +70,15 @@ class MenuItemACPSearchResultProvider extends AbstractACPSearchResultProvider im
                        }
                        
                        $parentMenuItem = $menuItem->parentMenuItem;
-                       $parentMenuItems = array();
+                       $parentMenuItems = [];
                        while ($parentMenuItem && isset($menuItems[$parentMenuItem])) {
                                array_unshift($parentMenuItems, $parentMenuItem);
                                
                                $parentMenuItem = $menuItems[$parentMenuItem]->parentMenuItem;
                        }
-                       $results[] = new ACPSearchResult($languageItems[$menuItem->menuItem], $menuItem->getLink(), WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', array(
+                       $results[] = new ACPSearchResult($languageItems[$menuItem->menuItem], $menuItem->getLink(), WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', [
                                'pieces' => $parentMenuItems
-                       )));
+                       ]));
                }
                
                return $results;
index 4c37916816a81edbe2ea0b2a81449ce09f56ad22..b1992c39835e5ebd59444430f29d427174ab016c 100644 (file)
@@ -25,13 +25,13 @@ class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultPr
         * @see \wcf\system\search\acp\IACPSearchResultProvider::search()
         */
        public function search($query) {
-               $results = array();
+               $results = [];
                
                // search by language item
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
-               $conditions->add("languageItem LIKE ?", array('wcf.acp.option.%'));
-               $conditions->add("languageItemValue LIKE ?", array('%'.$query.'%'));
+               $conditions->add("languageID = ?", [WCF::getLanguage()->languageID]);
+               $conditions->add("languageItem LIKE ?", ['wcf.acp.option.%']);
+               $conditions->add("languageItemValue LIKE ?", ['%'.$query.'%']);
                
                $sql = "SELECT          languageItem, languageItemValue
                        FROM            wcf".WCF_N."_language_item
@@ -39,8 +39,8 @@ class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultPr
                        ORDER BY        languageItemValue ASC";
                $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here
                $statement->execute($conditions->getParameters());
-               $languageItems = array();
-               $optionNames = array();
+               $languageItems = [];
+               $optionNames = [];
                while ($row = $statement->fetchArray()) {
                        $optionName = preg_replace('~^([a-z]+)\.acp\.option\.~', '', $row['languageItem']);
                        
@@ -49,11 +49,11 @@ class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultPr
                }
                
                if (empty($optionNames)) {
-                       return array();
+                       return [];
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("optionName IN (?)", array($optionNames));
+               $conditions->add("optionName IN (?)", [$optionNames]);
                
                $sql = "SELECT  optionName, categoryName, options, permissions, hidden
                        FROM    wcf".WCF_N."_option
@@ -61,7 +61,7 @@ class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultPr
                $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here
                $statement->execute($conditions->getParameters());
                
-               $optionCategories = OptionCacheBuilder::getInstance()->getData(array(), 'categories');
+               $optionCategories = OptionCacheBuilder::getInstance()->getData([], 'categories');
                
                while ($option = $statement->fetchObject('wcf\data\option\Option')) {
                        // category is not accessible
@@ -74,18 +74,18 @@ class OptionACPSearchResultProvider extends AbstractCategorizedACPSearchResultPr
                                continue;
                        }
                        
-                       $link = LinkHandler::getInstance()->getLink('Option', array('id' => $this->getCategoryID($this->getTopCategory($option->categoryName)->parentCategoryName)), 'optionName='.$option->optionName.'#'.$this->getCategoryName($option->categoryName));
+                       $link = LinkHandler::getInstance()->getLink('Option', ['id' => $this->getCategoryID($this->getTopCategory($option->categoryName)->parentCategoryName)], 'optionName='.$option->optionName.'#'.$this->getCategoryName($option->categoryName));
                        $categoryName = $option->categoryName;
-                       $parentCategories = array();
+                       $parentCategories = [];
                        while (isset($optionCategories[$categoryName])) {
                                array_unshift($parentCategories, 'wcf.acp.option.category.'.$optionCategories[$categoryName]->categoryName);
                                
                                $categoryName = $optionCategories[$categoryName]->parentCategoryName;
                        }
                        
-                       $results[] = new ACPSearchResult($languageItems[$option->optionName], $link, WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', array(
+                       $results[] = new ACPSearchResult($languageItems[$option->optionName], $link, WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', [
                                'pieces' => $parentCategories
-                       )));
+                       ]));
                }
                
                return $results;
index d30dd717467b86283e90abbba190006714e4e786..a0af60aef31b668e29103d07577a23d99269d17e 100644 (file)
@@ -20,16 +20,16 @@ class PackageACPSearchResultProvider implements IACPSearchResultProvider {
         */
        public function search($query) {
                if (!WCF::getSession()->getPermission('admin.configuration.package.canUpdatePackage') && !WCF::getSession()->getPermission('admin.configuration.package.canUninstallPackage')) {
-                       return array();
+                       return [];
                }
                
-               $results = array();
+               $results = [];
                
                // search by language item
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
-               $conditions->add("languageItem LIKE ?", array('wcf.acp.package.packageName.package%'));
-               $conditions->add("languageItemValue LIKE ?", array('%'.$query.'%'));
+               $conditions->add("languageID = ?", [WCF::getLanguage()->languageID]);
+               $conditions->add("languageItem LIKE ?", ['wcf.acp.package.packageName.package%']);
+               $conditions->add("languageItemValue LIKE ?", ['%'.$query.'%']);
                
                $sql = "SELECT          languageItem
                        FROM            wcf".WCF_N."_language_item
@@ -37,14 +37,14 @@ class PackageACPSearchResultProvider implements IACPSearchResultProvider {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
                
-               $packageIDs = array();
+               $packageIDs = [];
                while ($row = $statement->fetchArray()) {
                        $packageIDs[] = str_replace('wcf.acp.package.packageName.package', '', $row['languageItem']);
                }
                
                $conditions = new PreparedStatementConditionBuilder(false);
                if (!empty($packageIDs)) {
-                       $conditions->add("packageID IN (?)", array($packageIDs));
+                       $conditions->add("packageID IN (?)", [$packageIDs]);
                }
                
                $sql = "SELECT  *
@@ -53,16 +53,16 @@ class PackageACPSearchResultProvider implements IACPSearchResultProvider {
                                OR package LIKE ?
                                ".(count($conditions->getParameters()) ? "OR ".$conditions : "");
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array_merge(array(
+               $statement->execute(array_merge([
                        '%'.$query.'%',
                        '%'.$query.'%'
-               ), $conditions->getParameters()));
+               ], $conditions->getParameters()));
                
                while ($package = $statement->fetchObject('wcf\data\package\Package')) {
-                       $results[] = new ACPSearchResult($package->getName(), LinkHandler::getInstance()->getLink('Package', array(
+                       $results[] = new ACPSearchResult($package->getName(), LinkHandler::getInstance()->getLink('Package', [
                                'id' => $package->packageID,
                                'title' => $package->getName()
-                       )));
+                       ]));
                }
                
                return $results;
index 7cffbe5df8af611c3d826f66ee50d37cfe0965f3..f51bae0fb7cc1a5052d08528b3551ba9840f450a 100644 (file)
@@ -20,22 +20,22 @@ class UserACPSearchResultProvider implements IACPSearchResultProvider {
         */
        public function search($query) {
                if (!WCF::getSession()->getPermission('admin.user.canEditUser')) {
-                       return array();
+                       return [];
                }
                
-               $results = array();
+               $results = [];
                
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_user
                        WHERE   username LIKE ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($query.'%'));
+               $statement->execute([$query.'%']);
                
                while ($user = $statement->fetchObject('wcf\data\user\User')) {
                        if (UserGroup::isAccessibleGroup($user->getGroupIDs())) {
-                               $results[] = new ACPSearchResult($user->username, LinkHandler::getInstance()->getLink('UserEdit', array(
+                               $results[] = new ACPSearchResult($user->username, LinkHandler::getInstance()->getLink('UserEdit', [
                                        'object' => $user
-                               )));
+                               ]));
                        }
                }
                
index 88f5cddc4c6c08d23f965910a81ad8a1ce7d7bbb..14f6318b9e1c8edfc7d3d37a28bd4be2fd2536b0 100644 (file)
@@ -25,13 +25,13 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc
         * @see \wcf\system\search\acp\IACPSearchResultProvider::search()
         */
        public function search($query) {
-               $results = array();
+               $results = [];
                
                // search by language item
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("languageID = ?", array(WCF::getLanguage()->languageID));
-               $conditions->add("languageItem LIKE ?", array('wcf.acp.group.option.%'));
-               $conditions->add("languageItemValue LIKE ?", array('%'.$query.'%'));
+               $conditions->add("languageID = ?", [WCF::getLanguage()->languageID]);
+               $conditions->add("languageItem LIKE ?", ['wcf.acp.group.option.%']);
+               $conditions->add("languageItemValue LIKE ?", ['%'.$query.'%']);
                
                $sql = "SELECT          languageItem, languageItemValue
                        FROM            wcf".WCF_N."_language_item
@@ -39,7 +39,7 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc
                        ORDER BY        languageItemValue ASC";
                $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here
                $statement->execute($conditions->getParameters());
-               $languageItems = array();
+               $languageItems = [];
                while ($row = $statement->fetchArray()) {
                        // ignore descriptions
                        if (substr($row['languageItem'], -12) == '.description') {
@@ -51,11 +51,11 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc
                }
                
                if (empty($languageItems)) {
-                       return array();
+                       return [];
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("optionName IN (?)", array(array_keys($languageItems)));
+               $conditions->add("optionName IN (?)", [array_keys($languageItems)]);
                
                $sql = "SELECT  optionID, optionName, categoryName, permissions, options
                        FROM    wcf".WCF_N."_user_group_option
@@ -63,7 +63,7 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc
                $statement = WCF::getDB()->prepareStatement($sql); // don't use a limit here
                $statement->execute($conditions->getParameters());
                
-               $optionCategories = UserGroupOptionCacheBuilder::getInstance()->getData(array(), 'categories');
+               $optionCategories = UserGroupOptionCacheBuilder::getInstance()->getData([], 'categories');
                
                while ($userGroupOption = $statement->fetchObject('wcf\data\user\group\option\UserGroupOption')) {
                        // category is not accessible
@@ -76,18 +76,18 @@ class UserGroupOptionACPSearchResultProvider extends AbstractCategorizedACPSearc
                                continue;
                        }
                        
-                       $link = LinkHandler::getInstance()->getLink('UserGroupOption', array('id' => $userGroupOption->optionID));
+                       $link = LinkHandler::getInstance()->getLink('UserGroupOption', ['id' => $userGroupOption->optionID]);
                        $categoryName = $userGroupOption->categoryName;
-                       $parentCategories = array();
+                       $parentCategories = [];
                        while (isset($optionCategories[$categoryName])) {
                                array_unshift($parentCategories, 'wcf.acp.group.option.category.'.$optionCategories[$categoryName]->categoryName);
                                
                                $categoryName = $optionCategories[$categoryName]->parentCategoryName;
                        }
                        
-                       $results[] = new ACPSearchResult($languageItems[$userGroupOption->optionName], $link, WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', array(
+                       $results[] = new ACPSearchResult($languageItems[$userGroupOption->optionName], $link, WCF::getLanguage()->getDynamicVariable('wcf.acp.search.result.subtitle', [
                                'pieces' => $parentCategories
-                       )));
+                       ]));
                }
                
                return $results;
index 9aeccc4932d4f494fc8e04f3a8985ac241927f87..b05de4a36d0f4964c5cb779a9ce7248646b823be 100644 (file)
@@ -28,15 +28,15 @@ class MysqlSearchEngine extends AbstractSearchEngine {
        /**
         * @see \wcf\system\search\AbstractSearchEngine::$specialCharacters
         */
-       protected $specialCharacters = array('(', ')', '@', '+', '-', '"', '<', '>', '~', '*');
+       protected $specialCharacters = ['(', ')', '@', '+', '-', '"', '<', '>', '~', '*'];
        
        /**
         * @see \wcf\system\search\ISearchEngine::search()
         */
-       public function search($q, array $objectTypes, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, array $additionalConditions = array(), $orderBy = 'time DESC', $limit = 1000) {
+       public function search($q, array $objectTypes, $subjectOnly = false, PreparedStatementConditionBuilder $searchIndexCondition = null, array $additionalConditions = [], $orderBy = 'time DESC', $limit = 1000) {
                // build search query
                $sql = '';
-               $parameters = array();
+               $parameters = [];
                foreach ($objectTypes as $objectTypeName) {
                        $objectType = SearchEngine::getInstance()->getObjectType($objectTypeName);
                        
@@ -81,14 +81,14 @@ class MysqlSearchEngine extends AbstractSearchEngine {
                }
                
                // send search query
-               $messages = array();
+               $messages = [];
                $statement = WCF::getDB()->prepareStatement($sql, $limit);
                $statement->execute($parameters);
                while ($row = $statement->fetchArray()) {
-                       $messages[] = array(
+                       $messages[] = [
                                'objectID' => $row['objectID'],
                                'objectType' => $row['objectType']
-                       );
+                       ];
                }
                
                return $messages;
@@ -104,7 +104,7 @@ class MysqlSearchEngine extends AbstractSearchEngine {
                        $q = $this->parseSearchQuery($q);
                        
                        $fulltextCondition = new PreparedStatementConditionBuilder(false);
-                       $fulltextCondition->add("MATCH (subject".(!$subjectOnly ? ', message, metaData' : '').") AGAINST (? IN BOOLEAN MODE)", array($q));
+                       $fulltextCondition->add("MATCH (subject".(!$subjectOnly ? ', message, metaData' : '').") AGAINST (? IN BOOLEAN MODE)", [$q]);
                        
                        if ($orderBy == 'relevance ASC' || $orderBy == 'relevance DESC') {
                                $relevanceCalc = "MATCH (subject".(!$subjectOnly ? ', message, metaData' : '').") AGAINST ('".escapeString($q)."') + (5 / (1 + POW(LN(1 + (".TIME_NOW." - time) / 2592000), 2))) AS relevance";
@@ -119,11 +119,11 @@ class MysqlSearchEngine extends AbstractSearchEngine {
                        ".(!empty($orderBy) && $fulltextCondition === null ? 'ORDER BY '.$orderBy : '')."
                        LIMIT           ".($limit == 1000 ? SearchEngine::INNER_SEARCH_LIMIT : $limit);
                
-               return array(
+               return [
                        'fulltextCondition' => $fulltextCondition,
                        'searchIndexCondition' => $searchIndexCondition,
                        'sql' => $sql
-               );
+               ];
        }
        
        /**
@@ -140,7 +140,7 @@ class MysqlSearchEngine extends AbstractSearchEngine {
                        }
                        catch (DatabaseException $e) {
                                // fallback if user is disallowed to issue 'SHOW VARIABLES'
-                               $row = array('Value' => 4);
+                               $row = ['Value' => 4];
                        }
                        
                        $this->ftMinWordLen = $row['Value'];
index 0b9ed2440abb1ee4fa6afe1c96443801e2d7e6ef..fc905cb47be8c04da211c2714cef928fb0d3903d 100644 (file)
@@ -27,7 +27,7 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager {
                                        (objectID, subject, message, time, userID, username, languageID, metaData)
                        VALUES          (?, ?, ?, ?, ?, ?, ?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($objectID, $subject, $message, $time, $userID, $username, $languageID, $metaData));
+               $statement->execute([$objectID, $subject, $message, $time, $userID, $username, $languageID, $metaData]);
        }
        
        /**
@@ -35,7 +35,7 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager {
         */
        public function update($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID = null, $metaData = '') {
                // delete existing entry
-               $this->delete($objectType, array($objectID));
+               $this->delete($objectType, [$objectID]);
                
                // save new entry
                $this->add($objectType, $objectID, $message, $subject, $time, $userID, $username, $languageID, $metaData);
@@ -50,7 +50,7 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager {
                $statement = WCF::getDB()->prepareStatement($sql);
                WCF::getDB()->beginTransaction();
                foreach ($objectIDs as $objectID) {
-                       $statement->execute(array($objectID));
+                       $statement->execute([$objectID]);
                }
                WCF::getDB()->commitTransaction();
        }
@@ -75,31 +75,31 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager {
                        FROM    wcf".WCF_N."_package_installation_sql_log
                        WHERE   sqlTable = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($tableName));
+               $statement->execute([$tableName]);
                
                if ($statement->fetchSingleColumn()) {
                        // table already exists
                        return false;
                }
                
-               $columns = array(
-                       array('name' => 'objectID', 'data' => array('length' => 10, 'notNull' => true, 'type' => 'int')),
-                       array('name' => 'subject', 'data' => array('default' => '', 'length' => 255, 'notNull' => true, 'type' => 'varchar')),
-                       array('name' => 'message', 'data' => array('type' => 'mediumtext')),
-                       array('name' => 'metaData', 'data' => array('type' => 'mediumtext')),
-                       array('name' => 'time', 'data' => array('default' => 0, 'length' => 10, 'notNull' => true, 'type' => 'int')),
-                       array('name' => 'userID', 'data' => array('default' => '', 'length' => 10, 'type' => 'int')),
-                       array('name' => 'username', 'data' => array('default' => '', 'length' => 255,'notNull' => true, 'type' => 'varchar')),
-                       array('name' => 'languageID', 'data' => array('default' => 0, 'length' => 10, 'notNull' => true, 'type' => 'int'))
-               );
+               $columns = [
+                       ['name' => 'objectID', 'data' => ['length' => 10, 'notNull' => true, 'type' => 'int']],
+                       ['name' => 'subject', 'data' => ['default' => '', 'length' => 255, 'notNull' => true, 'type' => 'varchar']],
+                       ['name' => 'message', 'data' => ['type' => 'mediumtext']],
+                       ['name' => 'metaData', 'data' => ['type' => 'mediumtext']],
+                       ['name' => 'time', 'data' => ['default' => 0, 'length' => 10, 'notNull' => true, 'type' => 'int']],
+                       ['name' => 'userID', 'data' => ['default' => '', 'length' => 10, 'type' => 'int']],
+                       ['name' => 'username', 'data' => ['default' => '', 'length' => 255,'notNull' => true, 'type' => 'varchar']],
+                       ['name' => 'languageID', 'data' => ['default' => 0, 'length' => 10, 'notNull' => true, 'type' => 'int']]
+               ];
                
-               $indices = array(
-                       array('name' => 'objectAndLanguage', 'data' => array('columns' => 'objectID, languageID', 'type' => 'UNIQUE')),
-                       array('name' => 'fulltextIndex', 'data' => array('columns' => 'subject, message, metaData', 'type' => 'FULLTEXT')),
-                       array('name' => 'fulltextIndexSubjectOnly', 'data' => array('columns' => 'subject', 'type' => 'FULLTEXT')),
-                       array('name' => 'language', 'data' => array('columns' => 'languageID', 'type' => 'KEY')),
-                       array('name' => 'user', 'data' => array('columns' => 'userID, time', 'type'=> 'KEY'))
-               );
+               $indices = [
+                       ['name' => 'objectAndLanguage', 'data' => ['columns' => 'objectID, languageID', 'type' => 'UNIQUE']],
+                       ['name' => 'fulltextIndex', 'data' => ['columns' => 'subject, message, metaData', 'type' => 'FULLTEXT']],
+                       ['name' => 'fulltextIndexSubjectOnly', 'data' => ['columns' => 'subject', 'type' => 'FULLTEXT']],
+                       ['name' => 'language', 'data' => ['columns' => 'languageID', 'type' => 'KEY']],
+                       ['name' => 'user', 'data' => ['columns' => 'userID, time', 'type'=> 'KEY']]
+               ];
                
                WCF::getDB()->getEditor()->createTable($tableName, $columns, $indices);
                
@@ -114,10 +114,10 @@ class MysqlSearchIndexManager extends AbstractSearchIndexManager {
                                        (packageID, sqlTable)
                        VALUES          (?, ?)";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectType->packageID,
                        $tableName
-               ));
+               ]);
                
                return true;
        }
index 73f86bf02f68731b5d901663cf584aebf2fdbd72..b6b9013ce3118b12e789465c65aa2d8da0817e09 100644 (file)
@@ -53,7 +53,7 @@ class SessionHandler extends SingletonFactory {
         * various environment variables
         * @var array
         */
-       protected $environment = array();
+       protected $environment = [];
        
        /**
         * group data and permissions
@@ -149,7 +149,7 @@ class SessionHandler extends SingletonFactory {
         * list of names of permissions only available for users
         * @var string[]
         */
-       protected $usersOnlyPermissions = array();
+       protected $usersOnlyPermissions = [];
        
        /**
         * Provides access to session data.
@@ -170,7 +170,7 @@ class SessionHandler extends SingletonFactory {
         */
        protected function init() {
                $this->isACP = (class_exists(WCFACP::class, false) || !PACKAGE_ID);
-               $this->usersOnlyPermissions = UserGroupOptionCacheBuilder::getInstance()->getData(array(), 'usersOnlyOptions');
+               $this->usersOnlyPermissions = UserGroupOptionCacheBuilder::getInstance()->getData([], 'usersOnlyOptions');
        }
        
        /**
@@ -210,8 +210,8 @@ class SessionHandler extends SingletonFactory {
         */
        public function load($sessionEditorClassName, $sessionID) {
                $this->sessionEditorClassName = $sessionEditorClassName;
-               $this->sessionClassName = call_user_func(array($sessionEditorClassName, 'getBaseClass'));
-               $this->supportsVirtualSessions = call_user_func(array($this->sessionClassName, 'supportsVirtualSessions'));
+               $this->sessionClassName = call_user_func([$sessionEditorClassName, 'getBaseClass']);
+               $this->supportsVirtualSessions = call_user_func([$this->sessionClassName, 'supportsVirtualSessions']);
                
                // try to get existing session
                if (!empty($sessionID)) {
@@ -260,9 +260,9 @@ class SessionHandler extends SingletonFactory {
                
                /** @var \wcf\data\DatabaseObjectEditor $sessionEditor */
                $sessionEditor = new $this->sessionEditorClassName($this->session);
-               $sessionEditor->update(array(
+               $sessionEditor->update([
                        'sessionID' => $newSessionID
-               ));
+               ]);
                
                // fetch new session data from database
                $this->session = new $this->sessionClassName($newSessionID);
@@ -274,14 +274,14 @@ class SessionHandler extends SingletonFactory {
         * Initializes environment variables.
         */
        protected function initEnvironment() {
-               $this->environment = array(
+               $this->environment = [
                        'lastRequestURI' => $this->session->requestURI,
                        'lastRequestMethod' => $this->session->requestMethod,
                        'ipAddress' => UserUtil::getIpAddress(),
                        'userAgent' => UserUtil::getUserAgent(),
                        'requestURI' => UserUtil::getRequestURI(),
                        'requestMethod' => (!empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '')
-               );
+               ];
        }
        
        /**
@@ -377,7 +377,7 @@ class SessionHandler extends SingletonFactory {
        protected function loadVariables() {
                @$this->variables = unserialize($this->virtualSession->sessionVariables);
                if (!is_array($this->variables)) {
-                       $this->variables = array();
+                       $this->variables = [];
                }
        }
        
@@ -432,10 +432,10 @@ class SessionHandler extends SingletonFactory {
                if ($this->virtualSession === null || $forceReload) {
                        $this->virtualSession = null;
                        if ($this->isACP) {
-                               $virtualSessionAction = new ACPSessionVirtualAction(array(), 'create', array('data' => array('sessionID' => $this->session->sessionID)));
+                               $virtualSessionAction = new ACPSessionVirtualAction([], 'create', ['data' => ['sessionID' => $this->session->sessionID]]);
                        }
                        else {
-                               $virtualSessionAction = new SessionVirtualAction(array(), 'create', array('data' => array('sessionID' => $this->session->sessionID)));
+                               $virtualSessionAction = new SessionVirtualAction([], 'create', ['data' => ['sessionID' => $this->session->sessionID]]);
                        }
                        
                        try {
@@ -510,7 +510,7 @@ class SessionHandler extends SingletonFactory {
                $sessionID = StringUtil::getRandomID();
                
                // get user automatically
-               $this->user = UserAuthenticationFactory::getInstance()->getUserAuthentication()->loginAutomatically(call_user_func(array($this->sessionClassName, 'supportsPersistentLogins')));
+               $this->user = UserAuthenticationFactory::getInstance()->getUserAuthentication()->loginAutomatically(call_user_func([$this->sessionClassName, 'supportsPersistentLogins']));
                
                // create user
                if ($this->user === null) {
@@ -520,12 +520,12 @@ class SessionHandler extends SingletonFactory {
                }
                else if (!$this->supportsVirtualSessions) {
                        // delete all other sessions of this user
-                       call_user_func(array($this->sessionEditorClassName, 'deleteUserSessions'), array($this->user->userID));
+                       call_user_func([$this->sessionEditorClassName, 'deleteUserSessions'], [$this->user->userID]);
                }
                
                $createNewSession = true;
                // find existing session
-               $session = call_user_func(array($this->sessionClassName, 'getSessionByUserID'), $this->user->userID);
+               $session = call_user_func([$this->sessionClassName, 'getSessionByUserID'], $this->user->userID);
                
                if ($session !== null) {
                        // inherit existing session
@@ -537,7 +537,7 @@ class SessionHandler extends SingletonFactory {
                
                if ($createNewSession) {
                        // save session
-                       $sessionData = array(
+                       $sessionData = [
                                'sessionID' => $sessionID,
                                'userID' => $this->user->userID,
                                'ipAddress' => UserUtil::getIpAddress(),
@@ -545,19 +545,19 @@ class SessionHandler extends SingletonFactory {
                                'lastActivityTime' => TIME_NOW,
                                'requestURI' => UserUtil::getRequestURI(),
                                'requestMethod' => (!empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '')
-                       );
+                       ];
                        
                        if ($spiderID !== null) $sessionData['spiderID'] = $spiderID;
                        
                        try {
-                               $this->session = call_user_func(array($this->sessionEditorClassName, 'create'), $sessionData);
+                               $this->session = call_user_func([$this->sessionEditorClassName, 'create'], $sessionData);
                        }
                        catch (DatabaseException $e) {
                                // MySQL error 23000 = unique key
                                // do not check against the message itself, some weird systems localize them
                                if ($e->getCode() == 23000) {
                                        // find existing session
-                                       $session = call_user_func(array($this->sessionClassName, 'getSessionByUserID'), $this->user->userID);
+                                       $session = call_user_func([$this->sessionClassName, 'getSessionByUserID'], $this->user->userID);
                                        
                                        if ($session === null) {
                                                // MySQL reported a unique key error, but no corresponding session exists, rethrow exception
@@ -626,7 +626,7 @@ class SessionHandler extends SingletonFactory {
                                FROM    wcf".WCF_N."_user_to_group
                                WHERE   userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->user->userID));
+                       $statement->execute([$this->user->userID]);
                        $groupIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
                else {
@@ -636,7 +636,7 @@ class SessionHandler extends SingletonFactory {
                // get group data from cache
                $this->groupData = UserGroupPermissionCacheBuilder::getInstance()->getData($groupIDs);
                if (isset($this->groupData['groupIDs']) && $this->groupData['groupIDs'] != $groupIDs) {
-                       $this->groupData = array();
+                       $this->groupData = [];
                }
        }
        
@@ -657,7 +657,7 @@ class SessionHandler extends SingletonFactory {
        protected function loadLanguageIDs() {
                if ($this->languageIDs !== null) return;
                
-               $this->languageIDs = array();
+               $this->languageIDs = [];
                
                if (!$this->user->userID) {
                        return;
@@ -669,7 +669,7 @@ class SessionHandler extends SingletonFactory {
                                FROM    wcf".WCF_N."_user_to_language
                                WHERE   userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->user->userID));
+                       $statement->execute([$this->user->userID]);
                        $this->languageIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                }
                else {
@@ -685,7 +685,7 @@ class SessionHandler extends SingletonFactory {
         * @param       boolean                         $hideSession    if true, database won't be updated
         */
        public function changeUser(User $user, $hideSession = false) {
-               $eventParameters = array('user' => $user, 'hideSession' => $hideSession)
+               $eventParameters = ['user' => $user, 'hideSession' => $hideSession]
                
                EventHandler::getInstance()->fireAction($this, 'beforeChangeUser', $eventParameters);
                
@@ -750,7 +750,7 @@ class SessionHandler extends SingletonFactory {
                                // there are still other virtual sessions, create a new session
                                if ($sessionCount) {
                                        // save session
-                                       $sessionData = array(
+                                       $sessionData = [
                                                'sessionID' => StringUtil::getRandomID(),
                                                'userID' => $user->userID,
                                                'ipAddress' => UserUtil::getIpAddress(),
@@ -758,9 +758,9 @@ class SessionHandler extends SingletonFactory {
                                                'lastActivityTime' => TIME_NOW,
                                                'requestURI' => UserUtil::getRequestURI(),
                                                'requestMethod' => (!empty($_SERVER['REQUEST_METHOD']) ? substr($_SERVER['REQUEST_METHOD'], 0, 7) : '')
-                                       );
+                                       ];
                                        
-                                       $this->session = call_user_func(array($this->sessionEditorClassName, 'create'), $sessionData);
+                                       $this->session = call_user_func([$this->sessionEditorClassName, 'create'], $sessionData);
                                        
                                        HeaderUtil::setCookie('cookieHash'.$this->cookieSuffix, $this->session->sessionID);
                                }
@@ -768,9 +768,9 @@ class SessionHandler extends SingletonFactory {
                                        // this was the last virtual session, re-use current session
                                        // update session
                                        $sessionEditor = new $this->sessionEditorClassName($this->session);
-                                       $sessionEditor->update(array(
+                                       $sessionEditor->update([
                                                'userID' => $user->userID
-                                       ));
+                                       ]);
                                }
                        break;
                        
@@ -780,11 +780,11 @@ class SessionHandler extends SingletonFactory {
                        default:
                                if (!$this->supportsVirtualSessions) {
                                        // delete all other sessions of this user
-                                       call_user_func(array($this->sessionEditorClassName, 'deleteUserSessions'), array($user->userID));
+                                       call_user_func([$this->sessionEditorClassName, 'deleteUserSessions'], [$user->userID]);
                                }
                                
                                // find existing session for this user
-                               $session = call_user_func(array($this->sessionClassName, 'getSessionByUserID'), $user->userID);
+                               $session = call_user_func([$this->sessionClassName, 'getSessionByUserID'], $user->userID);
                                
                                // no session exists, re-use current session
                                if ($session === null) {
@@ -794,9 +794,9 @@ class SessionHandler extends SingletonFactory {
                                        try {
                                                $this->register('__changeSessionID', true);
                                                
-                                               $sessionEditor->update(array(
+                                               $sessionEditor->update([
                                                        'userID' => $user->userID
-                                               ));
+                                               ]);
                                        }
                                        catch (DatabaseException $e) {
                                                // MySQL error 23000 = unique key
@@ -844,13 +844,13 @@ class SessionHandler extends SingletonFactory {
                if ($this->doNotUpdate) return;
                
                // set up data
-               $data = array(
+               $data = [
                        'ipAddress' => UserUtil::getIpAddress(),
                        'userAgent' => $this->userAgent,
                        'requestURI' => $this->requestURI,
                        'requestMethod' => $this->requestMethod,
                        'lastActivityTime' => TIME_NOW
-               );
+               ];
                if (!class_exists('wcf\system\CLIWCF', false) && PACKAGE_ID && RequestHandler::getInstance()->getActiveRequest() && RequestHandler::getInstance()->getActiveRequest()->getRequestObject() instanceof ITrackablePage && RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->isTracked()) {
                        $data['controller'] = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->getController();
                        $data['parentObjectType'] = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->getParentObjectType();
@@ -890,9 +890,9 @@ class SessionHandler extends SingletonFactory {
                // update last activity time
                /** @var \wcf\data\DatabaseObjectEditor $sessionEditor */
                $sessionEditor = new $this->sessionEditorClassName($this->session);
-               $sessionEditor->update(array(
+               $sessionEditor->update([
                        'lastActivityTime' => TIME_NOW
-               ));
+               ]);
                
                if ($this->virtualSession instanceof ACPSessionVirtual) {
                        if ($this->isACP) {
@@ -911,12 +911,12 @@ class SessionHandler extends SingletonFactory {
        public function delete() {
                // clear storage
                if ($this->user->userID) {
-                       self::resetSessions(array($this->user->userID));
+                       self::resetSessions([$this->user->userID]);
                        
                        // update last activity time
                        if (!$this->isACP) {
                                $editor = new UserEditor($this->user);
-                               $editor->update(array('lastActivityTime' => TIME_NOW));
+                               $editor->update(['lastActivityTime' => TIME_NOW]);
                        }
                }
                
@@ -976,7 +976,7 @@ class SessionHandler extends SingletonFactory {
         * 
         * @param       integer[]       $userIDs
         */
-       public static function resetSessions(array $userIDs = array()) {
+       public static function resetSessions(array $userIDs = []) {
                if (!empty($userIDs)) {
                        UserStorageHandler::getInstance()->reset($userIDs, 'groupIDs');
                        UserStorageHandler::getInstance()->reset($userIDs, 'languageIDs');
@@ -1018,7 +1018,7 @@ class SessionHandler extends SingletonFactory {
                        WHERE   spiderID = ?
                                AND userID IS NULL";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($spiderID));
+               $statement->execute([$spiderID]);
                $row = $statement->fetchArray();
                if ($row !== false) {
                        // fix session validation
index 1a48c3d6b6c0ebe1a6c13a0f77d82201cd5a1e65..a21c52cf40b7afef12272c1d6ed296e8296e8455 100644 (file)
@@ -123,8 +123,8 @@ class Installer {
                $tar = new Tar($this->source);
                
                // distinct directories and files
-               $directories = array();
-               $files = array();
+               $directories = [];
+               $files = [];
                foreach ($tar->getContentList() as $index => $file) {
                        if (empty($this->folder) || mb_strpos($file['filename'], $this->folder) === 0) {
                                if (!empty($this->folder)) {
@@ -146,7 +146,7 @@ class Installer {
                $this->checkFiles($files);
                
                // now create the directories
-               $errors = array();
+               $errors = [];
                foreach ($directories as $dir) {
                        try {
                                $this->createDir($dir);
index d4ca918ec6962563afd796e7ecbf7955e547e808..021ea5e1b7ccd9983c74e85557521c59888c30f6 100644 (file)
@@ -97,7 +97,7 @@ class Uninstaller {
        protected function uninstall() {
                if ($this->checkTargetDir()) {
                        // delete all files
-                       $directories = array();
+                       $directories = [];
                        foreach ($this->files as $file) {
                                $this->deleteFile($this->targetDir.$file);
                                
index d3dad1e19a9c9a163c910f6fea9db94e774a8eba..7593e42d80b5b9550c808a6c1f378c849ab67707 100644 (file)
@@ -35,7 +35,7 @@ class SitemapHandler extends SingletonFactory {
         * @return      Sitemap[]
         */
        public function getTree() {
-               $tree = array();
+               $tree = [];
                
                if (!empty($this->cache)) {
                        foreach ($this->cache as $sitemap) {
index e9173fa3813cc87120b895132852c2bab753d594..cf0cf01e5c38d845c6ee64542bb3feb39fa7068d 100644 (file)
@@ -44,14 +44,14 @@ abstract class AbstractCommentStatDailyHandler extends AbstractStatDailyHandler
                                                AND comment_response.time BETWEEN ? AND ?
                        )";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        $date,
                        $date + 86399,
                        $objectTypeID,
                        $date,
                        $date + 86399
-               ));
+               ]);
                $counter = $statement->fetchColumn();
                
                $sql = "SELECT (
@@ -68,17 +68,17 @@ abstract class AbstractCommentStatDailyHandler extends AbstractStatDailyHandler
                                                AND comment_response.time < ?
                        )";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeID,
                        $date + 86400,
                        $objectTypeID,
                        $date + 86400
-               ));
+               ]);
                $total = $statement->fetchColumn();
                
-               return array(
+               return [
                        'counter' => $counter,
                        'total' => $total
-               );
+               ];
        }
 }
index 4c6b10260cffaeaee5372dcdc14afb43ef4c44c6..6d7877f2183091cc926e10b0a911548165d667b9 100644 (file)
@@ -21,7 +21,7 @@ abstract class AbstractDiskUsageStatDailyHandler extends AbstractStatDailyHandle
                        FROM    ".$tableName."
                        WHERE   ".$dateColumnName." BETWEEN ? AND ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($date, $date + 86399));
+               $statement->execute([$date, $date + 86399]);
                return $statement->fetchColumn();
        }
        
@@ -33,7 +33,7 @@ abstract class AbstractDiskUsageStatDailyHandler extends AbstractStatDailyHandle
                        FROM    ".$tableName."
                        WHERE   ".$dateColumnName." < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($date + 86400));
+               $statement->execute([$date + 86400]);
                return $statement->fetchColumn();
        }
        
index d390db36e94751f252f57b360df63e3acaca4513..ed019cbd43d1dc5ff0ba7be665df0ffd22bd43f0 100644 (file)
@@ -26,7 +26,7 @@ abstract class AbstractStatDailyHandler implements IStatDailyHandler {
                        FROM    " . $tableName . "
                        WHERE   " . $dateColumnName . " BETWEEN ? AND ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($date, $date + 86399));
+               $statement->execute([$date, $date + 86399]);
                return $statement->fetchColumn();
        }
        
@@ -43,7 +43,7 @@ abstract class AbstractStatDailyHandler implements IStatDailyHandler {
                        FROM    " . $tableName . "
                        WHERE   " . $dateColumnName . " < ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($date + 86400));
+               $statement->execute([$date + 86400]);
                return $statement->fetchColumn();
        }
        
index 42c0227503c3066bc42c9f297ed688d6702dc4ae..fe664f6e9d05d2ca5093b66c36a1c5c829b2d809 100644 (file)
@@ -16,9 +16,9 @@ class AttachmentDiskUsageStatDailyHandler extends AbstractDiskUsageStatDailyHand
         * @see \wcf\system\stat\IStatDailyHandler::getData()
         */
        public function getData($date) {
-               return array(
+               return [
                        'counter' => $this->getCounter($date, 'wcf'.WCF_N.'_attachment', 'uploadTime'),
                        'total' => $this->getTotal($date, 'wcf'.WCF_N.'_attachment', 'uploadTime')
-               );
+               ];
        }
 }
index a23e7ef6c776f20d2d291ff08f9c476ba691a2dc..a19987d24fec03dad2002fdcecd7f9366db29129 100644 (file)
@@ -16,9 +16,9 @@ class AttachmentStatDailyHandler extends AbstractStatDailyHandler {
         * @see \wcf\system\stat\IStatDailyHandler::getData()
         */
        public function getData($date) {
-               return array(
+               return [
                        'counter' => $this->getCounter($date, 'wcf'.WCF_N.'_attachment', 'uploadTime'),
                        'total' => $this->getTotal($date, 'wcf'.WCF_N.'_attachment', 'uploadTime')
-               );
+               ];
        }
 }
index fdca6723a8174d9bc857930ce40e0c426b9caeb8..8ac4769cbd3c5174f84ac6410f88239b02ca2e5b 100644 (file)
@@ -25,7 +25,7 @@ class LikeStatDailyHandler extends AbstractStatDailyHandler {
                        WHERE   time BETWEEN ? AND ?
                                AND likeValue = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($date, $date + 86399, $this->likeValue));
+               $statement->execute([$date, $date + 86399, $this->likeValue]);
                $counter = intval($statement->fetchColumn());
                
                $sql = "SELECT  COUNT(*)
@@ -33,12 +33,12 @@ class LikeStatDailyHandler extends AbstractStatDailyHandler {
                        WHERE   time < ?
                                AND likeValue = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($date + 86400, $this->likeValue));
+               $statement->execute([$date + 86400, $this->likeValue]);
                $total = intval($statement->fetchColumn());
                
-               return array(
+               return [
                        'counter' => $counter,
                        'total' => $total
-               );
+               ];
        }
 }
index 1e20a0d82af618ccd8a302c26d5f012ae0723274..f7107a41a3482a8374a36ebb4356e3f4149c9838 100644 (file)
@@ -16,9 +16,9 @@ class UserStatDailyHandler extends AbstractStatDailyHandler {
         * @see \wcf\system\stat\IStatDailyHandler::getData()
         */
        public function getData($date) {
-               return array(
+               return [
                        'counter' => $this->getCounter($date, 'wcf'.WCF_N.'_user', 'registrationDate'),
                        'total' => $this->getTotal($date, 'wcf'.WCF_N.'_user', 'registrationDate')
-               );
+               ];
        }
 }
index 6402f5b8bc2a92893e806526b43e307ca49ded84..eacf59c38893b1701b8579732d44fc31aca0d719 100644 (file)
@@ -23,7 +23,7 @@ class StyleHandler extends SingletonFactory {
         * style information cache
         * @var array
         */
-       protected $cache = array();
+       protected $cache = [];
        
        /**
         * active style object
@@ -45,7 +45,7 @@ class StyleHandler extends SingletonFactory {
         * @return      Style[]
         */
        public function getAvailableStyles() {
-               $styles = array();
+               $styles = [];
                
                foreach ($this->cache['styles'] as $styleID => $style) {
                        if (!$style->isDisabled || WCF::getSession()->getPermission('admin.style.canUseDisabledStyle')) {
index 849996752c0a60217fd0f062b0fcd678a426c732..1a1c9f1d96623dbffa54c860383c873789a79b02 100644 (file)
@@ -31,7 +31,7 @@ class TagCloud {
         * list of tags
         * @var TagCloudTag[]
         */
-       protected $tags = array();
+       protected $tags = [];
        
        /**
         * max value of tag counter
@@ -49,14 +49,14 @@ class TagCloud {
         * active language ids
         * @var integer[]
         */
-       protected $languageIDs = array();
+       protected $languageIDs = [];
        
        /**
         * Contructs a new TagCloud object.
         * 
         * @param       integer[]       $languageIDs
         */
-       public function __construct(array $languageIDs = array()) {
+       public function __construct(array $languageIDs = []) {
                $this->languageIDs = $languageIDs;
                if (empty($this->languageIDs)) {
                        $this->languageIDs = array_keys(LanguageFactory::getInstance()->getLanguages());
index fc12c55a38d92dbcff9bb4e6d7578bb09e889cb4..c79c230781940ee9ef910c2b8464f053c57d15d9 100644 (file)
@@ -39,15 +39,15 @@ class TagEngine extends SingletonFactory {
                                                AND objectID = ?
                                                AND languageID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $objectTypeID,
                                $objectID,
                                $languageID
-                       ));
+                       ]);
                }
                
                // get tag ids
-               $tagIDs = array();
+               $tagIDs = [];
                foreach ($tags as $tag) {
                        if (empty($tag)) continue;
                        
@@ -60,10 +60,10 @@ class TagEngine extends SingletonFactory {
                        $tagObj = Tag::getTag($tag, $languageID);
                        if ($tagObj === null) {
                                // create new tag
-                               $tagAction = new TagAction(array(), 'create', array('data' => array(
+                               $tagAction = new TagAction([], 'create', ['data' => [
                                        'name' => $tag,
                                        'languageID' => $languageID
-                               )));
+                               ]]);
                                
                                $tagAction->executeAction();
                                $returnValues = $tagAction->getReturnValues();
@@ -81,7 +81,7 @@ class TagEngine extends SingletonFactory {
                WCF::getDB()->beginTransaction();
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($tagIDs as $tagID) {
-                       $statement->execute(array($objectID, $tagID, $objectTypeID, $languageID));
+                       $statement->execute([$objectID, $tagID, $objectTypeID, $languageID]);
                }
                WCF::getDB()->commitTransaction();
        }
@@ -101,10 +101,10 @@ class TagEngine extends SingletonFactory {
                                        AND objectID = ?
                                        ".($languageID !== null ? "AND languageID = ?" : "");
                $statement = WCF::getDB()->prepareStatement($sql);
-               $parameters = array(
+               $parameters = [
                        $objectTypeID,
                        $objectID
-               );
+               ];
                if ($languageID !== null) $parameters[] = $languageID;
                $statement->execute($parameters);
        }
@@ -119,8 +119,8 @@ class TagEngine extends SingletonFactory {
                $objectTypeID = $this->getObjectTypeID($objectType);
                
                $conditionsBuilder = new PreparedStatementConditionBuilder();
-               $conditionsBuilder->add('objectTypeID = ?', array($objectTypeID));
-               $conditionsBuilder->add('objectID IN (?)', array($objectIDs));
+               $conditionsBuilder->add('objectTypeID = ?', [$objectTypeID]);
+               $conditionsBuilder->add('objectID IN (?)', [$objectIDs]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_tag_to_object
                        ".$conditionsBuilder;
@@ -136,10 +136,10 @@ class TagEngine extends SingletonFactory {
         * @param       integer[]               $languageIDs
         * @return      Tag[]
         */
-       public function getObjectTags($objectType, $objectID, array $languageIDs = array()) {
-               $tags = $this->getObjectsTags($objectType, array($objectID), $languageIDs);
+       public function getObjectTags($objectType, $objectID, array $languageIDs = []) {
+               $tags = $this->getObjectsTags($objectType, [$objectID], $languageIDs);
                
-               return isset($tags[$objectID]) ? $tags[$objectID] : array();
+               return isset($tags[$objectID]) ? $tags[$objectID] : [];
        }
        
        /**
@@ -150,19 +150,19 @@ class TagEngine extends SingletonFactory {
         * @param       integer[]               $languageIDs
         * @return      array
         */
-       public function getObjectsTags($objectType, array $objectIDs, array $languageIDs = array()) {
+       public function getObjectsTags($objectType, array $objectIDs, array $languageIDs = []) {
                $objectTypeID = $this->getObjectTypeID($objectType);
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("tag_to_object.objectTypeID = ?", array($objectTypeID));
-               $conditions->add("tag_to_object.objectID IN (?)", array($objectIDs));
+               $conditions->add("tag_to_object.objectTypeID = ?", [$objectTypeID]);
+               $conditions->add("tag_to_object.objectID IN (?)", [$objectIDs]);
                if (!empty($languageIDs)) {
                        foreach ($languageIDs as $index => $languageID) {
                                if (!$languageID) unset($languageIDs[$index]);
                        }
                        
                        if (!empty($languageIDs)) {
-                               $conditions->add("tag_to_object.languageID IN (?)", array($languageIDs));
+                               $conditions->add("tag_to_object.languageID IN (?)", [$languageIDs]);
                        }
                }
                
@@ -174,10 +174,10 @@ class TagEngine extends SingletonFactory {
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
                
-               $tags = array();
+               $tags = [];
                while ($tag = $statement->fetchObject('wcf\data\tag\Tag')) {
                        if (!isset($tags[$tag->objectID])) {
-                               $tags[$tag->objectID] = array();
+                               $tags[$tag->objectID] = [];
                        }
                        $tags[$tag->objectID][$tag->tagID] = $tag;
                }
index 63e30b668bcf85f3b957e84ce40997b19dcc1509..f3aab43f132995be46bd6d0bd7054185cce5dc3b 100644 (file)
@@ -18,7 +18,7 @@ class TypedTagCloud extends TagCloud {
         * object type ids
         * @var integer[]
         */
-       protected $objectTypeIDs = array();
+       protected $objectTypeIDs = [];
        
        /**
         * Contructs a new TypedTagCloud object.
@@ -26,7 +26,7 @@ class TypedTagCloud extends TagCloud {
         * @param       string          $objectType
         * @param       integer[]       $languageIDs
         */
-       public function __construct($objectType, array $languageIDs = array()) {
+       public function __construct($objectType, array $languageIDs = []) {
                $objectTypeObj = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.tagging.taggableObject', $objectType);
                $this->objectTypeIDs[] = $objectTypeObj->objectTypeID;
                
@@ -37,9 +37,9 @@ class TypedTagCloud extends TagCloud {
         * Loads the tag cloud cache.
         */
        protected function loadCache() {
-               $this->tags = TypedTagCloudCacheBuilder::getInstance()->getData(array(
+               $this->tags = TypedTagCloudCacheBuilder::getInstance()->getData([
                        'languageIDs' => $this->languageIDs,
                        'objectTypeIDs' => $this->objectTypeIDs
-               ));
+               ]);
        }
 }
index f90eaae7d9432f190ff6e7b05daa607316cea675..91ff743e6041ed18b0901c6fac3c351716fc2a32 100644 (file)
@@ -24,7 +24,7 @@ class ACPTemplateEngine extends TemplateEngine {
        protected function init() {
                parent::init();
                
-               $this->templatePaths = array('wcf' => WCF_DIR.'acp/templates/');
+               $this->templatePaths = ['wcf' => WCF_DIR.'acp/templates/'];
                $this->compileDir = WCF_DIR.'acp/templates/compiled/';
                
                if (!defined('NO_IMPORTS')) {
index 288ad6b61499b872dbf3a36da4f6840947b72b44..81fcab0af6066106fd09520936096605c464f88a 100755 (executable)
@@ -37,7 +37,7 @@ class TemplateEngine extends SingletonFactory {
         * directories used as template source
         * @var string[]
         */
-       public $templatePaths = array();
+       public $templatePaths = [];
        
        /**
         * namespace containing template modifiers and plugins
@@ -61,13 +61,13 @@ class TemplateEngine extends SingletonFactory {
         * list of registered prefilters
         * @var string[]
         */
-       protected $prefilters = array();
+       protected $prefilters = [];
        
        /**
         * cached list of known template groups
         * @var array
         */
-       protected $templateGroupCache = array();
+       protected $templateGroupCache = [];
        
        /**
         * active template group id
@@ -79,19 +79,19 @@ class TemplateEngine extends SingletonFactory {
         * all available template variables and those assigned during runtime
         * @var mixed[][]
         */
-       protected $v = array();
+       protected $v = [];
        
        /**
         * all cached variables for usage after execution in sandbox
         * @var mixed[][]
         */
-       protected $sandboxVars = array();
+       protected $sandboxVars = [];
        
        /**
         * contains all templates with assigned template listeners.
         * @var string[][][]
         */
-       protected $templateListeners = array();
+       protected $templateListeners = [];
        
        /**
         * true, if template listener code was already loaded
@@ -109,7 +109,7 @@ class TemplateEngine extends SingletonFactory {
         * @see \wcf\system\SingletonFactory::init()
         */
        protected function init() {
-               $this->templatePaths = array('wcf' => WCF_DIR.'templates/');
+               $this->templatePaths = ['wcf' => WCF_DIR.'templates/'];
                $this->pluginNamespace = 'wcf\system\template\plugin\\';
                $this->compileDir = WCF_DIR.'templates/compiled/';
                
@@ -141,7 +141,7 @@ class TemplateEngine extends SingletonFactory {
         * Assigns some system variables.
         */
        protected function assignSystemVariables() {
-               $this->v['tpl'] = array();
+               $this->v['tpl'] = [];
                
                // assign super globals
                $this->v['tpl']['get'] =& $_GET;
@@ -153,10 +153,10 @@ class TemplateEngine extends SingletonFactory {
                // system info
                $this->v['tpl']['now'] = TIME_NOW;
                $this->v['tpl']['template'] = '';
-               $this->v['tpl']['includedTemplates'] = array();
+               $this->v['tpl']['includedTemplates'] = [];
                
                // section / foreach / capture arrays
-               $this->v['tpl']['section'] = $this->v['tpl']['foreach'] = $this->v['tpl']['capture'] = array();
+               $this->v['tpl']['section'] = $this->v['tpl']['foreach'] = $this->v['tpl']['capture'] = [];
        }
        
        /**
@@ -284,7 +284,7 @@ class TemplateEngine extends SingletonFactory {
         * during runtime as it could leed to an unexpected behaviour.
         */
        public function clearAllAssign() {
-               $this->v = array();
+               $this->v = [];
        }
        
        /**
@@ -310,11 +310,11 @@ class TemplateEngine extends SingletonFactory {
                // check if compilation is necessary
                if (($metaData === null) || !$this->isCompiled($templateName, $sourceFilename, $compiledFilename, $application, $metaData)) {
                        // compile
-                       $this->compileTemplate($templateName, $sourceFilename, $compiledFilename, array(
+                       $this->compileTemplate($templateName, $sourceFilename, $compiledFilename, [
                                'application' => $application,
                                'data' => $metaData,
                                'filename' => $metaDataFilename
-                       ));
+                       ]);
                }
                
                // assign current package id
@@ -531,7 +531,7 @@ class TemplateEngine extends SingletonFactory {
         * @param       boolean         $sandbox        enables execution in sandbox
         * @return      string
         */
-       public function fetch($templateName, $application = 'wcf', array $variables = array(), $sandbox = false) {
+       public function fetch($templateName, $application = 'wcf', array $variables = [], $sandbox = false) {
                // enable sandbox
                if ($sandbox) {
                        $this->enableSandbox();
@@ -564,7 +564,7 @@ class TemplateEngine extends SingletonFactory {
         * @param       boolean         $sandbox        enables execution in sandbox
         * @return      string
         */
-       public function fetchString($compiledSource, array $variables = array(), $sandbox = true) {
+       public function fetchString($compiledSource, array $variables = [], $sandbox = true) {
                // enable sandbox
                if ($sandbox) {
                        $this->enableSandbox();
@@ -672,7 +672,7 @@ class TemplateEngine extends SingletonFactory {
         * @param       array           $variables
         * @param       boolean         $sandbox        enables execution in sandbox
         */
-       protected function includeTemplate($templateName, $application, array $variables = array(), $sandbox = true) {
+       protected function includeTemplate($templateName, $application, array $variables = [], $sandbox = true) {
                // enable sandbox
                if ($sandbox) {
                        $this->enableSandbox();
@@ -729,7 +729,7 @@ class TemplateEngine extends SingletonFactory {
         */
        protected function loadTemplateListenerCode() {
                if (!$this->templateListenersLoaded) {
-                       $this->templateListeners = TemplateListenerCodeCacheBuilder::getInstance()->getData(array('environment' => $this->environment));
+                       $this->templateListeners = TemplateListenerCodeCacheBuilder::getInstance()->getData(['environment' => $this->environment]);
                        $this->templateListenersLoaded = true;
                }
        }
index c9d2ffd9d8ad1fbca8b7235f964e349ec0a6b1a8..a3a93a09c988e12337fc1864dd34577b27ff0b8c 100644 (file)
@@ -28,17 +28,17 @@ class TemplateScriptingCompiler {
         * to PHP's function_exists function
         * @var string[]
         */
-       protected $unknownPHPFunctions = array('isset', 'unset', 'empty');
+       protected $unknownPHPFunctions = ['isset', 'unset', 'empty'];
        
        /**
         * PHP functions that can not be used in the modifier syntax
         * @var string[]
         */
-       protected $disabledPHPFunctions = array(
+       protected $disabledPHPFunctions = [
                'system', 'exec', 'passthru', 'shell_exec', // command line execution
                'include', 'require', 'include_once', 'require_once', // includes
                'eval', 'virtual', 'call_user_func_array', 'call_user_func', 'assert' // code execution
-       );
+       ];
        
        /**
         * pattern to match variable operators like -> or .
@@ -122,25 +122,25 @@ class TemplateScriptingCompiler {
         * list of automatically loaded tenplate plugins
         * @var string[]
         */
-       protected $autoloadPlugins = array();
+       protected $autoloadPlugins = [];
        
        /**
         * stack with template tags data
         * @var array
         */
-       protected $tagStack = array();
+       protected $tagStack = [];
        
        /**
         * list of loaded compiler plugin objects
         * @var ICompilerTemplatePlugin[]
         */
-       protected $compilerPlugins = array();
+       protected $compilerPlugins = [];
        
        /**
         * stack used to compile the capture tag
         * @var array
         */
-       protected $captureStack = array();
+       protected $captureStack = [];
        
        /**
         * left delimiter of template syntax
@@ -170,7 +170,7 @@ class TemplateScriptingCompiler {
         * list of static includes per template
         * @var string[]
         */
-       protected $staticIncludes = array();
+       protected $staticIncludes = [];
        
        /**
         * Creates a new TemplateScriptingCompiler object.
@@ -198,21 +198,21 @@ class TemplateScriptingCompiler {
         * @return      string
         * @throws      SystemException
         */
-       public function compileString($identifier, $sourceContent, array $metaData = array(), $isolated = false) {
+       public function compileString($identifier, $sourceContent, array $metaData = [], $isolated = false) {
                if ($isolated) {
-                       $previousData = array(
+                       $previousData = [
                                'autoloadPlugins' => $this->autoloadPlugins,
                                'currentIdentifier' => $this->currentIdentifier,
                                'currentLineNo' => $this->currentLineNo,
                                'tagStack' => $this->tagStack
-                       );
+                       ];
                }
                else {
-                       $this->staticIncludes = array();
+                       $this->staticIncludes = [];
                }
                
                // reset vars
-               $this->autoloadPlugins = $this->tagStack = array();
+               $this->autoloadPlugins = $this->tagStack = [];
                $this->currentIdentifier = $identifier;
                $this->currentLineNo = 1;
                
@@ -229,7 +229,7 @@ class TemplateScriptingCompiler {
                $sourceContent = $this->removeComments($sourceContent);
                
                // match all template tags
-               $matches = array();
+               $matches = [];
                preg_match_all("~".$this->ldq."(.*?)".$this->rdq."~s", $sourceContent, $matches);
                $templateTags = $matches[1];
                
@@ -237,7 +237,7 @@ class TemplateScriptingCompiler {
                $textBlocks = preg_split("~".$this->ldq.".*?".$this->rdq."~s", $sourceContent);
                
                // compile the template tags into php-code
-               $compiledTags = array();
+               $compiledTags = [];
                for ($i = 0, $j = count($templateTags); $i < $j; $i++) {
                        $this->currentLineNo += mb_substr_count($textBlocks[$i], "\n");
                        $compiledTags[] = $this->compileTag($templateTags[$i], $identifier, $metaData);
@@ -287,12 +287,12 @@ class TemplateScriptingCompiler {
                        $this->tagStack = $previousData['tagStack'];
                }
                
-               return array(
-                       'meta' => array(
+               return [
+                       'meta' => [
                                'include' => $this->staticIncludes
-                       ),
+                       ],
                        'template' => $compiledAutoloadPlugins.$compiledContent
-               );
+               ];
        }
        
        /**
@@ -310,7 +310,7 @@ class TemplateScriptingCompiler {
                        return $this->compileOutputTag($tag);
                }
                
-               $match = array();
+               $match = [];
                // replace 'else if' with 'elseif'
                $tag = preg_replace('~^else\s+if(?=\s)~i', 'elseif', $tag);
                
@@ -570,7 +570,7 @@ class TemplateScriptingCompiler {
                                }
                        }
                        
-                       $this->captureStack[] = array('name' => $args['name'], 'variable' => $args['assign'], 'append' => $append);
+                       $this->captureStack[] = ['name' => $args['name'], 'variable' => $args['assign'], 'append' => $append];
                        return '<?php ob_start(); ?>';
                }
                else {
@@ -776,7 +776,7 @@ class TemplateScriptingCompiler {
                if ($staticInclude) {
                        $phpCode = '';
                        if (!isset($this->staticIncludes[$application])) {
-                               $this->staticIncludes[$application] = array();
+                               $this->staticIncludes[$application] = [];
                        }
                        
                        if (!in_array($templateName, $this->staticIncludes[$application])) {
@@ -784,7 +784,7 @@ class TemplateScriptingCompiler {
                        }
                        
                        // pass remaining tag args as variables
-                       $variables = array();
+                       $variables = [];
                        if (!empty($args)) {
                                foreach ($args as $variable => $value) {
                                        if (substr($value, 0, 1) == "'") {
@@ -808,11 +808,11 @@ class TemplateScriptingCompiler {
                        $sourceFilename = $this->template->getSourceFilename($templateName, $application);
                        $metaDataFilename = $this->template->getMetaDataFilename($templateName);
                        
-                       $data = $this->compileString($templateName, file_get_contents($sourceFilename), array(
+                       $data = $this->compileString($templateName, file_get_contents($sourceFilename), [
                                'application' => $application,
                                'data' => null,
                                'filename' => ''
-                       ), true);
+                       ], true);
                        
                        return $phpCode . $data['template'];
                }
@@ -866,10 +866,10 @@ class TemplateScriptingCompiler {
                }
                
                // parse tag arguments
-               $matches = array();
+               $matches = [];
                // find all variables
                preg_match_all('~\s+(\w+)\s*=\s*([^=]*)(?=\s|$)~s', $tagArgs, $matches);
-               $args = array();
+               $args = [];
                for ($i = 0, $j = count($matches[1]); $i < $j; $i++) {
                        $name = $matches[1][$i];
                        $string = $this->compileVariableTag($matches[2][$i], false);
@@ -942,7 +942,7 @@ class TemplateScriptingCompiler {
         */
        protected function compileIfTag($tagArgs, $elseif = false) {
                $tagArgs = $this->replaceQuotes($tagArgs);
-               $tagArgs = str_replace(array(' ', "\n"), '', $tagArgs);
+               $tagArgs = str_replace([' ', "\n"], '', $tagArgs);
                
                // split tags
                preg_match_all('~('.$this->conditionOperatorPattern.')~', $tagArgs, $matches);
@@ -1002,7 +1002,7 @@ class TemplateScriptingCompiler {
         * @param       string          $tag
         */
        public function pushTag($tag) {
-               $this->tagStack[] = array($tag, $this->currentLineNo);
+               $this->tagStack[] = [$tag, $this->currentLineNo];
        }
        
        /**
@@ -1141,7 +1141,7 @@ class TemplateScriptingCompiler {
                $values = preg_split('~(?:'.$this->variableOperatorPattern.')~', $compiledTag);
                
                // parse tags
-               $statusStack = array(0 => 'start');
+               $statusStack = [0 => 'start'];
                $result = '';
                $modifierData = null;
                for ($i = 0, $j = count($values); $i < $j; $i++) {
@@ -1335,8 +1335,8 @@ class TemplateScriptingCompiler {
                                                        }
                                                }
                                                
-                                               $statusStack = array(0 => 'modifier');
-                                               $modifierData = array('name' => '', 'parameter' => array(0 => $result));
+                                               $statusStack = [0 => 'modifier'];
+                                               $modifierData = ['name' => '', 'parameter' => [0 => $result]];
                                                $result = '';
                                        break;
                                        
@@ -1503,7 +1503,7 @@ class TemplateScriptingCompiler {
         * @return      string
         */
        public function replaceLiterals($string) {
-               return preg_replace_callback("~".$this->ldq."literal".$this->rdq."(.*?)".$this->ldq."/literal".$this->rdq."~s", array($this, 'replaceLiteralsCallback'), $string);
+               return preg_replace_callback("~".$this->ldq."literal".$this->rdq."(.*?)".$this->ldq."/literal".$this->rdq."~s", [$this, 'replaceLiteralsCallback'], $string);
        }
        
        /**
@@ -1540,8 +1540,8 @@ class TemplateScriptingCompiler {
         * @return      string
         */
        public function replaceQuotes($string) {
-               $string = preg_replace_callback('~\'([^\'\\\\]+|\\\\.)*\'~', array($this, 'replaceSingleQuotesCallback'), $string);
-               $string = preg_replace_callback('~"([^"\\\\]+|\\\\.)*"~', array($this, 'replaceDoubleQuotesCallback'), $string);
+               $string = preg_replace_callback('~\'([^\'\\\\]+|\\\\.)*\'~', [$this, 'replaceSingleQuotesCallback'], $string);
+               $string = preg_replace_callback('~"([^"\\\\]+|\\\\.)*"~', [$this, 'replaceDoubleQuotesCallback'], $string);
                
                return $string;
        }
@@ -1583,7 +1583,7 @@ class TemplateScriptingCompiler {
         * @return      string
         */
        public function replaceConstants($string) {
-               return preg_replace_callback('~(?<=^|'.$this->variableOperatorPattern.')(?i)((?:\-?\d+(?:\.\d+)?)|true|false|null)(?=$|'.$this->variableOperatorPattern.')~', array($this, 'replaceConstantsCallback'), $string);
+               return preg_replace_callback('~(?<=^|'.$this->variableOperatorPattern.')(?i)((?:\-?\d+(?:\.\d+)?)|true|false|null)(?=$|'.$this->variableOperatorPattern.')~', [$this, 'replaceConstantsCallback'], $string);
        }
        
        /**
index bf1f222cde1861b54c6417069bf13d5386525f8c..0c275b514fbf1775330e87dfc5158dcd10ae610c 100644 (file)
@@ -21,7 +21,7 @@ class CounterFunctionTemplatePlugin implements IFunctionTemplatePlugin {
         * counter data
         * @var array
         */
-       protected $counters = array();
+       protected $counters = [];
        
        /**
         * @see \wcf\system\template\IFunctionTemplatePlugin::execute()
@@ -32,13 +32,13 @@ class CounterFunctionTemplatePlugin implements IFunctionTemplatePlugin {
                }
                
                if (!isset($this->counters[$tagArgs['name']])) {
-                       $this->counters[$tagArgs['name']] = array(
+                       $this->counters[$tagArgs['name']] = [
                                'skip' => isset($tagArgs['skip']) ? $tagArgs['skip'] : 1,
                                'direction' => isset($tagArgs['direction']) ? $tagArgs['direction'] : 'up',
                                'assign' => (isset($tagArgs['assign']) && !empty($tagArgs['assign'])) ? $tagArgs['assign'] : null,
                                'print' => isset($tagArgs['print']) ? $tagArgs['print'] : false,
                                'count' => isset($tagArgs['start']) ? $tagArgs['start'] : 1
-                       );
+                       ];
                }
                
                $counter =& $this->counters[$tagArgs['name']];
index 1b0712f045d38d9a0ae544d7f6f3f83f30878fbd..97021aec515dcf944bb207222a7abbc2f0173f02 100644 (file)
@@ -21,7 +21,7 @@ class CycleFunctionTemplatePlugin implements IFunctionTemplatePlugin {
         * cycle data
         * @var array
         */
-       protected $cycles = array();
+       protected $cycles = [];
        
        /**
         * @see \wcf\system\template\IFunctionTemplatePlugin::execute()
index 489ced75c23d3b94b176c7310d3c57d058558a32..a3ab22cec2422aa7a11736a23de0e97c87a4b47a 100644 (file)
@@ -33,7 +33,7 @@ class HascontentPrefilterTemplatePlugin implements IPrefilterTemplatePlugin {
                $ldq = preg_quote($compiler->getLeftDelimiter(), '~');
                $rdq = preg_quote($compiler->getRightDelimiter(), '~');
                
-               $sourceContent = preg_replace_callback("~{$ldq}hascontent( assign='(?P<assign>.*)')?{$rdq}(?P<before>.*){$ldq}content{$rdq}(?P<content>.*){$ldq}\/content{$rdq}(?P<after>.*)({$ldq}hascontentelse{$rdq}(?P<else>.*))?{$ldq}\/hascontent{$rdq}~sU", array('self', 'replaceContentCallback'), $sourceContent);
+               $sourceContent = preg_replace_callback("~{$ldq}hascontent( assign='(?P<assign>.*)')?{$rdq}(?P<before>.*){$ldq}content{$rdq}(?P<content>.*){$ldq}\/content{$rdq}(?P<after>.*)({$ldq}hascontentelse{$rdq}(?P<else>.*))?{$ldq}\/hascontent{$rdq}~sU", ['self', 'replaceContentCallback'], $sourceContent);
                
                return $sourceContent;
        }
index 1611e3126c0f1aad322c5fbfcd0f8032256ca803..41225e45ee984a58a5ec93415f7c4e3437a54e8e 100644 (file)
@@ -58,10 +58,10 @@ class HtmlCheckboxesFunctionTemplatePlugin implements IFunctionTemplatePlugin {
                
                // get selected values
                if (isset($tagArgs['selected'])) {
-                       if (!is_array($tagArgs['selected'])) $tagArgs['selected'] = array($tagArgs['selected']);
+                       if (!is_array($tagArgs['selected'])) $tagArgs['selected'] = [$tagArgs['selected']];
                }
                else {
-                       $tagArgs['selected'] = array();
+                       $tagArgs['selected'] = [];
                }
                if (!isset($tagArgs['separator'])) {
                        $tagArgs['separator'] = '';
index 7de12a4961f1a1833699e7a56f22cfe1ed0c7fa9..4038418c8ef8c4ba2f3c08344ee6a75ba866a8ca 100644 (file)
@@ -28,7 +28,7 @@ class HtmlOptionsFunctionTemplatePlugin extends HtmlCheckboxesFunctionTemplatePl
         * selected values
         * @var string[]
         */
-       protected $selected = array();
+       protected $selected = [];
        
        /**
         * @see \wcf\system\template\IFunctionTemplatePlugin::execute()
@@ -44,7 +44,7 @@ class HtmlOptionsFunctionTemplatePlugin extends HtmlCheckboxesFunctionTemplatePl
                                                $tagArgs['options'] = array_combine($tagArgs['values'], $tagArgs['output']);
                                        }
                                        else {
-                                               $tagArgs['options'] = array();
+                                               $tagArgs['options'] = [];
                                        }
                                }
                                else {
@@ -52,7 +52,7 @@ class HtmlOptionsFunctionTemplatePlugin extends HtmlCheckboxesFunctionTemplatePl
                                }
                        }
                        else {
-                               $tagArgs['options'] = array();
+                               $tagArgs['options'] = [];
                        }
                }
                
@@ -68,10 +68,10 @@ class HtmlOptionsFunctionTemplatePlugin extends HtmlCheckboxesFunctionTemplatePl
                }
                
                // get selected values
-               $this->selected = array();
+               $this->selected = [];
                if (isset($tagArgs['selected'])) {
                        $this->selected = $tagArgs['selected'];
-                       if (!is_array($this->selected)) $this->selected = array($this->selected);
+                       if (!is_array($this->selected)) $this->selected = [$this->selected];
                }
                
                // create option list
index 001d795fe9305be0ec3b72e9ec5a1951b70d1feb..9279d8b71cb03fa24843bcff30bfc7132fa90630 100644 (file)
@@ -22,7 +22,7 @@ class ImplodeCompilerTemplatePlugin implements ICompilerTemplatePlugin {
         * local tag stack
         * @var string[]
         */
-       protected $tagStack = array();
+       protected $tagStack = [];
        
        /**
         * @see \wcf\system\template\ICompilerTemplatePlugin::executeStart()
@@ -39,7 +39,7 @@ class ImplodeCompilerTemplatePlugin implements ICompilerTemplatePlugin {
                
                $hash = StringUtil::getRandomID();
                $glue = isset($tagArgs['glue']) ? $tagArgs['glue'] : "', '";
-               $this->tagStack[] = array('hash' => $hash, 'glue' => $glue);
+               $this->tagStack[] = ['hash' => $hash, 'glue' => $glue];
                
                $phpCode = "<?php\n";
                $phpCode .= "\$_length".$hash." = count(".$tagArgs['from'].");\n";
index edb0a0cccb15cec8a2f28c7a1e8eb30e951566f1..c0e00b4f0773d6a6a6a50bf22c36e113248755ea 100644 (file)
@@ -22,7 +22,7 @@ class DefaultUploadFileValidationStrategy implements IUploadFileValidationStrate
         * allowed file extensions
         * @var string[]
         */
-       protected $fileExtensions = array();
+       protected $fileExtensions = [];
        
        /**
         * regex for validation of allowed file extension
index afe67ffba77e16e0adf888018bf6f60922430e90..b1d91444e03ea82f3a27d6c8397ad4ad2258a75d 100644 (file)
@@ -169,11 +169,11 @@ class UploadFile {
        public function getImageData() {
                if (strpos($this->getMimeType(), 'image/') == 0) {
                        if (($imageData = @getimagesize($this->getLocation())) !== false) {
-                               return array(
+                               return [
                                        'width' => $imageData[0],
                                        'height' => $imageData[1],
                                        'mimeType' => $imageData['mime'],
-                               );
+                               ];
                        }
                }
                
index f7138ab98dfbaba333e0faae08e056ec835c0a4d..f4e8003d6836eabfba6ce6aa8d77ec6f0ba4d30a 100644 (file)
@@ -17,13 +17,13 @@ class UploadHandler {
         * list of uploaded files
         * @var UploadFile[]
         */
-       protected $files = array();
+       protected $files = [];
        
        /**
         * list of validation errors.
         * @var array
         */
-       protected $erroneousFiles = array();
+       protected $erroneousFiles = [];
        
        /**
         * Creates a new UploadHandler object.
@@ -33,13 +33,13 @@ class UploadHandler {
        protected function __construct(array $rawFileData) {
                if (is_array($rawFileData['name'])) {
                        // iOS work-around
-                       $newRawFileData = array(
-                               'name' => array(),
-                               'type' => array(),
-                               'tmp_name' => array(),
-                               'error' => array(),
-                               'size' => array()
-                       );
+                       $newRawFileData = [
+                               'name' => [],
+                               'type' => [],
+                               'tmp_name' => [],
+                               'error' => [],
+                               'size' => []
+                       ];
                        $i = 0;
                        foreach (array_keys($rawFileData['name']) as $internalFileID) {
                                $newRawFileData['name'][$i] = '__wcf_' . $internalFileID . '_' . $rawFileData['name'][$internalFileID]; // __wcf_X_filename.ext
index 291a49c7d2e421828f7fb55cb6fc3370579b8bff..4502c2c72a9528dc49b1b9d35c87611bc297826e 100644 (file)
@@ -18,7 +18,7 @@ class GroupedUserList implements \Countable, \Iterator {
         * list of user profiles shared across all instances of GroupedUserList
         * @var UserProfile[]
         */
-       protected static $users = array();
+       protected static $users = [];
        
        /**
         * group name
@@ -42,7 +42,7 @@ class GroupedUserList implements \Countable, \Iterator {
         * list of user ids assigned for this group
         * @var integer[]
         */
-       protected $userIDs = array();
+       protected $userIDs = [];
        
        /**
         * Creates a new grouped list of users.
@@ -103,7 +103,7 @@ class GroupedUserList implements \Countable, \Iterator {
         * Loads user profiles for outstanding user ids.
         */
        public static function loadUsers() {
-               $userIDs = array();
+               $userIDs = [];
                foreach (self::$users as $userID => $user) {
                        if ($user === null) {
                                $userIDs[] = $userID;
index 2b3192ecc184cf1ba02518bc987e1f281b454150..cdc16345ad3150cf60710175a9d9a9962be9c34a 100644 (file)
@@ -18,13 +18,13 @@ class UserBirthdayCache extends SingletonFactory {
         * loaded months
         * @var integer[]
         */
-       protected $monthsLoaded = array();
+       protected $monthsLoaded = [];
        
        /**
         * user birthdays
         * @var integer[]
         */
-       protected $birthdays = array();
+       protected $birthdays = [];
        
        /**
         * Loads the birthday cache.
@@ -33,7 +33,7 @@ class UserBirthdayCache extends SingletonFactory {
         */
        protected function loadMonth($month) {
                if (!isset($this->monthsLoaded[$month])) {
-                       $this->birthdays = array_merge($this->birthdays, UserBirthdayCacheBuilder::getInstance()->getData(array('month' => $month)));
+                       $this->birthdays = array_merge($this->birthdays, UserBirthdayCacheBuilder::getInstance()->getData(['month' => $month]));
                        $this->monthsLoaded[$month] = true;
                }
        }
@@ -51,6 +51,6 @@ class UserBirthdayCache extends SingletonFactory {
                $index = ($month < 10 ? '0' : '') . $month . '-' . ($day < 10 ? '0' : '') . $day;
                if (isset($this->birthdays[$index])) return $this->birthdays[$index];
                
-               return array();
+               return [];
        }
 }
index 9b30d3a074602073840f33258d7e9cd8b7c4b1a2..f178e16b549c3d747a4763cfee6704e696be617f 100644 (file)
@@ -19,7 +19,7 @@ class FollowUserActivityEvent extends SingletonFactory implements IUserActivityE
         * @see \wcf\system\user\activity\event\IUserActivityEvent::prepare()
         */
        public function prepare(array $events) {
-               $objectIDs = array();
+               $objectIDs = [];
                foreach ($events as $event) {
                        $objectIDs[] = $event->objectID;
                }
@@ -35,7 +35,7 @@ class FollowUserActivityEvent extends SingletonFactory implements IUserActivityE
                        if (isset($users[$event->objectID])) {
                                $event->setIsAccessible();
                                
-                               $text = WCF::getLanguage()->getDynamicVariable('wcf.user.profile.recentActivity.follow', array('user' => $users[$event->objectID]));
+                               $text = WCF::getLanguage()->getDynamicVariable('wcf.user.profile.recentActivity.follow', ['user' => $users[$event->objectID]]);
                                $event->setTitle($text);
                        }
                        else {
index 82aa14fcd422a86fd110a062849aaf054ac7c217..0068e7032a9a577a415a48109b42c35bf049deed 100644 (file)
@@ -24,7 +24,7 @@ class ProfileCommentUserActivityEvent extends SingletonFactory implements IUserA
                        return;
                }
                
-               $commentIDs = array();
+               $commentIDs = [];
                foreach ($events as $event) {
                        $commentIDs[] = $event->objectID;
                }
@@ -36,7 +36,7 @@ class ProfileCommentUserActivityEvent extends SingletonFactory implements IUserA
                $comments = $commentList->getObjects();
                
                // fetch users
-               $userIDs = $users = array();
+               $userIDs = $users = [];
                foreach ($comments as $comment) {
                        $userIDs[] = $comment->objectID;
                }
@@ -54,7 +54,7 @@ class ProfileCommentUserActivityEvent extends SingletonFactory implements IUserA
                                                $event->setIsAccessible();
                                                
                                                $user = $users[$comment->objectID];
-                                               $text = WCF::getLanguage()->getDynamicVariable('wcf.user.profile.recentActivity.profileComment', array('user' => $user));
+                                               $text = WCF::getLanguage()->getDynamicVariable('wcf.user.profile.recentActivity.profileComment', ['user' => $user]);
                                                $event->setTitle($text);
                                                
                                                // output
index 418fe691ee92e46366cadf31b02b41d75097e57b..343a95e2f726da93a525e664b67e7d59c67128a0 100644 (file)
@@ -24,7 +24,7 @@ class UserActivityEventHandler extends SingletonFactory {
         * cached object types
         * @var ObjectType[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -78,7 +78,7 @@ class UserActivityEventHandler extends SingletonFactory {
         * @return      \wcf\data\user\activity\event\UserActivityEvent
         * @throws      SystemException
         */
-       public function fireEvent($objectType, $objectID, $languageID = null, $userID = null, $time = TIME_NOW, $additionalData = array()) {
+       public function fireEvent($objectType, $objectID, $languageID = null, $userID = null, $time = TIME_NOW, $additionalData = []) {
                $objectTypeID = $this->getObjectTypeID($objectType);
                if ($objectTypeID === null) {
                        throw new SystemException("Unknown recent activity event '".$objectType."'");
@@ -86,16 +86,16 @@ class UserActivityEventHandler extends SingletonFactory {
                
                if ($userID === null) $userID = WCF::getUser()->userID;
                
-               $eventAction = new UserActivityEventAction(array(), 'create', array(
-                       'data' => array(
+               $eventAction = new UserActivityEventAction([], 'create', [
+                       'data' => [
                                'objectTypeID' => $objectTypeID,
                                'objectID' => $objectID,
                                'languageID' => $languageID,
                                'userID' => $userID,
                                'time' => $time,
                                'additionalData' => serialize($additionalData)
-                       )
-               ));
+                       ]
+               ]);
                $returnValues = $eventAction->executeAction();
                
                return $returnValues['returnValues'];
@@ -117,8 +117,8 @@ class UserActivityEventHandler extends SingletonFactory {
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("objectTypeID = ?", array($objectTypeID));
-               $conditions->add("objectID IN (?)", array($objectIDs));
+               $conditions->add("objectTypeID = ?", [$objectTypeID]);
+               $conditions->add("objectID IN (?)", [$objectIDs]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_user_activity_event
                        ".$conditions;
@@ -141,7 +141,7 @@ class UserActivityEventHandler extends SingletonFactory {
                        $statement = WCF::getDB()->prepareStatement($sql);
                        
                        foreach ($eventIDs as $eventID) {
-                               $statement->execute(array($eventID));
+                               $statement->execute([$eventID]);
                        }
                }
        }
index 062bf84968f27e3beaf1f4c3d4abb04af8ec37fe..b99434f4aa611eaf16ac9cfcc7b75a21508c7bce 100644 (file)
@@ -24,13 +24,13 @@ class UserActivityPointHandler extends SingletonFactory {
         * list of user activity point object types
         * @var ObjectType[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * maps the user activity point object type ids to their object type names
         * @var string[]
         */
-       protected $objectTypeNames = array();
+       protected $objectTypeNames = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -52,7 +52,7 @@ class UserActivityPointHandler extends SingletonFactory {
         * @param       mixed[]         $additionalData
         * @throws      SystemException
         */
-       public function fireEvent($objectType, $objectID, $userID = null, array $additionalData = array()) {
+       public function fireEvent($objectType, $objectID, $userID = null, array $additionalData = []) {
                $objectTypeObj = $this->getObjectTypeByName($objectType);
                if ($objectTypeObj === null) {
                        throw new SystemException("Object type '".$objectType."' is not valid for object type definition 'com.woltlab.wcf.user.activityPointEvent'");
@@ -69,27 +69,27 @@ class UserActivityPointHandler extends SingletonFactory {
                        UPDATE                  activityPoints = activityPoints + VALUES(activityPoints),
                                                items = items + 1";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $userID,
                        $objectTypeObj->objectTypeID,
                        $objectTypeObj->points
-               ));
+               ]);
                
                $sql = "UPDATE  wcf".WCF_N."_user
                        SET     activityPoints = activityPoints + ?
                        WHERE   userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeObj->points,
                        $userID
-               ));
+               ]);
                
                // update user ranks
-               $this->updateUserRanks(array($userID));
+               $this->updateUserRanks([$userID]);
                
                // check if the user will be automatically added to new user groups
                // because of the new activity points
-               UserGroupAssignmentHandler::getInstance()->checkUsers(array($userID));
+               UserGroupAssignmentHandler::getInstance()->checkUsers([$userID]);
        }
        
        /**
@@ -117,7 +117,7 @@ class UserActivityPointHandler extends SingletonFactory {
                
                // update user_activity_point
                $values = '';
-               $parameters = $userIDs = array();
+               $parameters = $userIDs = [];
                foreach ($itemsToUser as $userID => $items) {
                        if (!empty($values)) $values .= ',';
                        $values .= '(?, ?, ?, ?)';
@@ -172,12 +172,12 @@ class UserActivityPointHandler extends SingletonFactory {
                                AND userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
                foreach ($userToItems as $userID => $items) {
-                       $statement->execute(array(
+                       $statement->execute([
                                ($items * $objectTypeObj->points),
                                $items,
                                $objectTypeObj->objectTypeID,
                                $userID
-                       ));
+                       ]);
                }
                
                // update total activity points per user
@@ -193,7 +193,7 @@ class UserActivityPointHandler extends SingletonFactory {
        public function updateUsers(array $userIDs) {
                $userIDs = array_unique($userIDs);
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($userIDs));
+               $conditions->add("userID IN (?)", [$userIDs]);
                
                $sql = "UPDATE  wcf".WCF_N."_user user_table
                        SET     activityPoints = COALESCE((
@@ -228,7 +228,7 @@ class UserActivityPointHandler extends SingletonFactory {
                                items = 0
                        WHERE   objectTypeID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($objectTypeObj->objectTypeID));
+               $statement->execute([$objectTypeObj->objectTypeID]);
        }
        
        /**
index 193ccfa084be6eeee8f108c904be8f087120f9e1..d0f47aa9754a8d26cfdc4aed7b99a5d2188c7148 100644 (file)
@@ -38,7 +38,7 @@ class UserAuthenticationFactory extends SingletonFactory {
                        throw new SystemException("'" . $this->className . "' does not implement 'wcf\system\user\authentication\IUserAuthentication'");
                }
                
-               $this->userAuthentication = call_user_func(array($this->className, 'getInstance'));
+               $this->userAuthentication = call_user_func([$this->className, 'getInstance']);
        }
        
        /**
index 2e0d5ad4af6ba144355440dacaf484a966a6297f..657bac2310c24f53dc0bb3250feead92cfec124e 100644 (file)
@@ -28,16 +28,16 @@ class UserCollapsibleContentHandler extends SingletonFactory {
         * list of collapsed object ids per object type id
         * @var integer[][]
         */
-       protected $collapsedContent = array();
+       protected $collapsedContent = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
         */
        protected function init() {
-               $this->cache = array(
-                       'objectTypes' => array(),
-                       'objectTypeIDs' => array()
-               );
+               $this->cache = [
+                       'objectTypes' => [],
+                       'objectTypeIDs' => []
+               ];
                
                $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.collapsibleContent');
                foreach ($objectTypes as $objectType) {
@@ -86,7 +86,7 @@ class UserCollapsibleContentHandler extends SingletonFactory {
         */
        public function getCollapsedContent($objectTypeID) {
                if (!isset($this->collapsedContent[$objectTypeID])) {
-                       $this->collapsedContent[$objectTypeID] = array();
+                       $this->collapsedContent[$objectTypeID] = [];
                        
                        if (WCF::getUser()->userID) {
                                $data = UserStorageHandler::getInstance()->getField('collapsedContent-'.$objectTypeID);
@@ -98,10 +98,10 @@ class UserCollapsibleContentHandler extends SingletonFactory {
                                                WHERE   objectTypeID = ?
                                                        AND userID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                $objectTypeID,
                                                WCF::getUser()->userID
-                                       ));
+                                       ]);
                                        $this->collapsedContent[$objectTypeID] = $statement->fetchAll(\PDO::FETCH_COLUMN);
                                        
                                        // update storage data
@@ -138,11 +138,11 @@ class UserCollapsibleContentHandler extends SingletonFactory {
                                        AND objectID = ?
                                        AND userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $objectTypeID,
                                $objectID,
                                WCF::getUser()->userID
-                       ));
+                       ]);
                        $row = $statement->fetchArray();
                        
                        if (!$row) {
@@ -150,24 +150,24 @@ class UserCollapsibleContentHandler extends SingletonFactory {
                                                        (objectTypeID, objectID, userID)
                                        VALUES          (?, ?, ?)";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(
+                               $statement->execute([
                                        $objectTypeID,
                                        $objectID,
                                        WCF::getUser()->userID
-                               ));
+                               ]);
                        }
                        
                        // reset storage
-                       UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'collapsedContent-'.$objectTypeID);
+                       UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'collapsedContent-'.$objectTypeID);
                }
                else {
                        $collapsedContent = WCF::getSession()->getVar('collapsedContent');
                        if ($collapsedContent === null || !is_array($collapsedContent)) {
-                               $collapsedContent = array();
+                               $collapsedContent = [];
                        }
                        
                        if (!in_array($objectID, $collapsedContent)) {
-                               $collapsedContent[$objectTypeID] = array();
+                               $collapsedContent[$objectTypeID] = [];
                        }
                        
                        $collapsedContent[$objectTypeID][] = $objectID;
@@ -188,19 +188,19 @@ class UserCollapsibleContentHandler extends SingletonFactory {
                                                AND objectID = ?
                                                AND userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $objectTypeID,
                                $objectID,
                                WCF::getUser()->userID
-                       ));
+                       ]);
                        
                        // reset storage
-                       UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'collapsedContent-'.$objectTypeID);
+                       UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'collapsedContent-'.$objectTypeID);
                }
                else {
                        $collapsedContent = WCF::getSession()->getVar('collapsedContent');
                        if ($collapsedContent === null || !is_array($collapsedContent)) {
-                               $collapsedContent = array();
+                               $collapsedContent = [];
                        }
                        
                        if (isset($collapsedContent[$objectTypeID])) {
@@ -226,18 +226,18 @@ class UserCollapsibleContentHandler extends SingletonFactory {
                                WHERE           objectTypeID = ?
                                                AND userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array(
+                       $statement->execute([
                                $objectTypeID,
                                WCF::getUser()->userID
-                       ));
+                       ]);
                        
                        // reset storage
-                       UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'collapsedContent-'.$objectTypeID);
+                       UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'collapsedContent-'.$objectTypeID);
                }
                else {
                        $collapsedContent = WCF::getSession()->getVar('collapsedContent');
                        if ($collapsedContent === null || !is_array($collapsedContent)) {
-                               $collapsedContent = array();
+                               $collapsedContent = [];
                        }
                        
                        if (isset($collapsedContent[$objectTypeID])) {
@@ -263,9 +263,9 @@ class UserCollapsibleContentHandler extends SingletonFactory {
                }
                
                $conditionBuilder = new PreparedStatementConditionBuilder();
-               $conditionBuilder->add('objectTypeID = ?', array($objectTypeID));
+               $conditionBuilder->add('objectTypeID = ?', [$objectTypeID]);
                if ($objectID) {
-                       $conditionBuilder->add('objectID = ?', array($objectID));
+                       $conditionBuilder->add('objectID = ?', [$objectID]);
                }
                
                $sql = "DELETE FROM     wcf".WCF_N."_user_collapsible_content
index 7b657e6c8fad7463ff448813ace2c01b1764528c..b64cc1d4385ae0053afd9f75e93c5441bd8ab89d 100644 (file)
@@ -20,7 +20,7 @@ class UserCollapsibleSidebarHandler extends SingletonFactory implements IAJAXInv
         * list of methods allowed for remote invoke
         * @var string[]
         */
-       public static $allowInvoke = array('toggle');
+       public static $allowInvoke = ['toggle'];
        
        /**
         * Toggles a sidebar.
index 7dee2d437bd60cd7bb884f745ebf3109ada7be11..64b3f553899e03119ed5d923c79a38179ff30ea7 100644 (file)
@@ -23,7 +23,7 @@ class UserGroupAssignmentHandler extends SingletonFactory {
         * list of grouped user group assignment condition object types
         * @var array
         */
-       protected $groupedObjectTypes = array();
+       protected $groupedObjectTypes = [];
        
        /**
         * Checks if the users with the given ids should be assigned to new user
@@ -44,7 +44,7 @@ class UserGroupAssignmentHandler extends SingletonFactory {
                $assignments = UserGroupAssignmentCacheBuilder::getInstance()->getData();
                foreach ($userList as $user) {
                        $groupIDs = $user->getGroupIDs();
-                       $newGroupIDs = array();
+                       $newGroupIDs = [];
                        
                        foreach ($assignments as $assignment) {
                                if (in_array($assignment->groupID, $groupIDs) || in_array($assignment->groupID, $newGroupIDs)) {
@@ -66,11 +66,11 @@ class UserGroupAssignmentHandler extends SingletonFactory {
                        }
                        
                        if (!empty($newGroupIDs)) {
-                               $userAction = new UserAction(array($user), 'addToGroups', array(
+                               $userAction = new UserAction([$user], 'addToGroups', [
                                        'addDefaultGroups' => false,
                                        'deleteOldGroups' => false,
                                        'groups' => $newGroupIDs
-                               ));
+                               ]);
                                $userAction->executeAction();
                        }
                }
@@ -94,9 +94,9 @@ class UserGroupAssignmentHandler extends SingletonFactory {
         */
        public function getUsers(UserGroupAssignment $assignment) {
                $userList = new UserList();
-               $userList->getConditionBuilder()->add('user_table.userID NOT IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID = ?)', array(
+               $userList->getConditionBuilder()->add('user_table.userID NOT IN (SELECT userID FROM wcf'.WCF_N.'_user_to_group WHERE groupID = ?)', [
                        $assignment->groupID
-               ));
+               ]);
                
                $conditions = $assignment->getConditions();
                foreach ($conditions as $condition) {
@@ -116,7 +116,7 @@ class UserGroupAssignmentHandler extends SingletonFactory {
                        if (!$objectType->conditiongroup) continue;
                        
                        if (!isset($this->groupedObjectTypes[$objectType->conditiongroup])) {
-                               $this->groupedObjectTypes[$objectType->conditiongroup] = array();
+                               $this->groupedObjectTypes[$objectType->conditiongroup] = [];
                        }
                        
                        $this->groupedObjectTypes[$objectType->conditiongroup][$objectType->objectTypeID] = $objectType;
index e63be983474a0f36b2d1450a02bc90fc91551629..fbc9412a93fdf4853d4f68a52cc0ef4d72e08091 100644 (file)
@@ -38,13 +38,13 @@ class UserNotificationHandler extends SingletonFactory {
         * list of available object types
         * @var array
         */
-       protected $availableObjectTypes = array();
+       protected $availableObjectTypes = [];
        
        /**
         * list of available events
         * @var array
         */
-       protected $availableEvents = array();
+       protected $availableEvents = [];
        
        /**
         * number of outstanding notifications
@@ -56,7 +56,7 @@ class UserNotificationHandler extends SingletonFactory {
         * list of object types
         * @var ObjectType[]
         */
-       protected $objectTypes = array();
+       protected $objectTypes = [];
        
        /**
         * @see \wcf\system\SingletonFactory::init()
@@ -83,7 +83,7 @@ class UserNotificationHandler extends SingletonFactory {
         * @param       integer                         $baseObjectID
         * @throws      SystemException
         */
-       public function fireEvent($eventName, $objectType, IUserNotificationObject $notificationObject, array $recipientIDs, array $additionalData = array(), $baseObjectID = 0) {
+       public function fireEvent($eventName, $objectType, IUserNotificationObject $notificationObject, array $recipientIDs, array $additionalData = [], $baseObjectID = 0) {
                // check given object type and event name
                if (!isset($this->availableEvents[$objectType][$eventName])) {
                        throw new SystemException("Unknown event ".$objectType."-".$eventName." given");
@@ -104,13 +104,13 @@ class UserNotificationHandler extends SingletonFactory {
                        }
                }
                if ($userProfile === null) {
-                       $userProfile = new UserProfile(new User(null, array()));
+                       $userProfile = new UserProfile(new User(null, []));
                }
                
                // set object data
-               $event->setObject(new UserNotification(null, array()), $notificationObject, $userProfile, $additionalData);
+               $event->setObject(new UserNotification(null, []), $notificationObject, $userProfile, $additionalData);
                
-               $parameters = array(
+               $parameters = [
                        'eventName' => $eventName,
                        'objectType' => $objectType,
                        'notificationObject' => $notificationObject,
@@ -120,22 +120,22 @@ class UserNotificationHandler extends SingletonFactory {
                        'objectTypeObject' => $objectTypeObject,
                        'userProfile' => $userProfile,
                        'event' => $event
-               );
+               ];
                EventHandler::getInstance()->fireAction($this, 'fireEvent', $parameters);
                
                // find existing notifications
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($recipientIDs));
-               $conditions->add("eventID = ?", array($event->eventID));
-               $conditions->add("eventHash = ?", array($event->getEventHash()));
-               $conditions->add("confirmTime = ?", array(0));
+               $conditions->add("userID IN (?)", [$recipientIDs]);
+               $conditions->add("eventID = ?", [$event->eventID]);
+               $conditions->add("eventHash = ?", [$event->getEventHash()]);
+               $conditions->add("confirmTime = ?", [0]);
                
                $sql = "SELECT  notificationID, userID
                        FROM    wcf".WCF_N."_user_notification
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $notifications = array();
+               $notifications = [];
                while ($row = $statement->fetchArray()) {
                        $notifications[$row['userID']] = $row['notificationID'];
                }
@@ -143,9 +143,9 @@ class UserNotificationHandler extends SingletonFactory {
                // check if event supports stacking and author should be added
                if (!empty($notifications) && $event->isStackable()) {
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("notificationID IN (?)", array(array_values($notifications)));
+                       $conditions->add("notificationID IN (?)", [array_values($notifications)]);
                        if ($notificationObject->getAuthorID()) {
-                               $conditions->add("authorID = ?", array($notificationObject->getAuthorID()));
+                               $conditions->add("authorID = ?", [$notificationObject->getAuthorID()]);
                        }
                        else {
                                $conditions->add("authorID IS NULL");
@@ -176,11 +176,11 @@ class UserNotificationHandler extends SingletonFactory {
                                
                                WCF::getDB()->beginTransaction();
                                foreach ($notificationIDs as $notificationID) {
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                1,
                                                $notificationObject->getAuthorID() ? 0 : 1,
                                                $notificationID
-                                       ));
+                                       ]);
                                }
                                WCF::getDB()->commitTransaction();
                        }
@@ -193,14 +193,14 @@ class UserNotificationHandler extends SingletonFactory {
                
                // get recipients
                $recipientList = new UserNotificationEventRecipientList();
-               $recipientList->getConditionBuilder()->add('event_to_user.eventID = ?', array($event->eventID));
-               $recipientList->getConditionBuilder()->add('event_to_user.userID IN (?)', array($recipientIDs));
+               $recipientList->getConditionBuilder()->add('event_to_user.eventID = ?', [$event->eventID]);
+               $recipientList->getConditionBuilder()->add('event_to_user.userID IN (?)', [$recipientIDs]);
                $recipientList->readObjects();
                $recipients = $recipientList->getObjects();
                if (!empty($recipients)) {
-                       $data = array(
+                       $data = [
                                'authorID' => ($event->getAuthorID() ?: null),
-                               'data' => array(
+                               'data' => [
                                        'eventID' => $event->eventID,
                                        'authorID' => ($event->getAuthorID() ?: null),
                                        'objectID' => $notificationObject->getObjectID(),
@@ -210,18 +210,18 @@ class UserNotificationHandler extends SingletonFactory {
                                        'mailNotified' => ($event->supportsEmailNotification() ? 0 : 1),
                                        'time' => TIME_NOW,
                                        'additionalData' => serialize($additionalData)
-                               ),
+                               ],
                                'recipients' => $recipients
-                       );
+                       ];
                        
                        if ($event->isStackable()) {
                                $data['notifications'] = $notifications;
                                
-                               $action = new UserNotificationAction(array(), 'createStackable', $data);
+                               $action = new UserNotificationAction([], 'createStackable', $data);
                        }
                        else {
                                $data['data']['timesTriggered'] = 1;
-                               $action = new UserNotificationAction(array(), 'createDefault', $data);
+                               $action = new UserNotificationAction([], 'createDefault', $data);
                        }
                        
                        $result = $action->executeAction();
@@ -263,10 +263,10 @@ class UserNotificationHandler extends SingletonFactory {
                                                WHERE   userID = ?
                                                        AND confirmTime = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                       $statement->execute(array(
+                                       $statement->execute([
                                                WCF::getUser()->userID,
                                                0
-                                       ));
+                                       ]);
                                        
                                        $this->notificationCount = $statement->fetchSingleColumn();
                                        
@@ -292,7 +292,7 @@ class UserNotificationHandler extends SingletonFactory {
                        FROM    wcf".WCF_N."_user_notification
                        WHERE   userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(WCF::getUser()->userID));
+               $statement->execute([WCF::getUser()->userID]);
                
                return $statement->fetchSingleColumn();
        }
@@ -320,7 +320,7 @@ class UserNotificationHandler extends SingletonFactory {
        public function getMixedNotifications() {
                $notificationCount = $this->getNotificationCount(true);
                
-               $notifications = array();
+               $notifications = [];
                if ($notificationCount > 0) {
                        $notifications = $this->fetchNotifications(5, 0, 0);
                }
@@ -349,16 +349,16 @@ class UserNotificationHandler extends SingletonFactory {
        protected function fetchNotifications($limit, $offset, $filterByConfirmed = null) {
                // build enormous query
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("notification.userID = ?", array(WCF::getUser()->userID));
+               $conditions->add("notification.userID = ?", [WCF::getUser()->userID]);
                
                if ($filterByConfirmed !== null) {
                        // consider only unconfirmed notifications
                        if ($filterByConfirmed == 0) {
-                               $conditions->add("notification.confirmTime = ?", array(0));
+                               $conditions->add("notification.confirmTime = ?", [0]);
                        }
                        else {
                                // consider only notifications marked as confirmed in the past 48 hours (86400 = 1 day)
-                               $conditions->add("notification.confirmTime >= ?", array(TIME_NOW - (2 * 86400)));
+                               $conditions->add("notification.confirmTime >= ?", [TIME_NOW - (2 * 86400)]);
                        }
                }
                
@@ -373,7 +373,7 @@ class UserNotificationHandler extends SingletonFactory {
                $statement = WCF::getDB()->prepareStatement($sql, $limit, $offset);
                $statement->execute($conditions->getParameters());
                
-               $notifications = array();
+               $notifications = [];
                while ($notification = $statement->fetchObject('\wcf\data\user\notification\UserNotification')) {
                        $notifications[$notification->notificationID] = $notification;
                }
@@ -390,21 +390,21 @@ class UserNotificationHandler extends SingletonFactory {
        public function processNotifications(array $notificationObjects) {
                // return an empty set if no notifications exist
                if (empty($notificationObjects)) {
-                       return array(
+                       return [
                                'count' => 0,
-                               'notifications' => array()
-                       );
+                               'notifications' => []
+                       ];
                }
                
-               $eventIDs = $notificationIDs = $objectTypes = array();
+               $eventIDs = $notificationIDs = $objectTypes = [];
                foreach ($notificationObjects as $notification) {
                        // cache object types
                        if (!isset($objectTypes[$notification->objectType])) {
-                               $objectTypes[$notification->objectType] = array(
+                               $objectTypes[$notification->objectType] = [
                                        'objectType' => $this->availableObjectTypes[$notification->objectType],
-                                       'objectIDs' => array(),
-                                       'objects' => array()
-                               );
+                                       'objectIDs' => [],
+                                       'objects' => []
+                               ];
                        }
                        
                        $objectTypes[$notification->objectType]['objectIDs'][] = $notification->objectID;
@@ -414,21 +414,21 @@ class UserNotificationHandler extends SingletonFactory {
                
                // load authors
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("notificationID IN (?)", array($notificationIDs));
+               $conditions->add("notificationID IN (?)", [$notificationIDs]);
                $sql = "SELECT          notificationID, authorID
                        FROM            wcf".WCF_N."_user_notification_author
                        ".$conditions."
                        ORDER BY        time ASC";
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $authorIDs = $authorToNotification = array();
+               $authorIDs = $authorToNotification = [];
                while ($row = $statement->fetchArray()) {
                        if ($row['authorID']) {
                                $authorIDs[] = $row['authorID'];
                        }
                        
                        if (!isset($authorToNotification[$row['notificationID']])) {
-                               $authorToNotification[$row['notificationID']] = array();
+                               $authorToNotification[$row['notificationID']] = [];
                        }
                        
                        $authorToNotification[$row['notificationID']][] = $row['authorID'];
@@ -436,7 +436,7 @@ class UserNotificationHandler extends SingletonFactory {
                
                // load authors
                $authors = UserProfile::getUserProfiles($authorIDs);
-               $unknownAuthor = new UserProfile(new User(null, array('userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest'))));
+               $unknownAuthor = new UserProfile(new User(null, ['userID' => null, 'username' => WCF::getLanguage()->get('wcf.user.guest')]));
                
                // load objects associated with each object type
                foreach ($objectTypes as $objectType => $objectData) {
@@ -445,13 +445,13 @@ class UserNotificationHandler extends SingletonFactory {
                
                // load required events
                $eventList = new UserNotificationEventList();
-               $eventList->getConditionBuilder()->add("user_notification_event.eventID IN (?)", array($eventIDs));
+               $eventList->getConditionBuilder()->add("user_notification_event.eventID IN (?)", [$eventIDs]);
                $eventList->readObjects();
                $eventObjects = $eventList->getObjects();
                
                // build notification data
-               $notifications = array();
-               $deleteNotifications = array();
+               $notifications = [];
+               $deleteNotifications = [];
                foreach ($notificationObjects as $notification) {
                        $object = $objectTypes[$notification->objectType]['objects'][$notification->objectID];
                        if ($object->__unknownNotificationObject) {
@@ -469,7 +469,7 @@ class UserNotificationHandler extends SingletonFactory {
                        );
                        
                        if (isset($authorToNotification[$notification->notificationID])) {
-                               $eventAuthors = array();
+                               $eventAuthors = [];
                                foreach ($authorToNotification[$notification->notificationID] as $userID) {
                                        if (!$userID) {
                                                $eventAuthors[0] = $unknownAuthor;
@@ -483,12 +483,12 @@ class UserNotificationHandler extends SingletonFactory {
                                }
                        }
                        
-                       $data = array(
+                       $data = [
                                'authors' => count($class->getAuthors()),
                                'event' => $class,
                                'notificationID' => $notification->notificationID,
                                'time' => $notification->time
-                       );
+                       ];
                        
                        $data['confirmed'] = ($notification->confirmTime > 0);
                        
@@ -511,13 +511,13 @@ class UserNotificationHandler extends SingletonFactory {
                        $notificationAction->executeAction();
                        
                        // reset notification counter
-                       UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'userNotificationCount');
+                       UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'userNotificationCount');
                }
                
-               return array(
+               return [
                        'count' => count($notifications),
                        'notifications' => $notifications
-               );
+               ];
        }
        
        /**
@@ -540,7 +540,7 @@ class UserNotificationHandler extends SingletonFactory {
         * @return      IUserNotificationEvent[]
         */
        public function getEvents($objectType) {
-               if (!isset($this->availableEvents[$objectType])) return array();
+               if (!isset($this->availableEvents[$objectType])) return [];
                
                return $this->availableEvents[$objectType];
        }
@@ -561,10 +561,10 @@ class UserNotificationHandler extends SingletonFactory {
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("eventID = ?", array($eventID));
-               $conditions->add("objectID = ?", array($objectID));
-               if ($authorID !== null) $conditions->add("authorID = ?", array($authorID));
-               if ($time !== null) $conditions->add("time = ?", array($time));
+               $conditions->add("eventID = ?", [$eventID]);
+               $conditions->add("objectID = ?", [$objectID]);
+               if ($authorID !== null) $conditions->add("authorID = ?", [$authorID]);
+               if ($time !== null) $conditions->add("time = ?", [$time]);
                
                $sql = "SELECT  notificationID
                        FROM    wcf".WCF_N."_user_notification
@@ -639,9 +639,9 @@ class UserNotificationHandler extends SingletonFactory {
                $event->setLanguage($user->getLanguage());
                
                // add mail header
-               $message = $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.header', array(
+               $message = $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.header', [
                        'user' => $user
-               ))."\n\n";
+                       ])."\n\n";
                
                // get message
                $message .= $event->getEmailMessage();
@@ -650,18 +650,18 @@ class UserNotificationHandler extends SingletonFactory {
                $token = $user->notificationMailToken;
                if (!$token) {
                        // generate token if not present
-                       $token = mb_substr(StringUtil::getHash(serialize(array($user->userID, StringUtil::getRandomID()))), 0, 20);
+                       $token = mb_substr(StringUtil::getHash(serialize([$user->userID, StringUtil::getRandomID()])), 0, 20);
                        $editor = new UserEditor($user);
-                       $editor->update(array('notificationMailToken' => $token));
+                       $editor->update(['notificationMailToken' => $token]);
                }
-               $message .= "\n\n".$user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.footer', array(
+               $message .= "\n\n".$user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.footer', [
                        'user' => $user,
                        'token' => $token,
                        'notification' => $notification
-               ));
+                       ]);
                
                // build mail
-               $mail = new Mail(array($user->username => $user->email), $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.subject', array('title' => $event->getEmailTitle())), $message);
+               $mail = new Mail([$user->username => $user->email], $user->getLanguage()->getDynamicVariable('wcf.user.notification.mail.subject', ['title' => $event->getEmailTitle()]), $message);
                $mail->setLanguage($user->getLanguage());
                $mail->send();
        }
@@ -680,7 +680,7 @@ class UserNotificationHandler extends SingletonFactory {
         * @param       integer[]       $recipientIDs
         * @param       integer[]       $objectIDs
         */
-       public function deleteNotifications($eventName, $objectType, array $recipientIDs, array $objectIDs = array()) {
+       public function deleteNotifications($eventName, $objectType, array $recipientIDs, array $objectIDs = []) {
                $this->markAsConfirmed($eventName, $objectType, $recipientIDs, $objectIDs);
        }
        
@@ -703,15 +703,15 @@ class UserNotificationHandler extends SingletonFactory {
                        FROM    wcf".WCF_N."_user_notification_event
                        WHERE   objectTypeID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(
+               $statement->execute([
                        $objectTypeObj->objectTypeID
-               ));
+               ]);
                $eventIDs = $statement->fetchAll(\PDO::FETCH_COLUMN);
                
                if (!empty($eventIDs)) {
                        $conditions = new PreparedStatementConditionBuilder();
-                       $conditions->add("eventID IN (?)", array($eventIDs));
-                       $conditions->add("objectID IN (?)", array($objectIDs));
+                       $conditions->add("eventID IN (?)", [$eventIDs]);
+                       $conditions->add("objectID IN (?)", [$objectIDs]);
                        
                        $sql = "SELECT  userID
                                FROM    wcf".WCF_N."_user_notification
@@ -742,7 +742,7 @@ class UserNotificationHandler extends SingletonFactory {
         * @param       integer[]       $objectIDs
         * @throws      SystemException
         */
-       public function markAsConfirmed($eventName, $objectType, array $recipientIDs, array $objectIDs = array()) {
+       public function markAsConfirmed($eventName, $objectType, array $recipientIDs, array $objectIDs = []) {
                // check given object type and event name
                if (!isset($this->availableEvents[$objectType][$eventName])) {
                        throw new SystemException("Unknown event ".$objectType."-".$eventName." given");
@@ -753,9 +753,9 @@ class UserNotificationHandler extends SingletonFactory {
                
                // mark as confirmed
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("eventID = ?", array($event->eventID));
-               if (!empty($recipientIDs)) $conditions->add("userID IN (?)", array($recipientIDs));
-               if (!empty($objectIDs)) $conditions->add("objectID IN (?)", array($objectIDs));
+               $conditions->add("eventID = ?", [$event->eventID]);
+               if (!empty($recipientIDs)) $conditions->add("userID IN (?)", [$recipientIDs]);
+               if (!empty($objectIDs)) $conditions->add("objectID IN (?)", [$objectIDs]);
                
                $sql = "UPDATE  wcf".WCF_N."_user_notification
                        SET     confirmTime = ?
@@ -773,7 +773,7 @@ class UserNotificationHandler extends SingletonFactory {
                                                WHERE   confirmTime = ?
                                        )";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array(0));
+               $statement->execute([0]);
                
                // reset storage
                if (!empty($recipientIDs)) {
@@ -790,7 +790,7 @@ class UserNotificationHandler extends SingletonFactory {
         * @param       integer         $notificationID
         */
        public function markAsConfirmedByID($notificationID) {
-               $this->markAsConfirmedByIDs(array($notificationID));
+               $this->markAsConfirmedByIDs([$notificationID]);
        }
        
        /**
@@ -804,7 +804,7 @@ class UserNotificationHandler extends SingletonFactory {
                }
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("notificationID IN (?)", array($notificationIDs));
+               $conditions->add("notificationID IN (?)", [$notificationIDs]);
                
                // mark notifications as confirmed
                $sql = "UPDATE  wcf".WCF_N."_user_notification
@@ -822,7 +822,7 @@ class UserNotificationHandler extends SingletonFactory {
                $statement->execute($conditions->getParameters());
                
                // reset user storage
-               UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'userNotificationCount');
+               UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'userNotificationCount');
        }
        
        /**
@@ -842,7 +842,7 @@ class UserNotificationHandler extends SingletonFactory {
                        WHERE   eventID = ?
                                AND userID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($event->eventID, WCF::getUser()->userID));
+               $statement->execute([$event->eventID, WCF::getUser()->userID]);
                $row = $statement->fetchArray();
                if ($row === false) return false;
                return $row['mailNotificationType'];
index ca4c8c491ee3bf488ce04324a02861825507f65e..72a90d37f284c0c80cced01a3d44fabce22396e7 100644 (file)
@@ -18,7 +18,7 @@ abstract class AbstractSharedUserNotificationEvent extends AbstractUserNotificat
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::setObject()
         */
-       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = array()) {
+       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = []) {
                parent::setObject($notification, $object, $author, $additionalData);
                
                $this->prepare();
index a42ef85ed6bbb7fd4403e8b19b021fca6aa8cb7d..e02a42e10970f2a3c52fe119799b712c5f5504c1 100644 (file)
@@ -103,7 +103,7 @@ interface IUserNotificationEvent extends IDatabaseObjectProcessor {
         * @param       \wcf\data\user\UserProfile                                      $author
         * @param       mixed[]                                                         $additionalData
         */
-       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = array());
+       public function setObject(UserNotification $notification, IUserNotificationObject $object, UserProfile $author, array $additionalData = []);
        
        /**
         * Sets the language for the event
index 929177e318b479462591aabd6d65604ee6a21e54..f0675090e28270e15ba1fb7a0464ea4e87839519 100644 (file)
@@ -24,7 +24,7 @@ class UserFollowFollowingUserNotificationEvent extends AbstractUserNotificationE
        public function getTitle() {
                $count = count($this->getAuthors());
                if ($count > 1) {
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.title.stacked', array('count' => $count));
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.title.stacked', ['count' => $count]);
                }
                
                return $this->getLanguage()->get('wcf.user.notification.follow.title');
@@ -38,15 +38,15 @@ class UserFollowFollowingUserNotificationEvent extends AbstractUserNotificationE
                $count = count($authors);
                
                if ($count > 1) {
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.message.stacked', array(
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.message.stacked', [
                                'author' => $this->author,
                                'authors' => $authors,
                                'count' => $count,
                                'others' => $count - 1
-                       ));
+                       ]);
                }
                
-               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.message', array('author' => $this->author));
+               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.message', ['author' => $this->author]);
        }
        
        /**
@@ -57,23 +57,23 @@ class UserFollowFollowingUserNotificationEvent extends AbstractUserNotificationE
                $count = count($authors);
                
                if ($count > 1) {
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.mail.stacked', array(
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.mail.stacked', [
                                'author' => $this->author,
                                'authors' => $authors,
                                'count' => $count,
                                'others' => $count - 1,
                                'notificationType' => $notificationType
-                       ));
+                       ]);
                }
                
-               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.mail', array('author' => $this->author));
+               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.follow.mail', ['author' => $this->author]);
        }
        
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
         */
        public function getLink() {
-               return LinkHandler::getInstance()->getLink('User', array('object' => $this->author));
+               return LinkHandler::getInstance()->getLink('User', ['object' => $this->author]);
        }
        
        /**
index 76c5646e55d4cd5bbe4825557a388c651b8b4ec9..a22e22a08fd4d2f0533931ac0716322d0a2d4de1 100644 (file)
@@ -25,10 +25,10 @@ class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEv
        public function getTitle() {
                $count = count($this->getAuthors());
                if ($count > 1) {
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.title.stacked', array(
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.title.stacked', [
                                'count' => $count,
                                'timesTriggered' => $this->notification->timesTriggered
-                       ));
+                       ]);
                }
                
                return $this->getLanguage()->get('wcf.user.notification.comment.title');
@@ -45,18 +45,18 @@ class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEv
                        }
                        $count = count($authors);
                        
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message.stacked', array(
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message.stacked', [
                                'author' => $this->author,
                                'authors' => array_values($authors),
                                'count' => $count,
                                'others' => $count - 1,
                                'guestTimesTriggered' => $this->notification->guestTimesTriggered
-                       ));
+                       ]);
                }
                
-               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message', array(
+               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.message', [
                        'author' => $this->author
-               ));
+               ]);
        }
        
        /**
@@ -72,7 +72,7 @@ class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEv
                        }
                        $count = count($authors);
                        
-                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail.stacked', array(
+                       return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail.stacked', [
                                'author' => $this->author,
                                'authors' => array_values($authors),
                                'count' => $count,
@@ -80,22 +80,22 @@ class UserProfileCommentUserNotificationEvent extends AbstractUserNotificationEv
                                'owner' => $user,
                                'notificationType' => $notificationType,
                                'guestTimesTriggered' => $this->notification->guestTimesTriggered
-                       ));
+                       ]);
                }
                
-               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail', array(
+               return $this->getLanguage()->getDynamicVariable('wcf.user.notification.comment.mail', [
                        'comment' => $this->userNotificationObject,
                        'author' => $this->author,
                        'owner' => $user,
                        'notificationType' => $notificationType
-               ));
+               ]);
        }
        
        /**
         * @see \wcf\system\user\notification\event\IUserNotificationEvent::getLink()
         */
        public function getLink() {
-               return LinkHandler::getInstance()->getLink('User', array('id' => $this->userNotificationObject->objectID), '#wall');
+               return LinkHandler::getInstance()->getLink('User', ['id' => $this->userNotificationObject->objectID], '#wall');
        }
        
        /**
index f3190646ce67d3e576d21d2e6afe1c589dbd1d6a..fcd221d607409c1e9282a97335110d0e4922c7a4 100644 (file)
@@ -35,7 +35,7 @@ class AbstractUserNotificationObjectType extends AbstractObjectTypeProcessor imp
         * @see \wcf\system\user\notification\object\type\IUserNotificationObjectType::getObjectsByIDs()
         */
        public function getObjectsByIDs(array $objectIDs) {
-               $indexName = call_user_func(array(static::$objectClassName, 'getDatabaseTableIndexName'));
+               $indexName = call_user_func([static::$objectClassName, 'getDatabaseTableIndexName']);
                
                $objectList = new static::$objectListClassName();
                $objectList->setObjectIDs($objectIDs);
@@ -50,10 +50,10 @@ class AbstractUserNotificationObjectType extends AbstractObjectTypeProcessor imp
                                // '__unknownNotificationObject' tells the notification API
                                // that the object does not exist anymore so that the related
                                // notification can be deleted automatically
-                               $objects[$objectID] = new static::$decoratorClassName(new static::$objectClassName(null, array(
+                               $objects[$objectID] = new static::$decoratorClassName(new static::$objectClassName(null, [
                                        '__unknownNotificationObject' => true,
                                        $indexName => $objectID
-                               )));
+                               ]));
                        }
                }
                
index acf0daee171029246d09680e40729148cef379bc..49f3328bf0fb20a75e31c61231aaaf0f15b1031d 100644 (file)
@@ -36,7 +36,7 @@ class UserProfileCommentUserNotificationObjectType extends AbstractUserNotificat
                        FROM    wcf".WCF_N."_comment
                        WHERE   commentID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($objectID));
+               $statement->execute([$objectID]);
                $row = $statement->fetchArray();
                
                return ($row ? $row['objectID'] : 0);
index a648c512e8cabaee796e0ad302111d647db2e03e..2da52f388f94131efb3b9d21d3263e47f2cd37e9 100644 (file)
@@ -39,7 +39,7 @@ class UserObjectWatchHandler extends SingletonFactory {
         * @see \wcf\system\user\object\watch\UserObjectWatchHandler::resetObjects();
         */
        public function resetObject($objectType, $objectID) {
-               $this->resetObjects($objectType, array($objectID));
+               $this->resetObjects($objectType, [$objectID]);
        }
        
        /**
@@ -54,8 +54,8 @@ class UserObjectWatchHandler extends SingletonFactory {
                
                // get subscriber
                $conditionsBuilder = new PreparedStatementConditionBuilder();
-               $conditionsBuilder->add('objectTypeID = ?', array($objectTypeObj->objectTypeID));
-               $conditionsBuilder->add('objectID IN (?)', array($objectIDs));
+               $conditionsBuilder->add('objectTypeID = ?', [$objectTypeObj->objectTypeID]);
+               $conditionsBuilder->add('objectID IN (?)', [$objectIDs]);
                $sql = "SELECT          userID
                        FROM            wcf".WCF_N."_user_object_watch
                        ".$conditionsBuilder;
@@ -76,15 +76,15 @@ class UserObjectWatchHandler extends SingletonFactory {
         * @param       integer[]       $objectIDs
         * @param       integer[]       $userIDs
         */
-       public function deleteObjects($objectType, array $objectIDs, array $userIDs = array()) {
+       public function deleteObjects($objectType, array $objectIDs, array $userIDs = []) {
                // get object type id
                $objectTypeObj = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.objectWatch', $objectType);
                
                // delete objects
                $conditionsBuilder = new PreparedStatementConditionBuilder();
-               $conditionsBuilder->add('objectTypeID = ?', array($objectTypeObj->objectTypeID));
-               $conditionsBuilder->add('objectID IN (?)', array($objectIDs));
-               if (!empty($userIDs)) $conditionsBuilder->add('userID IN (?)', array($userIDs));
+               $conditionsBuilder->add('objectTypeID = ?', [$objectTypeObj->objectTypeID]);
+               $conditionsBuilder->add('objectID IN (?)', [$objectIDs]);
+               if (!empty($userIDs)) $conditionsBuilder->add('userID IN (?)', [$userIDs]);
                
                $sql = "DELETE FROM     wcf".WCF_N."_user_object_watch
                        ".$conditionsBuilder;
@@ -102,18 +102,18 @@ class UserObjectWatchHandler extends SingletonFactory {
         * @param       IUserNotificationObject         $notificationObject
         * @param       array                           $additionalData
         */
-       public function updateObject($objectType, $objectID, $notificationEventName, $notificationObjectType, IUserNotificationObject $notificationObject, array $additionalData = array()) {
+       public function updateObject($objectType, $objectID, $notificationEventName, $notificationObjectType, IUserNotificationObject $notificationObject, array $additionalData = []) {
                // get object type id
                $objectTypeObj = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.objectWatch', $objectType);
                
                // get subscriber
-               $userIDs = $recipientIDs = array();
+               $userIDs = $recipientIDs = [];
                $sql = "SELECT          userID, notification
                        FROM            wcf".WCF_N."_user_object_watch
                        WHERE           objectTypeID = ?
                                        AND objectID = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($objectTypeObj->objectTypeID, $objectID));
+               $statement->execute([$objectTypeObj->objectTypeID, $objectID]);
                while ($row = $statement->fetchArray()) {
                        $userIDs[] = $row['userID'];
                        if ($row['notification'] && $notificationObject->getAuthorID() != $row['userID']) $recipientIDs[] = $row['userID'];
index f38f217d2dd32195c64d3c73640938f9ef313856..e8f05bb2b6bb737f4825fc5fabcae436a0129bfe 100644 (file)
@@ -21,7 +21,7 @@ class UserLocation implements IUserOnlineLocation {
         * user ids
         * @var integer[]
         */
-       protected $userIDs = array();
+       protected $userIDs = [];
        
        /**
         * list of users
@@ -48,14 +48,14 @@ class UserLocation implements IUserOnlineLocation {
                        return '';
                }
                
-               return WCF::getLanguage()->getDynamicVariable($languageVariable, array('user' => $this->users[$user->objectID]));
+               return WCF::getLanguage()->getDynamicVariable($languageVariable, ['user' => $this->users[$user->objectID]]);
        }
        
        /**
         * Loads the users.
         */
        protected function readUsers() {
-               $this->users = array();
+               $this->users = [];
                
                if (empty($this->userIDs)) return;
                $this->userIDs = array_unique($this->userIDs);
index e7d0559bbb62296f01719fb86a39e7716f4cf3b7..1894240f9c9c06040b42f5f29b2dce707da5da43 100644 (file)
@@ -19,7 +19,7 @@ class SignatureCache extends SingletonFactory {
         * cached signatures
         * @var string
         */
-       protected $signatures = array();
+       protected $signatures = [];
        
        /**
         * Returns a parsed user signature.
index d1b661fc8ebd9e3301c3bfaf0a73b9c3894854af..89b4d74cfc9d7bf4d657c3d9b738c8ff76f06fed 100644 (file)
@@ -19,19 +19,19 @@ class UserStorageHandler extends SingletonFactory {
         * data cache
         * @var mixed[][]
         */
-       protected $cache = array();
+       protected $cache = [];
        
        /**
         * list of outdated data records
         * @var mixed[][]
         */
-       protected $resetFields = array();
+       protected $resetFields = [];
        
        /**
         * list of updated or new data records
         * @var mixed[][]
         */
-       protected $updateFields = array();
+       protected $updateFields = [];
        
        /**
         * Loads storage for a given set of users.
@@ -39,7 +39,7 @@ class UserStorageHandler extends SingletonFactory {
         * @param       integer[]       $userIDs
         */
        public function loadStorage(array $userIDs) {
-               $tmp = array();
+               $tmp = [];
                foreach ($userIDs as $userID) {
                        if (!isset($this->cache[$userID])) $tmp[] = $userID;
                }
@@ -48,7 +48,7 @@ class UserStorageHandler extends SingletonFactory {
                if (empty($tmp)) return;
                
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($tmp));
+               $conditions->add("userID IN (?)", [$tmp]);
                
                $sql = "SELECT  *
                        FROM    wcf".WCF_N."_user_storage
@@ -57,7 +57,7 @@ class UserStorageHandler extends SingletonFactory {
                $statement->execute($conditions->getParameters());
                while ($row = $statement->fetchArray()) {
                        if (!isset($this->cache[$row['userID']])) {
-                               $this->cache[$row['userID']] = array();
+                               $this->cache[$row['userID']] = [];
                        }
                        
                        $this->cache[$row['userID']][$row['field']] = $row['fieldValue'];
@@ -72,7 +72,7 @@ class UserStorageHandler extends SingletonFactory {
         * @return      mixed[]
         */
        public function getStorage(array $userIDs, $field) {
-               $data = array();
+               $data = [];
                
                foreach ($userIDs as $userID) {
                        if (isset($this->cache[$userID][$field])) {
@@ -109,7 +109,7 @@ class UserStorageHandler extends SingletonFactory {
                
                // make sure stored data is loaded
                if (!isset($this->cache[$userID])) {
-                       $this->loadStorage(array($userID));
+                       $this->loadStorage([$userID]);
                }
                
                if (isset($this->cache[$userID][$field])) {
@@ -160,7 +160,7 @@ class UserStorageHandler extends SingletonFactory {
                $sql = "DELETE FROM     wcf".WCF_N."_user_storage
                        WHERE           field = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($field));
+               $statement->execute([$field]);
                
                foreach ($this->cache as $userID => $fields) {
                        if (isset($fields[$field])) {
@@ -173,18 +173,18 @@ class UserStorageHandler extends SingletonFactory {
         * Removes and inserts data records on shutdown.
         */
        public function shutdown() {
-               $toReset = array();
+               $toReset = [];
                
                // remove outdated entries
                foreach ($this->resetFields as $userID => $fields) {
                        foreach ($fields as $field) {
-                               if (!isset($toReset[$field])) $toReset[$field] = array();
+                               if (!isset($toReset[$field])) $toReset[$field] = [];
                                $toReset[$field][] = $userID;
                        }
                }
                foreach ($this->updateFields as $userID => $fieldValues) {
                        foreach ($fieldValues as $field => $fieldValue) {
-                               if (!isset($toReset[$field])) $toReset[$field] = array();
+                               if (!isset($toReset[$field])) $toReset[$field] = [];
                                $toReset[$field][] = $userID;
                        }
                }
@@ -215,8 +215,8 @@ class UserStorageHandler extends SingletonFactory {
                                foreach ($toReset as $field => $userIDs) {
                                        sort($userIDs);
                                        $conditions = new PreparedStatementConditionBuilder();
-                                       $conditions->add("userID IN (?)", array($userIDs));
-                                       $conditions->add("field = ?", array($field));
+                                       $conditions->add("userID IN (?)", [$userIDs]);
+                                       $conditions->add("field = ?", [$field]);
 
                                        $sql = "DELETE FROM     wcf".WCF_N."_user_storage
                                                ".$conditions;
@@ -235,11 +235,11 @@ class UserStorageHandler extends SingletonFactory {
                                                ksort($fieldValues);
                                                
                                                foreach ($fieldValues as $field => $fieldValue) {
-                                                       $statement->execute(array(
+                                                       $statement->execute([
                                                                $userID,
                                                                $field,
                                                                $fieldValue
-                                                       ));
+                                                       ]);
                                                }
                                        }
                                }
@@ -259,14 +259,14 @@ class UserStorageHandler extends SingletonFactory {
                                usleep(mt_rand(0, .1e6)); // 0 to .1 seconds
                        }
                }
-               $this->resetFields = $this->updateFields = array();
+               $this->resetFields = $this->updateFields = [];
        }
        
        /**
         * Removes the entire user storage data.
         */
        public function clear() {
-               $this->resetFields = $this->updateFields = array();
+               $this->resetFields = $this->updateFields = [];
                
                $sql = "DELETE FROM     wcf".WCF_N."_user_storage";
                $statement = WCF::getDB()->prepareStatement($sql);
index 7c1a9a2c5fdec0cd095c634cc9b7774c898f1a93..f11f695c46c92b3c10ec561985ada069e639f9a8 100644 (file)
@@ -27,7 +27,7 @@ class VisitTracker extends SingletonFactory {
         * list of available object types
         * @var array
         */
-       protected $availableObjectTypes = array();
+       protected $availableObjectTypes = [];
        
        /**
         * user visits
@@ -73,12 +73,12 @@ class VisitTracker extends SingletonFactory {
                                
                                // cache does not exist or is outdated
                                if ($data === null) {
-                                       $this->userVisits = array();
+                                       $this->userVisits = [];
                                        $sql = "SELECT  objectTypeID, visitTime
                                                FROM    wcf".WCF_N."_tracked_visit_type
                                                WHERE   userID = ?";
                                        $statement = WCF::getDB()->prepareStatement($sql);
-                                       $statement->execute(array(WCF::getUser()->userID));
+                                       $statement->execute([WCF::getUser()->userID]);
                                        while ($row = $statement->fetchArray()) {
                                                $this->userVisits[$row['objectTypeID']] = $row['visitTime'];
                                        }
@@ -95,7 +95,7 @@ class VisitTracker extends SingletonFactory {
                        }
                        
                        if (!$this->userVisits) {
-                               $this->userVisits = array();
+                               $this->userVisits = [];
                        }
                }
                
@@ -125,7 +125,7 @@ class VisitTracker extends SingletonFactory {
                                        AND objectID = ?
                                        AND userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->getObjectTypeID($objectType), $objectID, WCF::getUser()->userID));
+                       $statement->execute([$this->getObjectTypeID($objectType), $objectID, WCF::getUser()->userID]);
                        $row = $statement->fetchArray();
                        if ($row) return $row['visitTime'];
                }
@@ -149,7 +149,7 @@ class VisitTracker extends SingletonFactory {
                                WHERE           objectTypeID = ?
                                                AND userID = ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->getObjectTypeID($objectType), WCF::getUser()->userID));
+                       $statement->execute([$this->getObjectTypeID($objectType), WCF::getUser()->userID]);
                }
        }
        
@@ -167,7 +167,7 @@ class VisitTracker extends SingletonFactory {
                                                (objectTypeID, objectID, userID, visitTime)
                                VALUES          (?, ?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->getObjectTypeID($objectType), $objectID, WCF::getUser()->userID, $time));
+                       $statement->execute([$this->getObjectTypeID($objectType), $objectID, WCF::getUser()->userID, $time]);
                }
                else {
                        WCF::getSession()->register('trackedUserVisit_'.$this->getObjectTypeID($objectType).'_'.$objectID, $time);
@@ -187,7 +187,7 @@ class VisitTracker extends SingletonFactory {
                                                (objectTypeID, userID, visitTime)
                                VALUES          (?, ?, ?)";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->getObjectTypeID($objectType), WCF::getUser()->userID, $time));
+                       $statement->execute([$this->getObjectTypeID($objectType), WCF::getUser()->userID, $time]);
                        
                        // delete obsolete object visits
                        $sql = "DELETE FROM     wcf".WCF_N."_tracked_visit
@@ -195,10 +195,10 @@ class VisitTracker extends SingletonFactory {
                                                AND userID = ?
                                                AND visitTime <= ?";
                        $statement = WCF::getDB()->prepareStatement($sql);
-                       $statement->execute(array($this->getObjectTypeID($objectType), WCF::getUser()->userID, $time));
+                       $statement->execute([$this->getObjectTypeID($objectType), WCF::getUser()->userID, $time]);
                        
                        // reset storage
-                       UserStorageHandler::getInstance()->reset(array(WCF::getUser()->userID), 'trackedUserVisits');
+                       UserStorageHandler::getInstance()->reset([WCF::getUser()->userID], 'trackedUserVisits');
                }
                else {
                        $this->getVisitTime($objectType);
index 5cf882a94aab1e5e7646a27eefb6fbfd7be46370..849fcf8d05f2ec41c9189610484a91e58e14e4a1 100644 (file)
@@ -49,7 +49,7 @@ abstract class AbstractRebuildDataWorker extends AbstractWorker implements IRebu
         * @see \wcf\system\worker\IWorker::validate()
         */
        public function validate() {
-               WCF::getSession()->checkPermissions(array('admin.management.canRebuildData'));
+               WCF::getSession()->checkPermissions(['admin.management.canRebuildData']);
        }
        
        /**
index d52fe8bea9832f0fb39088cdc0854dcd2fc338e8..bedfb3fe80c9e960f7a4a62633696b559edef9e2 100644 (file)
@@ -34,7 +34,7 @@ abstract class AbstractWorker implements IWorker {
         * list of additional parameters
         * @var array
         */
-       protected $parameters = array();
+       protected $parameters = [];
        
        /**
         * @see \wcf\system\worker\IWorker::__construct()
index c3d9d64518f558db3a395a7d2842627288a5353e..b2bd1183911961f444368e0d9b205696b1e30799 100644 (file)
@@ -31,7 +31,7 @@ class AttachmentRebuildDataWorker extends AbstractRebuildDataWorker {
                parent::initObjectList();
                
                $this->objectList->sqlOrderBy = 'attachment.attachmentID';
-               $this->objectList->getConditionBuilder()->add('attachment.isImage = ?', array(1));
+               $this->objectList->getConditionBuilder()->add('attachment.isImage = ?', [1]);
        }
        
        /**
@@ -42,7 +42,7 @@ class AttachmentRebuildDataWorker extends AbstractRebuildDataWorker {
                
                foreach ($this->objectList as $attachment) {
                        try {
-                               $action = new AttachmentAction(array($attachment), 'generateThumbnails');
+                               $action = new AttachmentAction([$attachment], 'generateThumbnails');
                                $action->executeAction();
                        }
                        catch (SystemException $e) {}
index 4d77245995d4c68c5f225ee6e86edbef286f966a..cfc7cabfb67768ed6f3f4f12885d5da1c686a46c 100644 (file)
@@ -33,7 +33,7 @@ class ImportWorker extends AbstractWorker {
         * @see \wcf\system\worker\IWorker::validate()
         */
        public function validate() {
-               WCF::getSession()->checkPermissions(array('admin.management.canImportData'));
+               WCF::getSession()->checkPermissions(['admin.management.canImportData']);
                
                if (!isset($this->parameters['objectType'])) {
                        throw new SystemException("parameter 'objectType' missing");
index 1ec63265b07377cc479e03c50cc38ebc59e5fbdd..71a2b68a2020fa0572fcdca07243dec2e2a268f4 100644 (file)
@@ -53,8 +53,8 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker {
                        $statement->execute();
                }
                
-               $itemsToUser = array();
-               $likeObjectData = array();
+               $itemsToUser = [];
+               $likeObjectData = [];
                foreach ($this->objectList as $like) {
                        if ($like->objectUserID && $like->likeValue == Like::LIKE) {
                                if (!isset($itemsToUser[$like->objectUserID])) {
@@ -65,15 +65,15 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker {
                        }
                        
                        if (!isset($likeObjectData[$like->objectTypeID])) {
-                               $likeObjectData[$like->objectTypeID] = array();
+                               $likeObjectData[$like->objectTypeID] = [];
                        }
                        if (!isset($likeObjectData[$like->objectTypeID][$like->objectID])) {
-                               $likeObjectData[$like->objectTypeID][$like->objectID] = array(
+                               $likeObjectData[$like->objectTypeID][$like->objectID] = [
                                        'likes' => 0,
                                        'dislikes' => 0,
                                        'cumulativeLikes' => 0,
                                        'objectUserID' => $like->objectUserID
-                               );
+                               ];
                        }
                        
                        if ($like->likeValue == Like::LIKE) {
@@ -99,14 +99,14 @@ class LikeRebuildDataWorker extends AbstractRebuildDataWorker {
                WCF::getDB()->beginTransaction();
                foreach ($likeObjectData as $objectTypeID => $objects) {
                        foreach ($objects as $objectID => $data) {
-                               $statement->execute(array(
+                               $statement->execute([
                                        $objectTypeID,
                                        $objectID,
                                        $data['objectUserID'],
                                        $data['likes'],
                                        $data['dislikes'],
                                        $data['cumulativeLikes']
-                               ));
+                               ]);
                        }
                }
                WCF::getDB()->commitTransaction();
index ccc354ed65361a69f75a1637468087f30c2d3102..29a78dffb6d530f664618b58b579614005ce6177 100644 (file)
@@ -55,15 +55,15 @@ class LikeUserRebuildDataWorker extends AbstractRebuildDataWorker {
                                        AND likeValue = ?
                        ORDER BY        time DESC";
                $statement = WCF::getDB()->prepareStatement($sql, 3);
-               $userData = $userIDs = array();
+               $userData = $userIDs = [];
                foreach ($this->objectList as $likeObject) {
-                       $userData[$likeObject->likeObjectID] = array();
+                       $userData[$likeObject->likeObjectID] = [];
                        
-                       $statement->execute(array(
+                       $statement->execute([
                                $likeObject->objectID,
                                $likeObject->objectTypeID,
                                Like::LIKE
-                       ));
+                       ]);
                        while ($row = $statement->fetchArray()) {
                                $userData[$likeObject->likeObjectID][] = $row['userID'];
                                $userIDs[] = $row['userID'];
@@ -76,13 +76,13 @@ class LikeUserRebuildDataWorker extends AbstractRebuildDataWorker {
                
                // fetch usernames
                $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID IN (?)", array($userIDs));
+               $conditions->add("userID IN (?)", [$userIDs]);
                $sql = "SELECT  userID, username
                        FROM    wcf".WCF_N."_user
                        ".$conditions;
                $statement = WCF::getDB()->prepareStatement($sql);
                $statement->execute($conditions->getParameters());
-               $usernames = array();
+               $usernames = [];
                while ($row = $statement->fetchArray()) {
                        $usernames[$row['userID']] = $row['username'];
                }
@@ -96,17 +96,17 @@ class LikeUserRebuildDataWorker extends AbstractRebuildDataWorker {
                WCF::getDB()->beginTransaction();
                foreach ($userData as $likeObjectID => $data) {
                        foreach ($data as &$value) {
-                               $value = array(
+                               $value = [
                                        'userID' => $value,
                                        'username' => $usernames[$value]
-                               );
+                               ];
                        }
                        unset($value);
                        
-                       $statement->execute(array(
+                       $statement->execute([
                                serialize($data),
                                $likeObjectID
-                       ));
+                       ]);
                }
                WCF::getDB()->commitTransaction();
        }
index 6bf09369d5bf0bb17367e73c243e395cfb217971..f1e517de5604f1c12e8787349ec5c6ae9400ca51 100644 (file)
@@ -40,7 +40,7 @@ class MailWorker extends AbstractWorker {
         * @see \wcf\system\worker\IWorker::validate()
         */
        public function validate() {
-               WCF::getSession()->checkPermissions(array('admin.user.canMailUser'));
+               WCF::getSession()->checkPermissions(['admin.user.canMailUser']);
                
                if (!isset($this->parameters['mailID'])) {
                        throw new SystemException("mailID missing");
@@ -60,14 +60,14 @@ class MailWorker extends AbstractWorker {
        public function countObjects() {
                $this->conditions = new PreparedStatementConditionBuilder();
                if ($this->mailData['action'] == '') {
-                       $this->conditions->add("user.userID IN (?)", array($this->mailData['userIDs']));
+                       $this->conditions->add("user.userID IN (?)", [$this->mailData['userIDs']]);
                }
                else {
-                       $this->conditions->add("user.activationCode = ?", array(0));
-                       $this->conditions->add("user.banned = ?", array(0));
+                       $this->conditions->add("user.activationCode = ?", [0]);
+                       $this->conditions->add("user.banned = ?", [0]);
                        
                        if ($this->mailData['action'] == 'group') {
-                               $this->conditions->add("user.userID IN (SELECT userID FROM wcf".WCF_N."_user_to_group WHERE groupID IN (?))", array($this->mailData['groupIDs']));
+                               $this->conditions->add("user.userID IN (SELECT userID FROM wcf".WCF_N."_user_to_group WHERE groupID IN (?))", [$this->mailData['groupIDs']]);
                        }
                }
                
@@ -129,7 +129,7 @@ class MailWorker extends AbstractWorker {
         */
        protected function sendMail(User $user) {
                try {
-                       $mail = new Mail(array($user->username => $user->email), $this->mailData['subject'], str_replace('{$username}', $user->username, $this->mailData['text']), $this->mailData['from']);
+                       $mail = new Mail([$user->username => $user->email], $this->mailData['subject'], str_replace('{$username}', $user->username, $this->mailData['text']), $this->mailData['from']);
                        if ($this->mailData['enableHTML']) $mail->setContentType('text/html');
                        $mail->setLanguage($user->getLanguage());
                        $mail->send();
index 77c90fbbcfba3db984989643e5ea64e18aa5bd77..ebc8726b8aca31597254ebdae46cdc4a892aff04 100644 (file)
@@ -31,7 +31,7 @@ class SendNewPasswordWorker extends AbstractWorker {
         */
        public function countObjects() {
                $userList = new UserList();
-               $userList->getConditionBuilder()->add('user_table.userID IN (?)', array($this->parameters['userIDs']));
+               $userList->getConditionBuilder()->add('user_table.userID IN (?)', [$this->parameters['userIDs']]);
                
                return $userList->countObjects();
        }
@@ -42,7 +42,7 @@ class SendNewPasswordWorker extends AbstractWorker {
        public function execute() {
                $userList = new UserList();
                $userList->decoratorClassName = 'wcf\data\user\UserEditor';
-               $userList->getConditionBuilder()->add('user_table.userID IN (?)', array($this->parameters['userIDs']));
+               $userList->getConditionBuilder()->add('user_table.userID IN (?)', [$this->parameters['userIDs']]);
                $userList->sqlLimit = $this->limit;
                $userList->sqlOffset = $this->limit * $this->loopCount;
                $userList->readObjects();
@@ -81,18 +81,18 @@ class SendNewPasswordWorker extends AbstractWorker {
        protected function sendNewPassword(UserEditor $userEditor) {
                $newPassword = PasswordUtil::getRandomPassword((REGISTER_PASSWORD_MIN_LENGTH > 12 ? REGISTER_PASSWORD_MIN_LENGTH : 12));
                
-               $userAction = new UserAction(array($userEditor), 'update', array(
-                       'data' => array(
+               $userAction = new UserAction([$userEditor], 'update', [
+                       'data' => [
                                'password' => $newPassword
-                       )
-               ));
+                       ]
+               ]);
                $userAction->executeAction();
                
                // send mail
-               $mail = new Mail(array($userEditor->username => $userEditor->email), $userEditor->getLanguage()->getDynamicVariable('wcf.acp.user.sendNewPassword.mail.subject'), $userEditor->getLanguage()->getDynamicVariable('wcf.acp.user.sendNewPassword.mail', array(
+               $mail = new Mail([$userEditor->username => $userEditor->email], $userEditor->getLanguage()->getDynamicVariable('wcf.acp.user.sendNewPassword.mail.subject'), $userEditor->getLanguage()->getDynamicVariable('wcf.acp.user.sendNewPassword.mail', [
                        'password' => $newPassword,
                        'username' => $userEditor->username,
-               )));
+               ]));
                $mail->send();
        }
        
@@ -100,7 +100,7 @@ class SendNewPasswordWorker extends AbstractWorker {
         * @see \wcf\system\worker\IWorker::validate()
         */
        public function validate() {
-               WCF::getSession()->checkPermissions(array('admin.user.canEditPassword'));
+               WCF::getSession()->checkPermissions(['admin.user.canEditPassword']);
                
                if (!isset($this->parameters['userIDs']) || !is_array($this->parameters['userIDs']) || empty($this->parameters['userIDs'])) {
                        throw new SystemException("'userIDs' parameter is missing or invalid");
index da7f7deca1adf1c29211ef82406b9c997f531e7f..f6b1e688fce3aad8fc57e79945b12807cc090b00 100644 (file)
@@ -73,7 +73,7 @@ class StatDailyRebuildDataWorker extends AbstractRebuildDataWorker {
                        // get object types
                        foreach (ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.statDailyHandler') as $objectType) {
                                $data = $objectType->getProcessor()->getData($d->getTimestamp());
-                               $statement->execute(array($objectType->objectTypeID, $d->format('Y-m-d'), $data['counter'], $data['total']));
+                               $statement->execute([$objectType->objectTypeID, $d->format('Y-m-d'), $data['counter'], $data['total']]);
                        }
                        
                        $d->add(new \DateInterval('P1D'));
index 59bd96553e9d92592d15b7bd336f8aa3970186d2..c2433c8087276d31c02bc6cc05f99b603eb7d136 100644 (file)
@@ -25,7 +25,7 @@ class UserActivityPointUpdateEventsWorker extends AbstractWorker {
         * object types
         * @var ObjectType[]
         */
-       public $objectTypes = array();
+       public $objectTypes = [];
        
        /**
         * @see \wcf\system\worker\IWorker
@@ -40,7 +40,7 @@ class UserActivityPointUpdateEventsWorker extends AbstractWorker {
         * @see \wcf\system\worker\IWorker::validate()
         */
        public function validate() {
-               WCF::getSession()->checkPermissions(array('admin.user.canEditActivityPoints'));
+               WCF::getSession()->checkPermissions(['admin.user.canEditActivityPoints']);
        }
        
        /**
@@ -61,10 +61,10 @@ class UserActivityPointUpdateEventsWorker extends AbstractWorker {
                                        SET             activityPoints = items * ?
                                        WHERE           objectTypeID = ?";
                                $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute(array(
+                               $statement->execute([
                                        $objectType->points,
                                        $objectType->objectTypeID
-                               ));
+                               ]);
                        }
                        
                        $i++;
index 64b4ec0536869e0ac7456a79224cf026ae19441a..bbca454cd029421b1d6741583778b662ab98548a 100644 (file)
@@ -43,7 +43,7 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker {
        public function execute() {
                parent::execute();
                
-               $users = $userIDs = array();
+               $users = $userIDs = [];
                foreach ($this->getObjectList() as $user) {
                        $users[] = new UserEditor($user);
                        $userIDs[] = $user->userID;
@@ -62,7 +62,7 @@ class UserRebuildDataWorker extends AbstractRebuildDataWorker {
                        // update like counter
                        if (MODULE_LIKE) {
                                $conditionBuilder = new PreparedStatementConditionBuilder();
-                               $conditionBuilder->add('user_table.userID IN (?)', array($userIDs));
+                               $conditionBuilder->add('user_table.userID IN (?)', [$userIDs]);
                                $sql = "UPDATE  wcf".WCF_N."_user user_table
                                        SET     likesReceived = (
                                                        SELECT  COUNT(*)
index 81e2fbd281de71d0cf20ef78e5dc59c910b6f934..31f9f043a190f51aa7773c7b659ca169c8fc3fd9 100644 (file)
@@ -208,8 +208,8 @@ final class ArrayUtil {
                }
                
                // get parameters
-               $params1 = array($array1, $array2);
-               $params2 = array($array2, $array1);
+               $params1 = [$array1, $array2];
+               $params2 = [$array2, $array1];
                if ($callback !== null) {
                        $params1[] = $callback;
                        $params2[] = $callback;
index 8bd49f3f9cfc5c8e70e8f94e41f1bd08016b690c..e1447355faa669e8a9a68228af8f7b261efa997d 100644 (file)
@@ -21,7 +21,7 @@ final class CLIUtil {
         * @return      string
         */
        public static function generateTable(array $table) {
-               $columnSize = array();
+               $columnSize = [];
                foreach ($table as $row) {
                        $i = 0;
                        foreach ($row as $column) {
index 86c99ff0eb43f2458cfa6b86f8cea9e81b966a30..4f04c2a1a9030c8be483053f09a3f9942c1433da 100644 (file)
@@ -31,7 +31,7 @@ final class CronjobUtil {
         * result date
         * @var integer[]
         */
-       protected static $result = array();
+       protected static $result = [];
        
        /**
         * time base used as reference for finding the next execution time
@@ -44,13 +44,13 @@ final class CronjobUtil {
         * since it varies from month to month)
         * @var integer[]
         */
-       public static $ranges = array(
-               'minute' => array(0, 59),
-               'hour' => array(0, 23),
-               'dom' => array(1, 31),
-               'month' => array(1, 12),
-               'dow' => array(0, 6)
-       );
+       public static $ranges = [
+               'minute' => [0, 59],
+               'hour' => [0, 23],
+               'dom' => [1, 31],
+               'month' => [1, 12],
+               'dow' => [0, 6]
+       ];
        
        /**
         * Calculates timestamp for next execution based on cron-like expressions and a given time base.
@@ -66,30 +66,30 @@ final class CronjobUtil {
        public static function calculateNextExec($minute, $hour, $dom, $month, $dow, $timeBase = TIME_NOW) {
                // initialize fields
                self::$timeBase = $timeBase;
-               self::$result = array(
+               self::$result = [
                        'minute' => 0,
                        'hour' => 0,
                        'day' => 0,
                        'month' => 0,
                        'year' => 0
-               );
+               ];
                
-               $fields = array(
+               $fields = [
                        'minute' => $minute,
                        'hour' => $hour,
                        'dom' => $dom,
                        'month' => $month,
                        'dow' => $dow
-               );
+               ];
                
                self::$domRestricted = ($dom != '*') ? true : false;
                self::$dowRestricted = ($dow != '*') ? true : false;
                
-               $dayNames = array('sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat');
-               $monthNames = array('jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec');
+               $dayNames = ['sun', 'mon', 'tue', 'wed', 'thu', 'fri', 'sat'];
+               $monthNames = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
                
                // calculate values based upon each expression
-               $values = array();
+               $values = [];
                foreach ($fields as $fieldName => $fieldValue) {
                        $fieldValue = mb_strtolower($fieldValue);
                        
@@ -239,11 +239,11 @@ final class CronjobUtil {
                        $dow = gmdate('w', gmmktime(0, 0, 1, $month, $i, $year));
                        
                        if (in_array($dow, $values['dow'])) {
-                               return array(
+                               return [
                                        'day' => $i,
                                        'month' => $month,
                                        'year' => $year
-                               );
+                               ];
                        }
                }
                
@@ -265,11 +265,11 @@ final class CronjobUtil {
                
                for ($i = $day; $i <= $days; $i++) {
                        if (in_array($i, $values['dom'])) {
-                               return array(
+                               return [
                                        'day' => $i,
                                        'month' => $month,
                                        'year' => $year
-                               );
+                               ];
                        }
                }
                
@@ -386,7 +386,7 @@ final class CronjobUtil {
         * @return      array
         */
        protected static function calculateValue($fieldName, $fieldValue) {
-               $values = array();
+               $values = [];
                
                // examinate first char
                $char = mb_substr($fieldValue, 0, 1);
@@ -427,7 +427,7 @@ final class CronjobUtil {
                        return explode(',', $fieldValue);
                }
                
-               return array($fieldValue);
+               return [$fieldValue];
        }
        
        /**
@@ -439,7 +439,7 @@ final class CronjobUtil {
        protected static function getRanges($value) {
                // this is a single value
                if (mb_strpos($value, '-') === false) {
-                       return array($value);
+                       return [$value];
                }
                
                $step = 1;
@@ -463,7 +463,7 @@ final class CronjobUtil {
         * @return      array
         */
        protected static function calculateRange($startValue, $endValue, $step = 1) {
-               $values = array();
+               $values = [];
                
                for ($i = $startValue; $i <= $endValue; $i = $i + $step) {
                        $values[] = $i;
@@ -505,7 +505,7 @@ final class CronjobUtil {
                $step = '[1-9]?[0-9]';
                $months = 'jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec';
                $days = 'mon|tue|wed|thu|fri|sat|sun';
-               $namesArr = array();
+               $namesArr = [];
                
                switch ($name) {
                        // check if startMinute is a valid minute or a list of valid minutes.
index 1005b2c42e24a0b54bcba3a68bf8d9ac6e8c3648..0d3314177a2d46f877c13f3cd12cf11a49b8dcc5 100644 (file)
@@ -32,7 +32,7 @@ final class DateUtil {
         * list of available time zones
         * @var string[]
         */
-       protected static $availableTimezones = array(
+       protected static $availableTimezones = [
                // there is not support for UTC-12:00 in php
                // '...', // (UTC-12:00) International Date Line West
                'Pacific/Samoa', // (UTC-11:00) Midway Island, American Samoa
@@ -128,7 +128,7 @@ final class DateUtil {
                'Pacific/Fiji', // (UTC+12:00) Fiji
                'Pacific/Tongatapu', // (UTC+13:00) Nukualofa
                'Pacific/Apia', // (UTC+13:00) Samoa
-       );
+       ];
        
        /**
         * first day of the week
@@ -203,7 +203,7 @@ final class DateUtil {
                }
                
                if ($fullInterval) {
-                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.full.'.$direction, array(
+                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.full.'.$direction, [
                                'days' => $days - 7 * $weeks,
                                'firstElement' => $years ? 'years' : ($months ? 'months' : ($weeks ? 'weeks' : ($days ? 'days' : ($hours ? 'hours' : 'minutes')))),
                                'hours' => $hours,
@@ -212,42 +212,42 @@ final class DateUtil {
                                'months' => $months,
                                'weeks' => $weeks,
                                'years' => $years
-                       ));
+                       ]);
                }
                
                if ($years) {
-                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.years.'.$direction, array(
+                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.years.'.$direction, [
                                'years' => $years
-                       ));
+                       ]);
                }
                
                if ($months) {
-                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.months.'.$direction, array(
+                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.months.'.$direction, [
                                'months' => $months
-                       ));
+                       ]);
                }
                
                if ($weeks) {
-                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.weeks.'.$direction, array(
+                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.weeks.'.$direction, [
                                'weeks' => $weeks
-                       ));
+                       ]);
                }
                
                if ($days) {
-                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.days.'.$direction, array(
+                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.days.'.$direction, [
                                'days' => $days
-                       ));
+                       ]);
                }
                
                if ($hours) {
-                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.hours.'.$direction, array(
+                       return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.hours.'.$direction, [
                                'hours' => $hours
-                       ));
+                       ]);
                }
                
-               return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.minutes.'.$direction, array(
+               return WCF::getLanguage()->getDynamicVariable('wcf.date.interval.minutes.'.$direction, [
                        'minutes' => $minutes
-               ));
+               ]);
        }
        
        /**
@@ -262,7 +262,7 @@ final class DateUtil {
                if ($language->languageCode != 'en') {
                        // full textual representation of the day of the week (l)
                        if (strpos($format, 'l') !== false) {
-                               $date = str_replace(array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'), array(
+                               $date = str_replace(['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], [
                                        $language->get('wcf.date.day.sunday'),
                                        $language->get('wcf.date.day.monday'),
                                        $language->get('wcf.date.day.tuesday'),
@@ -270,12 +270,12 @@ final class DateUtil {
                                        $language->get('wcf.date.day.thursday'),
                                        $language->get('wcf.date.day.friday'),
                                        $language->get('wcf.date.day.saturday')
-                               ), $date);
+                               ], $date);
                        }
                        
                        // textual representation of a day, three letters (D)
                        if (strpos($format, 'D') !== false) {
-                               $date = str_replace(array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'), array(
+                               $date = str_replace(['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], [
                                        $language->get('wcf.date.day.sun'),
                                        $language->get('wcf.date.day.mon'),
                                        $language->get('wcf.date.day.tue'),
@@ -283,12 +283,12 @@ final class DateUtil {
                                        $language->get('wcf.date.day.thu'),
                                        $language->get('wcf.date.day.fri'),
                                        $language->get('wcf.date.day.sat')
-                               ), $date);
+                               ], $date);
                        }
                        
                        // full textual representation of a month (F)
                        if (strpos($format, 'F') !== false) {
-                               $date = str_replace(array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'), array(
+                               $date = str_replace(['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'], [
                                        $language->get('wcf.date.month.january'),
                                        $language->get('wcf.date.month.february'),
                                        $language->get('wcf.date.month.march'),
@@ -301,12 +301,12 @@ final class DateUtil {
                                        $language->get('wcf.date.month.october'),
                                        $language->get('wcf.date.month.november'),
                                        $language->get('wcf.date.month.december')
-                               ), $date);
+                               ], $date);
                        }
                        
                        // short textual representation of a month (M)
                        if (strpos($format, 'M') !== false) {
-                               $date = str_replace(array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'), array(
+                               $date = str_replace(['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], [
                                        $language->get('wcf.date.month.short.jan'),
                                        $language->get('wcf.date.month.short.feb'),
                                        $language->get('wcf.date.month.short.mar'),
@@ -319,7 +319,7 @@ final class DateUtil {
                                        $language->get('wcf.date.month.short.oct'),
                                        $language->get('wcf.date.month.short.nov'),
                                        $language->get('wcf.date.month.short.dec')
-                               ), $date);
+                               ], $date);
                        }
                }
                
@@ -409,7 +409,7 @@ final class DateUtil {
        public static function getWeekDays() {
                if (self::$weekDays === null) {
                        if (self::getFirstDayOfTheWeek() == 1) {
-                               self::$weekDays = array(
+                               self::$weekDays = [
                                        1 => 'monday',
                                        2 => 'tuesday',
                                        3 => 'wednesday',
@@ -417,10 +417,10 @@ final class DateUtil {
                                        5 => 'friday',
                                        6 => 'saturday',
                                        0 => 'sunday'
-                               );
+                               ];
                        }
                        else {
-                               self::$weekDays = array(
+                               self::$weekDays = [
                                        0 => 'sunday',
                                        1 => 'monday',
                                        2 => 'tuesday',
@@ -428,7 +428,7 @@ final class DateUtil {
                                        4 => 'thursday',
                                        5 => 'friday',
                                        6 => 'saturday'
-                               );
+                               ];
                        }
                }
                
@@ -443,7 +443,7 @@ final class DateUtil {
        public static function getShortWeekDays() {
                if (self::$shortWeekDays === null) {
                        if (self::getFirstDayOfTheWeek() == 1) {
-                               self::$shortWeekDays = array(
+                               self::$shortWeekDays = [
                                        1 => 'mon',
                                        2 => 'tue',
                                        3 => 'wed',
@@ -451,10 +451,10 @@ final class DateUtil {
                                        5 => 'fri',
                                        6 => 'sat',
                                        0 => 'sun'
-                               );
+                               ];
                        }
                        else {
-                               self::$shortWeekDays = array(
+                               self::$shortWeekDays = [
                                        0 => 'sun',
                                        1 => 'mon',
                                        2 => 'tue',
@@ -462,7 +462,7 @@ final class DateUtil {
                                        4 => 'thu',
                                        5 => 'fri',
                                        6 => 'sat'
-                               );
+                               ];
                        }
                }
                
index df3451662ffa573ebdabf1a8fe77fb7676f8a673..ca25ce052e76d653d035d9efb1f838b41d15e51b 100644 (file)
@@ -36,13 +36,13 @@ class Diff {
         * original array, as given by the user
         * @var array
         */
-       protected $a = array();
+       protected $a = [];
        
        /**
         * modified array, as given by the user
         * @var array
         */
-       protected $b = array();
+       protected $b = [];
        
        /**
         * size of a
@@ -192,32 +192,32 @@ class Diff {
                if ($this->d !== null) return;
                $lcs = $this->getLCS();
                
-               $this->d = array();
+               $this->d = [];
                $positionA = 0;
                $positionB = 0;
                foreach ($lcs as $item) {
                        // find next matching item in a, every item in between must be removed
                        while ($positionA < $this->sizeA && $this->a[$positionA] !== $item) {
-                               $this->d[] = array(self::REMOVED, $this->a[$positionA++]);
+                               $this->d[] = [self::REMOVED, $this->a[$positionA++]];
                        }
                        
                        // find next matching item in b, every item in between must be removed
                        while ($positionB < $this->sizeB && $this->b[$positionB] !== $item) {
-                               $this->d[] = array(self::ADDED, $this->b[$positionB++]);
+                               $this->d[] = [self::ADDED, $this->b[$positionB++]];
                        }
                        
                        // we are back in our longest common subsequence
-                       $this->d[] = array(self::SAME, $item);
+                       $this->d[] = [self::SAME, $item];
                        $positionA++;
                        $positionB++;
                }
                
                // append remaining items of `a` and `b`
                while ($positionA < $this->sizeA) {
-                       $this->d[] = array(self::REMOVED, $this->a[$positionA++]);
+                       $this->d[] = [self::REMOVED, $this->a[$positionA++]];
                }
                while ($positionB < $this->sizeB) {
-                       $this->d[] = array(self::ADDED, $this->b[$positionB++]);
+                       $this->d[] = [self::ADDED, $this->b[$positionB++]];
                }
        }
        
@@ -240,7 +240,7 @@ class Diff {
        public function getUnixDiff($context = 2) {
                $d = $this->getRawDiff();
                
-               $result = array();
+               $result = [];
                $result[] = "--- a";
                $result[] = "+++ b";
                
index f0765aafec48a7ae531cf8092036bee97c7bb707..b9bda424840b3bcfe6f4fb38f970d66534ac93dd 100644 (file)
@@ -24,13 +24,13 @@ final class DirectoryUtil {
         * all files with full path
         * @var string[]
         */
-       protected $files = array();
+       protected $files = [];
        
        /**
         * all files with filename as key and DirectoryIterator object as value
         * @var \DirectoryIterator[]
         */
-       protected $fileObjects = array();
+       protected $fileObjects = [];
        
        /**
         * directory size in bytes
@@ -60,10 +60,10 @@ final class DirectoryUtil {
         * all recursive and non-recursive instances of DirectoryUtil
         * @var DirectoryUtil[][]
         */
-       protected static $instances = array(
-               true => array(),        // recursive instances
-               false => array()        // non-recursive instances
-       );
+       protected static $instances = [
+               true => [],     // recursive instances
+               false => []        // non-recursive instances
+       ];
        
        /**
         * Creates a new instance of DirectoryUtil.
@@ -330,8 +330,8 @@ final class DirectoryUtil {
         */
        public function clearCaches() {
                // clear cached list of files
-               $this->files = array();
-               $this->fileObjects = array();
+               $this->files = [];
+               $this->fileObjects = [];
                
                // clear cached size
                $this->size = 0;
index b4b48e89b4969f5b1d707f30b15019d56612679f..f0ff13d565acd530c65f02d1fb5466f4e0301ed3 100644 (file)
@@ -85,7 +85,7 @@ final class ExifUtil {
                        }
                }
                
-               return array();
+               return [];
        }
        
        /**
@@ -188,7 +188,7 @@ final class ExifUtil {
         * @return      array
         */
        public static function getFormattedExifData(array $rawExifData) {
-               $exifData = array();
+               $exifData = [];
                
                // unit is second (unsigned rational)
                if (isset($rawExifData['ExposureTime']) && is_string($rawExifData['ExposureTime'])) {
index de8e1fa8344e581a50f821fbd98df47addbd4433..dec1eb1d75d73d32d6118033c98748b75c01e211 100644 (file)
@@ -19,7 +19,7 @@ class FileReader {
         * http options
         * @var array
         */
-       protected $options = array(
+       protected $options = [
                'filename' => '',
                'mimeType' => 'application/octet-stream',
                'filesize' => 0,
@@ -28,13 +28,13 @@ class FileReader {
                'lastModificationTime' => 0,
                'expirationDate' => 0,
                'maxAge' => 0
-       );
+       ];
        
        /**
         * list of header items
         * @var array
         */
-       protected $headers = array();
+       protected $headers = [];
        
        /**
         * start byte
index ff557ee0f22e226cc2cacae90121d564867640b7..688070c115523f9bbd100fdedeea36b0322de2d6 100644 (file)
@@ -24,19 +24,19 @@ final class HTTPRequest {
         * given options
         * @var array
         */
-       private $options = array();
+       private $options = [];
        
        /**
         * given post parameters
         * @var array
         */
-       private $postParameters = array();
+       private $postParameters = [];
        
        /**
         * given files
         * @var array
         */
-       private $files = array();
+       private $files = [];
        
        /**
         * indicates if request will be made via SSL
@@ -96,13 +96,13 @@ final class HTTPRequest {
         * request headers
         * @var string[][]
         */
-       private $headers = array();
+       private $headers = [];
        
        /**
         * legacy headers
         * @var string[]
         */
-       private $legacyHeaders = array();
+       private $legacyHeaders = [];
        
        /**
         * request body
@@ -114,7 +114,7 @@ final class HTTPRequest {
         * reply headers
         * @var string[]
         */
-       private $replyHeaders = array();
+       private $replyHeaders = [];
        
        /**
         * reply body
@@ -136,7 +136,7 @@ final class HTTPRequest {
         * @param       mixed           $postParameters Parameters to send via POST
         * @param       array           $files          Files to attach to the request
         */
-       public function __construct($url, array $options = array(), $postParameters = array(), array $files = array()) {
+       public function __construct($url, array $options = [], $postParameters = [], array $files = []) {
                $this->setURL($url);
                
                $this->postParameters = $postParameters;
@@ -254,11 +254,11 @@ final class HTTPRequest {
         */
        public function execute() {
                // connect
-               $remoteFile = new RemoteFile(($this->useSSL ? 'ssl://' : '').$this->host, $this->port, $this->options['timeout'], array(
-                       'ssl' => array(
+               $remoteFile = new RemoteFile(($this->useSSL ? 'ssl://' : '').$this->host, $this->port, $this->options['timeout'], [
+                       'ssl' => [
                                'peer_name' => $this->originHost
-                       )
-               ));
+                       ]
+               ]);
                
                if ($this->originUseSSL && PROXY_SERVER_HTTP) {
                        if ($this->useSSL) throw new SystemException("Unable to proxy HTTPS when using TLS for proxy connection");
@@ -270,7 +270,7 @@ final class HTTPRequest {
                        $request .= "Host: ".$this->originHost.":".$this->originPort."\r\n";
                        $request .= "\r\n";
                        $remoteFile->puts($request);
-                       $this->replyHeaders = array();
+                       $this->replyHeaders = [];
                        while (!$remoteFile->eof()) {
                                $line = $remoteFile->gets();
                                if (rtrim($line) === '') {
@@ -300,7 +300,7 @@ final class HTTPRequest {
                $remoteFile->puts($request);
                
                $inHeader = true;
-               $this->replyHeaders = array();
+               $this->replyHeaders = [];
                $this->replyBody = '';
                $chunkLength = 0;
                $bodyLength = 0;
@@ -388,11 +388,11 @@ final class HTTPRequest {
         * Parses the reply headers.
         */
        private function parseReplyHeaders() {
-               $headers = array();
+               $headers = [];
                $lastKey = '';
                foreach ($this->replyHeaders as $header) {
                        if (strpos($header, ':') === false) {
-                               $headers[trim($header)] = array(trim($header));
+                               $headers[trim($header)] = [trim($header)];
                                continue;
                        }
                        
@@ -406,13 +406,13 @@ final class HTTPRequest {
                                list($key, $value) = explode(':', $header, 2);
                                
                                $lastKey = $key;
-                               if (!isset($headers[$key])) $headers[$key] = array();
+                               if (!isset($headers[$key])) $headers[$key] = [];
                                $headers[$key][] = trim($value);
                        }
                }
                // 4.2 Field names are case-insensitive.
                $this->replyHeaders = array_change_key_case($headers);
-               if (isset($this->replyHeaders['transfer-encoding'])) $this->replyHeaders['transfer-encoding'] = array(implode(',', $this->replyHeaders['transfer-encoding']));
+               if (isset($this->replyHeaders['transfer-encoding'])) $this->replyHeaders['transfer-encoding'] = [implode(',', $this->replyHeaders['transfer-encoding'])];
                $this->legacyHeaders = array_map('end', $headers);
                
                // get status code
@@ -452,7 +452,7 @@ final class HTTPRequest {
                                // be retrieved using a GET method on that resource.
                                if ($this->statusCode == '303') {
                                        $newRequest->options['method'] = 'GET';
-                                       $newRequest->postParameters = array();
+                                       $newRequest->postParameters = [];
                                        $newRequest->addHeader('content-length', '');
                                        $newRequest->addHeader('content-type', '');
                                }
@@ -537,13 +537,13 @@ final class HTTPRequest {
         * @return      array
         */
        public function getReply() {
-               return array(
+               return [
                        'statusCode' => $this->statusCode, 
                        'headers' => $this->legacyHeaders,
                        'httpHeaders' => $this->replyHeaders,
                        'body' => $this->replyBody,
                        'url' => $this->url
-               );
+               ];
        }
        
        /**
@@ -599,7 +599,7 @@ final class HTTPRequest {
                        $this->headers[$name][] = $value;
                }
                else {
-                       $this->headers[$name] = array($value);
+                       $this->headers[$name] = [$value];
                }
        }
        
@@ -607,7 +607,7 @@ final class HTTPRequest {
         * Resets reply data when cloning.
         */
        private function __clone() {
-               $this->replyHeaders = array();
+               $this->replyHeaders = [];
                $this->replyBody = '';
                $this->statusCode = 0;
        }
index 01498ce4c29a052a3911a2a4c862205f5630b630..7566881687138cce6f68c0b1f4a6a6c35e02c48c 100644 (file)
@@ -81,7 +81,7 @@ final class HeaderUtil {
                        @header('X-Frame-Options: SAMEORIGIN');
                }
                
-               ob_start(array('wcf\util\HeaderUtil', 'parseOutput'));
+               ob_start(['wcf\util\HeaderUtil', 'parseOutput']);
        }
        
        /**
@@ -104,7 +104,7 @@ final class HeaderUtil {
                self::$output = $output;
                
                // move script tags to the bottom of the page
-               $javascript = array();
+               $javascript = [];
                self::$output = preg_replace_callback('~(?P<conditionBefore><!--\[IF [^<]+\s*)?<script data-relocate="true"(?P<script>.*?</script>\s*)(?P<conditionAfter><!\[ENDIF]-->\s*)?~s', function($matches) use (&$javascript) {
                        $match = '';
                        if (isset($matches['conditionBefore'])) $match .= $matches['conditionBefore'];
@@ -159,14 +159,14 @@ final class HeaderUtil {
         * @param       string          $status
         */
        public static function delayedRedirect($location, $message, $delay = 5, $status = 'success') {
-               WCF::getTPL()->assign(array(
+               WCF::getTPL()->assign([
                        'url' => $location,
                        'message' => $message,
                        'wait' => $delay,
                        'templateName' => 'redirect',
                        'templateNameApplication' => 'wcf',
                        'status' => $status
-               ));
+               ]);
                WCF::getTPL()->display('redirect');
        }
        
index b5b6f55f959859f68acf79d57adbf3548f3e514c..2d9646b8d9448fc009a3d9001ccfd45e9f803420 100644 (file)
@@ -36,11 +36,11 @@ final class MathUtil {
                $lambda = $longitude * pi() / 180;
                $phi = $latitude * pi() / 180;
                
-               return array(
+               return [
                        6371 * cos($phi) * cos($lambda),        // x
                        6371 * cos($phi) * sin($lambda),        // y
                        6371 * sin($phi)                        // z
-               );
+               ];
        }
        
        private function __construct() { }
index d5d5f9828127dfe822f1bb17246f945a38d0aa97..23e4a1d2c51335180271e8fd35f73cbce9c7d983 100644 (file)
@@ -77,7 +77,7 @@ class MessageUtil {
                        return $matches[1];
                }
                
-               return array();
+               return [];
        }
        
        /**
@@ -87,7 +87,7 @@ class MessageUtil {
         * @return      string[]
         */
        public static function getQuotedUsers($text) {
-               $usernames = array();
+               $usernames = [];
                if (preg_match_all("~(?:\[(quote)=(?:')?(.+?)(?:')?(?:,[^\]]*)?\]|\[/quote\])~i", $text, $matches)) {
                        $level = 0;
                        
index 090c63109554c125695f9d02da6fc3140ce0f73b..150ebbcd50332f550bc30cd7d71b60422bfe9e56 100644 (file)
@@ -19,7 +19,7 @@ final class OptionUtil {
         * @return      array
         */
        public static function parseSelectOptions($selectOptions) {
-               $result = array();
+               $result = [];
                $options = explode("\n", StringUtil::trim(StringUtil::unifyNewlines($selectOptions)));
                foreach ($options as $option) {
                        $key = $value = $option;
@@ -42,7 +42,7 @@ final class OptionUtil {
         * @return      array
         */
        public static function parseMultipleEnableOptions($enableOptions) {
-               $result = array();
+               $result = [];
                if (!empty($enableOptions)) {
                        $options = explode("\n", StringUtil::trim(StringUtil::unifyNewlines($enableOptions)));
                        $key = -1;
index d9ea8ee2c749cb0f47f25c1cd7bfff39f07b942e..abb9c6c159f76a72c2fe60d2cfdbf68383fc037b 100644 (file)
@@ -30,7 +30,7 @@ final class PasswordUtil {
         * list of supported encryption type by software identifier
         * @var string[]
         */
-       private static $supportedEncryptionTypes = array(
+       private static $supportedEncryptionTypes = [
                'ipb2',         // Invision Power Board 2.x
                'ipb3',         // Invision Power Board 3.x
                'mybb1',        // MyBB 1.x
@@ -51,7 +51,7 @@ final class PasswordUtil {
                'joomla3',      // Joomla 3.x
                'cryptMD5',
                'invalid',      // Never going to match anything
-       );
+       ];
        
        /**
         * blowfish cost factor
index 60280cbe255e60a6c08646a72ecf245d723e6e4a..7b35b4a884a1e912de5b4e5b68291bab1fbc8e02 100644 (file)
@@ -22,7 +22,7 @@ final class StringStack {
         * local string stack
         * @var string[][]
         */
-       protected static $stringStack = array();
+       protected static $stringStack = [];
        
        /**
         * Replaces a string with an unique hash value.
@@ -36,7 +36,7 @@ final class StringStack {
                $hash = $delimiter.StringUtil::getHash(self::$i.uniqid(microtime()).$string).$delimiter;
                
                if (!isset(self::$stringStack[$type])) {
-                       self::$stringStack[$type] = array();
+                       self::$stringStack[$type] = [];
                }
                
                self::$stringStack[$type][$hash] = $string;
@@ -75,7 +75,7 @@ final class StringStack {
                        return self::$stringStack[$type];
                }
                
-               return array();
+               return [];
        }
        
        private function __construct() { }
index 6d0029f3303cafd829a542e356c3b9fe47aefd91..e2746febd26038b6e9711810789e241fd29fd0fc 100644 (file)
@@ -380,7 +380,7 @@ final class StringUtil {
         * @return      string[]
         */
        public static function split($string, $length = 1) {
-               $result = array();
+               $result = [];
                for ($i = 0, $max = mb_strlen($string); $i < $max; $i += $length) {
                        $result[] = mb_substr($string, $i, $length);
                }
@@ -648,7 +648,7 @@ final class StringUtil {
                if (mb_strlen(self::stripHTML($string)) <= $length) {
                        return $string;
                }
-               $openTags = array();
+               $openTags = [];
                $truncatedString = '';
                
                // initalize length counter with the ending length
index 2709f68f239046164ba36de536661b2dcd2c9a44..3651f326b3fe5f960189db4f83ecc29103ea1f8a 100644 (file)
@@ -55,7 +55,7 @@ final class UserUtil {
                        FROM    wcf".WCF_N."_user
                        WHERE   username = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($name));
+               $statement->execute([$name]);
                
                return $statement->fetchSingleColumn() == 0;
        }
@@ -94,7 +94,7 @@ final class UserUtil {
                        FROM    wcf".WCF_N."_user
                        WHERE   email = ?";
                $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute(array($email));
+               $statement->execute([$email]);
                
                return $statement->fetchSingleColumn() == 0;
        }
@@ -205,12 +205,12 @@ final class UserUtil {
                if (substr($ip, 0, 7) == '::ffff:') {
                        $ip = substr($ip, 7);
                        if (preg_match('~^([a-f0-9]{1,4}):([a-f0-9]{1,4})$~', $ip, $matches)) {
-                               $ip = array(
+                               $ip = [
                                        base_convert($matches[1], 16, 10),
                                        base_convert($matches[2], 16, 10)
-                               );
+                               ];
                                
-                               $ipParts = array();
+                               $ipParts = [];
                                $tmp = $ip[0] % 256;
                                $ipParts[] = ($ip[0] - $tmp) / 256;
                                $ipParts[] = $tmp;
index de4a9f8bb2cb634ac6c1124eab632a37bb6d5cc1..3d87c4d003f757177d79c5cdf7ed56d517e584c2 100644 (file)
@@ -152,15 +152,15 @@ class XML {
         * @return      string[][]
         */
        protected function pollErrors() {
-               $errors = array();
+               $errors = [];
                $errorList = libxml_get_errors();
                
                foreach ($errorList as $error) {
-                       $errors[] = array(
+                       $errors[] = [
                                'message' => $error->message,
                                'line' => $error->line,
                                'file' => $this->path
-                       );
+                       ];
                }
                
                libxml_clear_errors();
@@ -175,7 +175,7 @@ class XML {
         * @param       array           $errors
         * @throws      SystemException
         */
-       protected function throwException($message, array $errors = array()) {
+       protected function throwException($message, array $errors = []) {
                if (!empty($errors)) {
                        $description = '<b>LibXML output:</b><pre>';
                        foreach ($errors as $error) {
index 85ddf868c26ab2b6228e6ab508b8967c8b441664..769b4d6b808976834dc82689223212bd6570954a 100644 (file)
@@ -40,7 +40,7 @@ class XMLWriter {
         * @param       string[]        $attributes
         * @throws      SystemException
         */
-       public function beginDocument($rootElement, $namespace, $schemaLocation, array $attributes = array()) {
+       public function beginDocument($rootElement, $namespace, $schemaLocation, array $attributes = []) {
                if ($this->activeDocument) {
                        throw new SystemException("Could not begin a new document unless the previous is finished");
                }
@@ -54,11 +54,11 @@ class XMLWriter {
                
                $this->xml->startDocument('1.0', 'UTF-8');
                $this->startElement($rootElement);
-               $attributes = array_merge($attributes, array(
+               $attributes = array_merge($attributes, [
                        'xmlns' => $namespace,
                        'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
                        'xsi:schemaLocation' => $namespace . ' ' . $schemaLocation
-               ));
+               ]);
                $this->writeAttributes($attributes);
                
                $this->activeDocument = true;
@@ -96,7 +96,7 @@ class XMLWriter {
         * @param       string          $element
         * @param       string[]        $attributes
         */
-       public function startElement($element, array $attributes = array()) {
+       public function startElement($element, array $attributes = []) {
                $this->xml->startElement($element);
                $this->openElements++;
                
@@ -122,7 +122,7 @@ class XMLWriter {
         * @param       string          $cdata
         * @param       string[]        $attributes
         */
-       public function writeElement($element, $cdata, array $attributes = array()) {
+       public function writeElement($element, $cdata, array $attributes = []) {
                $this->startElement($element);
                
                // write attributes
@@ -143,7 +143,7 @@ class XMLWriter {
         * @param       string          $value
         */
        public function writeAttribute($attribute, $value) {
-               $this->writeAttributes(array($attribute => $value));
+               $this->writeAttributes([$attribute => $value]);
        }
        
        /**