protected function createLinks($lines, $matches, $test)
    {
        foreach ($matches as $line) {
            if (!empty($line) && is_array($line) && count($line) > 0 && is_array($line[0]) && count($line[0]) > 0) {
                $occurence = strpos($lines, $line[0]) === false ? 1 : 0;

                $lines = str_replace(
                    $line[$occurence],
                    $this->createLinkToEditFile($test, $line[1], $line, $occurence),
                    $lines
                );
            }
        }

        return $lines;
    }