Skip to content

Add types for app #7741

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/Config/Kint.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
namespace Config;

use CodeIgniter\Config\BaseConfig;
use Kint\Parser\ConstructablePluginInterface;
use Kint\Renderer\AbstractRenderer;
use Kint\Renderer\Rich\TabPluginInterface;
use Kint\Renderer\Rich\ValuePluginInterface;

/**
* --------------------------------------------------------------------------
Expand All @@ -23,7 +26,12 @@ class Kint extends BaseConfig
|--------------------------------------------------------------------------
*/

/**
* @var array<int, ConstructablePluginInterface|string>
* @phpstan-var list<class-string<ConstructablePluginInterface>|ConstructablePluginInterface>
*/
public $plugins;

public int $maxDepth = 6;
public bool $displayCalledFrom = true;
public bool $expanded = false;
Expand All @@ -36,7 +44,17 @@ class Kint extends BaseConfig
public string $richTheme = 'aante-light.css';
public bool $richFolder = false;
public int $richSort = AbstractRenderer::SORT_FULL;

/**
* @var array<string, string>
* @phpstan-var array<string, class-string<ValuePluginInterface>>
*/
public $richObjectPlugins;

/**
* @var array<string, string>
* @phpstan-var array<string, class-string<TabPluginInterface>>
*/
public $richTabPlugins;

/*
Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/BaseController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ abstract class BaseController extends Controller
// protected $session;

/**
* Constructor.
* @return void
*/
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
Expand Down
2 changes: 1 addition & 1 deletion app/Controllers/Home.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Home extends BaseController
{
public function index()
public function index(): string
{
return view('welcome_message');
}
Expand Down
25 changes: 0 additions & 25 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
@@ -1,31 +1,6 @@
<?php declare(strict_types = 1);

$ignoreErrors = [];
$ignoreErrors[] = [
'message' => '#^Property Config\\\\Kint\\:\\:\\$plugins has no type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Config/Kint.php',
];
$ignoreErrors[] = [
'message' => '#^Property Config\\\\Kint\\:\\:\\$richObjectPlugins has no type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Config/Kint.php',
];
$ignoreErrors[] = [
'message' => '#^Property Config\\\\Kint\\:\\:\\$richTabPlugins has no type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Config/Kint.php',
];
$ignoreErrors[] = [
'message' => '#^Method App\\\\Controllers\\\\BaseController\\:\\:initController\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Controllers/BaseController.php',
];
$ignoreErrors[] = [
'message' => '#^Method App\\\\Controllers\\\\Home\\:\\:index\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/app/Controllers/Home.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Autoloader\\\\Autoloader\\:\\:discoverComposerNamespaces\\(\\) has no return type specified\\.$#',
'count' => 1,
Expand Down