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
4 changes: 3 additions & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@
__DIR__ . '/spark',
]);

$overrides = [];
$overrides = [
'php_unit_data_provider_return_type' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.cache',
Expand Down
4 changes: 3 additions & 1 deletion .php-cs-fixer.no-header.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@
__DIR__ . '/admin/starter/builds',
]);

$overrides = [];
$overrides = [
'php_unit_data_provider_return_type' => true,
];

$options = [
'cacheFile' => 'build/.php-cs-fixer.no-header.cache',
Expand Down
9 changes: 5 additions & 4 deletions .php-cs-fixer.user-guide.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@
]);

$overrides = [
'echo_tag_syntax' => false,
'php_unit_internal_class' => false,
'no_unused_imports' => false,
'class_attributes_separation' => false,
'echo_tag_syntax' => false,
'php_unit_internal_class' => false,
'no_unused_imports' => false,
'class_attributes_separation' => false,
'php_unit_data_provider_return_type' => true,
];

$options = [
Expand Down
2 changes: 1 addition & 1 deletion tests/system/CLI/CLITest.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ public function testTable($tbody, $thead, $expected)
$this->assertSame($this->getStreamFilterBuffer(), $expected);
}

public function tableProvider()
public function tableProvider(): iterable
{
$head = [
'ID',
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/Handlers/BaseHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function testValidateKeyInvalidType($input)
BaseHandler::validateKey($input);
}

public function invalidTypeProvider(): array
public function invalidTypeProvider(): iterable
{
return [
[true],
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Cache/Handlers/FileHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function testSaveMode(int $int, string $string): void
$this->assertSame($string, $mode);
}

public function modeProvider()
public function modeProvider(): iterable
{
return [
[
Expand Down
2 changes: 1 addition & 1 deletion tests/system/CodeIgniterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ public function testPageCacheWithCacheQueryString($cacheQueryStringValue, int $e
CITestStreamFilter::removeErrorFilter();
}

public function cacheQueryStringProvider(): array
public function cacheQueryStringProvider(): iterable
{
$testingUrls = [
'test', // URL #1
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Commands/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public function testCommandParsesArgsCorrectly(string $input, array $expected)
$this->assertSame($expected, ParamsReveal::$args);
}

public function commandArgsProvider(): array
public function commandArgsProvider(): iterable
{
return [
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use CodeIgniter\Config\Services;
use CodeIgniter\Test\CIUnitTestCase;
use Generator;

/**
* @internal
Expand All @@ -34,7 +33,7 @@ public function testGet(string $routeKey, string $expected)
$this->assertSame($expected, $uri);
}

public function routeKeyProvider(): Generator
public function routeKeyProvider(): iterable
{
yield from [
'root' => ['/', '/'],
Expand Down
2 changes: 1 addition & 1 deletion tests/system/CommonFunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ public function testCleanPathActuallyCleaningThePaths($input, $expected)
$this->assertSame($expected, clean_path($input));
}

public function dirtyPathsProvider()
public function dirtyPathsProvider(): iterable
{
$ds = DIRECTORY_SEPARATOR;

Expand Down
4 changes: 2 additions & 2 deletions tests/system/Config/MimesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
final class MimesTest extends CIUnitTestCase
{
public function extensionsList()
public function extensionsList(): iterable
{
return [
'null' => [
Expand Down Expand Up @@ -55,7 +55,7 @@ public function testGuessExtensionFromType(?string $expected, string $mime)
$this->assertSame($expected, Mimes::guessExtensionFromType($mime));
}

public function mimesList()
public function mimesList(): iterable
{
return [
'null' => [
Expand Down
3 changes: 1 addition & 2 deletions tests/system/Cookie/CookieTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Config\Cookie as CookieConfig;
use DateTimeImmutable;
use DateTimeZone;
use Generator;
use LogicException;

/**
Expand Down Expand Up @@ -99,7 +98,7 @@ public function testConfigPrefix(string $configPrefix, string $optionPrefix, str
$this->assertSame($expected, $cookie->getPrefixedName());
}

public function prefixProvider(): Generator
public function prefixProvider(): iterable
{
yield from [
['prefix_', '', 'prefix_test'],
Expand Down
3 changes: 1 addition & 2 deletions tests/system/Database/BaseConnectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
use CodeIgniter\Database\Exceptions\DatabaseException;
use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\Mock\MockConnection;
use Generator;
use Throwable;

/**
Expand Down Expand Up @@ -184,7 +183,7 @@ public function testProtectIdentifiers(
$this->assertSame($expected, $return);
}

public function identifiersProvider(): Generator
public function identifiersProvider(): iterable
{
yield from [
// $prefixSingle, $protectIdentifiers, $fieldExists, $item, $expected
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Database/BaseQueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function testSwapPrefix()
$this->assertSame($newSQL, $query->getQuery());
}

public function queryTypes()
public function queryTypes(): iterable
{
return [
'select' => [
Expand Down Expand Up @@ -577,7 +577,7 @@ public function testSwapPrefixAfterGetQuery()
$this->assertSame($expected, $query->getQuery());
}

public function queryKeywords()
public function queryKeywords(): iterable
{
return [
'highlightKeyWords' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Database/Builder/WhereTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ public function testWhereInSubQuery()
$this->assertSame($expectedSQL, str_replace("\n", ' ', $builder->getCompiledSelect()));
}

public function provideInvalidKeys()
public function provideInvalidKeys(): iterable
{
return [
'null' => [null],
Expand All @@ -413,7 +413,7 @@ public function testWhereInvalidKeyThrowInvalidArgumentException($key)
$builder->whereIn($key, ['Politician', 'Accountant']);
}

public function provideInvalidValues()
public function provideInvalidValues(): iterable
{
return [
'null' => [null],
Expand Down
3 changes: 1 addition & 2 deletions tests/system/Database/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

use CodeIgniter\Test\CIUnitTestCase;
use CodeIgniter\Test\ReflectionHelper;
use Generator;

/**
* @internal
Expand Down Expand Up @@ -209,7 +208,7 @@ public function testConvertDSN(string $input, string $expected)
$this->assertSame($expected, $this->getPrivateProperty($conn, 'DSN'));
}

public function convertDSNProvider(): Generator
public function convertDSNProvider(): iterable
{
yield from [
[
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Email/EmailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function testEmailValidation()
$this->assertStringContainsString('Invalid email address: "invalid"', $email->printDebugger());
}

public function autoClearProvider()
public function autoClearProvider(): iterable
{
return [
'autoclear' => [true],
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Filters/FiltersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public function testProcessMethodProcessGlobals()
$this->assertSame($expected, $filters->initialize()->getFilters());
}

public function provideExcept()
public function provideExcept(): iterable
{
return [
[
Expand Down
4 changes: 2 additions & 2 deletions tests/system/Filters/InvalidCharsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public function testCheckControlStringWithLineBreakAndTabReturnsTheString(string
$this->invalidChars->before($this->request);
}

public function stringWithLineBreakAndTabProvider()
public function stringWithLineBreakAndTabProvider(): iterable
{
yield from [
["String contains \n line break."],
Expand All @@ -148,7 +148,7 @@ public function testCheckControlStringWithControlCharsCausesException(string $in
$this->invalidChars->before($this->request);
}

public function stringWithControlCharsProvider()
public function stringWithControlCharsProvider(): iterable
{
yield from [
["String contains null char.\0"],
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Format/XMLFormatterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function testValidatingInvalidTags(string $expected, array $input)
$this->assertSame($expectedXML, $this->xmlFormatter->format($input));
}

public function invalidTagsProvider()
public function invalidTagsProvider(): iterable
{
return [
[
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/CLIRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ public function testFetchGlobalWithEmptyNotation()
$this->assertSame($expected, $this->request->fetchGlobal('post', 'clients[]'));
}

public function ipAddressChecks()
public function ipAddressChecks(): iterable
{
return [
'empty' => [
Expand Down
7 changes: 3 additions & 4 deletions tests/system/HTTP/IncomingRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use CodeIgniter\HTTP\Files\UploadedFile;
use CodeIgniter\Test\CIUnitTestCase;
use Config\App;
use Generator;
use InvalidArgumentException;
use TypeError;

Expand Down Expand Up @@ -519,7 +518,7 @@ public function testCanGrabGetRawInput()
$this->assertSame($expected, $request->getRawInput());
}

public function provideRawInputVarChecks()
public function provideRawInputVarChecks(): iterable
{
return [
[
Expand Down Expand Up @@ -627,7 +626,7 @@ public function testIsHTTPMethodLowerCase(string $value)
$this->assertTrue($request->is(strtolower($value)));
}

public function provideIsHTTPMethods(): Generator
public function provideIsHTTPMethods(): iterable
{
yield from [
['GET'],
Expand Down Expand Up @@ -840,7 +839,7 @@ public function testGetPostIndexNotExists()
$this->assertNull($this->request->getGetPost('gc'));
}

public function providePathChecks()
public function providePathChecks(): iterable
{
return [
'not /index.php' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/MessageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public function testSetHeaderArrayValues()
$this->assertSame('json, html, xml', $this->message->getHeaderLine('Accept'));
}

public function provideArrayHeaderValue()
public function provideArrayHeaderValue(): iterable
{
return [
'existing for next not append' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/system/HTTP/RequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ public function testFetchGlobalFiltersWithArrayChildElement()
$this->assertSame($expected, $this->request->fetchGlobal('post', 'people[0]', FILTER_VALIDATE_INT));
}

public function ipAddressChecks()
public function ipAddressChecks(): iterable
{
return [
'empty' => [
Expand Down
4 changes: 2 additions & 2 deletions tests/system/HTTP/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ public function testRedirect(
$this->assertSame($expectedCode, $response->getStatusCode());
}

public function provideForRedirect()
public function provideForRedirect(): iterable
{
yield from [
['Apache/2.4.17', 'HTTP/1.1', 'GET', null, 302],
Expand Down Expand Up @@ -337,7 +337,7 @@ public function testRedirectWithIIS(
unset($_SERVER['SERVER_SOFTWARE']);
}

public function provideForRedirectWithIIS()
public function provideForRedirectWithIIS(): iterable
{
yield from [
['HTTP/1.1', 'GET', null, 302],
Expand Down
Loading