Skip to content

Commit 1571861

Browse files
authored
Merge pull request #6715 from kenjis/fix-phpdoc-mixed
docs: fix PHPDoc type mixed
2 parents 5331499 + 7e8c380 commit 1571861

13 files changed

Lines changed: 25 additions & 19 deletions

system/BaseModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ abstract protected function doDelete($id = null, bool $purge = false);
416416
* through soft deletes (deleted = 1)
417417
* This methods works only with dbCalls
418418
*
419-
* @return bool|mixed
419+
* @return bool|string Returns a string if in test mode.
420420
*/
421421
abstract protected function doPurgeDeleted();
422422

system/Common.php

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -414,10 +414,11 @@ function env(string $key, $default = null)
414414
* If $data is an array, then it loops over it, escaping each
415415
* 'value' of the key/value pairs.
416416
*
417-
* Valid context values: html, js, css, url, attr, raw
418-
*
419417
* @param array|string $data
420-
* @param string $encoding
418+
* @phpstan-param 'html'|'js'|'css'|'url'|'attr'|'raw' $context
419+
* @param string|null $encoding Current encoding for escaping.
420+
* If not UTF-8, we convert strings from this encoding
421+
* pre-escaping and back to this encoding post-escaping.
421422
*
422423
* @return array|string
423424
*
@@ -823,10 +824,11 @@ function model(string $name, bool $getShared = true, ?ConnectionInterface &$conn
823824
* Provides access to "old input" that was set in the session
824825
* during a redirect()->withInput().
825826
*
826-
* @param null $default
827-
* @param bool|string $escape
827+
* @param string|null $default
828+
* @param false|string $escape
829+
* @phpstan-param false|'attr'|'css'|'html'|'js'|'raw'|'url' $escape
828830
*
829-
* @return mixed|null
831+
* @return array|string|null
830832
*/
831833
function old(string $key, $default = null, $escape = 'html')
832834
{
@@ -932,7 +934,8 @@ function route_to(string $method, ...$params)
932934
*
933935
* @param string $val
934936
*
935-
* @return mixed|Session|null
937+
* @return array|bool|float|int|object|Session|string|null
938+
* @phpstan-return ($val is null ? Session : array|bool|float|int|object|string|null)
936939
*/
937940
function session(?string $val = null)
938941
{

system/Database/BaseBuilder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2350,7 +2350,7 @@ public function getCompiledDelete(bool $reset = true): string
23502350
*
23512351
* @param mixed $where
23522352
*
2353-
* @return bool|string
2353+
* @return bool|string Returns a string if in test mode.
23542354
*
23552355
* @throws DatabaseException
23562356
*/

system/Format/XMLFormatter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class XMLFormatter implements FormatterInterface
2525
*
2626
* @param mixed $data
2727
*
28-
* @return bool|string (XML string | false)
28+
* @return false|string (XML string | false)
2929
*/
3030
public function format($data)
3131
{

system/HTTP/IncomingRequest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,7 @@ public function getUserAgent()
671671
* with redirect_with_input(). It first checks for the data in the old
672672
* POST data, then the old GET data and finally check for dot arrays
673673
*
674-
* @return mixed
674+
* @return array|string|null
675675
*/
676676
public function getOldInput(string $key)
677677
{

system/HTTP/ResponseInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function setJSON($body, bool $unencoded = false);
202202
/**
203203
* Returns the current body, converted to JSON is it isn't already.
204204
*
205-
* @return mixed|string
205+
* @return string|null
206206
*
207207
* @throws InvalidArgumentException If the body property is not array.
208208
*/

system/HTTP/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ public function setJSON($body, bool $unencoded = false)
252252
/**
253253
* Returns the current body, converted to JSON is it isn't already.
254254
*
255-
* @return mixed|string
255+
* @return string|null
256256
*
257257
* @throws InvalidArgumentException If the body property is not array.
258258
*/

system/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ protected function doDelete($id = null, bool $purge = false)
406406
* through soft deletes (deleted = 1)
407407
* This methods works only with dbCalls
408408
*
409-
* @return bool|mixed
409+
* @return bool|string Returns a string if in test mode.
410410
*/
411411
protected function doPurgeDeleted()
412412
{

system/Session/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ public function set($data, $value = null)
481481
*
482482
* @param string|null $key Identifier of the session property to retrieve
483483
*
484-
* @return mixed The property value(s)
484+
* @return array|bool|float|int|object|string|null The property value(s)
485485
*/
486486
public function get(?string $key = null)
487487
{

system/Test/CIUnitTestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ abstract class CIUnitTestCase extends TestCase
147147
/**
148148
* Migration Runner instance.
149149
*
150-
* @var MigrationRunner|mixed
150+
* @var MigrationRunner|null
151151
*/
152152
protected $migrations;
153153

0 commit comments

Comments
 (0)