Skip to content

Commit f09575c

Browse files
authored
Merge pull request #7741 from paulbalandan/app-types
Add types for app
2 parents 6cd1a91 + daf48bb commit f09575c

File tree

4 files changed

+20
-27
lines changed

4 files changed

+20
-27
lines changed

app/Config/Kint.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
namespace Config;
44

55
use CodeIgniter\Config\BaseConfig;
6+
use Kint\Parser\ConstructablePluginInterface;
67
use Kint\Renderer\AbstractRenderer;
8+
use Kint\Renderer\Rich\TabPluginInterface;
9+
use Kint\Renderer\Rich\ValuePluginInterface;
710

811
/**
912
* --------------------------------------------------------------------------
@@ -23,7 +26,12 @@ class Kint extends BaseConfig
2326
|--------------------------------------------------------------------------
2427
*/
2528

29+
/**
30+
* @var array<int, ConstructablePluginInterface|string>
31+
* @phpstan-var list<class-string<ConstructablePluginInterface>|ConstructablePluginInterface>
32+
*/
2633
public $plugins;
34+
2735
public int $maxDepth = 6;
2836
public bool $displayCalledFrom = true;
2937
public bool $expanded = false;
@@ -36,7 +44,17 @@ class Kint extends BaseConfig
3644
public string $richTheme = 'aante-light.css';
3745
public bool $richFolder = false;
3846
public int $richSort = AbstractRenderer::SORT_FULL;
47+
48+
/**
49+
* @var array<string, string>
50+
* @phpstan-var array<string, class-string<ValuePluginInterface>>
51+
*/
3952
public $richObjectPlugins;
53+
54+
/**
55+
* @var array<string, string>
56+
* @phpstan-var array<string, class-string<TabPluginInterface>>
57+
*/
4058
public $richTabPlugins;
4159

4260
/*

app/Controllers/BaseController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ abstract class BaseController extends Controller
4444
// protected $session;
4545

4646
/**
47-
* Constructor.
47+
* @return void
4848
*/
4949
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
5050
{

app/Controllers/Home.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
class Home extends BaseController
66
{
7-
public function index()
7+
public function index(): string
88
{
99
return view('welcome_message');
1010
}

phpstan-baseline.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
11
<?php declare(strict_types = 1);
22

33
$ignoreErrors = [];
4-
$ignoreErrors[] = [
5-
'message' => '#^Property Config\\\\Kint\\:\\:\\$plugins has no type specified\\.$#',
6-
'count' => 1,
7-
'path' => __DIR__ . '/app/Config/Kint.php',
8-
];
9-
$ignoreErrors[] = [
10-
'message' => '#^Property Config\\\\Kint\\:\\:\\$richObjectPlugins has no type specified\\.$#',
11-
'count' => 1,
12-
'path' => __DIR__ . '/app/Config/Kint.php',
13-
];
14-
$ignoreErrors[] = [
15-
'message' => '#^Property Config\\\\Kint\\:\\:\\$richTabPlugins has no type specified\\.$#',
16-
'count' => 1,
17-
'path' => __DIR__ . '/app/Config/Kint.php',
18-
];
19-
$ignoreErrors[] = [
20-
'message' => '#^Method App\\\\Controllers\\\\BaseController\\:\\:initController\\(\\) has no return type specified\\.$#',
21-
'count' => 1,
22-
'path' => __DIR__ . '/app/Controllers/BaseController.php',
23-
];
24-
$ignoreErrors[] = [
25-
'message' => '#^Method App\\\\Controllers\\\\Home\\:\\:index\\(\\) has no return type specified\\.$#',
26-
'count' => 1,
27-
'path' => __DIR__ . '/app/Controllers/Home.php',
28-
];
294
$ignoreErrors[] = [
305
'message' => '#^Method CodeIgniter\\\\Autoloader\\\\Autoloader\\:\\:discoverComposerNamespaces\\(\\) has no return type specified\\.$#',
316
'count' => 1,

0 commit comments

Comments
 (0)