@@ -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 | |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * @param string $name |
| 19 | 19 | * @param Wiki $wiki |
| 20 | 20 | */ |
| 21 | - public function __construct( string $name, Wiki $wiki ) { |
|
| 21 | + public function __construct ( string $name, Wiki $wiki ) { |
|
| 22 | 22 | parent::__construct( $wiki ); |
| 23 | 23 | $this->name = $name; |
| 24 | 24 | } |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | /** |
| 27 | 27 | * @return string |
| 28 | 28 | */ |
| 29 | - public function getName() : string { |
|
| 29 | + public function getName () : string { |
|
| 30 | 30 | return $this->name; |
| 31 | 31 | } |
| 32 | 32 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * |
| 36 | 36 | * @return string[] |
| 37 | 37 | */ |
| 38 | - public function getGroups() : array { |
|
| 38 | + public function getGroups () : array { |
|
| 39 | 39 | return array_diff( array_keys( $this->getUserInfo() ), PageBotList::NON_GROUP_KEYS ); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * @return string[] [ group => date ] |
| 46 | 46 | */ |
| 47 | - public function getGroupsWithDates() : array { |
|
| 47 | + public function getGroupsWithDates () : array { |
|
| 48 | 48 | return array_intersect_key( $this->getUserInfo(), array_fill_keys( $this->getGroups(), 1 ) ); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * |
| 54 | 54 | * @return string[] |
| 55 | 55 | */ |
| 56 | - public function getUserInfo() : array { |
|
| 56 | + public function getUserInfo () : array { |
|
| 57 | 57 | if ( $this->info === null ) { |
| 58 | 58 | $usersList = PageBotList::get( $this->wiki )->getAdminsList(); |
| 59 | 59 | $this->info = $usersList[ $this->name ]->getUserInfo(); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | /** |
| 65 | 65 | * @param array|null $info |
| 66 | 66 | */ |
| 67 | - public function setInfo( ?array $info ) : void { |
|
| 67 | + public function setInfo ( ?array $info ) : void { |
|
| 68 | 68 | $this->info = $info; |
| 69 | 69 | } |
| 70 | 70 | |
@@ -74,7 +74,7 @@ discard block |
||
| 74 | 74 | * @param string $groupName |
| 75 | 75 | * @return bool |
| 76 | 76 | */ |
| 77 | - public function inGroup( string $groupName ) : bool { |
|
| 77 | + public function inGroup ( string $groupName ) : bool { |
|
| 78 | 78 | return in_array( $groupName, $this->getGroups() ); |
| 79 | 79 | } |
| 80 | 80 | |
@@ -83,9 +83,9 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * @inheritDoc |
| 85 | 85 | */ |
| 86 | - public function getRegex() : string { |
|
| 86 | + public function getRegex () : string { |
|
| 87 | 87 | $bits = $this->getAliases(); |
| 88 | - $bits[] = $this->name; |
|
| 88 | + $bits[ ] = $this->name; |
|
| 89 | 89 | $regexify = function ( $el ) { |
| 90 | 90 | return str_replace( ' ', '[ _]', preg_quote( $el ) ); |
| 91 | 91 | }; |
@@ -97,21 +97,21 @@ discard block |
||
| 97 | 97 | * |
| 98 | 98 | * @return string[] |
| 99 | 99 | */ |
| 100 | - public function getAliases() : array { |
|
| 101 | - return $this->getUserInfo()['aliases'] ?? []; |
|
| 100 | + public function getAliases () : array { |
|
| 101 | + return $this->getUserInfo()[ 'aliases' ] ?? [ ]; |
|
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | /** |
| 105 | 105 | * @return Page |
| 106 | 106 | */ |
| 107 | - public function getTalkPage() : Page { |
|
| 107 | + public function getTalkPage () : Page { |
|
| 108 | 108 | return new Page( "User talk:{$this->name}", $this->wiki ); |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
| 112 | 112 | * @return string |
| 113 | 113 | */ |
| 114 | - public function __toString() { |
|
| 114 | + public function __toString () { |
|
| 115 | 115 | return $this->name; |
| 116 | 116 | } |
| 117 | 117 | } |