Skip to content

Commit

Permalink
[K6.4] Fix some deprecated messages showed with Php 8.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
xillibit committed Nov 23, 2024
1 parent 4c09b4c commit 4e4e806
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/admin/src/Model/CategoriesModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class CategoriesModel extends KunenaModel
*
* @see JController
*/
public function __construct($config = [], MVCFactoryInterface $factory = null)
public function __construct($config = [], ?MVCFactoryInterface $factory = null)
{
parent::__construct($config, $factory);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ public function getCreationDate(): ?KunenaDate
*
* @since Kunena 4.0
*/
public function isAuthorised($action = 'read', KunenaUser $user = null): bool
public function isAuthorised($action = 'read', ?KunenaUser $user = null): bool
{
return !$this->tryAuthorise($action, $user, false);
}
Expand All @@ -329,7 +329,7 @@ public function isAuthorised($action = 'read', KunenaUser $user = null): bool
*
* @since Kunena 4.0
*/
public function tryAuthorise($action = 'read', KunenaUser $user = null, $throw = true)
public function tryAuthorise($action = 'read', ?KunenaUser $user = null, $throw = true)
{
// Special case to ignore authorisation.
if ($action == 'none') {
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/kunena/src/Forum/Message/KunenaMessage.php
Original file line number Diff line number Diff line change
Expand Up @@ -1249,7 +1249,7 @@ public function displayField(string $field, $html = true, $context = '')
* @throws Exception
* @since Kunena 4.0
*/
public function isAuthorised(string $action = 'read', KunenaUser $user = null)
public function isAuthorised(string $action = 'read', ?KunenaUser $user = null)
{
if (KunenaFactory::getConfig()->readOnly) {
// Special case to ignore authorisation.
Expand All @@ -1273,7 +1273,7 @@ public function isAuthorised(string $action = 'read', KunenaUser $user = null)
* @throws Exception
* @since Kunena 4.0
*/
public function tryAuthorise($action = 'read', KunenaUser $user = null, $throw = true)
public function tryAuthorise($action = 'read', ?KunenaUser $user = null, $throw = true)
{
// Special case to ignore authorisation.
if ($action == 'none') {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public function filterByCategories(array $categories)
*
* @since Kunena 6.0
*/
public function filterByTime(Date $starting = null, Date $ending = null): KunenaMessageFinder
public function filterByTime(?Date $starting = null, ?Date $ending = null): KunenaMessageFinder
{
if ($starting && $ending) {
$this->query->where($this->db->quoteName('a.time') . ' BETWEEN ' . $this->db->quote($starting->toUnix()) . ' AND ' . $this->db->quote($ending->toUnix()));
Expand All @@ -153,7 +153,7 @@ public function filterByTime(Date $starting = null, Date $ending = null): Kunena
*
* @since Kunena 6.0
*/
public function filterByUser(KunenaUser $user = null, $action = 'posted'): KunenaMessageFinder
public function filterByUser(?KunenaUser $user = null, $action = 'posted'): KunenaMessageFinder
{
if (\is_null($user) || \is_null($user->userid)) {
return $this;
Expand Down Expand Up @@ -229,7 +229,7 @@ public function find($access = 'read'): array
*
* @since Kunena 6.0
*/
protected function build(QueryInterface $query = null): void
protected function build(?QueryInterface $query = null): void
{
if (!empty($this->hold)) {
$this->hold = ArrayHelper::toInteger($this->hold, 0);
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/kunena/src/Layout/KunenaPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public static function factory($paths, $base = 'pages')
*
* @throws Exception
*/
public function execute($path, Input $input = null, $options = null)
public function execute($path, ?Input $input = null, $options = null)
{
return $this->request($path, $input, $options)->execute();
}
Expand All @@ -139,7 +139,7 @@ public function execute($path, Input $input = null, $options = null)
* @since Kunena 6.0
* @throws Exception
*/
public function request($path, Input $input = null, $options = null)
public function request($path, ?Input $input = null, $options = null)
{
return KunenaRequest::factory($path . '/Display', $input, $options ? $options : $this->getOptions())
->setPrimary()->set('layout', $this->getLayout());
Expand Down
8 changes: 4 additions & 4 deletions src/libraries/kunena/src/User/KunenaUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public static function getInstance($identifier = null, $reload = false): KunenaU
* @throws Exception
* @since Kunena 4.0
*/
public function isAuthorised($action = 'read', KunenaUser $user = null): bool
public function isAuthorised($action = 'read', ?KunenaUser $user = null): bool
{
return !$this->tryAuthorise($action, $user, false);
}
Expand All @@ -513,7 +513,7 @@ public function isAuthorised($action = 'read', KunenaUser $user = null): bool
* @throws Exception
* @since Kunena 4.0
*/
public function tryAuthorise($action = 'read', KunenaUser $user = null, $throw = true)
public function tryAuthorise($action = 'read', ?KunenaUser $user = null, $throw = true)
{
// Special case to ignore authorisation.
if ($action == 'none') {
Expand Down Expand Up @@ -621,7 +621,7 @@ public function isMyself(): bool
* @throws Exception
* @since Kunena 6.0
*/
public function isAdmin(KunenaCategory $category = null): bool
public function isAdmin(?KunenaCategory $category = null): bool
{
return KunenaAccess::getInstance()->isAdmin($this, $category && $category->exists() ? $category->id : null);
}
Expand All @@ -638,7 +638,7 @@ public function isAdmin(KunenaCategory $category = null): bool
* @throws Exception
* @since Kunena 6.0
*/
public function isModerator(KunenaCategory $category = null): bool
public function isModerator(?KunenaCategory $category = null): bool
{
return KunenaAccess::getInstance()->isModerator($this, $category && $category->exists() ? $category->id : null);
}
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/kunena/src/User/KunenaUserFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function __construct()
*
* @since Kunena 6.0
*/
public function filterByTime(Date $starting = null, Date $ending = null, $register = true): KunenaFinder
public function filterByTime(?Date $starting = null, ?Date $ending = null, $register = true): KunenaFinder
{
$name = $register ? 'registerDate' : 'lastvisitDate';

Expand Down
2 changes: 1 addition & 1 deletion src/libraries/kunena/src/User/KunenaUserHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ public static function getTopPosters($limit = 0): ?array
*
* @since Kunena 5.0
*/
public static function getGroupsForUsers(array $groupIds = null, array $userIds = null, $recursive = false): array
public static function getGroupsForUsers(?array $groupIds = null, ?array $userIds = null, $recursive = false): array
{
// Check for bad calls.
if (\is_null($userIds) && \is_null($groupIds)) {
Expand Down

0 comments on commit 4e4e806

Please sign in to comment.