Skip to content

Commit e49c0bd

Browse files
committed
refactor: run rector and fix types
1 parent f211714 commit e49c0bd

20 files changed

+44
-158
lines changed

tests/system/CLI/ConsoleTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,7 @@
2424
*/
2525
final class ConsoleTest extends CIUnitTestCase
2626
{
27-
/**
28-
* @var DotEnv
29-
*/
30-
private $env;
31-
27+
private DotEnv $env;
3228
private $stream_filter;
3329

3430
protected function setUp(): void

tests/system/CommonFunctionsTest.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace CodeIgniter;
1313

1414
use CodeIgniter\Config\BaseService;
15+
use CodeIgniter\HTTP\IncomingRequest;
1516
use CodeIgniter\HTTP\RedirectResponse;
1617
use CodeIgniter\HTTP\Response;
1718
use CodeIgniter\HTTP\URI;
@@ -43,12 +44,8 @@
4344
*/
4445
final class CommonFunctionsTest extends CIUnitTestCase
4546
{
46-
/**
47-
* @var App
48-
*/
49-
private $config;
50-
51-
public MockIncomingRequest $request;
47+
private ?App $config = null;
48+
private IncomingRequest $request;
5249

5350
protected function setUp(): void
5451
{

tests/system/Config/DotEnvTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,8 @@
2424
*/
2525
final class DotEnvTest extends CIUnitTestCase
2626
{
27-
/**
28-
* @var vfsStreamDirectory|null
29-
*/
30-
private $root;
31-
32-
public string $path;
27+
private ?vfsStreamDirectory $root;
28+
private string $path;
3329
private $fixturesFolder;
3430

3531
protected function setUp(): void

tests/system/ControllerTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@
3333
*/
3434
final class ControllerTest extends CIUnitTestCase
3535
{
36-
/**
37-
* @var App
38-
*/
39-
private $config;
36+
private App $config;
4037

4138
/**
4239
* @var Controller

tests/system/Database/Live/MetadataTest.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,9 @@ final class MetadataTest extends CIUnitTestCase
2626
{
2727
use DatabaseTestTrait;
2828

29-
/**
30-
* @var Forge
31-
*/
32-
private $forge;
33-
34-
protected $refresh = true;
35-
protected $seed = CITestSeeder::class;
29+
private ?Forge $forge = null;
30+
protected $refresh = true;
31+
protected $seed = CITestSeeder::class;
3632

3733
/**
3834
* Array of expected tables.

tests/system/Events/EventsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ final class EventsTest extends CIUnitTestCase
2525
/**
2626
* Accessible event manager instance
2727
*/
28-
private MockEvents $manager;
28+
private Events $manager;
2929

3030
protected function setUp(): void
3131
{

tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
final class CURLRequestDoNotShareOptionsTest extends CIUnitTestCase
2727
{
28-
private MockCURLRequest $request;
28+
private CURLRequest $request;
2929

3030
protected function setUp(): void
3131
{

tests/system/HTTP/CURLRequestTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*/
2626
final class CURLRequestTest extends CIUnitTestCase
2727
{
28-
private MockCURLRequest $request;
28+
private CURLRequest $request;
2929

3030
protected function setUp(): void
3131
{

tests/system/HTTP/ContentSecurityPolicyTest.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,8 @@
2727
*/
2828
final class ContentSecurityPolicyTest extends CIUnitTestCase
2929
{
30-
/**
31-
* @var Response
32-
*/
33-
private $response;
34-
35-
/**
36-
* @var \CodeIgniter\HTTP\ContentSecurityPolicy
37-
*/
38-
private $csp;
30+
private ?Response $response = null;
31+
private ?ContentSecurityPolicy $csp = null;
3932

4033
// Having this method as setUp() doesn't work - can't find Config\App !?
4134
protected function prepare(bool $CSPEnabled = true)

tests/system/HTTP/Files/FileMovingTest.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,10 @@
2121
*/
2222
final class FileMovingTest extends CIUnitTestCase
2323
{
24-
/**
25-
* @var vfsStreamDirectory|null
26-
*/
27-
private $root;
28-
29-
public string $path;
30-
31-
/**
32-
* @var string
33-
*/
34-
private $start;
35-
36-
/**
37-
* @var string
38-
*/
39-
private $destination;
24+
private ?vfsStreamDirectory $root;
25+
private string $path;
26+
private string $start;
27+
private string $destination;
4028

4129
protected function setUp(): void
4230
{

tests/system/Helpers/CookieHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
*/
2929
final class CookieHelperTest extends CIUnitTestCase
3030
{
31-
public IncomingRequest $request;
31+
private IncomingRequest $request;
3232
private $name;
3333
private string $value;
3434
private int $expire;

tests/system/Helpers/FilesystemHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ final class FilesystemHelperTest extends CIUnitTestCase
2323
/**
2424
* @var array<string, array<string, mixed[]>>|array<string, array<string, string>>|array<string, mixed>|array<string, mixed[]>|array<string, string>|mixed
2525
*/
26-
private $structure;
26+
private array $structure;
2727

2828
protected function setUp(): void
2929
{

tests/system/Images/BaseHandlerTest.php

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,10 @@
3131
*/
3232
final class BaseHandlerTest extends CIUnitTestCase
3333
{
34-
/**
35-
* @var vfsStreamDirectory
36-
*/
37-
private $root;
38-
39-
/**
40-
* @var string
41-
*/
42-
private $origin;
43-
44-
/**
45-
* @var string
46-
*/
47-
private $start;
48-
49-
/**
50-
* @var string
51-
*/
52-
private $path;
34+
private vfsStreamDirectory $root;
35+
private string $origin;
36+
private string $start;
37+
private string $path;
5338

5439
protected function setUp(): void
5540
{

tests/system/Images/GDHandlerTest.php

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,30 +31,11 @@
3131
*/
3232
final class GDHandlerTest extends CIUnitTestCase
3333
{
34-
/**
35-
* @var vfsStreamDirectory
36-
*/
37-
private $root;
38-
39-
/**
40-
* @var string
41-
*/
42-
private $origin;
43-
44-
/**
45-
* @var string
46-
*/
47-
private $start;
48-
49-
/**
50-
* @var string
51-
*/
52-
private $path;
53-
54-
/**
55-
* @var BaseHandler
56-
*/
57-
private $handler;
34+
private vfsStreamDirectory $root;
35+
private string $origin;
36+
private string $start;
37+
private string $path;
38+
private BaseHandler $handler;
5839

5940
protected function setUp(): void
6041
{

tests/system/Images/ImageMagickHandlerTest.php

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -31,25 +31,10 @@
3131
*/
3232
final class ImageMagickHandlerTest extends CIUnitTestCase
3333
{
34-
/**
35-
* @var string
36-
*/
37-
private $root;
38-
39-
/**
40-
* @var string
41-
*/
42-
private $origin;
43-
44-
/**
45-
* @var string
46-
*/
47-
private $path;
48-
49-
/**
50-
* @var BaseHandler
51-
*/
52-
private $handler;
34+
private string $root;
35+
private string $origin;
36+
private string $path;
37+
private BaseHandler $handler;
5338

5439
protected function setUp(): void
5540
{

tests/system/Images/ImageTest.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,10 @@
2121
*/
2222
final class ImageTest extends CIUnitTestCase
2323
{
24-
/**
25-
* @var vfsStreamDirectory
26-
*/
27-
private $root;
28-
29-
public string $origin;
30-
31-
/**
32-
* @var string
33-
*/
34-
private $start;
35-
36-
/**
37-
* @var Image
38-
*/
39-
private $image;
24+
private vfsStreamDirectory $root;
25+
private string $origin;
26+
private string $start;
27+
private Image $image;
4028

4129
protected function setUp(): void
4230
{

tests/system/Log/Handlers/FileHandlerTest.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,8 @@
2323
*/
2424
final class FileHandlerTest extends CIUnitTestCase
2525
{
26-
/**
27-
* @var vfsStreamDirectory
28-
*/
29-
private $root;
30-
31-
/**
32-
* @var string
33-
*/
34-
private $start;
26+
private vfsStreamDirectory $root;
27+
private string $start;
3528

3629
protected function setUp(): void
3730
{

tests/system/Pager/PagerRendererTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,7 @@
1919
*/
2020
final class PagerRendererTest extends CIUnitTestCase
2121
{
22-
/**
23-
* @var string
24-
*/
25-
private $expect;
26-
22+
private string $expect;
2723
private URI $uri;
2824

2925
protected function setUp(): void

tests/system/Throttle/ThrottleTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace CodeIgniter\Throttle;
1313

14+
use CodeIgniter\Cache\CacheInterface;
1415
use CodeIgniter\Test\CIUnitTestCase;
1516
use CodeIgniter\Test\Mock\MockCache;
1617

@@ -19,10 +20,7 @@
1920
*/
2021
final class ThrottleTest extends CIUnitTestCase
2122
{
22-
/**
23-
* @var Cache
24-
*/
25-
private $cache;
23+
private CacheInterface $cache;
2624

2725
protected function setUp(): void
2826
{

tests/system/View/TableTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,7 @@
2121
*/
2222
final class TableTest extends CIUnitTestCase
2323
{
24-
/**
25-
* @var Table
26-
*/
27-
private $table;
24+
private Table $table;
2825

2926
protected function setUp(): void
3027
{

0 commit comments

Comments
 (0)