Skip to content

Commit

Permalink
Merge pull request #7741 from paulbalandan/app-types
Browse files Browse the repository at this point in the history
Add types for app
  • Loading branch information
paulbalandan committed Jul 27, 2023
2 parents 6cd1a91 + daf48bb commit f09575c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 27 deletions.
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

0 comments on commit f09575c

Please sign in to comment.