This file is indexed.

/usr/share/php/TheSeer/Autoload/Collector.php is in phpab 1.24.1-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
namespace TheSeer\Autoload {

    use TheSeer\DirectoryScanner\PHPFilterIterator;

    class Collector {

        /**
         * @var ParserInterface
         */
        private $parser;

        /**
         * @var CollectorResult
         */
        private $collectorResult;

        /**
         * @var bool
         */
        private $tolerantMode;

        /**
         * @var bool
         */
        private $trustingMode;

        /**
         * Collector constructor.
         *
         * @param ParserInterface $parser
         * @param bool            $tolerantMode
         * @param bool            $trustingMode
         * @param array           $whitelist
         * @param array           $blacklist
         */
        public function __construct(ParserInterface $parser, $tolerantMode = false, $trustingMode = true, Array $whitelist = array('*'), Array $blacklist = array()) {
            $this->parser = $parser;
            $this->tolerantMode = $tolerantMode;
            $this->trustingMode = $trustingMode;
            $this->collectorResult = new CollectorResult($whitelist, $blacklist);
        }

        public function getResult() {
            return $this->collectorResult;
        }

        public function processDirectory(\Iterator $sources) {
            $worker = $this->trustingMode ? $sources : new PHPFilterIterator($sources);
            foreach($worker as $file) {
                $this->processFile($file);
            }
        }

        public function processFile(\SplFileInfo $file) {
                try {
                    $parseResult = $this->parser->parse(new SourceFile($file->getRealPath()));
                    if ($parseResult->hasRedeclarations() && !$this->tolerantMode) {
                        throw new CollectorException(
                            sprintf(
                                "Duplicate (potentially conditional) definitions of the following unit(s) found:\n\n\tUnit(s): %s\n\tFile: %s",
                                join(', ', $parseResult->getRedeclarations()),
                                $file->getRealPath()
                            ),
                            CollectorException::InFileRedeclarationFound
                        );
                    }
                    $this->collectorResult->addParseResult($file, $parseResult);
                } catch(ParserException $e) {
                    throw new CollectorException(
                        sprintf(
                            "Could not process file '%s' due to parse errors: %s",
                            $file->getRealPath(),
                            $e->getMessage()
                        ),
                        CollectorException::ParseErrror,
                        $e
                    );
                } catch(CollectorResultException $e) {
                    throw new CollectorException(
                        $e->getMessage(),
                        CollectorException::RedeclarationFound
                    );
                }
        }
    }

    class CollectorException extends \Exception {
        const ParseErrror = 1;
        const RedeclarationFound = 2;
        const InFileRedeclarationFound = 3;
    }
}