-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from joesaunderson/feature/predictions
Add Prediction API #7
- Loading branch information
Showing
3 changed files
with
107 additions
and
0 deletions.
There are no files selected for viewing
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,66 @@ | ||
<?php | ||
|
||
namespace Sportmonks\Soccer\Endpoint; | ||
|
||
use Sportmonks\Soccer\Exception\ApiRequestException; | ||
use Sportmonks\Soccer\SoccerClient; | ||
use stdClass; | ||
|
||
/** | ||
* Class Prediction | ||
* @package Sportmonks\Soccer\Endpoint | ||
*/ | ||
class Prediction extends SoccerClient | ||
{ | ||
/** | ||
* @return stdClass | ||
* @throws ApiRequestException | ||
*/ | ||
public function getLeagues() | ||
{ | ||
$url = "predictions/leagues"; | ||
return $this->call($url); | ||
} | ||
|
||
/** | ||
* @return stdClass | ||
* @throws ApiRequestException | ||
*/ | ||
public function getProbabilities() | ||
{ | ||
$url = "predictions/probabilities/next"; | ||
return $this->call($url); | ||
} | ||
|
||
/** | ||
* @param int $fixtureId | ||
* @return stdClass | ||
* @throws ApiRequestException | ||
*/ | ||
public function getProbabilitiesByFixtureId(int $fixtureId) | ||
{ | ||
$url = "predictions/probabilities/fixture/{$fixtureId}"; | ||
return $this->call($url); | ||
} | ||
|
||
/** | ||
* @return stdClass | ||
* @throws ApiRequestException | ||
*/ | ||
public function getValueBets() | ||
{ | ||
$url = "predictions/valuebets/next"; | ||
return $this->call($url); | ||
} | ||
|
||
/** | ||
* @param int $fixtureId | ||
* @return stdClass | ||
* @throws ApiRequestException | ||
*/ | ||
public function getValueBetsByFixtureId(int $fixtureId) | ||
{ | ||
$url = "predictions/valuebets/fixture/{$fixtureId}"; | ||
return $this->call($url); | ||
} | ||
} |
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