_line = preg_replace( '/^\s*=>(.*)/', '$1', trim( $line ) ); } public function getAddress(): ?string { if (preg_match('/^\s*([^\s]+)/', trim($this->_line), $match)) { return trim( $match[1] ); } return null; } public function getDate(?int &$timestamp = null): ?string { if (preg_match('/\s([\d]+-[\d+]+-[\d]+)\s/', trim($this->_line), $match)) { if ($result = strtotime($match[1])) { $timestamp = $result; return trim( $match[1] ); } } return null; } public function getAlt(): ?string { if (preg_match('/\s[\d]+-[\d+]+-[\d]+\s(.*)$/', trim($this->_line), $match)) { return trim( $match[1] ); } else if (preg_match('/\s(.*)$/', trim($this->_line), $match)) { return trim( $match[1] ); } return null; } }