Skip to content

Commit

Permalink
fix the breaking issue in php8 and some of the warnings (#1150)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-grace committed May 21, 2024
1 parent d0ed56e commit 0079295
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/Classes/MyRadio/MyRadioSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ public function __construct()
$this->db = Database::getInstance();
}

public function open($save_path, $sesion_name)
public function open($save_path, $sesion_name): bool
{
return true;
}

public function close()
public function close(): bool
{
return true;
}
Expand All @@ -41,7 +41,7 @@ public function close()
* Clear up old session entries in the database
* This should be called automatically by PHP every one in a while.
*/
public function gc($lifetime)
public function gc($lifetime): int|false
{
$this->db->query(
'DELETE FROM sso_session WHERE timestamp<$1',
Expand All @@ -55,7 +55,7 @@ public function gc($lifetime)
* Reads the session data from the database. If no data exists, creates an
* empty row.
*/
public function read($id)
public function read($id): string|false
{
if (empty($id)) {
return false;
Expand Down Expand Up @@ -87,7 +87,7 @@ public function read($id)
/**
* Writes changes to the session data to the database.
*/
public function write($id, $data)
public function write($id, $data): bool
{
if (empty($id)) {
return false;
Expand All @@ -107,7 +107,7 @@ public function write($id, $data)
/**
* Deletes the session entry from the database.
*/
public function destroy($id)
public function destroy($id): bool
{
if (empty($id)) {
return false;
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/ServiceAPI/MyRadio_Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ public function setPhoto(MyRadio_Photo $photo)
*
* @throws MyRadioException
*/
public static function create(MyRadio_Photo $photo, $alt = 'Unnamed Banner', $target = null, $type = 2)
public static function create($photo, $alt = 'Unnamed Banner', $target = null, $type = 2)
{
$result = self::$db->fetchColumn(
'INSERT INTO website.banner (alt, image, target, banner_type_id, photoid)
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/ServiceAPI/MyRadio_UserTrainingStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected function __construct($statusid)
$this->user = (int) $result['memberid'];
$this->awarded_time = strtotime($result['completeddate']);
$this->awarded_by = (int) $result['confirmedby'];
$this->revoked_time = strtotime($result['revokedtime']);
$this->revoked_time = $result['revokedtime'] ? strtotime($result['revokedtime']) : null;
$this->revoked_by = (int) $result['revokedby'];

parent::__construct($result['presenterstatusid']);
Expand Down

0 comments on commit 0079295

Please sign in to comment.