Skip to content

Commit 0079295

Browse files
fix the breaking issue in php8 and some of the warnings (#1150)
1 parent d0ed56e commit 0079295

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/Classes/MyRadio/MyRadioSession.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ public function __construct()
2727
$this->db = Database::getInstance();
2828
}
2929

30-
public function open($save_path, $sesion_name)
30+
public function open($save_path, $sesion_name): bool
3131
{
3232
return true;
3333
}
3434

35-
public function close()
35+
public function close(): bool
3636
{
3737
return true;
3838
}
@@ -41,7 +41,7 @@ public function close()
4141
* Clear up old session entries in the database
4242
* This should be called automatically by PHP every one in a while.
4343
*/
44-
public function gc($lifetime)
44+
public function gc($lifetime): int|false
4545
{
4646
$this->db->query(
4747
'DELETE FROM sso_session WHERE timestamp<$1',
@@ -55,7 +55,7 @@ public function gc($lifetime)
5555
* Reads the session data from the database. If no data exists, creates an
5656
* empty row.
5757
*/
58-
public function read($id)
58+
public function read($id): string|false
5959
{
6060
if (empty($id)) {
6161
return false;
@@ -87,7 +87,7 @@ public function read($id)
8787
/**
8888
* Writes changes to the session data to the database.
8989
*/
90-
public function write($id, $data)
90+
public function write($id, $data): bool
9191
{
9292
if (empty($id)) {
9393
return false;
@@ -107,7 +107,7 @@ public function write($id, $data)
107107
/**
108108
* Deletes the session entry from the database.
109109
*/
110-
public function destroy($id)
110+
public function destroy($id): bool
111111
{
112112
if (empty($id)) {
113113
return false;

src/Classes/ServiceAPI/MyRadio_Banner.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public function setPhoto(MyRadio_Photo $photo)
276276
*
277277
* @throws MyRadioException
278278
*/
279-
public static function create(MyRadio_Photo $photo, $alt = 'Unnamed Banner', $target = null, $type = 2)
279+
public static function create($photo, $alt = 'Unnamed Banner', $target = null, $type = 2)
280280
{
281281
$result = self::$db->fetchColumn(
282282
'INSERT INTO website.banner (alt, image, target, banner_type_id, photoid)

src/Classes/ServiceAPI/MyRadio_UserTrainingStatus.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ protected function __construct($statusid)
8585
$this->user = (int) $result['memberid'];
8686
$this->awarded_time = strtotime($result['completeddate']);
8787
$this->awarded_by = (int) $result['confirmedby'];
88-
$this->revoked_time = strtotime($result['revokedtime']);
88+
$this->revoked_time = $result['revokedtime'] ? strtotime($result['revokedtime']) : null;
8989
$this->revoked_by = (int) $result['revokedby'];
9090

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

0 commit comments

Comments
 (0)