Skip to content

Commit 2f07644

Browse files
committed
Minor cleanup
1 parent f15d82d commit 2f07644

File tree

6 files changed

+10
-12
lines changed

6 files changed

+10
-12
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,7 +453,7 @@ gradle-app.setting
453453

454454
##### Composer
455455
composer.phar
456-
/vendor/
456+
vendor/
457457

458458
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
459459
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
@@ -465,7 +465,7 @@ composer.lock
465465
#
466466
# Recommended template: PHP.gitignore
467467

468-
/wpcs/*
468+
*/wpcs/*
469469

470470
##### SASS
471471
.sass-cache/

includes/MultiCodeBlock.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?php
2-
32
/**
43
* This file is part of MultiCodeBlock.
54
*

includes/class/Code.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function &highlight(\Highlight\Highlighter &$hl) {
4848
* @param string $code The code that should be inserted into the class
4949
* @param string $lang The language the code is written in.
5050
*/
51-
public function setCode(string $code, string &$lang) {
51+
public function setCode(string &$code, string &$lang) {
5252
$this->code = $code;
5353
$this->lang = $lang;
5454
}

includes/hooks/MultiCodeBlockHooks.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
* Protect against register_globals vulnerabilities.
1111
* This line must be present before any global variable is referenced.
1212
*/
13-
if( !defined( 'MEDIAWIKI' ) ) {
14-
echo( "This is an extension to the MediaWiki package and cannot be run standalone.\n" );
15-
die( -1 );
16-
}
1713

1814
/**
1915
* The hooks class for the MultiCodeBlock MediaWiki-Extension.
@@ -24,7 +20,7 @@ class MultiCodeBlockHooks {
2420
/**
2521
* Sets a hook for the MediaWiki parser to be able to use the <multicodeblock>-Tag in the MediaWiki syntax.
2622
*
27-
* @param Parser &$parser The Parser Element as a reference.
23+
* @param Parser $parser The Parser Element as a reference.
2824
*/
2925
public static function onParserFirstCallInit( Parser &$parser ) {
3026
$parser->setHook( 'multicodeblock', [ self::class, 'renderMultiCodeBlock' ] );

includes/languages/languages.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"basic": "BASIC",
2222
"bnf": "BNF",
2323
"brainfuck": "Brainfuck",
24+
"c": "C",
2425
"cal": "C/AL",
2526
"capnproto": "Cap’n Proto",
2627
"ceylon": "Ceylon",

includes/utils/getData.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
*
1212
* @param string $content The content that should be parsed by the DOM-Parser
1313
*
14-
* @return PHPHtmlParser\Dom The DOM-Element that has the HTML-Tree
14+
* @return DOMDocument The DOM-Element that has the HTML-Tree
1515
*/
16-
function getDOM(&$content) {
16+
function getDOM(string &$content) {
1717
$dom = new DOMDocument();
1818

1919
$dom->validateOnParse = false;
@@ -26,7 +26,9 @@ function getDOM(&$content) {
2626
}
2727

2828
/**
29-
* Returns the code in the `<code>` tags.
29+
* Returns all of the blocks with code inside.
30+
* They are determined by having the
31+
* `<code>{code}</code>`-structure.
3032
*
3133
* @param string $codeblock The object where all of the codeblocks should be removed.
3234
*

0 commit comments

Comments
 (0)