Skip to content

Commit

Permalink
refactor: run rector and fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Jun 27, 2022
1 parent f211714 commit 52f9407
Show file tree
Hide file tree
Showing 20 changed files with 43 additions and 158 deletions.
6 changes: 1 addition & 5 deletions tests/system/CLI/ConsoleTest.php
Expand Up @@ -24,11 +24,7 @@
*/
final class ConsoleTest extends CIUnitTestCase
{
/**
* @var DotEnv
*/
private $env;

private DotEnv $env;
private $stream_filter;

protected function setUp(): void
Expand Down
8 changes: 2 additions & 6 deletions tests/system/CommonFunctionsTest.php
Expand Up @@ -43,12 +43,8 @@
*/
final class CommonFunctionsTest extends CIUnitTestCase
{
/**
* @var App
*/
private $config;

public MockIncomingRequest $request;
private ?App $config = null;
private IncomingRequest $request;

protected function setUp(): void
{
Expand Down
8 changes: 2 additions & 6 deletions tests/system/Config/DotEnvTest.php
Expand Up @@ -24,12 +24,8 @@
*/
final class DotEnvTest extends CIUnitTestCase
{
/**
* @var vfsStreamDirectory|null
*/
private $root;

public string $path;
private ?vfsStreamDirectory $root;
private string $path;
private $fixturesFolder;

protected function setUp(): void
Expand Down
5 changes: 1 addition & 4 deletions tests/system/ControllerTest.php
Expand Up @@ -33,10 +33,7 @@
*/
final class ControllerTest extends CIUnitTestCase
{
/**
* @var App
*/
private $config;
private App $config;

/**
* @var Controller
Expand Down
10 changes: 3 additions & 7 deletions tests/system/Database/Live/MetadataTest.php
Expand Up @@ -26,13 +26,9 @@ final class MetadataTest extends CIUnitTestCase
{
use DatabaseTestTrait;

/**
* @var Forge
*/
private $forge;

protected $refresh = true;
protected $seed = CITestSeeder::class;
private ?Forge $forge = null;
protected $refresh = true;
protected $seed = CITestSeeder::class;

/**
* Array of expected tables.
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Events/EventsTest.php
Expand Up @@ -25,7 +25,7 @@ final class EventsTest extends CIUnitTestCase
/**
* Accessible event manager instance
*/
private MockEvents $manager;
private Events $manager;

protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/CURLRequestDoNotShareOptionsTest.php
Expand Up @@ -25,7 +25,7 @@
*/
final class CURLRequestDoNotShareOptionsTest extends CIUnitTestCase
{
private MockCURLRequest $request;
private CURLRequest $request;

protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/CURLRequestTest.php
Expand Up @@ -25,7 +25,7 @@
*/
final class CURLRequestTest extends CIUnitTestCase
{
private MockCURLRequest $request;
private CURLRequest $request;

protected function setUp(): void
{
Expand Down
11 changes: 2 additions & 9 deletions tests/system/HTTP/ContentSecurityPolicyTest.php
Expand Up @@ -27,15 +27,8 @@
*/
final class ContentSecurityPolicyTest extends CIUnitTestCase
{
/**
* @var Response
*/
private $response;

/**
* @var \CodeIgniter\HTTP\ContentSecurityPolicy
*/
private $csp;
private ?Response $response = null;
private ?ContentSecurityPolicy $csp = null;

// Having this method as setUp() doesn't work - can't find Config\App !?
protected function prepare(bool $CSPEnabled = true)
Expand Down
20 changes: 4 additions & 16 deletions tests/system/HTTP/Files/FileMovingTest.php
Expand Up @@ -21,22 +21,10 @@
*/
final class FileMovingTest extends CIUnitTestCase
{
/**
* @var vfsStreamDirectory|null
*/
private $root;

public string $path;

/**
* @var string
*/
private $start;

/**
* @var string
*/
private $destination;
private ?vfsStreamDirectory $root;
private string $path;
private string $start;
private string $destination;

protected function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Helpers/CookieHelperTest.php
Expand Up @@ -28,7 +28,7 @@
*/
final class CookieHelperTest extends CIUnitTestCase
{
public IncomingRequest $request;
private IncomingRequest $request;
private $name;
private string $value;
private int $expire;
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Helpers/FilesystemHelperTest.php
Expand Up @@ -23,7 +23,7 @@ final class FilesystemHelperTest extends CIUnitTestCase
/**
* @var array<string, array<string, mixed[]>>|array<string, array<string, string>>|array<string, mixed>|array<string, mixed[]>|array<string, string>|mixed
*/
private $structure;
private array $structure;

protected function setUp(): void
{
Expand Down
23 changes: 4 additions & 19 deletions tests/system/Images/BaseHandlerTest.php
Expand Up @@ -31,25 +31,10 @@
*/
final class BaseHandlerTest extends CIUnitTestCase
{
/**
* @var vfsStreamDirectory
*/
private $root;

/**
* @var string
*/
private $origin;

/**
* @var string
*/
private $start;

/**
* @var string
*/
private $path;
private vfsStreamDirectory $root;
private string $origin;
private string $start;
private string $path;

protected function setUp(): void
{
Expand Down
29 changes: 5 additions & 24 deletions tests/system/Images/GDHandlerTest.php
Expand Up @@ -31,30 +31,11 @@
*/
final class GDHandlerTest extends CIUnitTestCase
{
/**
* @var vfsStreamDirectory
*/
private $root;

/**
* @var string
*/
private $origin;

/**
* @var string
*/
private $start;

/**
* @var string
*/
private $path;

/**
* @var BaseHandler
*/
private $handler;
private vfsStreamDirectory $root;
private string $origin;
private string $start;
private string $path;
private BaseHandler $handler;

protected function setUp(): void
{
Expand Down
23 changes: 4 additions & 19 deletions tests/system/Images/ImageMagickHandlerTest.php
Expand Up @@ -31,25 +31,10 @@
*/
final class ImageMagickHandlerTest extends CIUnitTestCase
{
/**
* @var string
*/
private $root;

/**
* @var string
*/
private $origin;

/**
* @var string
*/
private $path;

/**
* @var BaseHandler
*/
private $handler;
private string $root;
private string $origin;
private string $path;
private BaseHandler $handler;

protected function setUp(): void
{
Expand Down
20 changes: 4 additions & 16 deletions tests/system/Images/ImageTest.php
Expand Up @@ -21,22 +21,10 @@
*/
final class ImageTest extends CIUnitTestCase
{
/**
* @var vfsStreamDirectory
*/
private $root;

public string $origin;

/**
* @var string
*/
private $start;

/**
* @var Image
*/
private $image;
private vfsStreamDirectory $root;
private string $origin;
private string $start;
private Image $image;

protected function setUp(): void
{
Expand Down
11 changes: 2 additions & 9 deletions tests/system/Log/Handlers/FileHandlerTest.php
Expand Up @@ -23,15 +23,8 @@
*/
final class FileHandlerTest extends CIUnitTestCase
{
/**
* @var vfsStreamDirectory
*/
private $root;

/**
* @var string
*/
private $start;
private vfsStreamDirectory $root;
private string $start;

protected function setUp(): void
{
Expand Down
6 changes: 1 addition & 5 deletions tests/system/Pager/PagerRendererTest.php
Expand Up @@ -19,11 +19,7 @@
*/
final class PagerRendererTest extends CIUnitTestCase
{
/**
* @var string
*/
private $expect;

private string $expect;
private URI $uri;

protected function setUp(): void
Expand Down
6 changes: 2 additions & 4 deletions tests/system/Throttle/ThrottleTest.php
Expand Up @@ -11,6 +11,7 @@

namespace CodeIgniter\Throttle;

use CodeIgniter\Cache\CacheInterface;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\Mock\MockCache;

Expand All @@ -19,10 +20,7 @@
*/
final class ThrottleTest extends CIUnitTestCase
{
/**
* @var Cache
*/
private $cache;
private CacheInterface $cache;

protected function setUp(): void
{
Expand Down
5 changes: 1 addition & 4 deletions tests/system/View/TableTest.php
Expand Up @@ -21,10 +21,7 @@
*/
final class TableTest extends CIUnitTestCase
{
/**
* @var Table
*/
private $table;
private Table $table;

protected function setUp(): void
{
Expand Down

0 comments on commit 52f9407

Please sign in to comment.