Skip to content

Commit 5de2820

Browse files
author
Matthias Opitz
committed
code improvements
1 parent 4a5b157 commit 5de2820

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

block_news.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function specialization() {
4848
*
4949
* @return stdClass - the block content.
5050
*/
51-
public function get_content() : stdClass {
51+
public function get_content(): stdClass {
5252
global $OUTPUT;
5353

5454
if ($this->content !== null) {
@@ -82,7 +82,7 @@ public function get_content() : stdClass {
8282
*
8383
* @return array news items.
8484
*/
85-
public function fetch_news() : array {
85+
public function fetch_news(): array {
8686
// Template data for mustache.
8787
$template = new stdClass();
8888

@@ -144,7 +144,7 @@ public function fetch_news() : array {
144144
*
145145
* @return array of the pages where the block can be added.
146146
*/
147-
public function applicable_formats() : array {
147+
public function applicable_formats(): array {
148148
return [
149149
'admin' => false,
150150
'site-index' => true,
@@ -159,7 +159,7 @@ public function applicable_formats() : array {
159159
*
160160
* @return bool.
161161
*/
162-
public function instance_allow_multiple() : bool {
162+
public function instance_allow_multiple(): bool {
163163
return false;
164164
}
165165

@@ -168,7 +168,7 @@ public function instance_allow_multiple() : bool {
168168
*
169169
* @return bool.
170170
*/
171-
public function has_config() : bool {
171+
public function has_config(): bool {
172172
return true;
173173
}
174174
}

classes/admin_setting_date.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct($name, $visiblename, $description, $defaultsetting)
4545
* @param string $query
4646
* @return string HMTL field
4747
*/
48-
public function output_html($data, $query='') : string {
48+
public function output_html($data, $query=''): string {
4949
$default = $this->get_defaultsetting();
5050

5151
return format_admin_setting($this, $this->visiblename,

classes/privacy/provider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class provider implements \core_privacy\local\metadata\null_provider {
3838
*
3939
* @return string
4040
*/
41-
public static function get_reason() : string {
41+
public static function get_reason(): string {
4242
return 'privacy:metadata';
4343
}
4444
}

tests/behat/show_news.feature

-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@ Feature: Show news
2626
And I should see "News Title One"
2727
And I should see "News Title Two"
2828
And I should see "News Title Three"
29-

0 commit comments

Comments
 (0)