Skip to content

Commit 51a44db

Browse files
committed
Make codechecker happy
1 parent 398f115 commit 51a44db

3 files changed

+13
-18
lines changed

classes/admin_externalpage_in_tab.php

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

17-
namespace theme_boost_union;
18-
1917
/**
2018
* Theme Boost Union - External admin settings page which can be placed within a tab
2119
*
@@ -24,7 +22,7 @@
2422
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2523
*/
2624

27-
defined('MOODLE_INTERNAL') || die();
25+
namespace theme_boost_union;
2826

2927
/**
3028
* Class admin_externalpage_in_tab.

classes/admin_externalpage_tabs.php

+6-8
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

17-
namespace theme_boost_union;
18-
19-
use moodle_url;
20-
use tabobject;
21-
use tabtree;
22-
2317
/**
2418
* Theme Boost Union - Tabs to be shown within an external admin settings page
2519
*
@@ -28,7 +22,11 @@
2822
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2923
*/
3024

31-
defined('MOODLE_INTERNAL') || die();
25+
namespace theme_boost_union;
26+
27+
use moodle_url;
28+
use tabobject;
29+
use tabtree;
3230

3331
/**
3432
* Class admin_externalpage_tabs.
@@ -50,7 +48,7 @@ class admin_externalpage_tabs {
5048
*
5149
* @return void
5250
*/
53-
public function _construct() {
51+
public function __construct() {
5452
// Initialize the tab tree.
5553
$this->tabs = [];
5654
}

classes/admin_settingspage_tabs_with_external.php

+6-7
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
// You should have received a copy of the GNU General Public License
1515
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
1616

17-
namespace theme_boost_union;
18-
1917
/**
2018
* Theme Boost Union - Admin settings page with tabs as well as external pages within a tab
2119
*
@@ -25,7 +23,7 @@
2523
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
2624
*/
2725

28-
defined('MOODLE_INTERNAL') || die();
26+
namespace theme_boost_union;
2927

3028
/**
3129
* Class admin_settingspage_tabs_with_external.
@@ -43,7 +41,8 @@ class admin_settingspage_tabs_with_external extends \theme_boost_admin_settingsp
4341
*
4442
* This function is amended with a switch for the external tabs.
4543
*
46-
* @param $tab object A tab.
44+
* @param object $tab A tab.
45+
* @return bool
4746
*/
4847
public function add($tab) {
4948
// If the tab is an external page, add it as external tab.
@@ -77,7 +76,7 @@ public function output_html() {
7776
global $OUTPUT;
7877

7978
$activetab = optional_param('activetab', '', PARAM_TEXT);
80-
$context = array('tabs' => array());
79+
$context = ['tabs' => []];
8180
$havesetactive = false;
8281

8382
foreach ($this->get_tabs() as $tab) {
@@ -91,12 +90,12 @@ public function output_html() {
9190
$active = true;
9291
}
9392

94-
$newtab = array(
93+
$newtab = [
9594
'name' => $tab->name,
9695
'displayname' => $tab->visiblename,
9796
'html' => $tab->output_html(),
9897
'active' => $active,
99-
);
98+
];
10099
// If the tab is an external page.
101100
if ($tab instanceof \admin_externalpage) {
102101
// Add a flag for the mustache template.

0 commit comments

Comments
 (0)