diff --git a/app/bootstrap.php b/app/bootstrap.php
index fe1f461c..7dfcd4ae 100644
--- a/app/bootstrap.php
+++ b/app/bootstrap.php
@@ -67,7 +67,7 @@ return static function (array $configArray = []): Container {
// -------------------------------------------------------------------------
// Create Config Object
- $container->set('config', fn () => new Config($configArray));
+ $container->set('config', static fn () => new Config($configArray));
// Create Cache Object
$container->set('cache', static function(ContainerInterface $container): CacheInterface {
@@ -77,7 +77,7 @@ return static function (array $configArray = []): Container {
});
// Create Aura Router Object
- $container->set('aura-router', fn() => new RouterContainer);
+ $container->set('aura-router', static fn() => new RouterContainer);
// Create Html helpers
$container->set('html-helper', static function(ContainerInterface $container) {
@@ -125,8 +125,8 @@ return static function (array $configArray = []): Container {
});
// Create Request Object
- $container->set('request', fn () => ServerRequestFactory::fromGlobals(
- $_SERVER,
+ $container->set('request', static fn () => ServerRequestFactory::fromGlobals(
+ $GLOBALS['_SERVER'],
$_GET,
$_POST,
$_COOKIE,
@@ -134,10 +134,10 @@ return static function (array $configArray = []): Container {
));
// Create session Object
- $container->set('session', fn () => (new SessionFactory())->newInstance($_COOKIE));
+ $container->set('session', static fn () => (new SessionFactory())->newInstance($_COOKIE));
// Miscellaneous helper methods
- $container->set('util', fn ($container) => new Util($container));
+ $container->set('util', static fn ($container) => new Util($container));
// Models
$container->set('kitsu-model', static function(ContainerInterface $container): Kitsu\Model {
@@ -170,10 +170,10 @@ return static function (array $configArray = []): Container {
return $model;
});
- $container->set('anime-model', fn ($container) => new Model\Anime($container));
- $container->set('manga-model', fn ($container) => new Model\Manga($container));
- $container->set('anime-collection-model', fn ($container) => new Model\AnimeCollection($container));
- $container->set('manga-collection-model', fn ($container) => new Model\MangaCollection($container));
+ $container->set('anime-model', static fn ($container) => new Model\Anime($container));
+ $container->set('manga-model', static fn ($container) => new Model\Manga($container));
+ $container->set('anime-collection-model', static fn ($container) => new Model\AnimeCollection($container));
+ $container->set('manga-collection-model', static fn ($container) => new Model\MangaCollection($container));
$container->set('settings-model', static function($container) {
$model = new Model\Settings($container->get('config'));
$model->setContainer($container);
@@ -181,13 +181,13 @@ return static function (array $configArray = []): Container {
});
// Miscellaneous Classes
- $container->set('auth', fn ($container) => new Kitsu\Auth($container));
- $container->set('url-generator', fn ($container) => new UrlGenerator($container));
+ $container->set('auth', static fn ($container) => new Kitsu\Auth($container));
+ $container->set('url-generator', static fn ($container) => new UrlGenerator($container));
// -------------------------------------------------------------------------
// Dispatcher
// -------------------------------------------------------------------------
- $container->set('dispatcher', fn ($container) => new Dispatcher($container));
+ $container->set('dispatcher', static fn ($container) => new Dispatcher($container));
return $container;
};
diff --git a/app/views/main-menu.php b/app/views/main-menu.php
index 39d68032..c6b45276 100644
--- a/app/views/main-menu.php
+++ b/app/views/main-menu.php
@@ -5,8 +5,8 @@ namespace Aviat\AnimeClient;
$whose = $config->get('whose_list') . "'s ";
$lastSegment = $urlGenerator->lastSegment();
$extraSegment = $lastSegment === 'list' ? '/list' : '';
-$hasAnime = stripos($_SERVER['REQUEST_URI'], 'anime') !== FALSE;
-$hasManga = stripos($_SERVER['REQUEST_URI'], 'manga') !== FALSE;
+$hasAnime = stripos($GLOBALS['_SERVER']['REQUEST_URI'], 'anime') !== FALSE;
+$hasManga = stripos($GLOBALS['_SERVER']['REQUEST_URI'], 'manga') !== FALSE;
?>
@@ -84,7 +84,7 @@ $hasManga = stripos($_SERVER['REQUEST_URI'], 'manga') !== FALSE;
get('util')->isViewPage() && ($hasAnime || $hasManga)): ?>