Skip to content

Commit

Permalink
fixed phpstan for Slim
Browse files Browse the repository at this point in the history
  • Loading branch information
Lung committed Jul 11, 2024
1 parent dccd022 commit b98aa9a
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,4 @@ parameters:
exceptions:
uncheckedExceptionRegexes:
- '#Exception#'
treatPhpDocTypesAsCertain: false
4 changes: 4 additions & 0 deletions src/Application/ApplicationGetter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace kissj\Application;

use DI\Bridge\Slim\Bridge;
use DI\Container;
use DI\ContainerBuilder;
use kissj\Session\RedisSessionHandler;
use kissj\Settings\Settings;
Expand All @@ -11,6 +12,9 @@

class ApplicationGetter
{
/**
* @return App<Container>
*/
public function getApp(
string $envPath = __DIR__.'/../../',
string $envFilename = '.env',
Expand Down
5 changes: 5 additions & 0 deletions src/Application/Middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace kissj\Application;

use DI\Container;
use kissj\ErrorHandlerGetter;
use kissj\Middleware\EventInfoMiddleware;
use kissj\Middleware\LocalizationResolverMiddleware;
Expand All @@ -21,6 +22,10 @@

class Middleware
{
/**
* @param App<Container> $app
* @return App<Container>
*/
public function addMiddlewaresInto(App $app): App
{
// CONTENT LENGTH
Expand Down
8 changes: 8 additions & 0 deletions src/Application/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

namespace kissj\Application;

use DI\Container;
use kissj\Deal\DealController;
use kissj\Entry\EntryController;
use kissj\ParticipantVendor\ParticipantVendorController;
Expand Down Expand Up @@ -36,6 +37,10 @@

class Route
{
/**
* @param App<Container> $app
* @return App<Container>
*/
public function addRoutesInto(App $app): App
{
$app->redirect($this->getBasePathSlashPrefixed($app), $app->getBasePath() . '/v2/kissj/events', 301);
Expand Down Expand Up @@ -373,6 +378,9 @@ public function addRoutesInto(App $app): App
return $app;
}

/**
* @param App<Container> $app
*/
private function getBasePathSlashPrefixed(App $app): string
{
$basePath = $app->getBasePath();
Expand Down

0 comments on commit b98aa9a

Please sign in to comment.