diff --git a/src/HypixelPHP.php b/src/HypixelPHP.php index 922c111..331c029 100644 --- a/src/HypixelPHP.php +++ b/src/HypixelPHP.php @@ -33,7 +33,7 @@ use Plancke\HypixelPHP\responses\Resource; use Plancke\HypixelPHP\responses\skyblock\SkyBlockProfile; use Plancke\HypixelPHP\responses\Status; -use Plancke\HypixelPHP\responses\WatchdogStats; +use Plancke\HypixelPHP\responses\PunishmentStats; use Plancke\HypixelPHP\util\InputType; use Plancke\HypixelPHP\util\Utilities; use Plancke\HypixelPHP\util\Validator; @@ -582,15 +582,15 @@ function () { } /** - * @return WatchdogStats|Response|null + * @return PunishmentStats|Response|null */ - public function getWatchdogStats() { + public function getPunishmentStats() { return $this->handle( - $this->getCacheHandler()->getWatchdogStats(), + $this->getCacheHandler()->getPunishmentStats(), function () { - return $this->getFetcher()->fetch(FetchTypes::WATCHDOG_STATS, ['key' => $this->getAPIKey()]); + return $this->getFetcher()->fetch(FetchTypes::PUNISHMENT_STATS, ['key' => $this->getAPIKey()]); }, - $this->getProvider()->getWatchdogStats() + $this->getProvider()->getPunishmentStats() ); } diff --git a/src/cache/CacheHandler.php b/src/cache/CacheHandler.php index f187fa9..b6a7031 100644 --- a/src/cache/CacheHandler.php +++ b/src/cache/CacheHandler.php @@ -18,7 +18,7 @@ use Plancke\HypixelPHP\responses\Resource; use Plancke\HypixelPHP\responses\skyblock\SkyBlockProfile; use Plancke\HypixelPHP\responses\Status; -use Plancke\HypixelPHP\responses\WatchdogStats; +use Plancke\HypixelPHP\responses\PunishmentStats; /** * Class CacheHandler @@ -45,7 +45,7 @@ abstract class CacheHandler extends Module { CacheTimes::STATUS => 10 * 60, CacheTimes::KEY_INFO => 10 * 60, CacheTimes::FRIENDS => 10 * 60, - CacheTimes::WATCHDOG => 10 * 60, + CacheTimes::PUNISHMENT_STATS => 10 * 60, CacheTimes::GAME_COUNTS => 10 * 60, CacheTimes::SKYBLOCK_PROFILE => 10 * 60 @@ -241,15 +241,15 @@ public abstract function getBoosters(); public abstract function setBoosters(Boosters $boosters); /** - * @return WatchdogStats|null + * @return PunishmentStats|null */ - public abstract function getWatchdogStats(); + public abstract function getPunishmentStats(); /** - * @param WatchdogStats $watchdogStats + * @param PunishmentStats $punishmentStats * @return void */ - public abstract function setWatchdogStats(WatchdogStats $watchdogStats); + public abstract function setPunishmentStats(PunishmentStats $punishmentStats); /** * @return PlayerCount|null diff --git a/src/cache/CacheTimes.php b/src/cache/CacheTimes.php index ef52297..d754010 100644 --- a/src/cache/CacheTimes.php +++ b/src/cache/CacheTimes.php @@ -22,7 +22,7 @@ abstract class CacheTimes { const RECENT_GAMES = 'recentGames'; const KEY_INFO = 'keyInfo'; const FRIENDS = 'friends'; - const WATCHDOG = 'watchdog'; + const PUNISHMENT_STATS = 'punishmentStats'; const GAME_COUNTS = 'gameCounts'; const SKYBLOCK_PROFILE = 'skyblock_profile'; diff --git a/src/cache/CacheTypes.php b/src/cache/CacheTypes.php index be9a90d..12139be 100644 --- a/src/cache/CacheTypes.php +++ b/src/cache/CacheTypes.php @@ -27,7 +27,7 @@ abstract class CacheTypes { const LEADERBOARDS = 'leaderboards'; const BOOSTERS = 'boosters'; - const WATCHDOG_STATS = 'watchdogStats'; + const PUNISHMENT_STATS = 'punishmentStats'; const PLAYER_COUNT = 'playerCount'; const GAME_COUNTS = 'gameCounts'; diff --git a/src/cache/impl/FlatFileCacheHandler.php b/src/cache/impl/FlatFileCacheHandler.php index a759d29..6db852e 100644 --- a/src/cache/impl/FlatFileCacheHandler.php +++ b/src/cache/impl/FlatFileCacheHandler.php @@ -18,7 +18,7 @@ use Plancke\HypixelPHP\responses\Resource; use Plancke\HypixelPHP\responses\skyblock\SkyBlockProfile; use Plancke\HypixelPHP\responses\Status; -use Plancke\HypixelPHP\responses\WatchdogStats; +use Plancke\HypixelPHP\responses\PunishmentStats; use Plancke\HypixelPHP\util\CacheUtil; /** @@ -323,21 +323,21 @@ public function setBoosters(Boosters $boosters) { } /** - * @return WatchdogStats|null + * @return PunishmentStats|null */ - public function getWatchdogStats() { + public function getPunishmentStats() { return $this->wrapProvider( - $this->getHypixelPHP()->getProvider()->getWatchdogStats(), - $this->_getCache(CacheTypes::WATCHDOG_STATS) + $this->getHypixelPHP()->getProvider()->getPunishmentStats(), + $this->_getCache(CacheTypes::PUNISHMENT_STATS) ); } /** - * @param WatchdogStats $watchdogStats + * @param PunishmentStats $punishmentStats * @throws InvalidArgumentException */ - public function setWatchdogStats(WatchdogStats $watchdogStats) { - $this->_setCache(CacheTypes::WATCHDOG_STATS, $watchdogStats); + public function setPunishmentStats(PunishmentStats $punishmentStats) { + $this->_setCache(CacheTypes::PUNISHMENT_STATS, $punishmentStats); } /** diff --git a/src/cache/impl/NoCacheHandler.php b/src/cache/impl/NoCacheHandler.php index 6fb0d2d..a350203 100644 --- a/src/cache/impl/NoCacheHandler.php +++ b/src/cache/impl/NoCacheHandler.php @@ -14,7 +14,7 @@ use Plancke\HypixelPHP\responses\RecentGames; use Plancke\HypixelPHP\responses\skyblock\SkyBlockProfile; use Plancke\HypixelPHP\responses\Status; -use Plancke\HypixelPHP\responses\WatchdogStats; +use Plancke\HypixelPHP\responses\PunishmentStats; /** * Class NoCacheHandler @@ -103,10 +103,10 @@ function getBoosters() { return null; } - function setWatchdogStats(WatchdogStats $watchdogStats) { + function setPunishmentStats(PunishmentStats $punishmentStats) { } - function getWatchdogStats() { + function getPunishmentStats() { return null; } diff --git a/src/fetch/FetchTypes.php b/src/fetch/FetchTypes.php index 27356e9..fc02be9 100644 --- a/src/fetch/FetchTypes.php +++ b/src/fetch/FetchTypes.php @@ -21,7 +21,7 @@ abstract class FetchTypes { const STATUS = 'status'; const RECENT_GAMES = 'recentGames'; const KEY = 'key'; - const WATCHDOG_STATS = 'watchdogStats'; + const PUNISHMENT_STATS = 'punishmentStats'; const PLAYER_COUNT = 'playerCount'; const GAME_COUNTS = 'gameCounts'; @@ -38,7 +38,7 @@ public static function values() { self::STATUS, self::RECENT_GAMES, self::KEY, - self::WATCHDOG_STATS, + self::PUNISHMENT_STATS, self::PLAYER_COUNT, self::GAME_COUNTS, self::SKYBLOCK_PROFILE diff --git a/src/fetch/adapter/ResponseAdapter.php b/src/fetch/adapter/ResponseAdapter.php index 05865cb..01f30ae 100644 --- a/src/fetch/adapter/ResponseAdapter.php +++ b/src/fetch/adapter/ResponseAdapter.php @@ -44,7 +44,7 @@ public function adaptResponse($fetch, $keyValues, Response $response) { case FetchTypes::SKYBLOCK_PROFILE: return $this->remapField('profile', $response); - case FetchTypes::WATCHDOG_STATS: + case FetchTypes::PUNISHMENT_STATS: case FetchTypes::PLAYER_COUNT: case FetchTypes::GAME_COUNTS: return $this->wrapRecord($response); diff --git a/src/provider/Provider.php b/src/provider/Provider.php index 5fae04b..d3cd7d5 100644 --- a/src/provider/Provider.php +++ b/src/provider/Provider.php @@ -15,7 +15,7 @@ use Plancke\HypixelPHP\responses\RecentGames; use Plancke\HypixelPHP\responses\skyblock\SkyBlockProfile; use Plancke\HypixelPHP\responses\Status; -use Plancke\HypixelPHP\responses\WatchdogStats; +use Plancke\HypixelPHP\responses\PunishmentStats; /** * Class Provider @@ -98,9 +98,9 @@ public function getKeyInfo() { /** * @return Closure */ - public function getWatchdogStats() { + public function getPunishmentStats() { return function ($HypixelPHP, $data) { - return new WatchdogStats($HypixelPHP, $data); + return new PunishmentStats($HypixelPHP, $data); }; } diff --git a/src/responses/WatchdogStats.php b/src/responses/PunishmentStats.php similarity index 78% rename from src/responses/WatchdogStats.php rename to src/responses/PunishmentStats.php index a6e1118..385ee31 100644 --- a/src/responses/WatchdogStats.php +++ b/src/responses/PunishmentStats.php @@ -6,10 +6,10 @@ use Plancke\HypixelPHP\classes\HypixelObject; /** - * Class WatchdogStats + * Class PunishmentStats * @package Plancke\HypixelPHP\responses */ -class WatchdogStats extends HypixelObject { +class PunishmentStats extends HypixelObject { /** * @return int */ @@ -35,10 +35,10 @@ public function getRollingDaily() { * @return string */ public function getCacheTimeKey() { - return CacheTimes::WATCHDOG; + return CacheTimes::PUNISHMENT_STATS; } public function save() { - $this->getHypixelPHP()->getCacheHandler()->setWatchdogStats($this); + $this->getHypixelPHP()->getCacheHandler()->setPunishmentStats($this); } } \ No newline at end of file