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