/**
* @inheritDoc
*/
- public function seek($index)
+ public function seek($offset)
{
- $this->index = $index;
+ $this->index = $offset;
if (!$this->valid()) {
throw new \OutOfBoundsException();
/**
* @inheritDoc
*/
- public function checkPermissions(ILikeObject $comment)
+ public function checkPermissions(ILikeObject $object)
{
- /** @var Comment $comment */
+ /** @var Comment $object */
- if (!$comment->commentID) {
+ if (!$object->commentID) {
return false;
}
- $objectType = CommentHandler::getInstance()->getObjectType($comment->objectTypeID);
+ $objectType = CommentHandler::getInstance()->getObjectType($object->objectTypeID);
- return CommentHandler::getInstance()->getCommentManager($objectType->objectType)->isAccessible($comment->objectID);
+ return CommentHandler::getInstance()->getCommentManager($objectType->objectType)->isAccessible($object->objectID);
}
/**
/**
* @inheritDoc
*/
- public function checkPermissions(ILikeObject $response)
+ public function checkPermissions(ILikeObject $object)
{
- /** @var CommentResponse $response */
+ /** @var CommentResponse $object */
- if (!$response->responseID) {
+ if (!$object->responseID) {
return false;
}
- $comment = new Comment($response->commentID);
+ $comment = new Comment($object->commentID);
if (!$comment->commentID) {
return false;
}
/**
* @inheritDoc
*/
- public function seek($index)
+ public function seek($offset)
{
- $this->index = $index;
+ $this->index = $offset;
if (!$this->valid()) {
throw new \OutOfBoundsException();
/**
* @inheritDoc
*/
- public function seek($index)
+ public function seek($offset)
{
- $this->index = $index;
+ $this->index = $offset;
if (!$this->valid()) {
throw new \OutOfBoundsException();
/**
* Parses a message.
*
- * @param string $message
+ * @param string $text
* @param bool $enableSmilies
* @param bool $enableHtml
* @param bool $enableBBCodes
* @return string parsed message
*/
public function parse(
- $message,
+ $text,
$enableSmilies = true,
$enableHtml = false,
$enableBBCodes = true,
$doKeywordHighlighting = true
) {
$this->cachedCodes = [];
- $this->message = $message;
+ $this->message = $text;
// call event
EventHandler::getInstance()->fireAction($this, 'beforeParsing');
/**
* @inheritDoc
*/
- public function highlight($data)
+ public function highlight($string)
{
- $lines = \explode("\n", $data);
+ $lines = \explode("\n", $string);
foreach ($lines as $key => $val) {
if (\in_array(\mb_substr($val, 0, 1), $this->info) || \in_array($val, $this->splitter)) {
$lines[$key] = '<span class="hlComments">' . StringUtil::encodeHTML($val) . '</span>';
/**
* @inheritDoc
*/
- public function highlight($code)
+ public function highlight($string)
{
// add starting php tag
$phpTagsAdded = false;
- if (\mb_strpos($code, '<?') === false) {
+ if (\mb_strpos($string, '<?') === false) {
$phpTagsAdded = true;
- $code = '<?php ' . $code . ' ?>';
+ $string = '<?php ' . $string . ' ?>';
}
// do highlight
- $highlightedCode = \highlight_string($code, true);
+ $highlightedCode = \highlight_string($string, true);
// clear code
$highlightedCode = \str_replace('<code>', '', $highlightedCode);
/**
* @inheritDoc
*/
- public function highlight($code)
+ public function highlight($string)
{
- return StringUtil::encodeHTML($code);
+ return StringUtil::encodeHTML($string);
}
}
/**
* @inheritDoc
*/
- public static function create($columnName)
+ public static function create($name)
{
- return parent::create($columnName)
+ return parent::create($name)
->autoIncrement();
}
}
/**
* Adds a new condition.
*
- * @param mixed $conditions
+ * @param mixed $condition
*/
- public function add($conditions)
+ public function add($condition)
{
+ $conditions = $condition;
if (!\is_array($conditions)) {
- $conditions = [$conditions];
+ $conditions = [$condition];
}
foreach ($conditions as $condition) {
/**
* Sets whether this button is an `input[type=submit]` element or a `button` element.
*
- * @param bool $submitButton
+ * @param bool $submit
* @return static this form button
*/
- public function submit($submitButton = true);
+ public function submit($submit = true);
}
/**
* @inheritDoc
*/
- public function isAllowed(AbstractHtmlNodeProcessor $nodeProcessor)
+ public function isAllowed(AbstractHtmlNodeProcessor $htmlNodeProcessor)
{
if (BBCodeHandler::getInstance()->isAvailableBBCode('img')) {
return [];
// check if there are only attachments, media or smilies
/** @var \DOMElement $element */
- foreach ($nodeProcessor->getDocument()->getElementsByTagName('img') as $element) {
+ foreach ($htmlNodeProcessor->getDocument()->getElementsByTagName('img') as $element) {
$class = $element->getAttribute('class');
if (!\preg_match('~\b(?:woltlabAttachment|woltlabSuiteMedia|smiley)\b~', $class)) {
$foundImage = true;
/**
* @inheritDoc
*/
- public function getFileInfo($fileIndex)
+ public function getFileInfo($index)
{
- if (!\is_int($fileIndex)) {
- $fileIndex = $this->getIndexByFilename($fileIndex);
+ if (!\is_int($index)) {
+ $index = $this->getIndexByFilename($index);
}
- if (!isset($this->contentList[$fileIndex])) {
- throw new SystemException("Tar: could find file '" . $fileIndex . "' in archive");
+ if (!isset($this->contentList[$index])) {
+ throw new SystemException("Tar: could find file '" . $index . "' in archive");
}
- return $this->contentList[$fileIndex];
+ return $this->contentList[$index];
}
/**
/**
* @inheritDoc
*/
- public function getFileInfo($offset)
+ public function getFileInfo($index)
{
- if (!\is_int($offset)) {
- $offset = $this->getIndexByFilename($offset);
+ if (!\is_int($index)) {
+ $index = $this->getIndexByFilename($index);
}
- $info = $this->readFile($offset);
+ $info = $this->readFile($index);
return $info['header'];
}
/**
* @inheritDoc
*/
- public function extractToString($offset)
+ public function extractToString($index)
{
- if (!\is_int($offset)) {
- $offset = $this->getIndexByFilename($offset);
+ if (!\is_int($index)) {
+ $index = $this->getIndexByFilename($index);
}
try {
- $file = $this->readFile($offset);
+ $file = $this->readFile($index);
} catch (SystemException $e) {
return false;
}
/**
* @inheritDoc
*/
- public function extract($offset, $destination)
+ public function extract($index, $destination)
{
- if (!\is_int($offset)) {
- $offset = $this->getIndexByFilename($offset);
+ if (!\is_int($index)) {
+ $index = $this->getIndexByFilename($index);
}
try {
- $file = $this->readFile($offset);
+ $file = $this->readFile($index);
} catch (SystemException $e) {
return false;
}
/**
* @inheritDoc
*/
- protected function getClassName($type)
+ protected function getClassName($optionType)
{
- $className = 'wcf\system\option\user\group\\' . \ucfirst($type) . 'UserGroupOptionType';
+ $className = 'wcf\system\option\user\group\\' . \ucfirst($optionType) . 'UserGroupOptionType';
// validate class
if (!\class_exists($className)) {
/**
* @inheritDoc
*/
- public static function isValid(PackageArchive $archive, $instruction)
+ public static function isValid(PackageArchive $packageArchive, $instruction)
{
if (!$instruction) {
$instruction = static::getDefaultFilename();
if (\preg_match('~\.(tar(\.gz)?|tgz)$~', $instruction)) {
// check if file actually exists
try {
- if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+ if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
return false;
}
} catch (SystemException $e) {
/**
* @inheritDoc
*/
- public static function isValid(PackageArchive $archive, $instruction)
+ public static function isValid(PackageArchive $packageArchive, $instruction)
{
return true;
}
/**
* @inheritDoc
*/
- public static function isValid(PackageArchive $archive, $instruction)
+ public static function isValid(PackageArchive $packageArchive, $instruction)
{
if (!$instruction) {
$defaultFilename = static::getDefaultFilename();
if (\preg_match('~\.xml$~', $instruction)) {
// check if file actually exists
try {
- if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+ if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
return false;
}
} catch (SystemException $e) {
/**
* @inheritDoc
*/
- public static function isValid(PackageArchive $archive, $instruction)
+ public static function isValid(PackageArchive $packageArchive, $instruction)
{
if (!$instruction) {
$instruction = static::getDefaultFilename();
if (\preg_match('~\.(tar(\.gz)?|tgz)$~', $instruction)) {
// check if file actually exists
try {
- if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+ if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
return false;
}
} catch (SystemException $e) {
/**
* @inheritDoc
*/
- public static function isValid(PackageArchive $archive, $instruction)
+ public static function isValid(PackageArchive $packageArchive, $instruction)
{
return true;
}
/**
* @inheritDoc
*/
- public static function isValid(PackageArchive $archive, $instruction)
+ public static function isValid(PackageArchive $packageArchive, $instruction)
{
if (!$instruction) {
$instruction = static::getDefaultFilename();
if (\preg_match('~\.sql$~', $instruction)) {
// check if file actually exists
try {
- if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+ if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
return false;
}
} catch (SystemException $e) {
/**
* @inheritDoc
*/
- public static function isValid(PackageArchive $archive, $instruction)
+ public static function isValid(PackageArchive $packageArchive, $instruction)
{
if (!$instruction) {
$instruction = static::getDefaultFilename();
if (\preg_match('~\.(tar(\.gz)?|tgz)$~', $instruction)) {
// check if file actually exists
try {
- if ($archive->getTar()->getIndexByFilename($instruction) === false) {
+ if ($packageArchive->getTar()->getIndexByFilename($instruction) === false) {
return false;
}
} catch (SystemException $e) {