Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ jobs:
fail-fast: false
matrix:
include:
- php: '8.4'
moodle-branch: 'MOODLE_500_STABLE'
database: 'pgsql'
- php: '8.3'
moodle-branch: 'MOODLE_405_STABLE'
moodle-branch: 'MOODLE_500_STABLE'
database: 'mariadb'
- php: '8.2'
moodle-branch: 'MOODLE_405_STABLE'
moodle-branch: 'MOODLE_500_STABLE'
database: 'pgsql'
- php: '8.1'
moodle-branch: 'MOODLE_404_STABLE'
database: 'mariadb'

steps:
- name: Checkout
Expand Down
4 changes: 2 additions & 2 deletions classes/question/question.php
Original file line number Diff line number Diff line change
Expand Up @@ -653,9 +653,9 @@ public function update($questionrecord = null, $updatechoices = true) {
* Add the question to the database from supplied arguments.
* @param \stdClass $questionrecord The required data for adding the question.
* @param array $choicerecords An array of choice records with 'content' and 'value' properties.
* @param boolean $calcposition Whether or not to calculate the next available position in the survey.
* @param bool|null $calcposition Whether or not to calculate the next available position in the survey.
*/
public function add($questionrecord, array $choicerecords = null, $calcposition = true) {
public function add($questionrecord, ?array $choicerecords = null, ?bool $calcposition = true) {
global $DB;

// Create new question.
Expand Down
6 changes: 3 additions & 3 deletions classes/question/rate.php
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,9 @@ public function insert_nameddegrees(array $nameddegrees) {
* Helper function used to move existing named degree choices for the specified question from the "quest_choice" table to the
* "question" table.
* @param int $qid
* @param null|\stdClass $questionrec
* @param \stdClass|null $questionrec
*/
public static function move_nameddegree_choices(int $qid = 0, \stdClass $questionrec = null) {
public static function move_nameddegree_choices(int $qid = 0, ?\stdClass $questionrec = null) {
global $DB;

if ($qid !== 0) {
Expand Down Expand Up @@ -1079,7 +1079,7 @@ public static function move_nameddegree_choices(int $qid = 0, \stdClass $questio
* questionnaire before '2018110103'.
* @param int|null $surveyid
*/
public static function move_all_nameddegree_choices(int $surveyid = null) {
public static function move_all_nameddegree_choices(?int $surveyid = null) {
global $DB;

// This operation might take a while. Cancel PHP timeouts for this.
Expand Down
4 changes: 2 additions & 2 deletions classes/responsetype/responsetype.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ abstract class responsetype {
* responsetype constructor.
* @param \mod_questionnaire\question\question $question
* @param int|null $responseid
* @param array $choices
* @param array|null $choices
*/
public function __construct(\mod_questionnaire\question\question $question, int $responseid = null, array $choices = []) {
public function __construct(\mod_questionnaire\question\question $question, ?int $responseid = null, ?array $choices = []) {
$this->question = $question;
$this->responseid = $responseid;
$this->choices = $choices;
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/behat_mod_questionnaire.php
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private function add_response_data($qid, $sid) {
* to replace with mapped values.
* @return null
*/
private function add_data(array $data, $datatable, $mapvar = '', array $replvars = null) {
private function add_data(array $data, $datatable, $mapvar = '', ?array $replvars = null) {
global $DB;

if ($replvars === null) {
Expand Down
4 changes: 2 additions & 2 deletions tests/custom_completion_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class custom_completion_test extends \advanced_testcase {
*
* @return array[]
*/
public function get_state_provider(): array {
public static function get_state_provider(): array {
return [
'Undefined rule' => [
'somenonexistentrule', COMPLETION_DISABLED, false, null, coding_exception::class
Expand Down Expand Up @@ -178,7 +178,7 @@ public function test_is_defined() {
*
* @return array[]
*/
public function get_available_custom_rules_provider(): array {
public static function get_available_custom_rules_provider(): array {
return [
'Completion submit available' => [
COMPLETION_ENABLED, ['completionsubmit']
Expand Down
4 changes: 2 additions & 2 deletions tests/generator/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ public function questionnaires() {
/**
* Create a questionnaire activity.
* @param array $record Will be changed in this function.
* @param array $options
* @param array|null $options
* @return questionnaire
*/
public function create_instance($record = null, array $options = null) {
public function create_instance($record = null, ?array $options = null) {
$record = (object)(array)$record;

$defaultquestionnairesettings = array(
Expand Down