PHPStan fixes
This commit is contained in:
parent
e6dde8c42a
commit
d620e44114
@ -36,14 +36,14 @@ class Auth {
|
||||
/**
|
||||
* Anime API Model
|
||||
*
|
||||
* @var \Aviat\AnimeClient\API\Kitsu\Model
|
||||
* @var Model
|
||||
*/
|
||||
protected $model;
|
||||
|
||||
/**
|
||||
* Session object
|
||||
*
|
||||
* @var Aura\Session\Segment
|
||||
* @var \Aura\Session\Segment
|
||||
*/
|
||||
protected $segment;
|
||||
|
||||
|
@ -73,7 +73,7 @@ class MAL {
|
||||
'completed' => MangaReadingStatus::COMPLETED,
|
||||
'onhold' => MangaReadingStatus::ON_HOLD,
|
||||
'dropped' => MangaReadingStatus::DROPPED,
|
||||
'plantoread' => MangaReadingStatus::PLAN_TO_WATCH
|
||||
'plantoread' => MangaReadingStatus::PLAN_TO_READ
|
||||
];
|
||||
}
|
||||
}
|
@ -35,6 +35,11 @@ class Model {
|
||||
*/
|
||||
protected $animeListTransformer;
|
||||
|
||||
/**
|
||||
* @var ListItem
|
||||
*/
|
||||
protected $listItem;
|
||||
|
||||
/**
|
||||
* MAL Model constructor.
|
||||
*
|
||||
|
@ -28,6 +28,18 @@ const NOT_FOUND_METHOD = 'notFound';
|
||||
const ERROR_MESSAGE_METHOD = 'errorPage';
|
||||
const SRC_DIR = SRC_DIR;
|
||||
|
||||
/**
|
||||
* Joins paths together. Variadic to take an
|
||||
* arbitrary number of arguments
|
||||
*
|
||||
* @param string[] ...$args
|
||||
* @return string
|
||||
*/
|
||||
function _dir(...$args)
|
||||
{
|
||||
return implode(DIRECTORY_SEPARATOR, $args);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load configuration options from .toml files
|
||||
*
|
||||
|
@ -72,7 +72,7 @@ class BaseCommand extends Command {
|
||||
$config = loadToml($CONF_DIR);
|
||||
$config_array = array_merge($base_config, $config);
|
||||
|
||||
$di = function ($config_array) use ($APP_DIR) {
|
||||
$di = function ($config_array) {
|
||||
$container = new Container();
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
|
@ -31,13 +31,13 @@ class SyncKitsuWithMal extends BaseCommand {
|
||||
|
||||
/**
|
||||
* Model for making requests to Kitsu API
|
||||
* @var Aviat\AnimeClient\API\Kitsu
|
||||
* @var \Aviat\AnimeClient\API\Kitsu\Model
|
||||
*/
|
||||
protected $kitsuModel;
|
||||
|
||||
/**
|
||||
* Model for making requests to MAL API
|
||||
* @var Aviat\AnimeClient\API\MAL
|
||||
* @var \Aviat\AnimeClient\API\MAL\Model
|
||||
*/
|
||||
protected $malModel;
|
||||
|
||||
|
@ -18,6 +18,8 @@ namespace Aviat\AnimeClient;
|
||||
|
||||
use const Aviat\AnimeClient\SESSION_SEGMENT;
|
||||
|
||||
use function Aviat\AnimeClient\_dir;
|
||||
|
||||
use Aviat\Ion\Di\{ContainerAware, ContainerInterface};
|
||||
use Aviat\Ion\View\{HtmlView, HttpView, JsonView};
|
||||
use InvalidArgumentException;
|
||||
@ -33,13 +35,13 @@ class Controller {
|
||||
|
||||
/**
|
||||
* Cache manager
|
||||
* @var \Aviat\Ion\Cache\CacheInterface
|
||||
* @var \Psr\Cache\CacheItemPoolInterface
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
/**
|
||||
* The global configuration object
|
||||
* @var Aviat\Ion\ConfigInterface $config
|
||||
* @var \Aviat\Ion\ConfigInterface $config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
@ -69,7 +71,7 @@ class Controller {
|
||||
|
||||
/**
|
||||
* Session segment
|
||||
* @var [type]
|
||||
* @var \Aura\Session\Segment
|
||||
*/
|
||||
protected $session;
|
||||
|
||||
@ -307,7 +309,8 @@ class Controller {
|
||||
$post = $this->request->getParsedBody();
|
||||
if ($auth->authenticate($post['password']))
|
||||
{
|
||||
return $this->sessionRedirect();
|
||||
$this->sessionRedirect();
|
||||
return;
|
||||
}
|
||||
|
||||
$this->setFlashMessage('Invalid username or password.');
|
||||
|
@ -45,7 +45,7 @@ class Anime extends BaseController {
|
||||
|
||||
/**
|
||||
* Data cache
|
||||
* @var Aviat\Ion\Cache\CacheInterface
|
||||
* @var \Psr\Cache\CachePoolInterface
|
||||
*/
|
||||
protected $cache;
|
||||
|
||||
|
@ -24,6 +24,8 @@ use const Aviat\AnimeClient\{
|
||||
SRC_DIR
|
||||
};
|
||||
|
||||
use function Aviat\AnimeClient\_dir;
|
||||
|
||||
use Aviat\Ion\Di\ContainerInterface;
|
||||
use Aviat\Ion\Friend;
|
||||
|
||||
@ -46,7 +48,7 @@ class Dispatcher extends RoutingBase {
|
||||
|
||||
/**
|
||||
* Class wrapper for input superglobals
|
||||
* @var Psr\Http\Message\ServerRequestInterface
|
||||
* @var \Psr\Http\Message\ServerRequestInterface
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
|
@ -33,14 +33,14 @@ class MenuGenerator extends UrlGenerator {
|
||||
/**
|
||||
* Html generation helper
|
||||
*
|
||||
* @var Aura\Html\HelperLocator
|
||||
* @var \Aura\Html\HelperLocator
|
||||
*/
|
||||
protected $helper;
|
||||
|
||||
/**
|
||||
* Request object
|
||||
*
|
||||
* @var Aura\Web\Request
|
||||
* @var \Aura\Web\Request
|
||||
*/
|
||||
protected $request;
|
||||
|
||||
|
@ -52,14 +52,14 @@ class Anime extends API {
|
||||
/**
|
||||
* Model for making requests to Kitsu API
|
||||
*
|
||||
* @var Aviat\AnimeClient\API\Kitsu\Model
|
||||
* @var \Aviat\AnimeClient\API\Kitsu\Model
|
||||
*/
|
||||
protected $kitsuModel;
|
||||
|
||||
/**
|
||||
* Model for making requests to MAL API
|
||||
*
|
||||
* @var Aviat\AnimeClient\API\MAL\Model
|
||||
* @var \Aviat\AnimeClient\API\MAL\Model
|
||||
*/
|
||||
protected $malModel;
|
||||
|
||||
|
@ -58,10 +58,16 @@ class Manga extends API
|
||||
|
||||
/**
|
||||
* Model for making requests to Kitsu API
|
||||
* @var Aviat\AnimeClient\API\Kitsu\KitsuModel
|
||||
* @var \Aviat\AnimeClient\API\Kitsu\Model
|
||||
*/
|
||||
protected $kitsuModel;
|
||||
|
||||
/**
|
||||
* Model for making requests to MAL API
|
||||
* @var \Aviat\AnimeClient\API\MAL\Model
|
||||
*/
|
||||
protected $malModel;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*
|
||||
@ -70,6 +76,7 @@ class Manga extends API
|
||||
public function __construct(ContainerInterface $container)
|
||||
{
|
||||
$this->kitsuModel = $container->get('kitsu-model');
|
||||
$this->malModel = $container->get('mal-model');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -34,7 +34,7 @@ class RoutingBase {
|
||||
|
||||
/**
|
||||
* Config Object
|
||||
* @var Config
|
||||
* @var \Aviat\Ion\Config
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
|
@ -22,6 +22,10 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
class JsonAPITest extends TestCase {
|
||||
|
||||
protected $startData;
|
||||
protected $organizedIncludes;
|
||||
protected $inlineIncluded;
|
||||
|
||||
public function setUp()
|
||||
{
|
||||
$dir = __DIR__ . '/../test_data/JsonAPI';
|
||||
|
Loading…
Reference in New Issue
Block a user