Skip to content

Commit 873a926

Browse files
committed
Add missing typings to interface methods
1 parent 891c213 commit 873a926

111 files changed

Lines changed: 248 additions & 527 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

wcfsetup/install/files/lib/data/IDatabaseObjectProcessor.class.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,23 @@ public function __construct(DatabaseObject $object);
1616
/**
1717
* Delegates accesses to inaccessible object properties the processed object.
1818
*
19-
* @param string $name
2019
* @return mixed
2120
*/
22-
public function __get($name);
21+
public function __get(string $name);
2322

2423
/**
2524
* Delegates isset calls for inaccessible object properties to the processed
2625
* object.
2726
*
28-
* @param string $name
2927
* @return bool
3028
*/
31-
public function __isset($name);
29+
public function __isset(string $name);
3230

3331
/**
3432
* Delegates inaccessible method calls to the processed database object.
3533
*
36-
* @param string $name
3734
* @param mixed[] $arguments
3835
* @return mixed
3936
*/
40-
public function __call($name, $arguments);
37+
public function __call(string $name, array $arguments);
4138
}

wcfsetup/install/files/lib/data/IPermissionObject.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ public function checkPermissions(array $permissions);
2626
* Returns the permission value of the given permission for this object
2727
* and the active user.
2828
*
29-
* @param string $permission
3029
* @return mixed
3130
*/
32-
public function getPermission($permission);
31+
public function getPermission(string $permission);
3332
}

wcfsetup/install/files/lib/data/IThumbnailFile.class.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,16 @@ interface IThumbnailFile extends IFile
1616
/**
1717
* Returns the link to the thumbnail file with the given size.
1818
*
19-
* @param string $size
2019
* @return string
2120
*/
22-
public function getThumbnailLink($size);
21+
public function getThumbnailLink(string $size);
2322

2423
/**
2524
* Returns the physical location of the thumbnail file with the given size.
2625
*
27-
* @param string $size
2826
* @return string
2927
*/
30-
public function getThumbnailLocation($size);
28+
public function getThumbnailLocation(string $size);
3129

3230
/**
3331
* Returns the available thumbnail sizes.

wcfsetup/install/files/lib/data/ITraversableObject.class.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,15 @@ interface ITraversableObject extends \SeekableIterator
1717
/**
1818
* Sets internal iterator pointer based upon related object id.
1919
*
20-
* @param int $objectID
2120
* @return void
2221
*/
23-
public function seekTo($objectID);
22+
public function seekTo(int $objectID);
2423

2524
/**
2625
* Searches a specific object by object id and setting internal iterator
2726
* pointer to found item. Returns `null` if object id is not found.
2827
*
29-
* @param int $objectID
3028
* @return ?TDatabaseObject
3129
*/
32-
public function search($objectID);
30+
public function search(int $objectID);
3331
}

wcfsetup/install/files/lib/data/object/type/IObjectTypeProvider.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,9 @@ interface IObjectTypeProvider
1919
/**
2020
* Returns an object by its ID.
2121
*
22-
* @param int $objectID
2322
* @return TDatabaseObject
2423
*/
25-
public function getObjectByID($objectID);
24+
public function getObjectByID(int $objectID);
2625

2726
/**
2827
* Returns objects by their IDs.

wcfsetup/install/files/lib/data/user/avatar/IUserAvatar.class.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,16 @@ interface IUserAvatar
1414
/**
1515
* Returns the url to this avatar.
1616
*
17-
* @param int $size
1817
* @return string
1918
*/
20-
public function getURL($size = null);
19+
public function getURL(?int $size = null);
2120

2221
/**
2322
* Returns the html code to display this avatar.
2423
*
25-
* @param int $size
2624
* @return string
2725
*/
28-
public function getImageTag($size = null);
26+
public function getImageTag(?int $size = null);
2927

3028
/**
3129
* Returns the width of this avatar.

wcfsetup/install/files/lib/system/ad/location/IAdLocation.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ public function getVariablesDescription();
2727
/**
2828
* Replaces all relevant variables in the given ad and returns the processed ad.
2929
*
30-
* @param string $ad
3130
* @return string
3231
*/
33-
public function replaceVariables($ad);
32+
public function replaceVariables(string $ad);
3433
}

wcfsetup/install/files/lib/system/bbcode/media/provider/IBBCodeMediaProvider.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ interface IBBCodeMediaProvider
1515
/**
1616
* Parses given media url and returns output html.
1717
*
18-
* @param string $url media url
1918
* @param string[] $matches
2019
* @return string output html
2120
*/
22-
public function parse($url, array $matches = []);
21+
public function parse(string $url, array $matches = []);
2322
}

wcfsetup/install/files/lib/system/cache/builder/ICacheBuilder.class.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ interface ICacheBuilder
1515
* Returns the data that ought to be cached.
1616
*
1717
* @param mixed[] $parameters
18-
* @param string $arrayIndex
1918
* @return mixed
2019
*/
21-
public function getData(array $parameters = [], $arrayIndex = '');
20+
public function getData(array $parameters = [], string $arrayIndex = '');
2221

2322
/**
2423
* Returns maximum lifetime for cache resource.

wcfsetup/install/files/lib/system/cache/runtime/IRuntimeCache.class.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ interface IRuntimeCache
2020
* Caches the given object id so that during the next object fetch, the object with
2121
* this id will also be fetched.
2222
*
23-
* @param int $objectID
2423
* @return void
2524
*/
26-
public function cacheObjectID($objectID);
25+
public function cacheObjectID(int $objectID);
2726

2827
/**
2928
* Caches the given object ids so that during the next object fetch, the objects with
@@ -46,10 +45,9 @@ public function getCachedObjects();
4645
* If the given object id should not have been cached before, it will be cached
4746
* during this method call and the object, if existing, will be returned.
4847
*
49-
* @param int $objectID
5048
* @return ?TDatabaseObject
5149
*/
52-
public function getObject($objectID);
50+
public function getObject(int $objectID);
5351

5452
/**
5553
* Returns the objects with the given ids. If an object does not exist, the array element
@@ -65,10 +63,9 @@ public function getObjects(array $objectIDs);
6563
/**
6664
* Removes the object with the given id from the runtime cache if it has already been loaded.
6765
*
68-
* @param int $objectID
6966
* @return void
7067
*/
71-
public function removeObject($objectID);
68+
public function removeObject(int $objectID);
7269

7370
/**
7471
* Removes the objects with the given ids from the runtime cache if they have already been loaded.

0 commit comments

Comments
 (0)