Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| GlobalPreferencesServices | |
100.00% |
3 / 3 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| wrap | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getGlobalPreferencesConnectionProvider | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * This program is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License along |
| 14 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 15 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 16 | * http://www.gnu.org/copyleft/gpl.html |
| 17 | * |
| 18 | * @file |
| 19 | */ |
| 20 | |
| 21 | namespace GlobalPreferences; |
| 22 | |
| 23 | use GlobalPreferences\Services\GlobalPreferencesConnectionProvider; |
| 24 | use MediaWiki\MediaWikiServices; |
| 25 | |
| 26 | class GlobalPreferencesServices { |
| 27 | |
| 28 | public function __construct( private readonly MediaWikiServices $serviceContainer ) { |
| 29 | } |
| 30 | |
| 31 | /** |
| 32 | * Static version of the constructor, for nicer syntax. |
| 33 | * |
| 34 | * @param MediaWikiServices $serviceContainer |
| 35 | * @return static |
| 36 | */ |
| 37 | public static function wrap( MediaWikiServices $serviceContainer ): GlobalPreferencesServices { |
| 38 | return new static( $serviceContainer ); |
| 39 | } |
| 40 | |
| 41 | public function getGlobalPreferencesConnectionProvider(): GlobalPreferencesConnectionProvider { |
| 42 | return $this->serviceContainer->get( 'GlobalPreferences.GlobalPreferencesConnectionProvider' ); |
| 43 | } |
| 44 | } |