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
{

0 commit comments

Comments
 (0)