*
* @param string $function
* @param array $arguments
+ * @return mixed
*/
public function __call($function, $arguments) {
if (function_exists('f' . $function)) {
*
* @param string $function
* @param array $arguments
+ * @return mixed
*/
public function __call($function, $arguments) {
if (self::$gzopen64 && function_exists('gz' . $function . '64')) {
*
* @param mixed $result
* @param string $method
+ * @return mixed
*/
private function checkResult($result, $method = '') {
if ($result === false || $result === null) {
*
* @param string $name
* @param array $arguments
+ * @return object
*/
public static final function __callStatic($name, array $arguments) {
$className = preg_replace('~^get~', '', $name);
/**
* Fixes markup that every line has proper number of opening and closing tags
*
- * @param array<string> $lines
+ * @param string[] $lines
+ * @return string[]
*/
public static function fixMarkup(array $lines) {
static $spanRegex = null;
<?php
namespace wcf\system\bulk\processing\user;
use wcf\data\user\group\UserGroup;
+use wcf\data\user\User;
use wcf\data\user\UserList;
use wcf\system\bulk\processing\AbstractBulkProcessingAction;
use wcf\system\database\util\PreparedStatementConditionBuilder;
* Abstract implementation of a user bulk processing action.
*
* @author Matthias Schmidt
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.bulk.processing.user
*/
abstract class AbstractUserBulkProcessingAction extends AbstractBulkProcessingAction {
/**
- * @see \wcf\system\bulk\processing\IBulkProcessingAction::getObjectList()
+ * @inheritDoc
*/
public function getObjectList() {
return new UserList();
* Returns all users who the active user can access due to their user group
* assocition.
*
- * @param \wcf\data\user\UserList $userList
+ * @param UserList $userList
+ * @return User[]
*/
protected function getAccessibleUsers(UserList $userList) {
// fetch user group ids of all users
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute($conditionBuilder->getParameters());
- $groupIDs = [ ];
+ $groupIDs = [];
while ($row = $statement->fetchArray()) {
if (!isset($groupIDs[$row['userID']])) {
- $groupIDs[$row['userID']] = [ ];
+ $groupIDs[$row['userID']] = [];
}
$groupIDs[$row['userID']][] = $row['groupID'];
}
- $users = [ ];
+ $users = [];
foreach ($userList as $user) {
if (empty($groupIDs[$user->userID]) || UserGroup::isAccessibleGroup($groupIDs[$user->userID])) {
$users[$user->userID] = $user;
* Handles the category permissions.
*
* @author Matthias Schmidt
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.category
* cached category acl options
* @var array
*/
- protected $categoryPermissions = array();
+ protected $categoryPermissions = [];
/**
* Returns the acl options for the given category and for the given user.
* If no user is given, the active user is used.
*
- * @param \wcf\data\category\Category $category
- * @param \wcf\data\user\User $user
+ * @param Category $category
+ * @param User $user
+ * @return integer[]
*/
public function getPermissions(Category $category, User $user = null) {
if ($user === null) {
$user = WCF::getUser();
}
- $permissions = array();
+ $permissions = [];
if (isset($this->categoryPermissions[$category->categoryID])) {
if (isset($this->categoryPermissions[$category->categoryID]['group'])) {
foreach ($user->getGroupIDs() as $groupID) {
}
/**
- * @see \wcf\system\SingletonFactory::init()
+ * @inheritDoc
*/
protected function init() {
$this->categoryPermissions = CategoryACLOptionCacheBuilder::getInstance()->getData();
* Loads a list of marked items grouped by type name.
*
* @param integer $objectTypeID
+ * @return array
*/
public function getMarkedItems($objectTypeID = null) {
if ($this->markedItems === null) {
*
* @param string $columnName
* @param array $columnData
- * @param string
+ * @return string
*/
protected function buildColumnDefinition($columnName, $columnData) {
// column name
*
* @param string $indexName
* @param array $indexData
- * @param string
+ * @return string
*/
protected function buildIndexDefinition($indexName, $indexData) {
$definition = "";
*
* @param string $columnName
* @param array $columnData
- * @param string
+ * @return string
*/
protected function buildColumnDefinition($columnName, $columnData) {
// column name
* Builds a column type for execution in a create table or alter table statement.
*
* @param array $columnData
- * @param string
+ * @return string
*/
protected function buildColumnType($columnData) {
$definition = strtoupper($columnData['type']);
* Converts a MySQL column type to the matching PostgreSQL column type.
*
* @param string $mySQLType
- * @param string
+ * @return string
*/
protected function getColumnType($mySQLType) {
switch ($mySQLType) {
}
/**
- * Removes a quote from storage.
+ * Removes a quote from storage and returns true if the quote has successfully been removed.
*
* @param string $quoteID
+ * @return boolean
*/
public function removeQuote($quoteID) {
if (!isset($this->quoteData[$quoteID])) {
* Returns a list of quotes.
*
* @param boolean $supportPaste
+ * @return string
*/
public function getQuotes($supportPaste = false) {
$template = '';
*
* @param \DOMXPath $xpath
* @param \DOMNode $package
+ * @return array
*/
protected function parsePackageUpdateXMLBlock(\DOMXPath $xpath, \DOMNode $package) {
// define default values
* and released under the conditions of the GNU Lesser General Public License.
*
* @author Alexander Ebert
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.recaptcha
class RecaptchaHandler extends SingletonFactory {
/**
* list of supported languages
- * @var array<string>
+ * @var string[]
* @see http://code.google.com/intl/de-DE/apis/recaptcha/docs/customization.html#i18n
*/
- protected $supportedLanguages = array(
- 'de', 'en', 'es', 'fr', 'nl', 'pt', 'ru', 'tr'
- );
+ protected $supportedLanguages = ['de', 'en', 'es', 'fr', 'nl', 'pt', 'ru', 'tr'];
/**
* language code
const ERROR_NOT_REACHABLE = 'recaptcha-not-reachable';
/**
- * @see \wcf\system\SingletonFactory::init()
+ * @inheritDoc
*/
protected function init() {
// set appropriate language code, fallback to EN if language code is not known to reCAPTCHA-API
*
* @param string $challenge
* @param string $response
+ * @return string
*/
protected function verify($challenge, $response) {
- $request = new HTTPRequest('http://www.google.com/recaptcha/api/verify', array('timeout' => 10), array(
+ $request = new HTTPRequest('http://www.google.com/recaptcha/api/verify', ['timeout' => 10], [
'privatekey' => $this->privateKey,
'remoteip' => UserUtil::getIpAddress(),
'challenge' => $challenge,
'response' => $response
- ));
+ ]);
try {
$request->execute();
* Assigns template variables for reCAPTCHA.
*/
public function assignVariables() {
- WCF::getTPL()->assign(array(
+ WCF::getTPL()->assign([
'recaptchaLanguageCode' => $this->languageCode,
'recaptchaPublicKey' => $this->publicKey,
'recaptchaUseSSL' => RouteHandler::secureConnection(), // @deprecated since 2.1
'recaptchaLegacyMode' => true
- ));
+ ]);
}
}
<?php
namespace wcf\system\search;
+use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\SingletonFactory;
use wcf\util\StringUtil;
* all search engines to preserve compatibility in case of interface changes.
*
* @author Alexander Ebert
- * @copyright 2001-2015 WoltLab GmbH
+ * @copyright 2001-2016 WoltLab GmbH
* @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
* @package com.woltlab.wcf
* @subpackage system.search
* class name for preferred condition builder
* @var string
*/
- protected $conditionBuilderClassName = 'wcf\system\database\util\PreparedStatementConditionBuilder';
+ protected $conditionBuilderClassName = PreparedStatementConditionBuilder::class;
/**
* list of engine-specific special characters
- * @var array<string>
+ * @var string[]
*/
- protected $specialCharacters = array();
+ protected $specialCharacters = [];
/**
- * @see \wcf\system\search\ISearchEngine::getConditionBuilderClassName()
+ * @inheritDoc
*/
public function getConditionBuilderClassName() {
return $this->conditionBuilderClassName;
* @see http://dev.mysql.com/doc/refman/5.5/en/fulltext-boolean.html
*
* @param string $query
+ * @return string
*/
protected function parseSearchQuery($query) {
$query = StringUtil::trim($query);
$inQuotes = false;
$previousChar = $tmp = '';
$controlCharacterOrSpace = false;
- $chars = array('+', '-', '*');
+ $chars = ['+', '-', '*'];
$ftMinWordLen = $this->getFulltextMinimumWordLength();
for ($i = 0, $length = mb_strlen($query); $i < $length; $i++) {
$char = mb_substr($query, $i, 1);
abstract protected function getFulltextMinimumWordLength();
/**
- * @see \wcf\system\search\ISearchEngine::removeSpecialCharacters()
+ * @inheritDoc
*/
public function removeSpecialCharacters($string) {
if (!empty($this->specialCharacters)) {
* @param string $tag
* @param string $identifier
* @param array $metaData
+ * @return string
*/
protected function compileTag($tag, $identifier, array &$metaData) {
if (preg_match('~^'.$this->outputPattern.'~s', $tag)) {
* @param string $password
* @param string $salt
* @param string $dbHash
+ * @return boolean
*/
protected static function wcf1e($type, $password, $salt, $dbHash) {
preg_match('~^wcf1e([cms])([01])([ab])([01])$~', $type, $matches);