More cleanup, update changelog
All checks were successful
timw4mail/HummingBirdAnimeClient/pipeline/pr-master This commit looks good

This commit is contained in:
Timothy Warren 2020-10-21 18:12:22 -04:00
parent d2a3b8ad37
commit fd6624862f
8 changed files with 3 additions and 1181 deletions

View File

@ -3,6 +3,7 @@
## Version 5.1 ## Version 5.1
* Added session check, so when coming back to a page, if the session is expired, the page will refresh. * Added session check, so when coming back to a page, if the session is expired, the page will refresh.
* Updated logging config so that much fewer, much smaller files are generated. * Updated logging config so that much fewer, much smaller files are generated.
* Updated Kitsu integration to use GraphQL API, reducing a lot of internal complexity.
## Version 5 ## Version 5
* Updated PHP requirement to 7.4 * Updated PHP requirement to 7.4

View File

@ -57,7 +57,7 @@ trait CacheTrait {
* *
* @param string $key * @param string $key
* @param callable $primer * @param callable $primer
* @param array $primeArgs * @param array|null $primeArgs
* @return mixed|null * @return mixed|null
* @throws InvalidArgumentException * @throws InvalidArgumentException
*/ */
@ -78,22 +78,4 @@ trait CacheTrait {
return $value; return $value;
} }
/**
* Generate a hash as a cache key from the current method call
*
* @param mixed $object
* @param string $method
* @param array $args
* @return string
*/
public function getHashForMethodCall($object, string $method, array $args = []): string
{
$keyObj = [
'class' => get_class($object),
'method' => $method,
'args' => $args,
];
return sha1(json_encode($keyObj));
}
} }

View File

@ -33,7 +33,6 @@ final class Kitsu {
public const MANGA_HISTORY_LIST_CACHE_KEY = 'kitsu-manga-history-list'; public const MANGA_HISTORY_LIST_CACHE_KEY = 'kitsu-manga-history-list';
public const GRAPHQL_ENDPOINT = 'https://kitsu.io/api/graphql'; public const GRAPHQL_ENDPOINT = 'https://kitsu.io/api/graphql';
public const JSON_API_ENDPOINT = 'https://kitsu.io/api/edge/';
public const SECONDS_IN_MINUTE = 60; public const SECONDS_IN_MINUTE = 60;
public const MINUTES_IN_HOUR = 60; public const MINUTES_IN_HOUR = 60;

View File

@ -36,10 +36,4 @@ class CacheTraitTest extends AnimeClientTestCase {
$this->testClass->setCache($cachePool); $this->testClass->setCache($cachePool);
$this->assertEquals($cachePool, $this->testClass->getCache()); $this->assertEquals($cachePool, $this->testClass->getCache());
} }
public function testGetHashForMethodCall()
{
$hash = $this->testClass->getHashForMethodCall($this, __METHOD__, []);
$this->assertEquals('684ba0a5c29ffec452c5f6a07d2eee6932575490', $hash);
}
} }

View File

@ -22,7 +22,7 @@ class RequirementsTest extends AnimeClientTestCase {
public function testPHPVersion(): void public function testPHPVersion(): void
{ {
$this->assertTrue(version_compare(PHP_VERSION, "5.4", "ge")); $this->assertTrue(version_compare(PHP_VERSION, "7.4", "ge"));
} }
public function testHasPDO(): void public function testHasPDO(): void

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long