Various code tweaks
All checks were successful
timw4mail/HummingBirdAnimeClient/pipeline/head This commit looks good

This commit is contained in:
Timothy Warren 2020-05-01 19:38:45 -04:00
parent 9344d98056
commit 2d44435c59
5 changed files with 34 additions and 6 deletions

View File

@ -29,7 +29,7 @@ class AnimeListTransformer extends AbstractTransformer {
public function transform($item): AnimeListItem public function transform($item): AnimeListItem
{ {
return new AnimeListItem([]); return AnimeListItem::from([]);
} }
/** /**

View File

@ -176,7 +176,7 @@ trait KitsuTrait {
$logger->warning('Non 200 response for api call', (array)$response); $logger->warning('Non 200 response for api call', (array)$response);
} }
// throw new FailedResponseException('Failed to get the proper response from the API'); throw new FailedResponseException('Failed to get the proper response from the API');
} }
try try

View File

@ -0,0 +1,27 @@
<?php declare(strict_types=1);
/**
* Hummingbird Anime List Client
*
* An API client for Kitsu to manage anime and manga watch lists
*
* PHP version 7.4
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren <tim@timshomepage.net>
* @copyright 2015 - 2020 Timothy J. Warren
* @license http://www.opensource.org/licenses/mit-license.html MIT License
* @version 5
* @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
*/
namespace Aviat\AnimeClient\Enum;
use Aviat\Ion\Enum as BaseEnum;
/**
* Types of lists
*/
final class APISource extends BaseEnum {
public const KITSU = 'kitsu';
public const ANILIST = 'anilist';
}

View File

@ -26,7 +26,7 @@ trait ContainerAware {
* *
* @var ContainerInterface * @var ContainerInterface
*/ */
protected $container; protected ContainerInterface $container;
/** /**
* Set the container for the current object * Set the container for the current object

View File

@ -17,6 +17,7 @@
namespace Aviat\Ion; namespace Aviat\Ion;
use ReflectionClass; use ReflectionClass;
use ReflectionException;
/** /**
* Class emulating an enumeration type * Class emulating an enumeration type
@ -27,7 +28,7 @@ abstract class Enum {
* Return the list of constant values for the Enum * Return the list of constant values for the Enum
* *
* @return array * @return array
* @throws \ReflectionException * @throws ReflectionException
*/ */
public static function getConstList(): array public static function getConstList(): array
{ {
@ -48,12 +49,12 @@ abstract class Enum {
* *
* @param mixed $key * @param mixed $key
* @return boolean * @return boolean
* @throws \ReflectionException * @throws ReflectionException
*/ */
public static function isValid($key): bool public static function isValid($key): bool
{ {
$values = array_values(static::getConstList()); $values = array_values(static::getConstList());
return \in_array($key, $values, TRUE); return in_array($key, $values, TRUE);
} }
} }
// End of Enum.php // End of Enum.php