Skip to content

Commit

Permalink
code review
Browse files Browse the repository at this point in the history
  • Loading branch information
rdebleu committed Jun 5, 2024
1 parent 0152e5c commit 9ff01b3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions classes/frontend.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@

namespace availability_language;

use cm_info;
use section_info;
use stdClass;

/**
* Front-end class.
*
Expand All @@ -40,11 +44,11 @@ class frontend extends \core_availability\frontend {
* Returns an array of array of id, name of languages.
*
* @param stdClass $course Course object
* @param cm_info $cm Course-module currently being edited (null if none)
* @param section_info $section Section currently being edited (null if none)
* @param cm_info|null $cm Course-module currently being edited (null if none)
* @param section_info|null $section Section currently being edited (null if none)
* @return array Array of parameters for the JavaScript function
*/
protected function get_javascript_init_params($course, \cm_info $cm = null, \section_info $section = null) {
protected function get_javascript_init_params($course, ?cm_info $cm = null, ?section_info $section = null) {
return [self::convert_associative_array_for_js(get_string_manager()->get_list_of_translations(), 'id', 'name')];
}

Expand All @@ -55,11 +59,11 @@ protected function get_javascript_init_params($course, \cm_info $cm = null, \sec
* more than language is installed.
*
* @param stdClass $course Course object
* @param cm_info $cm Course-module currently being edited (null if none)
* @param section_info $section Section currently being edited (null if none)
* @param cm_info|null $cm Course-module currently being edited (null if none)
* @param section_info|null $section Section currently being edited (null if none)
* @return bool True if available
*/
protected function allow_add($course, \cm_info $cm = null, \section_info $section = null) {
protected function allow_add($course, ?cm_info $cm = null, ?section_info $section = null) {
// If forced course language.
if ($course->lang != '') {
return false;
Expand Down

0 comments on commit 9ff01b3

Please sign in to comment.