Passed
Push — master ( 4cf7bd...148f21 )
by Daimona
01:40
created
includes/Wiki/Element.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Wiki;
4 4
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 	 *
12 12
 	 * @return string
13 13
 	 */
14
-	abstract public function getRegex() : string;
14
+	abstract public function getRegex () : string;
15 15
 
16 16
 	/**
17 17
 	 * Get a regex matching any element in the given array
@@ -20,10 +20,10 @@  discard block
 block discarded – undo
20 20
 	 * @return string
21 21
 	 * @todo Is this the right place?
22 22
 	 */
23
-	public static function regexFromArray( array $elements ) : string {
24
-		$bits = [];
23
+	public static function regexFromArray ( array $elements ) : string {
24
+		$bits = [ ];
25 25
 		foreach ( $elements as $el ) {
26
-			$bits[] = $el->getRegex();
26
+			$bits[ ] = $el->getRegex();
27 27
 		}
28 28
 		return '(?:' . implode( '|', $bits ) . ')';
29 29
 	}
Please login to merge, or discard this patch.
includes/Task/TaskBase.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Task;
4 4
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
  */
12 12
 abstract class TaskBase extends ContextSource {
13 13
 	/** @var string[] */
14
-	protected $errors = [];
14
+	protected $errors = [ ];
15 15
 	/** @var TaskDataProvider */
16 16
 	protected $dataProvider;
17 17
 
@@ -20,14 +20,14 @@  discard block
 block discarded – undo
20 20
 	 *
21 21
 	 * @param TaskDataProvider $dataProvider
22 22
 	 */
23
-	final public function __construct( TaskDataProvider $dataProvider ) {
23
+	final public function __construct ( TaskDataProvider $dataProvider ) {
24 24
 		set_exception_handler( [ $this, 'handleException' ] );
25 25
 		set_error_handler( [ $this, 'handleError' ] );
26 26
 		parent::__construct();
27 27
 		$this->dataProvider = $dataProvider;
28 28
 	}
29 29
 
30
-	public function __destruct() {
30
+	public function __destruct () {
31 31
 		restore_error_handler();
32 32
 		restore_exception_handler();
33 33
 	}
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 *
38 38
 	 * @return TaskResult
39 39
 	 */
40
-	final public function run() : TaskResult {
40
+	final public function run () : TaskResult {
41 41
 		$class = ( new \ReflectionClass( $this ) )->getShortName();
42 42
 		$opName = $this->getOperationName();
43 43
 		$this->getLogger()->info( "Starting $opName $class" );
@@ -68,14 +68,14 @@  discard block
 block discarded – undo
68 68
 	 *
69 69
 	 * @return int One of the STATUS_* constants
70 70
 	 */
71
-	abstract protected function runInternal() : int;
71
+	abstract protected function runInternal () : int;
72 72
 
73 73
 	/**
74 74
 	 * How this operation should be called in logs
75 75
 	 *
76 76
 	 * @return string
77 77
 	 */
78
-	abstract public function getOperationName() : string;
78
+	abstract public function getOperationName () : string;
79 79
 
80 80
 	/**
81 81
 	 * Exception handler.
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 	 * @param \Throwable $ex
84 84
 	 * @protected
85 85
 	 */
86
-	public function handleException( \Throwable $ex ) {
86
+	public function handleException ( \Throwable $ex ) {
87 87
 		$this->getLogger()->error(
88 88
 			( new \ReflectionClass( $ex ) )->getShortName() . ': ' .
89 89
 			$ex->getMessage() . "\nin " . $ex->getFile() . ' line ' .
@@ -101,14 +101,14 @@  discard block
 block discarded – undo
101 101
 	 * @throws \ErrorException
102 102
 	 * @protected
103 103
 	 */
104
-	public function handleError( $errno, $errstr, $errfile, $errline ) {
104
+	public function handleError ( $errno, $errstr, $errfile, $errline ) {
105 105
 		throw new \ErrorException( $errstr, 0, $errno, $errfile, $errline );
106 106
 	}
107 107
 
108 108
 	/**
109 109
 	 * @return TaskDataProvider
110 110
 	 */
111
-	protected function getDataProvider() : TaskDataProvider {
111
+	protected function getDataProvider () : TaskDataProvider {
112 112
 		return $this->dataProvider;
113 113
 	}
114 114
 }
Please login to merge, or discard this patch.
includes/Wiki/Controller.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Wiki;
4 4
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
 	/**
28 28
 	 * @param string $domain The URL of the wiki, if different from default
29 29
 	 */
30
-	public function __construct( string $domain = DEFAULT_URL ) {
30
+	public function __construct ( string $domain = DEFAULT_URL ) {
31 31
 		$this->logger = new Logger;
32 32
 		$this->domain = $domain;
33 33
 	}
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * @throws MissingPageException
42 42
 	 * @throws MissingSectionException
43 43
 	 */
44
-	public function getPageContent( string $title, int $section = null ) : string {
44
+	public function getPageContent ( string $title, int $section = null ) : string {
45 45
 		$msg = "Retrieving content of page $title" . ( $section !== null ? ", section $section" : '' );
46 46
 		$this->logger->debug( $msg );
47 47
 		$params = [
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
 		];
54 54
 
55 55
 		if ( $section !== null ) {
56
-			$params['rvsection'] = $section;
56
+			$params[ 'rvsection' ] = $section;
57 57
 		}
58 58
 
59 59
 		$req = RequestBase::newFromParams( $params )->setUrl( $this->domain );
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 			throw new MissingPageException( $title );
64 64
 		}
65 65
 
66
-		$mainSlot = $page->revisions[0]->slots->main;
66
+		$mainSlot = $page->revisions[ 0 ]->slots->main;
67 67
 
68 68
 		if ( $section !== null && isset( $mainSlot->nosuchsection ) ) {
69 69
 			throw new MissingSectionException( $title, $section );
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @param array $params
78 78
 	 * @throws EditException
79 79
 	 */
80
-	public function editPage( array $params ) {
80
+	public function editPage ( array $params ) {
81 81
 		$this->login();
82 82
 
83 83
 		$params = [
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 	 * Login wrapper. Checks if we're already logged in and clears tokens cache
105 105
 	 * @throws LoginException
106 106
 	 */
107
-	public function login() {
107
+	public function login () {
108 108
 		if ( self::$loggedIn ) {
109 109
 			return;
110 110
 		}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 
131 131
 		self::$loggedIn = true;
132 132
 		// Clear tokens cache
133
-		$this->tokens = [];
133
+		$this->tokens = [ ];
134 134
 		$this->logger->info( 'Login succeeded' );
135 135
 	}
136 136
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
 	 * @param string $type
141 141
 	 * @return string
142 142
 	 */
143
-	public function getToken( string $type ) : string {
143
+	public function getToken ( string $type ) : string {
144 144
 		if ( !isset( $this->tokens[ $type ] ) ) {
145 145
 			$params = [
146 146
 				'action' => 'query',
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
 	 * @param string $title
164 164
 	 * @return int
165 165
 	 */
166
-	public function getPageCreationTS( string $title ) : int {
166
+	public function getPageCreationTS ( string $title ) : int {
167 167
 		$params = [
168 168
 			'action' => 'query',
169 169
 			'prop' => 'revisions',
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
 		$res = RequestBase::newFromParams( $params )->setUrl( $this->domain )->execute();
178 178
 		$data = $res->query->pages;
179
-		return strtotime( reset( $data )->revisions[0]->timestamp );
179
+		return strtotime( reset( $data )->revisions[ 0 ]->timestamp );
180 180
 	}
181 181
 
182 182
 	/**
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 	 * @param string $title
186 186
 	 * @param string $reason
187 187
 	 */
188
-	public function protectPage( string $title, string $reason ) {
188
+	public function protectPage ( string $title, string $reason ) {
189 189
 		$this->logger->info( "Protecting page $title" );
190 190
 		$this->login();
191 191
 
Please login to merge, or discard this patch.
includes/Request/CurlRequest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Request;
4 4
 
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 	 * @inheritDoc
13 13
 	 * @throws APIRequestException
14 14
 	 */
15
-	protected function reallyMakeRequest( string $params ) : string {
15
+	protected function reallyMakeRequest ( string $params ) : string {
16 16
 		$curl = curl_init();
17 17
 		if ( $curl === false ) {
18 18
 			throw new APIRequestException( 'Cannot open cURL handler.' );
@@ -54,10 +54,10 @@  discard block
 block discarded – undo
54 54
 	 * @return int
55 55
 	 * @internal Only used as CB for cURL
56 56
 	 */
57
-	public function headersHandler( $ch, string $header ) : int {
57
+	public function headersHandler ( $ch, string $header ) : int {
58 58
 		$bits = explode( ':', $header, 2 );
59
-		if ( trim( $bits[0] ) === 'Set-Cookie' ) {
60
-			$this->newCookies[] = $bits[1];
59
+		if ( trim( $bits[ 0 ] ) === 'Set-Cookie' ) {
60
+			$this->newCookies[ ] = $bits[ 1 ];
61 61
 		}
62 62
 		// @phan-suppress-next-line PhanTypeMismatchReturn WTF? Why does phan thinks this is a string?
63 63
 		return strlen( $header );
Please login to merge, or discard this patch.
includes/Config.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme;
4 4
 
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
 	/** @var self */
14 14
 	private static $instance;
15 15
 	/** @var array */
16
-	private $opts = [];
16
+	private $opts = [ ];
17 17
 
18 18
 	/**
19 19
 	 * Use self::init() and self::getInstance()
20 20
 	 */
21
-	private function __construct() {
21
+	private function __construct () {
22 22
 	}
23 23
 
24 24
 	/**
@@ -27,16 +27,16 @@  discard block
 block discarded – undo
27 27
 	 * @param array $defaults
28 28
 	 * @throws ConfigException
29 29
 	 */
30
-	public static function init( array $defaults ) {
30
+	public static function init ( array $defaults ) {
31 31
 		if ( self::$instance ) {
32 32
 			throw new ConfigException( 'Config was already initialized' );
33 33
 		}
34 34
 
35 35
 		$inst = new self;
36
-		$inst->set( 'list-title', $defaults['list-title'] );
37
-		$inst->set( 'msg-title', $defaults['msg-title'] );
38
-		$inst->set( 'username', $defaults['username'] );
39
-		$inst->set( 'password', $defaults['password'] );
36
+		$inst->set( 'list-title', $defaults[ 'list-title' ] );
37
+		$inst->set( 'msg-title', $defaults[ 'msg-title' ] );
38
+		$inst->set( 'username', $defaults[ 'username' ] );
39
+		$inst->set( 'password', $defaults[ 'password' ] );
40 40
 		self::$instance = $inst;
41 41
 
42 42
 		// On-wiki values
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
 	 * @return string
57 57
 	 * @throws ConfigException
58 58
 	 */
59
-	public function getWikiMessage( string $key ) : string {
59
+	public function getWikiMessage ( string $key ) : string {
60 60
 		static $messages = null;
61 61
 		if ( $messages === null ) {
62 62
 			try {
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
 		if ( !isset( $messages[ $key ] ) ) {
70 70
 			throw new ConfigException( "Message '$key' does not exist." );
71 71
 		}
72
-		return $messages[$key];
72
+		return $messages[ $key ];
73 73
 	}
74 74
 	/**
75 75
 	 * Set a config value.
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
 	 * @param string $key
78 78
 	 * @param mixed $value
79 79
 	 */
80
-	protected function set( string $key, $value ) {
80
+	protected function set ( string $key, $value ) {
81 81
 		$this->opts[ $key ] = $value;
82 82
 	}
83 83
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 * @return self
88 88
 	 * @throws ConfigException
89 89
 	 */
90
-	public static function getInstance() : self {
90
+	public static function getInstance () : self {
91 91
 		if ( !self::$instance ) {
92 92
 			throw new ConfigException( 'Config not yet initialized' );
93 93
 		}
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 	 * @return mixed
102 102
 	 * @throws ConfigException
103 103
 	 */
104
-	public function get( string $opt ) {
104
+	public function get ( string $opt ) {
105 105
 		if ( !isset( $this->opts[ $opt ] ) ) {
106 106
 			throw new ConfigException( "Config option '$opt' not set." );
107 107
 		}
Please login to merge, or discard this patch.
includes/Bot.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme;
4 4
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 
12 12
 	const VERSION = '1.0';
13 13
 
14
-	public function __construct() {
14
+	public function __construct () {
15 15
 		$this->logger = new Logger;
16 16
 	}
17 17
 
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 * @param string $mode
22 22
 	 * @param string|null $name
23 23
 	 */
24
-	private function run( string $mode = TaskManager::MODE_COMPLETE, string $name = null ) {
24
+	private function run ( string $mode = TaskManager::MODE_COMPLETE, string $name = null ) {
25 25
 		$activity = $mode === TaskManager::MODE_COMPLETE ? TaskManager::MODE_COMPLETE : "$mode $name";
26 26
 		$this->logger->info( "Running $activity" );
27 27
 		$manager = new TaskManager;
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	/**
38 38
 	 * Entry point for the whole process
39 39
 	 */
40
-	public function runAll() {
40
+	public function runAll () {
41 41
 		$this->run();
42 42
 	}
43 43
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
 	 *
47 47
 	 * @param string $task
48 48
 	 */
49
-	public function runTask( string $task ) {
49
+	public function runTask ( string $task ) {
50 50
 		$this->run( TaskManager::MODE_TASK, $task );
51 51
 	}
52 52
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 *
56 56
 	 * @param string $subtask
57 57
 	 */
58
-	public function runSubtask( string $subtask ) {
58
+	public function runSubtask ( string $subtask ) {
59 59
 		$this->run( TaskManager::MODE_SUBTASK, $subtask );
60 60
 	}
61 61
 }
Please login to merge, or discard this patch.
includes/Exception/PermissionDeniedException.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Exception;
4 4
 
Please login to merge, or discard this patch.
includes/Wiki/Page/PageBotList.php 1 patch
Spacing   +11 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Wiki\Page;
4 4
 
@@ -11,7 +11,7 @@  discard block
 block discarded – undo
11 11
 	/**
12 12
 	 * @private Use self::get()
13 13
 	 */
14
-	public function __construct() {
14
+	public function __construct () {
15 15
 		parent::__construct( Config::getInstance()->get( 'list-title' ) );
16 16
 	}
17 17
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 *
21 21
 	 * @return self
22 22
 	 */
23
-	public static function get() : self {
23
+	public static function get () : self {
24 24
 		static $instance = null;
25 25
 		if ( $instance === null ) {
26 26
 			$instance = new self;
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	 * @param string[] $groups
33 33
 	 * @return int|null
34 34
 	 */
35
-	public static function getOverrideTimestamp( array $groups ) : ?int {
35
+	public static function getOverrideTimestamp ( array $groups ) : ?int {
36 36
 		if ( array_intersect_key( $groups, [ 'override-perm' => true, 'override' => true ] ) ) {
37 37
 			// A one-time override takes precedence
38 38
 			$day = $groups[ 'override' ] ?? $groups[ 'override-perm' ];
@@ -48,17 +48,15 @@  discard block
 block discarded – undo
48 48
 	 * @param array $groups
49 49
 	 * @return int
50 50
 	 */
51
-	public static function getValidFlagTimestamp( array $groups ): int {
52
-		$checkuser = isset( $groups['checkuser'] ) ?
53
-			\DateTime::createFromFormat( 'd/m/Y', $groups['checkuser'] )->getTimestamp() :
54
-			0;
55
-		$bureaucrat = isset( $groups['bureaucrat'] ) ?
56
-			\DateTime::createFromFormat( 'd/m/Y', $groups['bureaucrat'] )->getTimestamp() :
57
-			0;
51
+	public static function getValidFlagTimestamp ( array $groups ): int {
52
+		$checkuser = isset( $groups[ 'checkuser' ] ) ?
53
+			\DateTime::createFromFormat( 'd/m/Y', $groups[ 'checkuser' ] )->getTimestamp() : 0;
54
+		$bureaucrat = isset( $groups[ 'bureaucrat' ] ) ?
55
+			\DateTime::createFromFormat( 'd/m/Y', $groups[ 'bureaucrat' ] )->getTimestamp() : 0;
58 56
 
59 57
 		$timestamp = max( $bureaucrat, $checkuser );
60 58
 		if ( $timestamp === 0 ) {
61
-			$timestamp = \DateTime::createFromFormat( 'd/m/Y', $groups['sysop'] )->getTimestamp();
59
+			$timestamp = \DateTime::createFromFormat( 'd/m/Y', $groups[ 'sysop' ] )->getTimestamp();
62 60
 		}
63 61
 		return $timestamp;
64 62
 	}
@@ -68,7 +66,7 @@  discard block
 block discarded – undo
68 66
 	 *
69 67
 	 * @return array[]
70 68
 	 */
71
-	public function getAdminsList() : array {
69
+	public function getAdminsList () : array {
72 70
 		return json_decode( $this->getContent(), true );
73 71
 	}
74 72
 }
Please login to merge, or discard this patch.
includes/Wiki/Page/Page.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -1,4 +1,4 @@  discard block
 block discarded – undo
1
-<?php declare( strict_types=1 );
1
+<?php declare(strict_types=1);
2 2
 
3 3
 namespace BotRiconferme\Wiki\Page;
4 4
 
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 	 * @param string $title
23 23
 	 * @param string $domain The site where the page lives, if different from default
24 24
 	 */
25
-	public function __construct( string $title, string $domain = DEFAULT_URL ) {
25
+	public function __construct ( string $title, string $domain = DEFAULT_URL ) {
26 26
 		$this->title = $title;
27 27
 		$this->controller = new Controller( $domain );
28 28
 	}
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 	/**
31 31
 	 * @return string
32 32
 	 */
33
-	public function getTitle() : string {
33
+	public function getTitle () : string {
34 34
 		return $this->title;
35 35
 	}
36 36
 
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 * @param int|null $section A section number to retrieve the content of that section
41 41
 	 * @return string
42 42
 	 */
43
-	public function getContent( int $section = null ) : string {
43
+	public function getContent ( int $section = null ) : string {
44 44
 		if ( $this->content === null ) {
45 45
 			$this->content = $this->controller->getPageContent( $this->title, $section );
46 46
 		}
@@ -52,16 +52,16 @@  discard block
 block discarded – undo
52 52
 	 *
53 53
 	 * @param array $params
54 54
 	 */
55
-	public function edit( array $params ) {
55
+	public function edit ( array $params ) {
56 56
 		$params = [
57 57
 			'title' => $this->getTitle()
58 58
 		] + $params;
59 59
 
60 60
 		$this->controller->editPage( $params );
61
-		if ( isset( $params['text'] ) ) {
62
-			$this->content = $params['text'];
63
-		} elseif ( isset( $params['appendtext'] ) ) {
64
-			$this->content .= $params['appendtext'];
61
+		if ( isset( $params[ 'text' ] ) ) {
62
+			$this->content = $params[ 'text' ];
63
+		} elseif ( isset( $params[ 'appendtext' ] ) ) {
64
+			$this->content .= $params[ 'appendtext' ];
65 65
 		} else {
66 66
 			// Clear the cache anyway
67 67
 			( new Logger )->warning( 'Resetting content cache. Params: ' . var_export( $params, true ) );
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @return bool
76 76
 	 */
77
-	public function exists() : bool {
77
+	public function exists () : bool {
78 78
 		$res = RequestBase::newFromParams( [
79 79
 			'action' => 'query',
80 80
 			'titles' => $this->getTitle()
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
89 89
 	 * @param string $regex
90 90
 	 * @return bool
91 91
 	 */
92
-	public function matches( string $regex ) : bool {
92
+	public function matches ( string $regex ) : bool {
93 93
 		return (bool)preg_match( $regex, $this->getContent() );
94 94
 	}
95 95
 
@@ -101,8 +101,8 @@  discard block
 block discarded – undo
101 101
 	 * @return string[]
102 102
 	 * @throws \Exception
103 103
 	 */
104
-	public function getMatch( string $regex ) : array {
105
-		$ret = [];
104
+	public function getMatch ( string $regex ) : array {
105
+		$ret = [ ];
106 106
 		if ( preg_match( $regex, $this->getContent(), $ret ) === 0 ) {
107 107
 			throw new \Exception( 'The content does not match the given regex' );
108 108
 		}
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 *
115 115
 	 * @inheritDoc
116 116
 	 */
117
-	public function getRegex() : string {
117
+	public function getRegex () : string {
118 118
 		return str_replace( ' ', '[ _]', preg_quote( $this->title ) );
119 119
 	}
120 120
 
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
 	 *
124 124
 	 * @return string
125 125
 	 */
126
-	public function __toString() {
126
+	public function __toString () {
127 127
 		return $this->getTitle();
128 128
 	}
129 129
 }
Please login to merge, or discard this patch.