@@ -1,4 +1,4 @@ discard block |
||
| 1 | -<?php declare( strict_types=1 ); |
|
| 1 | +<?php declare(strict_types=1); |
|
| 2 | 2 | |
| 3 | 3 | namespace BotRiconferme\Wiki; |
| 4 | 4 | |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | * @param UserInfo $ui |
| 24 | 24 | * @param Wiki $wiki |
| 25 | 25 | */ |
| 26 | - public function __construct( UserInfo $ui, Wiki $wiki ) { |
|
| 26 | + public function __construct ( UserInfo $ui, Wiki $wiki ) { |
|
| 27 | 27 | $this->wiki = $wiki; |
| 28 | 28 | $this->name = $ui->getName(); |
| 29 | 29 | $this->ui = $ui; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | /** |
| 33 | 33 | * @return string |
| 34 | 34 | */ |
| 35 | - public function getName() : string { |
|
| 35 | + public function getName () : string { |
|
| 36 | 36 | return $this->name; |
| 37 | 37 | } |
| 38 | 38 | |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | * |
| 42 | 42 | * @return string[] |
| 43 | 43 | */ |
| 44 | - public function getGroups() : array { |
|
| 44 | + public function getGroups () : array { |
|
| 45 | 45 | return $this->ui->extractGroups(); |
| 46 | 46 | } |
| 47 | 47 | |
@@ -50,7 +50,7 @@ discard block |
||
| 50 | 50 | * |
| 51 | 51 | * @return string[] [ group => date ] |
| 52 | 52 | */ |
| 53 | - public function getGroupsWithDates() : array { |
|
| 53 | + public function getGroupsWithDates () : array { |
|
| 54 | 54 | return $this->ui->extractGroupsWithDates(); |
| 55 | 55 | } |
| 56 | 56 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | * @param string $groupName |
| 61 | 61 | * @return bool |
| 62 | 62 | */ |
| 63 | - public function inGroup( string $groupName ) : bool { |
|
| 63 | + public function inGroup ( string $groupName ) : bool { |
|
| 64 | 64 | return in_array( $groupName, $this->getGroups(), true ); |
| 65 | 65 | } |
| 66 | 66 | |
@@ -69,9 +69,9 @@ discard block |
||
| 69 | 69 | * |
| 70 | 70 | * @inheritDoc |
| 71 | 71 | */ |
| 72 | - public function getRegex( string $delimiter = '/' ) : string { |
|
| 72 | + public function getRegex ( string $delimiter = '/' ) : string { |
|
| 73 | 73 | $bits = $this->getAliases(); |
| 74 | - $bits[] = $this->name; |
|
| 74 | + $bits[ ] = $this->name; |
|
| 75 | 75 | $regexify = static function ( string $el ) use ( $delimiter ) : string { |
| 76 | 76 | return str_replace( ' ', '[ _]', preg_quote( $el, $delimiter ) ); |
| 77 | 77 | }; |
@@ -83,14 +83,14 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @return string[] |
| 85 | 85 | */ |
| 86 | - public function getAliases() : array { |
|
| 86 | + public function getAliases () : array { |
|
| 87 | 87 | return $this->ui->getAliases(); |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | /** |
| 91 | 91 | * @return Page |
| 92 | 92 | */ |
| 93 | - public function getTalkPage() : Page { |
|
| 93 | + public function getTalkPage () : Page { |
|
| 94 | 94 | return new Page( "User talk:{$this->name}", $this->wiki ); |
| 95 | 95 | } |
| 96 | 96 | |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | * Get the default base page, e.g. WP:A/Riconferma annuale/XXX |
| 99 | 99 | * @return Page |
| 100 | 100 | */ |
| 101 | - public function getBasePage() : Page { |
|
| 101 | + public function getBasePage () : Page { |
|
| 102 | 102 | $prefix = Config::getInstance()->get( 'main-page-title' ); |
| 103 | 103 | return new Page( "$prefix/$this", $this->wiki ); |
| 104 | 104 | } |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | * @throws MissingPageException |
| 111 | 111 | * @return Page |
| 112 | 112 | */ |
| 113 | - public function getExistingBasePage() : Page { |
|
| 113 | + public function getExistingBasePage () : Page { |
|
| 114 | 114 | $basePage = $this->getBasePage(); |
| 115 | 115 | if ( !$basePage->exists() ) { |
| 116 | 116 | $basePage = null; |
@@ -134,7 +134,7 @@ discard block |
||
| 134 | 134 | /** |
| 135 | 135 | * @return string |
| 136 | 136 | */ |
| 137 | - public function __toString() : string { |
|
| 137 | + public function __toString () : string { |
|
| 138 | 138 | return $this->name; |
| 139 | 139 | } |
| 140 | 140 | } |