Skip to content

Commit e3bc5e9

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
Conflicts: user_guide_src/source/database/configuration.rst
2 parents b241ca8 + 46e1ab1 commit e3bc5e9

File tree

9 files changed

+33
-14
lines changed

9 files changed

+33
-14
lines changed

system/BaseModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1711,7 +1711,7 @@ protected function transformDataToArray($data, string $type): array
17111711
*
17121712
* @param string $name Name
17131713
*
1714-
* @return mixed
1714+
* @return array|bool|float|int|object|string|null
17151715
*/
17161716
public function __get(string $name)
17171717
{

system/Common.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ function app_timezone(): string
6666
* cache()->save('foo', 'bar');
6767
* $foo = cache('bar');
6868
*
69-
* @return CacheInterface|mixed
70-
* @phpstan-return ($key is null ? CacheInterface : mixed)
69+
* @return array|bool|CacheInterface|float|int|object|string|null
70+
* @phpstan-return ($key is null ? CacheInterface : array|bool|float|int|object|string|null)
7171
*/
7272
function cache(?string $key = null)
7373
{
@@ -1007,7 +1007,7 @@ function session(?string $val = null)
10071007
* - $timer = service('timer')
10081008
* - $timer = \CodeIgniter\Config\Services::timer();
10091009
*
1010-
* @param mixed ...$params
1010+
* @param array|bool|float|int|object|string|null ...$params
10111011
*
10121012
* @return object
10131013
*/
@@ -1021,7 +1021,7 @@ function service(string $name, ...$params)
10211021
/**
10221022
* Always returns a new instance of the class.
10231023
*
1024-
* @param mixed ...$params
1024+
* @param array|bool|float|int|object|string|null ...$params
10251025
*
10261026
* @return object|null
10271027
*/

system/HTTP/CURLRequest.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,10 @@ public function send(string $method, string $url)
387387
$output = substr($output, strpos($output, $breakString) + 4);
388388
}
389389

390+
if (strpos($output, 'HTTP/1.1 200 Connection established') === 0) {
391+
$output = substr($output, strpos($output, $breakString) + 4);
392+
}
393+
390394
// If request and response have Digest
391395
if (isset($this->config['auth'][2]) && $this->config['auth'][2] === 'digest' && strpos($output, 'WWW-Authenticate: Digest') !== false) {
392396
$output = substr($output, strpos($output, $breakString) + 4);

system/Helpers/number_helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ function format_number(float $num, int $precision = 1, ?string $locale = null, a
173173
/**
174174
* Convert a number to a roman numeral.
175175
*
176-
* @param string $num it will convert to int
176+
* @param int|string $num it will convert to int
177177
*/
178-
function number_to_roman(string $num): ?string
178+
function number_to_roman($num): ?string
179179
{
180180
static $map = [
181181
'M' => 1000,

system/Model.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ protected function objectToRawArray($data, bool $onlyChanged = true, bool $recur
792792
*
793793
* @param string $name Name
794794
*
795-
* @return mixed
795+
* @return array|BaseBuilder|bool|float|int|object|string|null
796796
*/
797797
public function __get(string $name)
798798
{
@@ -821,7 +821,7 @@ public function __isset(string $name): bool
821821
* Provides direct access to method in the builder (if available)
822822
* and the database connection.
823823
*
824-
* @return mixed
824+
* @return $this|array|BaseBuilder|bool|float|int|object|string|null
825825
*/
826826
public function __call(string $name, array $params)
827827
{

tests/system/HTTP/CURLRequestTest.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,21 @@ public function testSendContinuedWithManyHeaders()
779779
$this->assertSame(200, $response->getStatusCode());
780780
}
781781

782+
public function testSendProxied()
783+
{
784+
$request = $this->getRequest([
785+
'base_uri' => 'http://www.foo.com/api/v1/',
786+
'delay' => 100,
787+
]);
788+
789+
$output = "HTTP/1.1 200 Connection established
790+
Proxy-Agent: Fortinet-Proxy/1.0\x0d\x0a\x0d\x0aHTTP/1.1 200 OK\x0d\x0a\x0d\x0aHi there";
791+
$request->setOutput($output);
792+
793+
$response = $request->get('answer');
794+
$this->assertSame('Hi there', $response->getBody());
795+
}
796+
782797
/**
783798
* See: https://github.com/codeigniter4/CodeIgniter4/issues/7394
784799
*/

user_guide_src/source/database/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ Explanation of Values:
174174
**compress** Whether or not to use client compression (``MySQLi`` only).
175175
**strictOn** true/false (boolean) - Whether to force "Strict Mode" connections, good for ensuring strict SQL
176176
while developing an application (``MySQLi`` only).
177-
**port** The database port number.
177+
**port** The database port number - Empty string ``''`` for default port (or dynamic port with ``SQLSRV``).
178178
**foreignKeys** true/false (boolean) - Whether or not to enable Foreign Key constraint (``SQLite3`` only).
179179

180180
.. important:: SQLite3 Foreign Key constraint is disabled by default.

user_guide_src/source/helpers/number_helper.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The following functions are available:
9292

9393
.. php:function:: number_to_roman($num)
9494
95-
:param string $num: The number want to convert
95+
:param int|string $num: The number want to convert
9696
:returns: The roman number converted from given parameter
9797
:rtype: string|null
9898

@@ -101,4 +101,4 @@ The following functions are available:
101101
.. literalinclude:: number_helper/009.php
102102

103103
This function only handles numbers in the range 1 through 3999.
104-
It will return null for any value outside that range.
104+
It will return ``null`` for any value outside that range.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

3-
echo number_to_roman(23); // Returns XXIII
4-
echo number_to_roman(324); // Returns CCCXXIV
3+
echo number_to_roman(23); // Returns XXIII
4+
echo number_to_roman(324); // Returns CCCXXIV
55
echo number_to_roman(2534); // Returns MMDXXXIV

0 commit comments

Comments
 (0)