Do you wish to register an account?
Browse Source

More cleanup, update changelog

pull/32/head
Timothy Warren 2 months ago
parent
commit
fd6624862f
8 changed files with 3 additions and 1181 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -19
      src/AnimeClient/API/CacheTrait.php
  3. +0
    -1
      src/AnimeClient/Kitsu.php
  4. +0
    -6
      tests/AnimeClient/API/CacheTraitTest.php
  5. +1
    -1
      tests/AnimeClient/RequirementsTest.php
  6. +0
    -1
      tests/AnimeClient/test_data/JsonAPI/inlineIncluded.json
  7. +0
    -1152
      tests/AnimeClient/test_data/JsonAPI/jsonApiExample.json
  8. +0
    -1
      tests/AnimeClient/test_data/JsonAPI/organizedIncludes.json

+ 1
- 0
CHANGELOG.md View File

@ -3,6 +3,7 @@
## Version 5.1
* 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 Kitsu integration to use GraphQL API, reducing a lot of internal complexity.
## Version 5
* Updated PHP requirement to 7.4

+ 1
- 19
src/AnimeClient/API/CacheTrait.php View File

@ -57,7 +57,7 @@ trait CacheTrait {
*
* @param string $key
* @param callable $primer
* @param array $primeArgs
* @param array|null $primeArgs
* @return mixed|null
* @throws InvalidArgumentException
*/
@ -78,22 +78,4 @@ trait CacheTrait {
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));
}
}

+ 0
- 1
src/AnimeClient/Kitsu.php View File

@ -33,7 +33,6 @@ final class Kitsu {
public const MANGA_HISTORY_LIST_CACHE_KEY = 'kitsu-manga-history-list';
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 MINUTES_IN_HOUR = 60;

+ 0
- 6
tests/AnimeClient/API/CacheTraitTest.php View File

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

+ 1
- 1
tests/AnimeClient/RequirementsTest.php View File

@ -22,7 +22,7 @@ class RequirementsTest extends AnimeClientTestCase {
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

+ 0
- 1
tests/AnimeClient/test_data/JsonAPI/inlineIncluded.json
File diff suppressed because it is too large
View File


+ 0
- 1152
tests/AnimeClient/test_data/JsonAPI/jsonApiExample.json
File diff suppressed because it is too large
View File


+ 0
- 1
tests/AnimeClient/test_data/JsonAPI/organizedIncludes.json
File diff suppressed because it is too large
View File


Loading…
Cancel
Save