| Total Complexity | 8 |
| Total Lines | 49 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare( strict_types=1 ); |
||
| 10 | class PageBotList extends Page { |
||
| 11 | /** |
||
| 12 | * @private Use self::get() |
||
| 13 | */ |
||
| 14 | public function __construct() { |
||
| 16 | } |
||
| 17 | |||
| 18 | /** |
||
| 19 | * Instance getter |
||
| 20 | * |
||
| 21 | * @return self |
||
| 22 | */ |
||
| 23 | public static function get() : self { |
||
| 29 | } |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Get the valid timestamp for the given groups |
||
| 33 | * |
||
| 34 | * @param array $groups |
||
| 35 | * @return int |
||
| 36 | */ |
||
| 37 | public static function getValidTimestamp( array $groups ): int { |
||
| 38 | $checkuser = isset( $groups['checkuser'] ) ? |
||
| 39 | \DateTime::createFromFormat( 'd/m/Y', $groups['checkuser'] )->getTimestamp() : |
||
| 40 | 0; |
||
| 41 | $bureaucrat = isset( $groups['bureaucrat'] ) ? |
||
| 42 | \DateTime::createFromFormat( 'd/m/Y', $groups['bureaucrat'] )->getTimestamp() : |
||
| 43 | 0; |
||
| 44 | |||
| 45 | $timestamp = max( $bureaucrat, $checkuser ); |
||
| 46 | if ( $timestamp === 0 ) { |
||
| 47 | $timestamp = \DateTime::createFromFormat( 'd/m/Y', $groups['sysop'] )->getTimestamp(); |
||
| 48 | } |
||
| 49 | return $timestamp; |
||
| 50 | } |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the actual list of admins |
||
| 54 | * |
||
| 55 | * @return array[] |
||
| 56 | */ |
||
| 57 | public function getAdminsList() : array { |
||
| 59 | } |
||
| 60 | } |
||
| 61 |