|
|
|
@ -10,12 +10,18 @@ class Link
@@ -10,12 +10,18 @@ class Link
|
|
|
|
|
|
|
|
|
|
public function __construct(string $line) |
|
|
|
|
{ |
|
|
|
|
$this->_line = $line; |
|
|
|
|
$this->_line = preg_replace( |
|
|
|
|
'/^\s*=>(.*)/', |
|
|
|
|
'$1', |
|
|
|
|
trim( |
|
|
|
|
$line |
|
|
|
|
) |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public function getAddress(): ?string |
|
|
|
|
{ |
|
|
|
|
if (preg_match('/^=>\s*([^\s]+)/', trim($this->_line), $match)) |
|
|
|
|
if (preg_match('/^\s*([^\s]+)/', trim($this->_line), $match)) |
|
|
|
|
{ |
|
|
|
|
return trim( |
|
|
|
|
$match[1] |
|
|
|
|