Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion com.woltlab.wcf/templates/commentList.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<span class="badge label green comment__status--disabled">{lang}wcf.message.status.disabled{/lang}</span>
{/if}

{if $commentManager->isContentAuthor($comment)}
{if $commentManager->isContentAuthor($comment->getDecoratedObject())}
<span class="badge label">{lang}wcf.comment.objectAuthor{/lang}</span>
{/if}

Expand Down
2 changes: 1 addition & 1 deletion com.woltlab.wcf/templates/commentResponseList.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<span class="badge label green commentResponse__status--disabled">{lang}wcf.message.status.disabled{/lang}</span>
{/if}

{if $commentManager->isContentAuthor($response)}
{if $commentManager->isContentAuthor($response->getDecoratedObject())}
<span class="badge label">{lang}wcf.comment.objectAuthor{/lang}</span>
{/if}

Expand Down
4 changes: 2 additions & 2 deletions wcfsetup/install/files/lib/data/DatabaseObject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ protected function handleData($data)
/**
* @inheritDoc
*/
public function __get($name)
public function __get(string $name)
{
return $this->data[$name] ?? null;
}
Expand All @@ -114,7 +114,7 @@ public function getObjectID()
/**
* @inheritDoc
*/
public function __isset($name)
public function __isset(string $name)
{
return isset($this->data[$name]);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ public function __construct(DatabaseObject $object)
/**
* @inheritDoc
*/
public function __get($name)
public function __get(string $name)
{
return $this->object->__get($name);
}

/**
* @inheritDoc
*/
public function __isset($name)
public function __isset(string $name)
{
return $this->object->__isset($name);
}
Expand Down
4 changes: 2 additions & 2 deletions wcfsetup/install/files/lib/data/DatabaseObjectList.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public function seek($offset): void
/**
* @inheritDoc
*/
public function seekTo($objectID)
public function seekTo(int $objectID)
{
$this->index = \array_search($objectID, $this->indexToObject);

Expand All @@ -415,7 +415,7 @@ public function seekTo($objectID)
/**
* @inheritDoc
*/
public function search($objectID)
public function search(int $objectID)
{
try {
$this->seekTo($objectID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,23 @@ public function __construct(DatabaseObject $object);
/**
* Delegates accesses to inaccessible object properties the processed object.
*
* @param string $name
* @return mixed
*/
public function __get($name);
public function __get(string $name);

/**
* Delegates isset calls for inaccessible object properties to the processed
* object.
*
* @param string $name
* @return bool
*/
public function __isset($name);
public function __isset(string $name);

/**
* Delegates inaccessible method calls to the processed database object.
*
* @param string $name
* @param mixed[] $arguments
* @return mixed
*/
public function __call($name, $arguments);
public function __call(string $name, array $arguments);
}
3 changes: 1 addition & 2 deletions wcfsetup/install/files/lib/data/IMessage.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ interface IMessage extends IUserContent
/**
* Returns a simplified message (only inline codes), truncated to 255 characters by default.
*
* @param int $maxLength
* @return string
*/
public function getExcerpt($maxLength = 255);
public function getExcerpt(int $maxLength = 255);

/**
* Returns formatted message text.
Expand Down
3 changes: 1 addition & 2 deletions wcfsetup/install/files/lib/data/IPermissionObject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ public function checkPermissions(array $permissions);
* Returns the permission value of the given permission for this object
* and the active user.
*
* @param string $permission
* @return mixed
*/
public function getPermission($permission);
public function getPermission(string $permission);
}
6 changes: 2 additions & 4 deletions wcfsetup/install/files/lib/data/IStorableObject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,17 @@ interface IStorableObject
* Returns the value of a object data variable with the given name or `null` if no
* such data variable exists.
*
* @param string $name
* @return mixed
*/
public function __get($name);
public function __get(string $name);

/**
* Determines if the object data variable with the given name is set and
* is not NULL.
*
* @param string $name
* @return bool
*/
public function __isset($name);
public function __isset(string $name);

/**
* Returns the value of all object data variables.
Expand Down
6 changes: 2 additions & 4 deletions wcfsetup/install/files/lib/data/IThumbnailFile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,16 @@ interface IThumbnailFile extends IFile
/**
* Returns the link to the thumbnail file with the given size.
*
* @param string $size
* @return string
*/
public function getThumbnailLink($size);
public function getThumbnailLink(string $size);

/**
* Returns the physical location of the thumbnail file with the given size.
*
* @param string $size
* @return string
*/
public function getThumbnailLocation($size);
public function getThumbnailLocation(string $size);

/**
* Returns the available thumbnail sizes.
Expand Down
6 changes: 2 additions & 4 deletions wcfsetup/install/files/lib/data/ITraversableObject.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,15 @@ interface ITraversableObject extends \SeekableIterator
/**
* Sets internal iterator pointer based upon related object id.
*
* @param int $objectID
* @return void
*/
public function seekTo($objectID);
public function seekTo(int $objectID);

/**
* Searches a specific object by object id and setting internal iterator
* pointer to found item. Returns `null` if object id is not found.
*
* @param int $objectID
* @return ?TDatabaseObject
*/
public function search($objectID);
public function search(int $objectID);
}
2 changes: 1 addition & 1 deletion wcfsetup/install/files/lib/data/IUserContent.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function getTime();
/**
* Returns author's user id.
*
* @return int
* @return ?int
*/
public function getUserID();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ protected function handleData($data)
/**
* @inheritDoc
*/
public function __get($name)
public function __get(string $name)
{
if (ENABLE_ENTERPRISE_MODE && \defined('ENTERPRISE_MODE_DOMAIN_OVERRIDE') && \PHP_SAPI !== 'cli') {
if (ENTERPRISE_MODE_DOMAIN_OVERRIDE === $_SERVER['HTTP_HOST']) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function getMessage()
/**
* @inheritDoc
*/
public function getExcerpt($maxLength = 255)
public function getExcerpt(int $maxLength = 255)
{
return StringUtil::truncateHTML($this->getDecoratedObject()->getFormattedTeaser(), $maxLength);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getObjectID()
/**
* @inheritDoc
*/
public function updateLikeCounter($cumulativeLikes)
public function updateLikeCounter(int $cumulativeLikes)
{
// update cumulative likes
$editor = new ArticleEditor($this->getDecoratedObject());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function getTime()
/**
* @inheritDoc
*/
public function getLink($query = ''): string
public function getLink(string $query = ''): string
{
$parameters = [
'object' => $this->getDecoratedObject(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public function getTinyThumbnailLocation()
* @inheritDoc
* @deprecated 6.1 This will no longer be required once the attachments have been migrated.
*/
public function getThumbnailLocation($size = '')
public function getThumbnailLocation(string $size = '')
{
if ($size == 'tiny') {
$location = self::getStorage() . \substr(
Expand Down Expand Up @@ -255,7 +255,7 @@ final protected function getLocationHelper($location)
/**
* @inheritDoc
*/
public function getThumbnailLink($size = '')
public function getThumbnailLink(string $size = '')
{
$file = $this->getFile();
if ($file === null) {
Expand Down Expand Up @@ -394,7 +394,7 @@ public function setFile(File $file): void
}

#[\Override]
public function __get($name)
public function __get(string $name)
{
if ($name === 'downloads' || $name === 'lastDownloadTime') {
// Static files are no longer served through PHP but the web server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function __construct(string $objectType)
'com.woltlab.wcf.attachment.objectType',
$objectType
);
if ($objectType === null) {
if ($objectTypeObj === null) {
throw new \BadMethodCallException("unknown attachment object type '{$objectType}'");
}

Expand Down
2 changes: 1 addition & 1 deletion wcfsetup/install/files/lib/data/box/Box.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class Box extends DatabaseObject
/**
* @inheritDoc
*/
public function __get($name)
public function __get(string $name)
{
$value = parent::__get($name);

Expand Down
6 changes: 3 additions & 3 deletions wcfsetup/install/files/lib/data/category/Category.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Category extends ProcessibleDatabaseObject implements IPermissionObject, I
/**
* @inheritDoc
*/
public function __get($name)
public function __get(string $name)
{
// forward 'className' property requests to object type
if ($name == 'className') {
Expand All @@ -100,7 +100,7 @@ public function __get($name)
/**
* @inheritDoc
*/
public function __isset($name)
public function __isset(string $name)
{
return parent::__isset($name) || isset($this->data['additionalData'][$name]);
}
Expand Down Expand Up @@ -209,7 +209,7 @@ public function isParentCategory(self $category)
/**
* @inheritDoc
*/
public function getPermission($permission, ?User $user = null)
public function getPermission(string $permission, ?User $user = null)
{
if ($user === null) {
$user = WCF::getUser();
Expand Down
2 changes: 1 addition & 1 deletion wcfsetup/install/files/lib/data/comment/Comment.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function getMailText($mimeType = 'text/plain')
/**
* @inheritDoc
*/
public function getExcerpt($maxLength = 255)
public function getExcerpt(int $maxLength = 255)
{
return StringUtil::truncateHTML($this->getSimplifiedFormattedMessage(), $maxLength);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function prepare(array $likes)
}

#[\Override]
public function getObjectByID($objectID)
public function getObjectByID(int $objectID)
{
return new LikeableComment(CommentRuntimeCache::getInstance()->getObject($objectID));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function getMailText($mimeType = 'text/plain')
/**
* @inheritDoc
*/
public function getExcerpt($maxLength = 255)
public function getExcerpt(int $maxLength = 255)
{
return StringUtil::truncateHTML($this->getSimplifiedFormattedMessage(), $maxLength);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function prepare(array $likes)
}

#[\Override]
public function getObjectByID($objectID)
public function getObjectByID(int $objectID)
{
return new LikeableCommentResponse(CommentResponseRuntimeCache::getInstance()->getObject($objectID));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Condition extends DatabaseObject
/**
* @inheritDoc
*/
public function __get($name)
public function __get(string $name)
{
$value = parent::__get($name);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class CustomOption extends Option implements ITitledObject
/**
* @inheritDoc
*/
public function __get($name)
public function __get(string $name)
{
// Some options support empty values, such as "select", but the code checks for the
// property `allowEmptyValue`, which is the inverse value of `required`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public function seek($offset): void
/**
* @inheritDoc
*/
public function seekTo($objectID)
public function seekTo(int $objectID)
{
$this->index = \array_search($objectID, $this->indexToObject);

Expand All @@ -252,7 +252,7 @@ public function seekTo($objectID)
/**
* @inheritDoc
*/
public function search($objectID)
public function search(int $objectID)
{
try {
$this->seekTo($objectID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class AbstractLikeObject extends DatabaseObjectDecorator implements ILi
/**
* @inheritDoc
*/
public function updateLikeCounter($cumulativeLikes)
public function updateLikeCounter(int $cumulativeLikes)
{
// individual implementations can override this method to update like counter
}
Expand Down
Loading
Loading