Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
76.92% |
10 / 13 |
|
50.00% |
1 / 2 |
CRAP | |
0.00% |
0 / 1 |
FindClasses | |
76.92% |
10 / 13 |
|
50.00% |
1 / 2 |
6.44 | |
0.00% |
0 / 1 |
__construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
execute | |
72.73% |
8 / 11 |
|
0.00% |
0 / 1 |
5.51 |
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 | * @ingroup Maintenance |
20 | */ |
21 | |
22 | use MediaWiki\Maintenance\Maintenance; |
23 | |
24 | // @codeCoverageIgnoreStart |
25 | require_once __DIR__ . '/Maintenance.php'; |
26 | // @codeCoverageIgnoreEnd |
27 | |
28 | /** |
29 | * Maintenance script for finding the files that contain classes |
30 | * |
31 | * @ingroup Maintenance |
32 | * @since 1.37 |
33 | */ |
34 | class FindClasses extends Maintenance { |
35 | |
36 | public function __construct() { |
37 | parent::__construct(); |
38 | $this->addDescription( 'Finds the files containing classes via the autoloader.' ); |
39 | } |
40 | |
41 | public function execute() { |
42 | $stdin = $this->getStdin(); |
43 | |
44 | while ( !feof( $stdin ) ) { |
45 | $line = fgets( $stdin ); |
46 | if ( $line === false ) { |
47 | break; |
48 | } |
49 | $class = trim( $line ); |
50 | $filename = AutoLoader::find( $class ); |
51 | if ( $filename ) { |
52 | $this->output( "$filename\n" ); |
53 | } elseif ( $class ) { |
54 | $this->output( "#$class\n" ); |
55 | } |
56 | } |
57 | } |
58 | } |
59 | |
60 | // @codeCoverageIgnoreStart |
61 | $maintClass = FindClasses::class; |
62 | require_once RUN_MAINTENANCE_IF_MAIN; |
63 | // @codeCoverageIgnoreEnd |