Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
76.92% covered (warning)
76.92%
10 / 13
50.00% covered (danger)
50.00%
1 / 2
CRAP
0.00% covered (danger)
0.00%
0 / 1
FindClasses
76.92% covered (warning)
76.92%
10 / 13
50.00% covered (danger)
50.00%
1 / 2
6.44
0.00% covered (danger)
0.00%
0 / 1
 __construct
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
1 / 1
1
 execute
72.73% covered (warning)
72.73%
8 / 11
0.00% covered (danger)
0.00%
0 / 1
5.51
1<?php
2/**
3 * @license GPL-2.0-or-later
4 * @file
5 */
6
7use MediaWiki\Maintenance\Maintenance;
8
9// @codeCoverageIgnoreStart
10require_once __DIR__ . '/Maintenance.php';
11// @codeCoverageIgnoreEnd
12
13/**
14 * Find the files that contain classes
15 *
16 * @since 1.37
17 * @ingroup Autoload
18 * @ingroup Maintenance
19 */
20class FindClasses extends Maintenance {
21
22    public function __construct() {
23        parent::__construct();
24        $this->addDescription( 'Finds the files containing classes via the autoloader.' );
25    }
26
27    public function execute() {
28        $stdin = $this->getStdin();
29
30        while ( !feof( $stdin ) ) {
31            $line = fgets( $stdin );
32            if ( $line === false ) {
33                break;
34            }
35            $class = trim( $line );
36            $filename = AutoLoader::find( $class );
37            if ( $filename ) {
38                $this->output( "$filename\n" );
39            } elseif ( $class ) {
40                $this->output( "#$class\n" );
41            }
42        }
43    }
44}
45
46// @codeCoverageIgnoreStart
47$maintClass = FindClasses::class;
48require_once RUN_MAINTENANCE_IF_MAIN;
49// @codeCoverageIgnoreEnd