Skip to content

Commit

Permalink
Linker interface extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
kapxapot committed May 2, 2020
1 parent 62a880d commit db1c19e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Core/Interfaces/LinkerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ function news(int $id = null) : string;
function tag(string $tag = null, string $tab = null) : string;

function twitch(string $id) : string;
function twitchImg(string $id) : string;
function twitchLargeImg(string $id) : string;

function youtube(string $code) : string;

function gravatarUrl(string $hash = null) : string;
Expand Down
2 changes: 1 addition & 1 deletion src/Core/Linker.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public function tag(string $tag = null, string $tab = null) : string

return $url;
}

public function twitchImg(string $id) : string
{
return 'https://static-cdn.jtvnw.net/previews-ttv/live_user_' . $id . '-320x180.jpg';
Expand Down
9 changes: 9 additions & 0 deletions src/Testing/Mocks/LinkerMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,15 @@ public function twitch(string $id) : string
{
return 'https://twitch.tv/' . $id;
}
public function twitchImg(string $id) : string
{
return 'https://static-cdn.jtvnw.net/previews-ttv/live_user_' . $id . '-320x180.jpg';
}

public function twitchLargeImg(string $id) : string
{
return 'https://static-cdn.jtvnw.net/previews-ttv/live_user_' . $id . '-640x360.jpg';
}

public function youtube(string $code) : string
{
Expand Down

0 comments on commit db1c19e

Please sign in to comment.