Skip to content

Commit 8e79533

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
Conflicts: user_guide_src/source/tutorial/create_news_items/004.php user_guide_src/source/tutorial/news_section/008.php user_guide_src/source/tutorial/static_pages/004.php
2 parents ae51f28 + a0554f3 commit 8e79533

19 files changed

Lines changed: 96 additions & 74 deletions

File tree

system/API/ResponseTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ trait ResponseTrait
6666
/**
6767
* How to format the response data.
6868
* Either 'json' or 'xml'. If blank will be
69-
* determine through content negotiation.
69+
* determined through content negotiation.
7070
*
7171
* @var string
7272
*/

system/Common.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ function app_timezone(): string
6565
* $foo = cache('bar');
6666
*
6767
* @return CacheInterface|mixed
68+
* @phpstan-return ($key is null ? CacheInterface : mixed)
6869
*/
6970
function cache(?string $key = null)
7071
{
@@ -198,7 +199,7 @@ function command(string $command)
198199
/**
199200
* More simple way of getting config instances from Factories
200201
*
201-
* @return mixed
202+
* @return object|null
202203
*/
203204
function config(string $name, bool $getShared = true)
204205
{
@@ -361,7 +362,7 @@ function db_connect($db = null, bool $getShared = true)
361362
*
362363
* @param string|null $default
363364
*
364-
* @return mixed
365+
* @return bool|string|null
365366
*/
366367
function env(string $key, $default = null)
367368
{
@@ -999,7 +1000,7 @@ function session(?string $val = null)
9991000
*
10001001
* @param mixed ...$params
10011002
*
1002-
* @return mixed
1003+
* @return object
10031004
*/
10041005
function service(string $name, ...$params)
10051006
{
@@ -1013,7 +1014,7 @@ function service(string $name, ...$params)
10131014
*
10141015
* @param mixed ...$params
10151016
*
1016-
* @return mixed
1017+
* @return object|null
10171018
*/
10181019
function single_service(string $name, ...$params)
10191020
{
@@ -1125,7 +1126,7 @@ function stringify_attributes($attributes, bool $js = false): string
11251126
* returns its return value if any.
11261127
* Otherwise will start or stop the timer intelligently.
11271128
*
1128-
* @return mixed|Timer
1129+
* @return Timer
11291130
*/
11301131
function timer(?string $name = null, ?callable $callable = null)
11311132
{

system/Config/Factories.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
* large performance boost and helps keep code clean of lengthy
2424
* instantiation checks.
2525
*
26-
* @method static BaseConfig config(...$arguments)
26+
* @method static BaseConfig|null config(...$arguments)
2727
*/
2828
class Factories
2929
{

system/Debug/Timer.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ class Timer
3434
* Multiple calls can be made to this method so that several
3535
* execution points can be measured.
3636
*
37-
* @param string $name The name of this timer.
38-
* @param float $time Allows user to provide time.
37+
* @param string $name The name of this timer.
38+
* @param float|null $time Allows user to provide time.
3939
*
4040
* @return Timer
4141
*/

system/Email/Email.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ class Email
392392
protected static $func_overload;
393393

394394
/**
395-
* @param array|null $config
395+
* @param array|\Config\Email|null $config
396396
*/
397397
public function __construct($config = null)
398398
{
@@ -405,7 +405,7 @@ public function __construct($config = null)
405405
/**
406406
* Initialize preferences
407407
*
408-
* @param array|\Config\Email $config
408+
* @param array|\Config\Email|null $config
409409
*
410410
* @return Email
411411
*/

system/HTTP/IncomingRequest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
use Config\Services;
1919
use InvalidArgumentException;
2020
use Locale;
21+
use stdClass;
2122

2223
/**
2324
* Class IncomingRequest
@@ -509,7 +510,7 @@ public function getDefaultLocale(): string
509510
* @param int|null $filter Filter constant
510511
* @param mixed $flags
511512
*
512-
* @return mixed
513+
* @return array|bool|float|int|stdClass|string|null
513514
*/
514515
public function getVar($index = null, $filter = null, $flags = null)
515516
{
@@ -550,7 +551,7 @@ public function getVar($index = null, $filter = null, $flags = null)
550551
*
551552
* @see http://php.net/manual/en/function.json-decode.php
552553
*
553-
* @return mixed
554+
* @return array|bool|float|int|stdClass|null
554555
*/
555556
public function getJSON(bool $assoc = false, int $depth = 512, int $options = 0)
556557
{
@@ -565,7 +566,7 @@ public function getJSON(bool $assoc = false, int $depth = 512, int $options = 0)
565566
* @param int|null $filter Filter Constant
566567
* @param array|int|null $flags Option
567568
*
568-
* @return mixed
569+
* @return array|bool|float|int|stdClass|string|null
569570
*/
570571
public function getJsonVar(string $index, bool $assoc = false, ?int $filter = null, $flags = null)
571572
{
@@ -599,7 +600,7 @@ public function getJsonVar(string $index, bool $assoc = false, ?int $filter = nu
599600
* A convenience method that grabs the raw input stream(send method in PUT, PATCH, DELETE) and decodes
600601
* the String into an array.
601602
*
602-
* @return mixed
603+
* @return array
603604
*/
604605
public function getRawInput()
605606
{

system/HTTP/Request.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function getMethod(bool $upper = false): string
8585
/**
8686
* Sets the request method. Used when spoofing the request.
8787
*
88-
* @return Request
88+
* @return $this
8989
*
9090
* @deprecated Use withMethod() instead for immutability
9191
*

system/HTTP/URI.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,11 +148,11 @@ class URI
148148
/**
149149
* Builds a representation of the string from the component parts.
150150
*
151-
* @param string $scheme
152-
* @param string $authority
153-
* @param string $path
154-
* @param string $query
155-
* @param string $fragment
151+
* @param string|null $scheme URI scheme. E.g., http, ftp
152+
* @param string $authority
153+
* @param string $path
154+
* @param string $query
155+
* @param string $fragment
156156
*/
157157
public static function createURIString(
158158
?string $scheme = null,

system/Helpers/url_helper.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ function _get_uri(string $relativePath = '', ?App $config = null): URI
9191
* Returns a site URL as defined by the App config.
9292
*
9393
* @param array|string $relativePath URI string or array of URI segments
94+
* @param string|null $scheme URI scheme. E.g., http, ftp
9495
* @param App|null $config Alternate configuration to use
9596
*/
9697
function site_url($relativePath = '', ?string $scheme = null, ?App $config = null): string
@@ -118,6 +119,7 @@ function site_url($relativePath = '', ?string $scheme = null, ?App $config = nul
118119
* Base URLs are trimmed site URLs without the index page.
119120
*
120121
* @param array|string $relativePath URI string or array of URI segments
122+
* @param string|null $scheme URI scheme. E.g., http, ftp
121123
*/
122124
function base_url($relativePath = '', ?string $scheme = null): string
123125
{

system/Model.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -646,9 +646,9 @@ public function builder(?string $table = null)
646646
* data here. This allows it to be used with any of the other
647647
* builder methods and still get validated data, like replace.
648648
*
649-
* @param mixed $key Field name, or an array of field/value pairs
650-
* @param mixed $value Field value, if $key is a single field
651-
* @param bool|null $escape Whether to escape values
649+
* @param array|object|string $key Field name, or an array of field/value pairs
650+
* @param bool|float|int|object|string|null $value Field value, if $key is a single field
651+
* @param bool|null $escape Whether to escape values
652652
*
653653
* @return $this
654654
*/

0 commit comments

Comments
 (0)