mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-73424 general: specify return type where possible
This commit is contained in:
parent
41b93bd7e5
commit
44aac31980
@ -129,8 +129,7 @@ class chart_axis implements JsonSerializable {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
return [
|
||||
'label' => $this->label,
|
||||
'labels' => $this->labels,
|
||||
|
@ -43,8 +43,7 @@ class chart_bar extends chart_base {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
$data = parent::jsonSerialize();
|
||||
$data['horizontal'] = $this->get_horizontal();
|
||||
$data['stacked'] = $this->get_stacked();
|
||||
|
@ -77,8 +77,7 @@ class chart_base implements JsonSerializable, renderable {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
global $CFG;
|
||||
return [
|
||||
'type' => $this->get_type(),
|
||||
|
@ -42,8 +42,7 @@ class chart_line extends chart_base {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
$data = parent::jsonSerialize();
|
||||
$data['smooth'] = $this->get_smooth();
|
||||
return $data;
|
||||
|
@ -42,8 +42,7 @@ class chart_pie extends chart_base {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
$data = parent::jsonSerialize();
|
||||
$data['doughnut'] = $this->get_doughnut();
|
||||
return $data;
|
||||
|
@ -183,8 +183,7 @@ class chart_series implements JsonSerializable {
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function jsonSerialize() {
|
||||
public function jsonSerialize(): array {
|
||||
$data = [
|
||||
'label' => $this->label,
|
||||
'labels' => $this->labels,
|
||||
|
@ -62,8 +62,7 @@ class mysqli_native_moodle_recordset extends moodle_recordset {
|
||||
return $row;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current() {
|
||||
public function current(): stdClass {
|
||||
return (object)$this->current;
|
||||
}
|
||||
|
||||
|
@ -56,8 +56,7 @@ class oci_native_moodle_recordset extends moodle_recordset {
|
||||
return $row;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current() {
|
||||
public function current(): stdClass {
|
||||
return (object)$this->current;
|
||||
}
|
||||
|
||||
|
@ -55,8 +55,7 @@ class pdo_moodle_recordset extends moodle_recordset {
|
||||
return $row;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current() {
|
||||
public function current(): stdClass {
|
||||
return (object)$this->current;
|
||||
}
|
||||
|
||||
|
@ -133,8 +133,7 @@ class pgsql_native_moodle_recordset extends moodle_recordset {
|
||||
return $row;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current() {
|
||||
public function current(): stdClass {
|
||||
return (object)$this->current;
|
||||
}
|
||||
|
||||
|
@ -105,8 +105,7 @@ class sqlsrv_native_moodle_recordset extends moodle_recordset {
|
||||
return $row;
|
||||
}
|
||||
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current() {
|
||||
public function current(): stdClass {
|
||||
return (object)$this->current;
|
||||
}
|
||||
|
||||
|
@ -108,16 +108,14 @@ class read_slave_moodle_recordset_special extends \moodle_recordset {
|
||||
* Iterator interface
|
||||
* @return \stdClass
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current() {
|
||||
public function current(): \stdClass {
|
||||
return new \stdClass();
|
||||
}
|
||||
/**
|
||||
* Iterator interface
|
||||
* @return void
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function next() {
|
||||
public function next(): void {
|
||||
}
|
||||
/**
|
||||
* Iterator interface
|
||||
|
@ -44,8 +44,7 @@ class read_slave_moodle_recordset_special extends moodle_recordset {
|
||||
* Iterator interface
|
||||
* @return stdClass
|
||||
*/
|
||||
#[\ReturnTypeWillChange]
|
||||
public function current() {
|
||||
public function current(): stdClass {
|
||||
return new stdClass();
|
||||
}
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user