1 | <?php |
||
21 | class GitLogParser extends AbstractParser |
||
22 | { |
||
23 | public function mergeTo($history) |
||
28 | |||
29 | public function mergeGitLog() |
||
38 | |||
39 | public function parseGitLog() |
||
45 | |||
46 | 1 | public function parseLines(array $lines) |
|
47 | { |
||
48 | 1 | $this->getHistory()->initTags(); |
|
49 | |||
50 | 1 | foreach ($lines as $line) { |
|
51 | 1 | if (!preg_match('/^(\w+) (([0-9-]+) (.*?) \[.*?\]) *\(?(.*?)\)?$/', $line, $m)) { |
|
52 | throw new UnexpectedValueException('failed parse git line'); |
||
53 | } |
||
54 | 1 | $tag = $this->matchTag($m[5]); |
|
55 | 1 | $note = $this->matchNote($m[4]); |
|
56 | 1 | if ($tag) { |
|
57 | 1 | $this->addTag($tag, $m[3]); |
|
58 | } |
||
59 | 1 | if (false && $note) { /// disabled adding notes |
|
60 | $this->addNote($note); |
||
61 | } |
||
62 | 1 | $this->addCommit($m[1], $m[2]); |
|
63 | } |
||
64 | |||
65 | 1 | return $this->getHistory(); |
|
66 | } |
||
67 | |||
68 | /** |
||
69 | * Finds first tag in given refs string. |
||
70 | * @param string $str |
||
71 | * @return string |
||
72 | */ |
||
73 | 1 | public function matchTag($str) |
|
74 | { |
||
75 | 1 | $refs = explode(', ', $str); |
|
76 | 1 | foreach ($refs as $ref) { |
|
77 | 1 | if (preg_match('/^tag: (.*)$/', $ref, $m)) { |
|
78 | 1 | return $m[1]; |
|
79 | } |
||
80 | } |
||
81 | |||
82 | 1 | return null; |
|
83 | } |
||
84 | |||
85 | 1 | public function matchNote($str) |
|
89 | } |
||
90 |
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.