1 | <?php |
||
13 | class PhpStanLoader implements FileChecker |
||
14 | { |
||
15 | protected $lineRegex = '/^\s+(?<lineNumber>[0-9]+)/'; |
||
16 | |||
17 | protected $file; |
||
18 | protected $relatedRegex = '#(function|method) (?:(?P<class>.*?)::)?(?P<function>.*?)[ \(]#'; |
||
19 | |||
20 | /** |
||
21 | * @var array |
||
22 | */ |
||
23 | protected $invalidLines = []; |
||
24 | |||
25 | /** |
||
26 | * @param string $filename the path to the phpstan.txt file |
||
27 | */ |
||
28 | public function __construct($filename) |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | public function getLines() |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function isValidLine($file, $lineNumber) |
||
62 | |||
63 | |||
64 | /** |
||
65 | * {@inheritdoc} |
||
66 | */ |
||
67 | public function handleNotFoundFile() |
||
71 | |||
72 | /** |
||
73 | * @param string $line |
||
74 | * @param string $currentFile |
||
75 | * @return string the currentFileName |
||
76 | */ |
||
77 | protected function checkForFilename($line, $currentFile) |
||
84 | |||
85 | protected function getLineNumber($line, $currentLineNumber) |
||
98 | |||
99 | protected function getMessage($line) |
||
103 | |||
104 | protected function trimLines() |
||
112 | |||
113 | /** |
||
114 | * {@inheritdoc} |
||
115 | */ |
||
116 | public static function getDescription() |
||
120 | |||
121 | protected function handleRelatedError($filename, $line, $error) |
||
142 | |||
143 | /** |
||
144 | * @param $filename |
||
145 | * @param $lineNumber |
||
146 | * @param $error |
||
147 | */ |
||
148 | protected function addError($filename, $lineNumber, $error) |
||
155 | |||
156 | /** |
||
157 | * @param $matches |
||
158 | * @return Reflector |
||
159 | */ |
||
160 | protected function getReflector($matches) |
||
173 | } |
||
174 |