Skip to content

Commit 2c76d1e

Browse files
committed
Standardized Arrays
Changed all instances of `array()` to `[ ]`. Added spaces when arrays are directly initialized. The standartization was there to have a similar codestyle everywhere so that the code is more readable everywhere and looks more like it is made by one person and not ten.
1 parent 9104e01 commit 2c76d1e

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

includes/MultiCodeBlock.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function createMultiCodeBlock(string &$input, Parser &$parser) {
4242

4343
$size = sizeof($codevariants);
4444
$return = "";
45-
$languages = array();
45+
$languages = [];
4646

4747
$h1 = new \Highlight\Highlighter();
4848

includes/class/Description.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
* @param $dom A string that has the content of the <desc>-element.
1818
*/
1919
class Description {
20-
public $texts = array();
21-
public $keys = array();
20+
public $texts = [];
21+
public $keys = [];
2222

2323
public function __construct($dom = null) {
2424
if($dom === null) {

includes/hooks/MultiCodeBlockHooks.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public static function renderMultiCodeBlock(string $input, array $args, Parser $
4343
$out->addModuleStyles(['ext.multicodeblock.styles']);
4444
$out->addModules(['ext.multicodeblock.js']);
4545

46-
return [createMultiCodeBlock($input, $parser), 'noparse' => true, 'isHTML' => true, 'markerType' => 'nowiki'];
46+
return [ createMultiCodeBlock($input, $parser), 'noparse' => true, 'isHTML' => true, 'markerType' => 'nowiki' ];
4747
}
4848
}

includes/utils/HTMLFramework.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function createFrame(array &$lang, string &$code, bool $addCopy = true, string $
4848
*/
4949
function createCodeBlock(array &$codeTags, DOMNodeList &$descriptions, $lang, Parser &$parser, \Highlight\Highlighter &$h1) {
5050
if($lang == null) {
51-
return array('<span style="color: red; font-size: 700;">No Lang Attribute</span>', 'No lang');
51+
return [ '<span style="color: red; font-size: 700;">No Lang Attribute</span>', 'No lang' ];
5252
}
5353

5454
$lang = strtolower($lang);
@@ -77,7 +77,7 @@ function createCodeBlock(array &$codeTags, DOMNodeList &$descriptions, $lang, Pa
7777

7878
$return = createFrame($versions, $return, false, 'inner');
7979

80-
return array($return, replaceLang($lang));
80+
return [ $return, replaceLang($lang) ];
8181
}
8282

8383
/**

0 commit comments

Comments
 (0)