1 | <?php |
||
9 | class Phpcs |
||
10 | { |
||
11 | private $id; |
||
12 | |||
13 | public function init($fileContents, $commitFileId) |
||
14 | { |
||
15 | $this->id = $commitFileId; |
||
16 | $filename = uniqid(strtotime('now'), true); |
||
17 | Storage::disk('local_tmp')->put($filename.'.php', $fileContents); |
||
18 | $result = shell_exec('phpcs --report=diff '.storage_path('tmp').DIRECTORY_SEPARATOR.$filename.'.php 2>&1; echo $?'); |
||
19 | $this->addSuggestionFix($result); |
||
20 | $result = shell_exec('phpcs '.storage_path('tmp').DIRECTORY_SEPARATOR.$filename.'.php 2>&1; echo $?'); |
||
21 | Storage::delete(storage_path('tmp').DIRECTORY_SEPARATOR.$filename.'.php'); |
||
|
|||
22 | $this->convertToLines($result); |
||
23 | } |
||
24 | |||
25 | private function addSuggestionFix($result) |
||
35 | |||
36 | private function addPhpcs($data) |
||
49 | |||
50 | private function convertToLines($result) |
||
76 | } |
||
77 |
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.