Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

::getUserLink() #1

wants to merge 2 commits into from

Conversation

JayPHP
Copy link
Member

@JayPHP JayPHP commented Jun 5, 2017

No description provided.

@JayPHP JayPHP requested a review from DaveRandom June 5, 2017 16:34
Copy link
Member

@DaveRandom DaveRandom left a 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;
Copy link
Member

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?

Copy link
Member Author

@JayPHP JayPHP Jun 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -56,4 +49,13 @@ public function getGithubUsername()
{
return $this->githubUsername;
}

private static function getUserLink($xpath, string $class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

: ?string

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DaveRandom #visualDebt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants