Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,12 @@
__DIR__ . '/tests/system/Debug/ExceptionsTest.php',
],

RemoveNullArgOnNullDefaultParamRector::class,
RemoveNullArgOnNullDefaultParamRector::class => [
// skip form query usage, easier to read
__DIR__ . '/system/Model.php',
__DIR__ . '/tests/system/Database',
__DIR__ . '/tests/system/Models',
],
])
// auto import fully qualified class names
->withImportNames(removeUnusedImports: true)
Expand Down
2 changes: 1 addition & 1 deletion system/Debug/Toolbar/Collectors/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public static function collect(Query $query)
static::$queries[] = [
'query' => $query,
'string' => $queryString,
'duplicate' => in_array($queryString, array_column(static::$queries, 'string', null), true),
'duplicate' => in_array($queryString, array_column(static::$queries, 'string'), true),
'trace' => $backtrace,
];
}
Expand Down
2 changes: 1 addition & 1 deletion system/Test/FeatureTestTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public function call(string $method, string $path, ?array $params = null)
->run($routes, true);

// Reset directory if it has been set
service('router')->setDirectory(null);
service('router')->setDirectory();

return new TestResponse($response);
}
Expand Down
2 changes: 1 addition & 1 deletion tests/system/CommonFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -801,7 +801,7 @@ public function testIsWindowsUsingMock(): void
$this->assertFalse(is_windows());
$this->assertNotTrue(is_windows());

is_windows(null);
is_windows();
$this->assertSame(str_contains(php_uname(), 'Windows'), is_windows());
$this->assertSame(defined('PHP_WINDOWS_VERSION_MAJOR'), is_windows());
}
Expand Down
10 changes: 5 additions & 5 deletions tests/system/Config/ServicesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,13 @@ public function testNewImage(): void

public function testNewNegotiatorWithNullConfig(): void
{
$actual = Services::negotiator(null);
$actual = Services::negotiator();
$this->assertInstanceOf(Negotiate::class, $actual);
}

public function testNewClirequest(): void
{
$actual = Services::clirequest(null);
$actual = Services::clirequest();
$this->assertInstanceOf(CLIRequest::class, $actual);
}

Expand Down Expand Up @@ -201,7 +201,7 @@ public function testNewUnsharedLanguage(): void

public function testNewPager(): void
{
$actual = Services::pager(null);
$actual = Services::pager();
$this->assertInstanceOf(Pager::class, $actual);
}

Expand All @@ -225,13 +225,13 @@ public function testNewToolbar(): void

public function testNewUri(): void
{
$actual = Services::uri(null);
$actual = Services::uri();
$this->assertInstanceOf(URI::class, $actual);
}

public function testNewValidation(): void
{
$actual = Services::validation(null);
$actual = Services::validation();
$this->assertInstanceOf(Validation::class, $actual);
}

Expand Down
6 changes: 3 additions & 3 deletions tests/system/HTTP/HeaderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ public function testHeaderAppendsValueSkippedForNull(): void

$header = new Header($name, $value);

$header->appendValue(null);
$header->appendValue();

$this->assertSame($name, $header->getName());
$this->assertSame($expected, $header->getValue());
Expand Down Expand Up @@ -158,7 +158,7 @@ public function testHeaderPrependsValueSkippedForNull(): void

$header = new Header($name, $value);

$header->prependValue(null);
$header->prependValue();

$this->assertSame($name, $header->getName());
$this->assertSame($expected, $header->getValue());
Expand Down Expand Up @@ -204,7 +204,7 @@ public function testHeaderSetValueWithNullWillMarkAsEmptyString(): void
$expected = '';

$header = new Header($name);
$header->setValue('bar')->setValue(null);
$header->setValue('bar')->setValue();

$this->assertSame($name, $header->getName());
$this->assertSame($expected, $header->getValueLine());
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/IncomingRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ public function testGetVarWorksWithJsonAndGetParams(): void
$_REQUEST['foo'] = 'bar';
$_REQUEST['fizz'] = 'buzz';

$request = $this->createRequest($config, null);
$request = $this->createRequest($config);
$request = $request->withMethod('GET');

// JSON type
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Helpers/DateHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function testNowSpecific(): void

public function testTimezoneSelectDefault(): void
{
$timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL, null);
$timezones = DateTimeZone::listIdentifiers(DateTimeZone::ALL);

$expected = "<select name='timezone' class='custom-select'>\n";

Expand All @@ -71,7 +71,7 @@ public function testTimezoneSelectDefault(): void
public function testTimezoneSelectSpecific(): void
{
$spesificRegion = DateTimeZone::ASIA;
$timezones = DateTimeZone::listIdentifiers($spesificRegion, null);
$timezones = DateTimeZone::listIdentifiers($spesificRegion);

$expected = "<select name='timezone' class='custom-select'>\n";

Expand Down
6 changes: 3 additions & 3 deletions tests/system/Helpers/URLHelper/SiteUrlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ public function testBaseURLService(): void
);
$this->assertSame(
'http://example.com/ci/v4/controller/method',
base_url('controller/method', null),
base_url('controller/method'),
);
}

Expand All @@ -402,7 +402,7 @@ public function testBaseURLWithCLIRequest(): void
);
$this->assertSame(
'http://example.com/controller/method',
base_url('controller/method', null),
base_url('controller/method'),
);
}

Expand Down Expand Up @@ -456,7 +456,7 @@ public function testBaseURLWithAllowedHostname(): void

$this->assertSame(
'http://www.example.jp/public/controller/method',
base_url('controller/method', null),
base_url('controller/method'),
);
}
}
2 changes: 1 addition & 1 deletion tests/system/Test/FabricatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function testConstructorSetsFormatters(): void

public function testConstructorGuessesFormatters(): void
{
$fabricator = new Fabricator(UserModel::class, null);
$fabricator = new Fabricator(UserModel::class);

$this->assertSame($this->formatters, $fabricator->getFormatters());
}
Expand Down
Loading