| Conditions | 4 | 
| Paths | 4 | 
| Total Lines | 21 | 
| Code Lines | 10 | 
| Lines | 0 | 
| Ratio | 0 % | 
| Tests | 15 | 
| CRAP Score | 4 | 
| Changes | 0 | ||
| 1 | <?php | ||
| 15 | 263 | public function parse() | |
| 16 | 	{ | ||
| 17 | 263 | if (strpos($this->text, ']:') === false) | |
| 18 | 263 | 		{ | |
| 19 | 237 | return; | |
| 20 | } | ||
| 21 | |||
| 22 | 26 | 		$regexp = '/^\\x1A* {0,3}\\[([^\\x17\\]]+)\\]: *([^\\s\\x17]+ *(?:"[^\\x17]*?"|\'[^\\x17]*?\'|\\([^\\x17)]*\\))?)[^\\x17\\n]*\\n?/m'; | |
| 23 | 26 | preg_match_all($regexp, $this->text, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER); | |
| 24 | 26 | foreach ($matches as $m) | |
| 25 | 		{ | ||
| 26 | 26 | $this->parser->addIgnoreTag($m[0][1], strlen($m[0][0]), -2); | |
| 27 | |||
| 28 | // Ignore the reference if it already exists | ||
| 29 | 26 | $id = strtolower($m[1][0]); | |
| 30 | 26 | if (!isset($this->text->linkReferences[$id])) | |
| 31 | 26 | 			{ | |
| 32 | 26 | $this->text->linkReferences[$id] = $m[2][0]; | |
| 33 | 26 | } | |
| 34 | 26 | } | |
| 35 | } | ||
| 36 | } |