-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
323 additions
and
79 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
|
||
namespace Npldevfr\Liquipedia\Meta; | ||
|
||
use Npldevfr\Liquipedia\Traits\HasConstants; | ||
|
||
final class Endpoints | ||
{ | ||
use HasConstants; | ||
|
||
final public const BROADCASTERS = 'broadcasters'; | ||
|
||
final public const COMPANIES = 'company'; | ||
|
||
final public const DATAPOINTS = 'datapoint'; | ||
|
||
final public const EXTERNAL_MEDIA_LINKS = 'externalmedialink'; | ||
|
||
final public const MATCHES = 'match'; | ||
|
||
final public const PLACEMENTS = 'placement'; | ||
|
||
final public const PLAYERS = 'player'; | ||
|
||
final public const SERIES = 'series'; | ||
|
||
final public const SQUAD_PLAYERS = 'squadplayer'; | ||
|
||
final public const STANDINGS_ENTRY = 'standingsentry'; | ||
|
||
final public const STANDINGS_TABLE = 'standingstable'; | ||
|
||
final public const TEAMS = 'team'; | ||
|
||
final public const TOURNAMENTS = 'tournament'; | ||
|
||
final public const TRANSFERS = 'transfer'; | ||
|
||
final public const TEAM_TEMPLATES = 'teamtemplate'; | ||
|
||
final public const TEAM_TEMPLATE_LIST = 'teamtemplatelist'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Npldevfr\Liquipedia\Meta; | ||
|
||
use Npldevfr\Liquipedia\Traits\HasConstants; | ||
|
||
final class SortOrder | ||
{ | ||
use HasConstants; | ||
|
||
public final const ASC = 'ASC'; | ||
|
||
public final const DESC = 'DESC'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace Npldevfr\Liquipedia\Traits; | ||
|
||
trait HasConstants | ||
{ | ||
/** | ||
* Get all the endpoints. | ||
* | ||
* @return array<string, mixed> | ||
*/ | ||
public static function all(): array | ||
{ | ||
return (new \ReflectionClass(self::class))->getConstants(); | ||
} | ||
|
||
/** | ||
* Check if the value is valid. | ||
*/ | ||
public static function fromValue(string $value): bool | ||
{ | ||
return in_array($value, self::all()); | ||
} | ||
} |
Oops, something went wrong.