* @param string $message
* @param string $filename
* @param integer $lineNo
+ * @throws SystemException
*/
function handleError($errorNo, $message, $filename, $lineNo) {
if (error_reporting() != 0) {
* Tries to find the temp folder.
*
* @return string
+ * @throws SystemException
*/
public static function getTempFolder() {
// use tmp folder in document root by default
* permissions and goes up until 0666 for files and 0777 for directories.
*
* @param string $filename
+ * @throws SystemException
*/
public static function makeWritable($filename) {
if (!file_exists($filename)) {
* archiveName must be tarball or gzipped tarball
*
* @param string $archiveName
+ * @throws SystemException
*/
public function __construct($archiveName) {
if (!is_file($archiveName)) {
*
* @param mixed $fileIndex index or name of the requested file
* @return array
+ * @throws SystemException
*/
public function getFileInfo($fileIndex) {
if (!is_int($fileIndex)) {
*
* @param mixed $index index or name of the requested file
* @param string $destination
- * @return boolean $success
+ * @return boolean
+ * @throws SystemException
*/
public function extract($index, $destination) {
if (!$this->read) {
*
* @param string $filename
* @param string $mode
+ * @throws SystemException
*/
public function __construct($filename, $mode = 'wb') {
$this->filename = $filename;
* @param string $function
* @param array $arguments
* @return mixed
+ * @throws SystemException
*/
public function __call($function, $arguments) {
if (function_exists('f' . $function)) {
*
* @param string $filename
* @param string $mode
+ * @throws SystemException
*/
public function __construct($filename, $mode = 'wb') {
if (self::$gzopen64 === null) {
* @param string $function
* @param array $arguments
* @return mixed
+ * @throws SystemException
*/
public function __call($function, $arguments) {
if (self::$gzopen64 && function_exists('gz' . $function . '64')) {
* Validates the upload package input.
*
* @param string $filename
+ * @throws UserInputException
*/
protected function validateUploadPackage($filename = '') {
$this->activeTabMenuItem = 'upload';
* Throws a UserInputException if the username is not unique or not valid.
*
* @param string $username
+ * @throws UserInputException
*/
protected function validateUsername($username) {
if (empty($username)) {
*
* @param string $email
* @param string $confirmEmail
+ * @throws UserInputException
*/
protected function validateEmail($email, $confirmEmail) {
- if (empty($email)) {
+ if (empty($email)) {
throw new UserInputException('email');
}
*
* @param string $password
* @param string $confirmPassword
+ * @throws UserInputException
*/
protected function validatePassword($password, $confirmPassword) {
if (empty($password)) {
* Throws an previously catched exception while maintaing the propriate stacktrace.
*
* @param \Exception $e
+ * @throws AJAXException
+ * @throws \Exception
*/
protected function throwException(\Exception $e) {
if ($this->inDebugMode) {
*
* @param array $data
* @return AJAXInvokeAction
+ * @throws SystemException
*/
public static function debugCall(array $data) {
// validate $data array
* Removes a list of quotes from storage and returns the remaining count.
*
* @return integer
+ * @throws SystemException
+ * @throws UserInputException
*/
protected function remove() {
if (empty($this->quoteIDs)) {
* Returns a list of full quotes by object ids for given object types.
*
* @return array<array>
+ * @throws UserInputException
*/
protected function getFullQuoteObjectIDs() {
if (empty($this->objectTypes)) {
* @param array<mixed> $objects
* @param string $action
* @param array $parameters
+ * @throws SystemException
*/
public function __construct(array $objects, $action, array $parameters = array()) {
// set class name
/**
* Returns a single object and throws an UserInputException if no or more than one object is given.
*
- * @return \wcf\data\DatabaseObject
+ * @return DatabaseObject
+ * @throws UserInputException
*/
protected function getSingleObject() {
if (empty($this->objects)) {
* @param string $arrayIndex
* @param integer $type
* @param integer $structure
+ * @throws SystemException
+ * @throws UserInputException
*/
protected function readValue($variableName, $allowEmpty, $arrayIndex, $type, $structure) {
if ($arrayIndex) {
/**
* Creates a new DatabaseObjectDecorator object.
*
- * @param \wcf\data\DatabaseObject $object
+ * @param DatabaseObject $object
+ * @throws SystemException
*/
public function __construct(DatabaseObject $object) {
if (empty(static::$baseClass)) {
* @param string $name
* @param array $arguments
* @return mixed
+ * @throws SystemException
*/
public function __call($name, $arguments) {
if (!method_exists($this->object, $name) && !($this->object instanceof DatabaseObjectDecorator)) {
* Returns the processor this database object.
*
* @return object
+ * @throws SystemException
*/
public function getProcessor() {
if ($this->processor === null) {
* Returns the categories of the object.
*
* @return AbstractDecoratedCategory[]
+ * @throws SystemException
*/
public function getCategories() {
if ($this->categories === null) {
*
* @param string $abbreviation
* @return string
+ * @throws SystemException
*/
public static function getDirectory($abbreviation) {
if (static::$directories === null) {
* Returns a rendered message preview.
*
* @return array
+ * @throws UserInputException
*/
public function getMessagePreview() {
// get options
* @param integer $parentCategoryID
* @param boolean $includeDisabledCategories
* @param integer[] $excludedCategoryIDs
+ * @throws SystemException
*/
public function __construct($objectType, $parentCategoryID = 0, $includeDisabledCategories = false, array $excludedCategoryIDs = []) {
$this->objectType = $objectType;
* them enter a username and solving a captcha.
*
* @return array
+ * @throws SystemException
*/
public function getGuestDialog() {
$captchaObjectType = null;
* Validates object type id parameter.
*
* @return ObjectType
+ * @throws UserInputException
*/
protected function validateObjectType() {
$this->readInteger('objectTypeID', false, 'data');
/**
* Takes an XML object and returns the specific language code.
*
- * @param \wcf\util\XML $xml
+ * @param XML $xml
* @return string
+ * @throws SystemException
*/
public static function readLanguageCodeFromXML(XML $xml) {
$rootNode = $xml->xpath()->query('/ns:language')->item(0);
/**
* Takes an XML object and returns the specific language name.
*
- * @param \wcf\util\XML $xml
+ * @param XML $xml
* @return string language name
+ * @throws SystemException
*/
public static function readLanguageNameFromXML(XML $xml) {
$rootNode = $xml->xpath()->query('/ns:language')->item(0);
/**
* Takes an XML object and returns the specific country code.
*
- * @param \wcf\util\XML $xml
+ * @param XML $xml
* @return string country code
+ * @throws SystemException
*/
public static function readCountryCodeFromXML(XML $xml) {
$rootNode = $xml->xpath()->query('/ns:language')->item(0);
*
* @param string $size thumbnail size
* @return string
+ * @throws SystemException
*/
public function getThumbnailTag($size = '') {
if (!isset(Media::getThumbnailSizes()[$size])) {
* TODO: Comment
*
* @return IMenuPageHandler|null
+ * @throws SystemException
*/
protected function getMenuPageHandler() {
$page = $this->getPage();
/**
* Searches for purchased items in the WoltLab Plugin-Store.
*
- * @return array<string>
+ * @return string[]
+ * @throws SystemException
*/
public function searchForPurchasedItems() {
if (!RemoteFile::supportsSSL()) {
*
* @param integer $languageID language id or `null` if there are no localized versions
* @return string[] page content data
- * @throws \wcf\system\database\DatabaseException
*/
public function getPageContentByLanguage($languageID = null) {
$conditions = new PreparedStatementConditionBuilder();
/**
* Sets the current page as landing page.
*
- * @throws SystemException
+ * @throws SystemException
*/
public function setAsLandingPage() {
if ($this->requireObjectID) {
* Returns parsed template for current sitemap.
*
* @return string
+ * @throws SystemException
*/
public function getTemplate() {
if ($this->sitemapObj === null) {
/**
* Reads the data of a style exchange format file.
*
- * @param \wcf\system\io\Tar $tar
+ * @param Tar $tar
* @return array
+ * @throws SystemException
*/
public static function readStyleData(Tar $tar) {
// search style.xml
* Validates accessible groups.
*
* @param boolean $ignoreOwnUser
+ * @throws PermissionDeniedException
+ * @throws UserInputException
*/
protected function __validateAccessibleGroups($ignoreOwnUser = true) {
if ($ignoreOwnUser) {
*
* @param string $filename
* @return string
+ * @throws UserInputException
*/
protected function enforceDimensions($filename) {
$imageData = getimagesize($filename);
* Returns unique group by given type. Only works for the default user groups.
*
* @param integer $type
- * @return \wcf\data\user\group\UserGroup
+ * @return UserGroup
+ * @throws SystemException
*/
public static function getGroupByType($type) {
if ($type != self::EVERYONE && $type != self::GUESTS && $type != self::USERS) {
*
* @param integer $groupID this group is added or deleted in the value
* @param boolean $delete flag for group deletion
+ * @throws SystemException
*/
protected static function updateAccessibleGroups($groupID, $delete = false) {
$sql = "SELECT optionID
* Returns the output object for current user option.
*
* @return \wcf\system\option\user\IUserOptionOutput
+ * @throws SystemException
*/
public function getOutputObject() {
if (!isset(self::$outputObjects[$this->outputClass])) {
* Returns the content manager for this menu item.
*
* @return IUserProfileMenuContent
+ * @throws SystemException
*/
public function getContentManager() {
if ($this->contentManager === null) {
* Creates new instance of Callback.
*
* @param callback $callback
+ * @throws SystemException
*/
public function __construct($callback) {
if (!is_callable($callback)) {
*
* @param string $regex
* @param integer $modifier
+ * @throws SystemException
*/
public function __construct($regex, $modifier = self::MODIFIER_NONE) {
// escape delimiter
* @param mixed $result
* @param string $method
* @return mixed
+ * @throws SystemException
*/
private function checkResult($result, $method = '') {
if ($result === false || $result === null) {
* Returns an unique instance of current child class.
*
* @return static
+ * @throws SystemException
*/
public static final function getInstance() {
$className = get_called_class();
* @param string $message
* @param string $file
* @param integer $line
+ * @throws ErrorException
*/
public static final function handleError($severity, $message, $file, $line) {
// this is neccessary for the shut-up operator
/**
* Loads an application.
*
- * @param \wcf\data\application\Application $application
- * @param boolean $isDependentApplication
- * @return \wcf\system\application\IApplication
+ * @param Application $application
+ * @param boolean $isDependentApplication
+ * @return IApplication
+ * @throws SystemException
*/
protected function loadApplication(Application $application, $isDependentApplication = false) {
$applicationObject = null;
*
* @param string $name
* @return mixed value
+ * @throws SystemException
*/
public function __get($name) {
$method = 'get'.ucfirst($name);
* @param string $name
* @param array $arguments
* @return object
+ * @throws SystemException
*/
public static final function __callStatic($name, array $arguments) {
$className = preg_replace('~^get~', '', $name);
*
* @param string $objectType
* @return integer
+ * @throws SystemException
*/
public function getObjectTypeID($objectType) {
if (!isset($this->availableObjectTypes[$objectType])) {
*
* @param string $adLocation
* @return string
+ * @throws SystemException
*/
public function getAds($adLocation) {
if (!isset($this->objectTypes[$adLocation])) {
* @param string $objectType
* @param integer $objectID
* @param string $tmpHash
+ * @throws SystemException
*/
public function __construct($objectType, $objectID, $tmpHash = '', $parentObjectID = 0) {
if (!$objectID && !$tmpHash) {
*
* @param mixed $jobs Either an instance of \wcf\system\background\job\AbstractBackgroundJob or an array of these
* @param int $time Earliest time to consider the job for execution.
+ * @throws SystemException
*/
public function enqueueAt($jobs, $time) {
if ($time < TIME_NOW) {
/**
* Returns an object of the requested group option type.
*
- * @param string $type
+ * @param string $type
* @return \wcf\system\option\user\group\IUserGroupOptionType
+ * @throws SystemException
*/
protected function getTypeObject($type) {
if (!isset($this->typeObjects[$type])) {
* @param string $cacheName
* @param string $filename
* @return mixed
+ * @throws SystemException
*/
protected function readCache($cacheName, $filename) {
// get file contents
<?php
namespace wcf\system\category;
+use wcf\data\category\Category;
use wcf\data\object\type\ObjectTypeCache;
use wcf\system\cache\builder\CategoryCacheBuilder;
use wcf\system\exception\SystemException;
*
* @param integer $categoryID
* @param integer $objectTypeID
- * @return array<\wcf\data\category\Category>
+ * @return Category[]
+ * @throws SystemException
*/
public function getChildCategories($categoryID, $objectTypeID = null) {
if (!$categoryID && $objectTypeID === null) {
*
* @param string $line
* @return \wcf\system\cli\command\ICLICommand
+ * @throws IllegalLinkException
*/
public static function getCommand($line) {
list($command, $parameters) = explode(' ', $line.' ', 2);
*
* @param string $line
* @return string
+ * @throws IllegalLinkException
*/
public static function getCommandName($line) {
list($command, $parameters) = explode(' ', $line.' ', 2);
*
* @param string $name
* @param mixed $value
+ * @throws SystemException
*/
public function addInternalData($name, $value) {
if (!preg_match('~^[a-zA-Z]+$~', $name)) {
*
* @param string $name
* @param mixed $value
+ * @throws SystemException
*/
public function addParameter($name, $value) {
if (!preg_match('~^[a-zA-Z]+$~', $name)) {
* Sets item name.
*
* @param string $name
+ * @throws SystemException
*/
public function setName($name) {
if (!preg_match('~^[a-zA-Z0-9\.-]+$~', $name)) {
* Loads a list of marked items grouped by type name.
*
* @param integer $objectTypeID
+ * @throws SystemException
*/
protected function loadMarkedItems($objectTypeID = null) {
if ($this->markedItems === null) {
* @param string $page
* @param integer $pageObjectID
* @return array<array>
+ * @throws SystemException
*/
public function getEditorItems($page, $pageObjectID) {
$this->pageObjectID = 0;
*
* @param string $objectType
* @return ICommentManager
+ * @throws SystemException
*/
public function getCommentManager($objectType) {
$objectTypeID = $this->getObjectTypeID($objectType);
}
return $this->getObjectType($objectTypeID)->getProcessor();
-
}
/**
* Enforces the censorship.
*
* @param string $text
+ * @throws UserInputException
*/
public static function enforceCensorship($text) {
// search for censored words
<?php
namespace wcf\system\condition;
+use wcf\data\condition\Condition;
use wcf\data\condition\ConditionAction;
use wcf\data\condition\ConditionList;
use wcf\data\object\type\ObjectTypeCache;
/**
* Deletes all conditions of the objects with the given ids.
*
- * @param string $definitionName
- * @param array<integer> $objectIDs
+ * @param string $definitionName
+ * @param integer[] $objectIDs
+ * @throws SystemException
*/
public function deleteConditions($definitionName, array $objectIDs) {
if (empty($objectIDs)) return;
*
* @param string $definitionName
* @param integer $objectID
- * @return array<\wcf\data\condition\Condition>
+ * @return Condition[]
+ * @throws SystemException
*/
public function getConditions($definitionName, $objectID) {
// validate definition
/**
* Executes a cronjob.
*
- * @param \wcf\data\cronjob\CronjobEditor $cronjobEditor
- * @param \wcf\data\cronjob\log\CronjobLogEditor $logEditor
+ * @param CronjobEditor $cronjobEditor
+ * @param CronjobLogEditor $logEditor
+ * @throws SystemException
*/
protected function executeCronjob(CronjobEditor $cronjobEditor, CronjobLogEditor $logEditor) {
$className = $cronjobEditor->className;
* Loads the active dashboard boxes for the given object type and page.
*
* @param string $objectType
- * @param \wcf\page\IPage $page
+ * @param IPage $page
+ * @throws SystemException
*/
public function loadBoxes($objectType, IPage $page) {
$objectTypeObj = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.dashboardContainer', $objectType);
* all boxes will be assigned as disabled for given object type.
*
* @param string $objectType
- * @param array<names> $enableBoxNames
+ * @param string[] $enableBoxNames
+ * @throws SystemException
*/
public static function setDefaultValues($objectType, array $enableBoxNames = array()) {
$objectTypeID = 0;
* @param string $table
* @param string $field
* @return integer
+ * @throws DatabaseException
*/
public function getInsertID($table, $field) {
try {
* Initiates a transaction.
*
* @return boolean true on success
+ * @throws DatabaseTransactionException
*/
public function beginTransaction() {
try {
* Commits a transaction and returns true if the transaction was successfull.
*
* @return boolean
+ * @throws DatabaseTransactionException
*/
public function commitTransaction() {
if ($this->activeTransactions === 0) return false;
* Rolls back a transaction and returns true if the rollback was successfull.
*
* @return boolean
+ * @throws DatabaseTransactionException
*/
public function rollBackTransaction() {
if ($this->activeTransactions === 0) return false;
* @param string $statement
* @param integer $limit
* @param integer $offset
- * @return \wcf\system\database\statement\PreparedStatement
+ * @return PreparedStatement
+ * @throws DatabaseQueryException
*/
public function prepareStatement($statement, $limit = 0, $offset = 0) {
$statement = $this->handleLimitParameter($statement, $limit, $offset);
* @param string $tableName
* @param string $columnName
* @return array
+ * @throws DatabaseException
*/
protected function getColumnData($tableName, $columnName) {
$sql = "SELECT pg_catalog.FORMAT_TYPE(atttypid, atttypmod) AS type, attnotnull AS notNull, atthasdef AS default
*
* @param string $mySQLType
* @return string
+ * @throws DatabaseException
*/
protected function getColumnType($mySQLType) {
switch ($mySQLType) {
* @param string $name
* @param array $arguments
* @return mixed
+ * @throws SystemException
*/
public function __call($name, $arguments) {
if (!method_exists($this->pdoStatement, $name)) {
* Executes a prepared statement.
*
* @param array $parameters
+ * @throws DatabaseQueryExecutionException
*/
public function execute(array $parameters = array()) {
$this->parameters = $parameters;
* Counts number of affected rows by the last sql statement (INSERT, UPDATE or DELETE).
*
* @return integer number of affected rows
+ * @throws DatabaseQueryException
*/
public function getAffectedRows() {
try {
*
* @param string $statement
* @param string $query
+ * @throws SystemException
*/
protected function executeStatement($statement, $query) {
switch ($statement) {
*
* @param string $objectType
* @return integer
+ * @throws SystemException
*/
public function getObjectTypeID($objectType) {
if (!isset($this->availableObjectTypes[$objectType])) {
/**
* Sets the part left of the at sign (@) in the email's 'Message-Id'.
*
- * @param string $messageID
+ * @param string $messageID
+ * @throws SystemException
*/
public function setMessageID($messageID = null) {
if ($messageID === null) {
/**
* Adds a message id to the email's 'In-Reply-To'.
*
- * @param string $messageID
+ * @param string $messageID
+ * @throws SystemException
*/
public function addInReplyTo($messageID) {
if (!preg_match('(^'.EmailGrammar::getGrammar('msg-id').'$)', $messageID)) {
/**
* Adds a message id to the email's 'References'.
*
- * @param string $messageID
+ * @param string $messageID
+ * @throws SystemException
*/
public function addReferences($messageID) {
if (!preg_match('(^'.EmailGrammar::getGrammar('msg-id').'$)', $messageID)) {
/**
* Adds a recipient to this email.
*
- * @param \wcf\system\email\Mailbox $recipient
- * @param string $type One of 'to', 'cc', 'bcc'
+ * @param Mailbox $recipient
+ * @param string $type One of 'to', 'cc', 'bcc'
+ * @throws SystemException
*/
public function addRecipient(Mailbox $recipient, $type = 'to') {
switch ($type) {
/**
* Adds a custom X-* header to the email.
*
- * @param string $header
- * @param string $value
+ * @param string $header
+ * @param string $value
+ * @throws SystemException
*/
public function addHeader($header, $value) {
$header = mb_strtolower($header);
* The given priority determines the ordering within the Email. A higher priority
* mime part will be further down the email (see RFC 2046, 5.1.4).
*
- * @param \wcf\system\email\mime\AbstractMimePart $part
- * @param integer $priority
+ * @param AbstractMimePart $part
+ * @param integer $priority
+ * @throws SystemException
*/
public function addMimePart(AbstractMimePart $part, $priority = 1000) {
foreach ($part->getAdditionalHeaders() as $header) {
* headers will fail.
*
* @return array
+ * @throws SystemException
*/
public function getHeaders() {
$headers = [ ];
/**
* Creates a new Mailbox.
*
- * @param string $address email address of this mailbox
- * @param string $name human readable name of this mailbox (or null)
- * @param \wcf\data\language\Language $language Language to use for localization (or null for the default language)
+ * @param string $address email address of this mailbox
+ * @param string $name human readable name of this mailbox (or null)
+ * @param Language $language Language to use for localization (or null for the default language)
+ * @throws SystemException
*/
public function __construct($address, $name = null, Language $language = null) {
if (!preg_match('(^'.EmailGrammar::getGrammar('addr-spec').'$)', $address)) {
* @param string $path Path to read the file from.
* @param string $filename Filename to provide in the email or null to use the $path's basename.
* @param string $mimeType Mime type to provide in the email or null to guess the mime type.
+ * @throws SystemException
*/
public function __construct($path, $filename = null, $mimeType = null) {
if (!is_file($path) || !is_readable($path)) {
* @param string $username username to use for authentication
* @param string $password corresponding password
* @param string $starttls one of 'none', 'may' and 'encrypt'
+ * @throws SystemException
*/
public function __construct($host = MAIL_SMTP_HOST, $port = MAIL_SMTP_PORT, $username = MAIL_SMTP_USER, $password = MAIL_SMTP_PASSWORD, $starttls = MAIL_SMTP_STARTTLS) {
$this->host = $host;
* Reads a server reply and validates it against the given expected status codes.
* Returns a tuple [ status code, reply text ].
*
- * @param array<integer> $expectedCodes
+ * @param integer[] $expectedCodes
* @return array
+ * @throws PermanentFailure
+ * @throws TransientFailure
*/
protected function read(array $expectedCodes) {
$code = null;
/**
* Delivers the given email using SMTP.
*
- * @param \wcf\system\email\Email $email
- * @param \wcf\system\email\Mailbox $envelopeTo
+ * @param Email $email
+ * @param Mailbox $envelopeTo
+ * @throws \Exception
+ * @throws PermanentFailure
+ * @throws SystemException
*/
public function deliver(Email $email, Mailbox $envelopeTo) {
// delivery is locked
}
/**
- * Gets a data importer.
+ * Returns a data importer.
*
* @param string $type
- * @return \wcf\system\importer\IImporter
+ * @return IImporter
+ * @throws SystemException
*/
public function getImporter($type) {
if (!isset($this->importers[$type])) {
* Opens a new file. The file is always opened in binary mode.
*
* @param string $filename
+ * @throws SystemException
*/
public function __construct($filename) {
$this->targetFilename = $filename;
* @param string $host
* @param integer $port
* @param integer $timeout
+ * @throws SystemException
*/
public function __construct($host = 'localhost', $port = 21, $timeout = 30) {
$this->resource = ftp_connect($host, $port, $timeout);
*
* @param string $function
* @param array $arguments
+ * @throws SystemException
*/
public function __call($function, $arguments) {
array_unshift($arguments, $this->resource);
* @param string $filename
* @param string $mode
* @param array $options
+ * @throws SystemException
*/
public function __construct($filename, $mode = 'wb', $options = array()) {
$this->filename = $filename;
*
* @param string $function
* @param array $arguments
+ * @throws SystemException
*/
public function __call($function, $arguments) {
if (function_exists('f' . $function)) {
*
* @param string $filename
* @param string $mode
+ * @throws SystemException
*/
public function __construct($filename, $mode = 'wb') {
if (self::$gzopen64 === null) {
*
* @param string $function
* @param array $arguments
+ * @throws SystemException
*/
public function __call($function, $arguments) {
if (self::$gzopen64 && function_exists('gz' . $function . '64')) {
* @param integer $port
* @param integer $timeout
* @param array $options
+ * @throws SystemException
*/
public function __construct($host, $port, $timeout = 30, $options = array()) {
$this->host = $host;
* archiveName must be tarball or gzipped tarball
*
* @param string $archiveName
+ * @throws SystemException
*/
public function __construct($archiveName) {
if (!is_file($archiveName)) {
* @param string $addDir
* @param string $removeDir
* @return boolean result
+ * @throws SystemException
*/
public function add($files, $addDir = '', $removeDir = '') {
if (!is_array($files)) $files = array($files);
* Reads the central directory and returns it.
*
* @return array
+ * @throws SystemException
*/
protected function readCentralDirectory() {
$this->jumpToCentralDirectory();
$offset = $this->tell();
-
+
// check signature
if ($this->read(4) !== self::CENTRAL_DIRECTORY_SIGNATURE) {
throw new SystemException('Not in central directory');
*
* @param integer $offset where to start reading
* @return boolean
+ * @throws SystemException
*/
public function isFile($offset = null) {
if ($offset === null) $offset = $this->tell();
*
* @param integer $offset where to start reading
* @return array
+ * @throws SystemException
*/
public function readFile($offset = null) {
if ($offset === null) $offset = $this->tell();
<?php
namespace wcf\system\label;
+use wcf\data\label\group\ViewableLabelGroup;
use wcf\data\object\type\ObjectTypeCache;
use wcf\system\cache\builder\LabelCacheBuilder;
use wcf\system\database\util\PreparedStatementConditionBuilder;
* Returns an array with boolean values for each given label id.
*
* @param string $optionName
- * @param array<integer> $labelIDs
+ * @param integer[] $labelIDs
* @return array
+ * @throws SystemException
*/
public function getPermissions($optionName, array $labelIDs) {
if (empty($labelIDs)) {
/**
* Returns given label groups by id.
*
- * @param array<integer> $groupID
- * @param boolean $validatePermissions
- * @param string $permission
- * @return array<\wcf\data\label\group\ViewableLabelGroup>
+ * @param integer[] $groupIDs
+ * @param boolean $validatePermissions
+ * @param string $permission
+ * @return ViewableLabelGroup[]
+ * @throws SystemException
*/
public function getLabelGroups(array $groupIDs = array(), $validatePermissions = true, $permission = 'canSetLabel') {
$data = array();
*
* @param string $elementID
* @param string $plainValue
+ * @throws SystemException
*/
public function setValue($elementID, $plainValue) {
if (!is_string($plainValue)) {
*
* @param string $elementID
* @param string[] $i18nValues
+ * @throws SystemException
*/
public function setValues($elementID, array $i18nValues) {
if (empty($i18nValues)) {
* Downloads and imports a language file from a language server.
*
* @param string $location
- * @param array<string> $packageList
+ * @param string[] $packageList
+ * @throws SystemException
*/
protected function importLanguageFile($location, array $packageList) {
// get proxy
*
* @param integer[] $objectIDs
* @param string[] $ignoredActions names of actions whose log entries will not be deleted
- * @throws DatabaseQueryException
- * @throws DatabaseQueryExecutionException
*/
public function deleteLogs(array $objectIDs, array $ignoredActions = []) {
if (empty($objectIDs)) return;
* Deletes modification log entries by the id of the parent object.
*
* @param integer[] $parentObjectIDs
- * @throws DatabaseQueryException
- * @throws DatabaseQueryExecutionException
*/
public function deleteLogsByParentIDs(array $parentObjectIDs) {
if (empty($parentObjectIDs)) return;
<?php
namespace wcf\system\log\modification;
+use wcf\data\modification\log\ModificationLog;
use wcf\data\modification\log\ModificationLogEditor;
use wcf\data\object\type\ObjectTypeCache;
use wcf\system\database\util\PreparedStatementConditionBuilder;
* @param integer $time
* @param integer $userID
* @param string $username
- * @return \wcf\data\modification\log\ModificationLog
+ * @return ModificationLog
+ * @throws SystemException
*/
protected function _add($objectType, $objectID, $action, array $additionalData = array(), $time = TIME_NOW, $userID = null, $username = null) {
$objectTypeObj = $this->getObjectType($objectType);
* Removes log entries.
*
* @param string $objectType
- * @param array<integer> $objectIDs
+ * @param integer[] $objectIDs
+ * @throws SystemException
*/
protected function _remove($objectType, array $objectIDs) {
$objectTypeObj = $this->getObjectType($objectType);
* @param array<array> $parameters
* @param string $containerClassName
* @param string $containerDecoratorClassName
+ * @throws SystemException
+ * @throws UserInputException
*/
public function validateParameters(IMessageQuickReplyAction $object, array &$parameters, $containerClassName, $containerDecoratorClassName = '') {
if (!isset($parameters['data']['message'])) {
* @param string $fullQuote
* @param boolean $returnFalseIfExists
* @return mixed
+ * @throws SystemException
*/
public function addQuote($objectType, $parentObjectID, $objectID, $message, $fullQuote = '', $returnFalseIfExists = true) {
if (!isset($this->objectTypes[$objectType])) {
*
* @param string[] $objectTypes
* @return array<array>
+ * @throws SystemException
*/
public function getFullQuoteObjectIDs(array $objectTypes) {
$objectIDs = [];
*
* @param string $objectType
* @param integer[] $objectIDs
+ * @throws SystemException
*/
public function initObjects($objectType, array $objectIDs) {
if (!isset($this->objectTypes[$objectType])) {
* @param string $objectType
* @param integer $objectID
* @param array $additionalData
+ * @throws SystemException
*/
public function addModeratedContent($objectType, $objectID, array $additionalData = array()) {
if (!$this->isValid($objectType)) {
* Marks entries from moderation queue as done.
*
* @param string $objectType
- * @param array<integer> $objectIDs
+ * @param integer[] $objectIDs
+ * @throws SystemException
*/
public function removeModeratedContent($objectType, array $objectIDs) {
if (!$this->isValid($objectType)) {
namespace wcf\system\moderation\queue;
use wcf\data\moderation\queue\ModerationQueue;
use wcf\data\moderation\queue\ModerationQueueList;
+use wcf\data\moderation\queue\ViewableModerationQueue;
use wcf\data\object\type\ObjectTypeCache;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\exception\SystemException;
/**
* Populates object properties for viewing.
*
- * @param integer $objectTypeID
- * @param array<\wcf\data\moderation\queue\ViewableModerationQueue> $objects
+ * @param integer $objectTypeID
+ * @param ViewableModerationQueue[] $objects
+ * @throws SystemException
*/
public function populate($objectTypeID, array $objects) {
$moderationType = '';
/**
* Removes moderation queues, should only be called if related objects are permanently deleted.
*
- * @param string $objectType
- * @param array<integer> $objectIDs
+ * @param string $objectType
+ * @param integer[] $objectIDs
+ * @throws SystemException
*/
public function removeQueues($objectType, array $objectIDs) {
$definitionNames = $this->getDefinitionNamesByObjectType($objectType);
* @param integer $objectID
* @param string $message
* @param array $additionalData
+ * @throws SystemException
*/
public function addReport($objectType, $objectID, $message, array $additionalData = array()) {
if (!$this->isValid($objectType)) {
/**
* Validates an option.
*
- * @param \wcf\data\option\Option $option
+ * @param Option $option
+ * @throws UserInputException
*/
protected function validateOption(Option $option) {
// get type object
* Returns an object of the requested option type.
*
* @param string $type
- * @return \wcf\system\option\IOptionType
+ * @return IOptionType
+ * @throws SystemException
*/
public function getTypeObject($type) {
if (!isset($this->typeObjects[$type])) {
*
* @param string $optionType
* @return string
+ * @throws SystemException
*/
protected function getClassName($optionType) {
$optionType = StringUtil::firstCharToUpperCase($optionType);
* @param string $filename
* @param string $tempPrefix
* @return string
+ * @throws PackageValidationException
*/
public function extractTar($filename, $tempPrefix = 'package_') {
// search the requested tar archive in our package archive.
*
* @param mixed[] $nodeData
* @return PackageInstallationStep
+ * @throws SystemException
*/
protected function installPackage(array $nodeData) {
$installationStep = new PackageInstallationStep();
/**
* Executes a package installation plugin.
*
- * @param mixed[] $nodeData
+ * @param mixed[] $nodeData
* @return boolean
+ * @throws SystemException
*/
protected function executePIP(array $nodeData) {
$step = new PackageInstallationStep();
* Builds nodes for required packages, whereas each has it own node.
*
* @return string
+ * @throws SystemException
*/
protected function buildRequirementNodes() {
$queue = $this->installation->queue;
* @param array $packageUpdateVersions package update versions
* @param boolean $validateInstallInstructions
* @return string tmp filename of a downloaded package
+ * @throws PackageUpdateUnauthorizedException
+ * @throws SystemException
*/
protected function downloadPackage($package, $packageUpdateVersions, $validateInstallInstructions = false) {
// get download from cache
* @param string $currentVersion current package version
* @param string $newVersion new package version
* @return array list of update steps (old version => new version, old version => new version, ...)
+ * @throws SystemException
*/
protected function findShortestUpdateThread($package, $fromversions, $currentVersion, $newVersion) {
if (!isset($fromversions[$newVersion])) {
/**
* Gets the package_update.xml from an update server.
*
- * @param \wcf\data\package\update\server\PackageUpdateServer $updateServer
- * @param boolean $forceHTTP
+ * @param PackageUpdateServer $updateServer
+ * @param boolean $forceHTTP
+ * @throws PackageUpdateUnauthorizedException
+ * @throws SystemException
*/
protected function getPackageUpdateXML(PackageUpdateServer $updateServer, $forceHTTP = false) {
$settings = array();
* Parses a stream containing info from a packages_update.xml.
*
* @param string $content
- * @return array $allNewPackages
+ * @return array
+ * @throws SystemException
*/
protected function parsePackageUpdateXML($content) {
// load xml document
* @param string $package package identifier
* @param string $version package version
* @return array package update versions
+ * @throws SystemException
*/
public function getPackageUpdateVersions($package, $version = '') {
// get newest package version
* Imports options.
*
* @param \DOMXPath $xpath
+ * @throws SystemException
*/
protected function importOptions(\DOMXPath $xpath) {
$elements = $xpath->query('/ns:data/ns:import/ns:options/ns:option');
*
* @param string $optionType
* @return integer
+ * @throws SystemException
*/
protected function getObjectTypeID($optionType) {
if (!isset($this->optionTypeIDs[$optionType])) {
* Imports option categories.
*
* @param \DOMXPath $xpath
+ * @throws SystemException
*/
protected function importCategories(\DOMXPath $xpath) {
$elements = $xpath->query('/ns:data/ns:import/ns:categories/ns:category');
* Imports options.
*
* @param \DOMXPath $xpath
+ * @throws SystemException
*/
protected function importOptions(\DOMXPath $xpath) {
$elements = $xpath->query('/ns:data/ns:import/ns:options/ns:option');
* Installs option categories.
*
* @param array $category
+ * @throws SystemException
*/
protected function saveCategory($category) {
// search existing category
*
* @param string $filename
* @return XML $xml
+ * @throws SystemException
*/
protected function getXML($filename = '') {
if (empty($filename)) {
* was not found, an exception message is thrown.
*
* @param string $filename
- * @return \wcf\util\XML
+ * @return XML
+ * @throws SystemException
*/
protected function readLanguage($filename) {
// search language files in package archive
*
* @param string $definitionName
* @return integer
+ * @throws SystemException
*/
protected function getDefinitionID($definitionName) {
// get object type id
*
* @param string $filename
* @return string
+ * @throws SystemException
*/
protected function getSQL($filename) {
// search sql files in package archive
*
* @param string $requiredVersion
* @param integer $validationMode
+ * @throws PackageValidationException
*/
protected function validateInstructions($requiredVersion, $validationMode) {
$package = $this->getPackage();
*
* @param string $type
* @param array<array> $instructions
+ * @throws PackageValidationException
*/
protected function validatePackageInstallationPlugins($type, array $instructions) {
for ($i = 0, $length = count($instructions); $i < $length; $i++) {
* Validates if an installed package excludes the current package and vice versa.
*
* @param string $package
+ * @throws PackageValidationException
*/
protected function validateExclusion($package) {
$packageVersion = $this->archive->getPackageInfo('version');
* are returned.
*
* @param string $application
- * @return array<string>
+ * @return string[]
+ * @throws SystemException
*/
public function getSelection($application = null) {
$objectTypes = $this->objectTypes;
* @param integer $objectID
* @param integer $pollID
* @return boolean
+ * @throws SystemException
*/
public function setObject($objectType, $objectID, $pollID = 0) {
if (!isset($this->cache[$objectType])) {
*
* @param integer $objectID
* @return integer
+ * @throws SystemException
*/
public function save($objectID = null) {
if ($objectID !== null) {
* @param integer $objectTypeID
* @param string $objectType
* @return mixed
+ * @throws SystemException
*/
protected function getHandler($objectTypeID, $objectType = '') {
if ($objectTypeID !== null) {
*
* @param string $challenge
* @param string $response
+ * @throws SystemException
+ * @throws UserInputException
*/
public function validate($challenge, $response) {
// fail if challenge or response are empty to avoid sending api requests
* Validates response.
*
* @param string $response
+ * @throws UserInputException
*/
public function validate($response) {
// fail if response is empty to avoid sending api requests
*
* @param string $application application identifier
* @return null|string[] default controller
+ * @throws SystemException
*/
public function lookupDefaultController($application) {
$controller = $this->landingPages[$application][1];
* @param integer $pageID page id
* @param integer $languageID language id, optional
* @return string full URL of empty string if `$pageID` is invalid
- * @throws \wcf\system\exception\SystemException
* @since 2.2
*/
public function getCmsLink($pageID, $languageID = -1) {
*
* @param string $application
* @param string[] $routeData
+ * @throws IllegalLinkException
*/
protected function handleDefaultController($application, array &$routeData) {
if (!RouteHandler::getInstance()->isDefaultController()) {
*
* @param string $routeSchema
* @param string $controller
+ * @throws SystemException
*/
public function setSchema($routeSchema, $controller = null) {
$schemaParts = $this->getParts($routeSchema);
<?php
namespace wcf\system\search;
+use wcf\data\object\type\ObjectType;
use wcf\data\object\type\ObjectTypeCache;
use wcf\data\package\Package;
use wcf\data\package\PackageList;
*
* @param string $objectType
* @return integer
+ * @throws SystemException
*/
public function getObjectTypeID($objectType) {
if (!isset($this->availableObjectTypes[$objectType])) {
* Returns the the object type with the given name.
*
* @param string $objectType
- * @return \wcf\data\object\type\ObjectType
+ * @return ObjectType
+ * @throws SystemException
*/
public function getObjectType($objectType) {
if (!isset($this->availableObjectTypes[$objectType])) {
*
* @param string $query
* @param integer $limit
- * @return array<\wcf\system\search\acp\ACPSearchResultList>
+ * @return ACPSearchResultList[]
+ * @throws SystemException
*/
public function search($query, $limit = 10) {
$data = array();
*
* @param string $categoryName
* @return \wcf\data\DatabaseObject
+ * @throws SystemException
*/
protected function getTopCategory($categoryName) {
if (!$this->isValid($categoryName)) {
/**
* Changes the user stored in the session.
*
- * @param \wcf\data\user\User $user
+ * @param User $user
+ * @throws DatabaseException
*/
protected function changeUserVirtual(User $user) {
/** @var \wcf\data\DatabaseObjectEditor $sessionEditor */
* Creates a directory in the target directory.
*
* @param string $dir
+ * @throws SystemException
*/
protected function createDir($dir) {
if (!@is_dir($this->targetDir.$dir)) {
* Validates sitemap name.
*
* @param string $sitemapName
+ * @throws SystemException
*/
public function validateSitemapName($sitemapName) {
if (empty($sitemapName)) {
*
* @param string $filename
* @return string
+ * @throws SystemException
*/
protected function prepareFile($filename) {
if (!file_exists($filename) || !is_readable($filename)) {
* @param string[] $variables
* @param string $individualScss
* @param Callback $callback
+ * @throws SystemException
*/
protected function compileStylesheet($filename, array $files, array $variables, $individualScss, Callback $callback) {
foreach ($variables as &$value) {
*
* @param integer $styleID
* @param boolean $ignorePermissions
+ * @throws SystemException
*/
public function changeStyle($styleID = 0, $ignorePermissions = false) {
// check permission
*
* @param string $objectType
* @return integer
+ * @throws SystemException
*/
public function getObjectTypeID($objectType) {
// get object type
* @param string $templateName
* @param string $application
* @return string $path
+ * @throws SystemException
*/
public function getSourceFilename($templateName, $application) {
$sourceFilename = $this->getPath($this->templatePaths[$application], $templateName);
* Reads the content of a template file.
*
* @param string $sourceFilename
- * @return string $sourceContent
+ * @return string
+ * @throws SystemException
*/
public function getSourceContent($sourceFilename) {
$sourceContent = '';
* Sets the dir for the compiled templates.
*
* @param string $compileDir
+ * @throws SystemException
*/
public function setCompileDir($compileDir) {
if (!is_dir($compileDir)) {
* @param array $metaData
* @param boolean $isolated
* @return string
+ * @throws SystemException
*/
public function compileString($identifier, $sourceContent, array $metaData = array(), $isolated = false) {
if ($isolated) {
* @param string $identifier
* @param array $metaData
* @return string
+ * @throws SystemException
*/
protected function compileTag($tag, $identifier, array &$metaData) {
if (preg_match('~^'.$this->outputPattern.'~s', $tag)) {
* @param string $tagCommand
* @param string $tagArgs
* @return mixed
+ * @throws SystemException
*/
protected function compileBlockPlugin($tagCommand, $tagArgs) {
// check wheater this is the start ({block}) or the
* @param string $tagCommand
* @param string $tagArgs
* @return mixed
+ * @throws SystemException
*/
protected function compileCompilerPlugin($tagCommand, $tagArgs) {
// check wheater this is the start ({block}) or the
*
* @param string $sectionTag
* @return string
+ * @throws SystemException
*/
protected function compileSectionTag($sectionTag) {
$args = $this->parseTagArgs($sectionTag, 'section');
*
* @param string $foreachTag
* @return string
+ * @throws SystemException
*/
protected function compileForeachTag($foreachTag) {
$args = $this->parseTagArgs($foreachTag, 'foreach');
* @param string $identifier
* @param array $metaData
* @return string
+ * @throws SystemException
*/
protected function compileIncludeTag($includeTag, $identifier, array $metaData) {
$args = $this->parseTagArgs($includeTag, 'include');
* @param string $tagArgs
* @param string $tag
* @return array
+ * @throws SystemException
*/
public function parseTagArgs($tagArgs, $tag) {
// replace strings
* @param string $tagArgs
* @param boolean $elseif true, if this tag is an else tag
* @return string
+ * @throws SystemException
*/
protected function compileIfTag($tagArgs, $elseif = false) {
$tagArgs = $this->replaceQuotes($tagArgs);
*
* @param string $tag
* @return string
+ * @throws SystemException
*/
protected function compileOutputTag($tag) {
$encodeHTML = false;
*
* @param string $tag
* @return string
+ * @throws SystemException
*/
public function compileVariableTag($tag, $replaceQuotes = true) {
// replace all quotes with unique hash values
* @param string $templateName
* @param string $string
* @return string
+ * @throws SystemException
*/
public function applyPrefilters($templateName, $string) {
foreach ($this->template->getPrefilters() as $prefilter) {
* @param string $actionClassName
* @param array $options
* @param array $data
+ * @throws SystemException
*/
public function __construct($actionClassName, array $options = [ ], array $data = [ ]) {
$this->actionClassName = $actionClassName;
* @param integer $time
* @param array $additionalData
* @return \wcf\data\user\activity\event\UserActivityEvent
+ * @throws SystemException
*/
public function fireEvent($objectType, $objectID, $languageID = null, $userID = null, $time = TIME_NOW, $additionalData = array()) {
$objectTypeID = $this->getObjectTypeID($objectType);
* Removes activity events.
*
* @param string $objectType
- * @param array<integer> $objectIDs
+ * @param integer[] $objectIDs
+ * @throws SystemException
*/
public function removeEvents($objectType, array $objectIDs) {
if (empty($objectIDs)) return;
* @param integer $objectID
* @param integer $userID
* @param array<mixed> $additionalData
+ * @throws SystemException
*/
public function fireEvent($objectType, $objectID, $userID = null, array $additionalData = array()) {
$objectTypeObj = $this->getObjectTypeByName($objectType);
* userID => countOfItems
* )
*
- * @param string $objectType
- * @param array<integer> $itemsToUser
- * @param boolean $updateUsers
+ * @param string $objectType
+ * @param integer[] $itemsToUser
+ * @param boolean $updateUsers
+ * @throws SystemException
*/
public function fireEvents($objectType, array $itemsToUser, $updateUsers = true) {
$objectTypeObj = $this->getObjectTypeByName($objectType);
* Removes activity point events.
*
* @param string $objectType
- * @param array<integer> $userToItems
+ * @param integer[] $userToItems
+ * @throws SystemException
*/
public function removeEvents($objectType, array $userToItems) {
if (empty($userToItems)) return;
* Resets activity points and items for a given object type.
*
* @param string $objectType
+ * @throws SystemException
*/
public function reset($objectType) {
// get and validate object type
* @param string $objectType
* @param string $objectID
* @return boolean
+ * @throws SystemException
*/
public function isCollapsed($objectType, $objectID) {
$objectTypeID = $this->getObjectTypeID($objectType);
*
* @param string $objectType
* @param integer $objectID
+ * @throws SystemException
*/
public function resetAll($objectType, $objectID = null) {
$objectTypeID = $this->getObjectTypeID($objectType);
/**
* Triggers a notification event.
*
- * @param string $eventName
- * @param string $objectType
- * @param \wcf\system\user\notification\object\IUserNotificationObject $notificationObject
- * @param array<integer> $recipientIDs
- * @param array<mixed> $additionalData
- * @param integer $baseObjectID
+ * @param string $eventName
+ * @param string $objectType
+ * @param IUserNotificationObject $notificationObject
+ * @param integer[] $recipientIDs
+ * @param array<mixed> $additionalData
+ * @param integer $baseObjectID
+ * @throws SystemException
*/
public function fireEvent($eventName, $objectType, IUserNotificationObject $notificationObject, array $recipientIDs, array $additionalData = array(), $baseObjectID = 0) {
// check given object type and event name
* @param integer $authorID
* @param integer $time
* @return integer
+ * @throws SystemException
*/
public function getNotificationID($eventID, $objectID, $authorID = null, $time = null) {
if ($authorID === null && $time === null) {
* Removes notifications, this method should only be invoked for delete objects.
*
* @param string $objectType
- * @param array<integer> $objectIDs
+ * @param integer[] $objectIDs
+ * @throws SystemException
*/
public function removeNotifications($objectType, array $objectIDs) {
// check given object type
*
* @param string $eventName
* @param string $objectType
- * @param array<integer> $recipientIDs
- * @param array<integer> $objectIDs
+ * @param integer[] $recipientIDs
+ * @param integer[] $objectIDs
+ * @throws SystemException
*/
public function markAsConfirmed($eventName, $objectType, array $recipientIDs, array $objectIDs = array()) {
// check given object type and event name
*
* @param string $objectTypeName
* @return integer
+ * @throws SystemException
*/
public function getObjectTypeID($objectTypeName) {
$objectType = ObjectTypeCache::getInstance()->getObjectTypeByName('com.woltlab.wcf.user.objectWatch', $objectTypeName);
*
* @param string $objectType
* @return integer
+ * @throws SystemException
*/
public function getObjectTypeID($objectType) {
if (!isset($this->availableObjectTypes[$objectType])) {
* @param string $method
* @param array $array1
* @param array $array2
- * @param callable $callback
+ * @param Callback $callback
* @return boolean
+ * @throws SystemException
*/
protected static function compareHelper($method, array $array1, array $array2, Callback $callback = null) {
// get function name
* @param string $className
* @param string $targetClass
* @return boolean
+ * @throws SystemException
*
* @deprecated use is_subclass_of() instead
*/
*
* @param string $name
* @param string $value
+ * @throws SystemException
*/
protected static function validateAttribute($name, $value) {
if ($value === '') {
/**
* Signs the given value with the signature secret.
*
- * @param string $value
+ * @param string $value
* @return string
+ * @throws CryptoException
*/
public static function getSignature($value) {
if (mb_strlen(SIGNATURE_SECRET, '8bit') < 15) throw new CryptoException('SIGNATURE_SECRET is too short, aborting.');
*
* @param int $n
* @return string
+ * @throws CryptoException
*/
public static function randomBytes($n) {
try {
* Validates if given date is valid ISO-8601.
*
* @param string $date
+ * @throws SystemException
*/
public static function validateDate($date) {
if (preg_match('~^(?P<year>[0-9]{4})-(?P<month>[0-9]{2})-(?P<day>[0-9]{2})~', $date, $matches)) {
* @param string $tmpDirectory path
* @param boolean $recursive walk through sub-directories too
* @return DirectoryUtil
+ * @throws SystemException
*/
public static function getInstance($tmpDirectory, $recursive = true) {
$directory = realpath(FileUtil::unifyDirSeparator($tmpDirectory));
/**
* Returns a sorted list of files.
*
- * @param integer $order sort-order
- * @param \wcf\system\Regex $pattern pattern to match
- * @param boolean $negativeMatch true if the pattern should be inversed
- * @return array<string>
+ * @param integer $order sort-order
+ * @param Regex $pattern pattern to match
+ * @param boolean $negativeMatch true if the pattern should be inversed
+ * @return string[]
+ * @throws SystemException
*/
public function getFiles($order = SORT_ASC, Regex $pattern = null, $negativeMatch = false) {
// scan the folder
/**
* Returns a sorted list of files, with DirectoryIterator object as value
*
- * @param integer $order sort order
- * @param \wcf\system\Regex $pattern pattern to match
- * @param boolean $negativeMatch should the pattern be inversed
- * @return array<\DirectoryIterator>
+ * @param integer $order sort order
+ * @param Regex $pattern pattern to match
+ * @param boolean $negativeMatch should the pattern be inversed
+ * @return \DirectoryIterator[]
+ * @throws SystemException
*/
public function getFileObjects($order = SORT_ASC, Regex $pattern = null, $negativeMatch = false) {
// scan the folder
/**
* Removes all files that match the given pattern.
*
- * @param \wcf\system\Regex $pattern pattern to match
- * @param boolean $negativeMatch should the pattern be inversed
+ * @param Regex $pattern pattern to match
+ * @param boolean $negativeMatch should the pattern be inversed
+ * @throws SystemException
*/
public function removePattern(Regex $pattern, $negativeMatch = false) {
if (!$this->recursive) throw new SystemException('Removing of files only works in recursive mode');
* Calculates the size of the directory.
*
* @return integer directory size in bytes
+ * @throws SystemException
*/
public function getSize() {
if (!$this->recursive) throw new SystemException('Calculating of size only works in recursive mode');
*
* @param string $location
* @param array $options
+ * @throws SystemException
*/
public function __construct($location, array $options) {
$this->location = $location;
* Tries to find the temp folder.
*
* @return string
+ * @throws SystemException
*/
public static function getTempFolder() {
try {
* permissions and goes up until 0666 for files and 0777 for directories.
*
* @param string $filename
+ * @throws SystemException
*/
public static function makeWritable($filename) {
if (!file_exists($filename)) {
* Sets options and applies default values when an option is omitted.
*
* @param array $options
+ * @throws SystemException
*/
private function setOptions(array $options) {
if (!isset($options['timeout'])) {
* @param string $json
* @param boolean $asArray
* @return array
+ * @throws SystemException
*/
public static function decode($json, $asArray = true) {
// decodes JSON
* @param string $password
* @param string $dbHash
* @return boolean
+ * @throws SystemException
*/
public static function checkPassword($username, $password, $dbHash) {
$type = self::detectEncryption($dbHash);
* @param integer $min
* @param integer $max
* @return integer
+ * @throws SystemException
*/
public static function secureRandomNumber($min, $max) {
$range = $max - $min;
* Loads a xml file for processing.
*
* @param string $path
+ * @throws SystemException
*/
public function load($path) {
$this->path = $path;
*
* @param string $message
* @param array $errors
+ * @throws SystemException
*/
protected function throwException($message, array $errors = array()) {
if (!empty($errors)) {
* @param string $rootElement
* @param string $namespace
* @param string $schemaLocation
- * @param array<string> $attributes
+ * @param string[] $attributes
+ * @throws SystemException
*/
public function beginDocument($rootElement, $namespace, $schemaLocation, array $attributes = array()) {
if ($this->activeDocument) {