-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
::getUserLink() #1
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:cockandballs:
@@ -23,19 +23,12 @@ class MainSiteUser | |||
public static function createFromDOMDocument(\DOMDocument $doc): MainSiteUser // very todo: remove horrible static ctor | |||
{ | |||
$xpath = new \DOMXPath($doc); | |||
$twitterHandle = ($link = ltrim(self::getUserLink($xpath, 'iconTwitter'), '@')) === '' ? null : $link; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't this throw when getUserLink()
returns null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaveRandom Don't think so https://3v4l.org/BLLQv
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/Entities/MainSiteUser.php
Outdated
@@ -56,4 +49,13 @@ public function getGithubUsername() | |||
{ | |||
return $this->githubUsername; | |||
} | |||
|
|||
private static function getUserLink($xpath, string $class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
: ?string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@DaveRandom #visualDebt
No description provided.