Skip to content

Commit 86cf38a

Browse files
committed
Merge branch 'develop' into 4.7
2 parents 2b9b314 + 1cfe68c commit 86cf38a

File tree

8 files changed

+15
-32
lines changed

8 files changed

+15
-32
lines changed

phpstan.neon.dist

+1
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,6 @@ parameters:
4141
codeigniter:
4242
additionalServices:
4343
- AfterAutoloadModule\Config\Services
44+
checkArgumentTypeOfModel: false
4445
shipmonkBaselinePerIdentifier:
4546
directory: %currentWorkingDirectory%

system/Log/Handlers/ChromeLoggerHandler.php

+2
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,8 @@ protected function format($object)
151151
/**
152152
* Attaches the header and the content to the passed in request object.
153153
*
154+
* @param-out ResponseInterface $response
155+
*
154156
* @return void
155157
*/
156158
public function sendLogs(?ResponseInterface &$response = null)

tests/_support/Validation/TestRules.php

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515

1616
class TestRules
1717
{
18+
/**
19+
* @param-out string $error
20+
*/
1821
public function customError(string $str, ?string &$error = null)
1922
{
2023
$error = 'My lovely error';

tests/system/ControllerTest.php

+6-2
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,17 @@ public function testConstructorHTTPS(): void
8989
$_SERVER = $original; // restore so code coverage doesn't break
9090
}
9191

92-
public function testCachePage(): void
92+
public function testCachePageSetsTtl(): void
9393
{
9494
$this->controller = new Controller();
9595
$this->controller->initController($this->request, $this->response, $this->logger);
9696

9797
$method = self::getPrivateMethodInvoker($this->controller, 'cachePage');
98-
$this->assertNull($method(10));
98+
99+
$this->assertSame(0, self::getPrivateProperty(service('responsecache'), 'ttl'));
100+
101+
$method(10);
102+
$this->assertSame(10, self::getPrivateProperty(service('responsecache'), 'ttl'));
99103
}
100104

101105
public function testValidate(): void

tests/system/Database/ConfigTest.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
namespace CodeIgniter\Database;
1515

16+
use CodeIgniter\Database\Postgre\Connection as PostgreConnection;
1617
use CodeIgniter\Test\CIUnitTestCase;
1718
use CodeIgniter\Test\ReflectionHelper;
1819
use PHPUnit\Framework\Attributes\DataProvider;
@@ -149,7 +150,7 @@ public function testConnectionGroupWithDSN(): void
149150
public function testConnectionGroupWithDSNPostgre(): void
150151
{
151152
$conn = Config::connect($this->dsnGroupPostgre, false);
152-
$this->assertInstanceOf(BaseConnection::class, $conn);
153+
$this->assertInstanceOf(PostgreConnection::class, $conn);
153154

154155
$this->assertSame('', $this->getPrivateProperty($conn, 'DSN'));
155156
$this->assertSame('localhost', $this->getPrivateProperty($conn, 'hostname'));
@@ -205,7 +206,7 @@ public function testConvertDSN(string $input, string $expected): void
205206
// Should deprecate?
206207
$this->dsnGroupPostgreNative['DSN'] = $input;
207208
$conn = Config::connect($this->dsnGroupPostgreNative, false);
208-
$this->assertInstanceOf(BaseConnection::class, $conn);
209+
$this->assertInstanceOf(PostgreConnection::class, $conn);
209210

210211
$method = self::getPrivateMethodInvoker($conn, 'convertDSN');
211212
$method();

utils/phpstan-baseline/codeigniter.modelArgumentInstanceof.neon

-13
This file was deleted.

utils/phpstan-baseline/loader.neon

-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ includes:
33
- assign.propertyType.neon
44
- codeigniter.cacheHandlerInstance.neon
55
- codeigniter.getReassignArray.neon
6-
- codeigniter.modelArgumentInstanceof.neon
76
- codeigniter.modelArgumentType.neon
87
- codeigniter.superglobalAccess.neon
98
- codeigniter.superglobalAccessAssign.neon
@@ -26,7 +25,6 @@ includes:
2625
- notIdentical.alwaysTrue.neon
2726
- nullCoalesce.property.neon
2827
- nullCoalesce.variable.neon
29-
- parameterByRef.unusedType.neon
3028
- property.defaultValue.neon
3129
- property.nonObject.neon
3230
- property.notFound.neon

utils/phpstan-baseline/parameterByRef.unusedType.neon

-13
This file was deleted.

0 commit comments

Comments
 (0)