Skip to content

Commit c88bf4f

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.4
Conflicts: system/Controller.php system/View/View.php
2 parents d9bb124 + fbb9c4d commit c88bf4f

16 files changed

Lines changed: 76 additions & 163 deletions

File tree

phpstan-baseline.php

Lines changed: 0 additions & 155 deletions
Original file line numberDiff line numberDiff line change
@@ -326,26 +326,6 @@
326326
'count' => 1,
327327
'path' => __DIR__ . '/system/Config/View.php',
328328
];
329-
$ignoreErrors[] = [
330-
'message' => '#^Method CodeIgniter\\\\Controller\\:\\:cachePage\\(\\) has no return type specified\\.$#',
331-
'count' => 1,
332-
'path' => __DIR__ . '/system/Controller.php',
333-
];
334-
$ignoreErrors[] = [
335-
'message' => '#^Method CodeIgniter\\\\Controller\\:\\:forceHTTPS\\(\\) has no return type specified\\.$#',
336-
'count' => 1,
337-
'path' => __DIR__ . '/system/Controller.php',
338-
];
339-
$ignoreErrors[] = [
340-
'message' => '#^Method CodeIgniter\\\\Controller\\:\\:initController\\(\\) has no return type specified\\.$#',
341-
'count' => 1,
342-
'path' => __DIR__ . '/system/Controller.php',
343-
];
344-
$ignoreErrors[] = [
345-
'message' => '#^Method CodeIgniter\\\\Controller\\:\\:loadHelpers\\(\\) has no return type specified\\.$#',
346-
'count' => 1,
347-
'path' => __DIR__ . '/system/Controller.php',
348-
];
349329
$ignoreErrors[] = [
350330
'message' => '#^Method CodeIgniter\\\\Database\\\\BaseBuilder\\:\\:_whereIn\\(\\) has parameter \\$values with no signature specified for Closure\\.$#',
351331
'count' => 1,
@@ -906,26 +886,6 @@
906886
'count' => 1,
907887
'path' => __DIR__ . '/system/Exceptions/TestException.php',
908888
];
909-
$ignoreErrors[] = [
910-
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forExpectedDirectory\\(\\) has no return type specified\\.$#',
911-
'count' => 1,
912-
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
913-
];
914-
$ignoreErrors[] = [
915-
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forExpectedFile\\(\\) has no return type specified\\.$#',
916-
'count' => 1,
917-
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
918-
];
919-
$ignoreErrors[] = [
920-
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forUnableToMove\\(\\) has no return type specified\\.$#',
921-
'count' => 1,
922-
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
923-
];
924-
$ignoreErrors[] = [
925-
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileNotFoundException\\:\\:forFileNotFound\\(\\) has no return type specified\\.$#',
926-
'count' => 1,
927-
'path' => __DIR__ . '/system/Files/Exceptions/FileNotFoundException.php',
928-
];
929889
$ignoreErrors[] = [
930890
'message' => '#^Property CodeIgniter\\\\Files\\\\File\\:\\:\\$size \\(int\\) on left side of \\?\\? is not nullable\\.$#',
931891
'count' => 1,
@@ -936,11 +896,6 @@
936896
'count' => 1,
937897
'path' => __DIR__ . '/system/Filters/Filters.php',
938898
];
939-
$ignoreErrors[] = [
940-
'message' => '#^Method CodeIgniter\\\\Format\\\\XMLFormatter\\:\\:arrayToXML\\(\\) has no return type specified\\.$#',
941-
'count' => 1,
942-
'path' => __DIR__ . '/system/Format/XMLFormatter.php',
943-
];
944899
$ignoreErrors[] = [
945900
'message' => '#^Method CodeIgniter\\\\HTTP\\\\CLIRequest\\:\\:parseCommand\\(\\) has no return type specified\\.$#',
946901
'count' => 1,
@@ -1131,21 +1086,6 @@
11311086
'count' => 4,
11321087
'path' => __DIR__ . '/system/Images/Handlers/ImageMagickHandler.php',
11331088
];
1134-
$ignoreErrors[] = [
1135-
'message' => '#^Method CodeIgniter\\\\Log\\\\Exceptions\\\\LogException\\:\\:forInvalidLogLevel\\(\\) has no return type specified\\.$#',
1136-
'count' => 1,
1137-
'path' => __DIR__ . '/system/Log/Exceptions/LogException.php',
1138-
];
1139-
$ignoreErrors[] = [
1140-
'message' => '#^Method CodeIgniter\\\\Log\\\\Exceptions\\\\LogException\\:\\:forInvalidMessageType\\(\\) has no return type specified\\.$#',
1141-
'count' => 1,
1142-
'path' => __DIR__ . '/system/Log/Exceptions/LogException.php',
1143-
];
1144-
$ignoreErrors[] = [
1145-
'message' => '#^Method CodeIgniter\\\\Log\\\\Handlers\\\\ChromeLoggerHandler\\:\\:sendLogs\\(\\) has no return type specified\\.$#',
1146-
'count' => 1,
1147-
'path' => __DIR__ . '/system/Log/Handlers/ChromeLoggerHandler.php',
1148-
];
11491089
$ignoreErrors[] = [
11501090
'message' => '#^Method CodeIgniter\\\\Model\\:\\:chunk\\(\\) has parameter \\$userFunc with no signature specified for Closure\\.$#',
11511091
'count' => 1,
@@ -2146,66 +2086,11 @@
21462086
'count' => 1,
21472087
'path' => __DIR__ . '/system/View/Cell.php',
21482088
];
2149-
$ignoreErrors[] = [
2150-
'message' => '#^Method CodeIgniter\\\\View\\\\Cell\\:\\:getMethodParams\\(\\) has no return type specified\\.$#',
2151-
'count' => 1,
2152-
'path' => __DIR__ . '/system/View/Cell.php',
2153-
];
21542089
$ignoreErrors[] = [
21552090
'message' => '#^Property CodeIgniter\\\\View\\\\Cell\\:\\:\\$cache \\(CodeIgniter\\\\Cache\\\\CacheInterface\\) in empty\\(\\) is not falsy\\.$#',
21562091
'count' => 2,
21572092
'path' => __DIR__ . '/system/View/Cell.php',
21582093
];
2159-
$ignoreErrors[] = [
2160-
'message' => '#^Method CodeIgniter\\\\View\\\\Cells\\\\Cell\\:\\:setView\\(\\) has no return type specified\\.$#',
2161-
'count' => 1,
2162-
'path' => __DIR__ . '/system/View/Cells/Cell.php',
2163-
];
2164-
$ignoreErrors[] = [
2165-
'message' => '#^Method class@anonymous/system/Traits/PropertiesTrait\\.php\\:47\\:\\:getProperties\\(\\) has no return type specified\\.$#',
2166-
'count' => 1,
2167-
'path' => __DIR__ . '/system/View/Cells/Cell.php',
2168-
];
2169-
$ignoreErrors[] = [
2170-
'message' => '#^Method class@anonymous/system/Traits/PropertiesTrait\\.php\\:47\\:\\:getProperties\\(\\) has parameter \\$obj with no type specified\\.$#',
2171-
'count' => 1,
2172-
'path' => __DIR__ . '/system/View/Cells/Cell.php',
2173-
];
2174-
$ignoreErrors[] = [
2175-
'message' => '#^Method CodeIgniter\\\\View\\\\Exceptions\\\\ViewException\\:\\:forInvalidCellClass\\(\\) has no return type specified\\.$#',
2176-
'count' => 1,
2177-
'path' => __DIR__ . '/system/View/Exceptions/ViewException.php',
2178-
];
2179-
$ignoreErrors[] = [
2180-
'message' => '#^Method CodeIgniter\\\\View\\\\Exceptions\\\\ViewException\\:\\:forInvalidCellMethod\\(\\) has no return type specified\\.$#',
2181-
'count' => 1,
2182-
'path' => __DIR__ . '/system/View/Exceptions/ViewException.php',
2183-
];
2184-
$ignoreErrors[] = [
2185-
'message' => '#^Method CodeIgniter\\\\View\\\\Exceptions\\\\ViewException\\:\\:forInvalidCellParameter\\(\\) has no return type specified\\.$#',
2186-
'count' => 1,
2187-
'path' => __DIR__ . '/system/View/Exceptions/ViewException.php',
2188-
];
2189-
$ignoreErrors[] = [
2190-
'message' => '#^Method CodeIgniter\\\\View\\\\Exceptions\\\\ViewException\\:\\:forInvalidDecorator\\(\\) has no return type specified\\.$#',
2191-
'count' => 1,
2192-
'path' => __DIR__ . '/system/View/Exceptions/ViewException.php',
2193-
];
2194-
$ignoreErrors[] = [
2195-
'message' => '#^Method CodeIgniter\\\\View\\\\Exceptions\\\\ViewException\\:\\:forMissingCellParameters\\(\\) has no return type specified\\.$#',
2196-
'count' => 1,
2197-
'path' => __DIR__ . '/system/View/Exceptions/ViewException.php',
2198-
];
2199-
$ignoreErrors[] = [
2200-
'message' => '#^Method CodeIgniter\\\\View\\\\Exceptions\\\\ViewException\\:\\:forNoCellClass\\(\\) has no return type specified\\.$#',
2201-
'count' => 1,
2202-
'path' => __DIR__ . '/system/View/Exceptions/ViewException.php',
2203-
];
2204-
$ignoreErrors[] = [
2205-
'message' => '#^Method CodeIgniter\\\\View\\\\Exceptions\\\\ViewException\\:\\:forTagSyntaxError\\(\\) has no return type specified\\.$#',
2206-
'count' => 1,
2207-
'path' => __DIR__ . '/system/View/Exceptions/ViewException.php',
2208-
];
22092094
$ignoreErrors[] = [
22102095
'message' => '#^Method CodeIgniter\\\\View\\\\Parser\\:\\:addPlugin\\(\\) has parameter \\$callback with no signature specified for callable\\.$#',
22112096
'count' => 1,
@@ -2216,50 +2101,10 @@
22162101
'count' => 1,
22172102
'path' => __DIR__ . '/system/View/Parser.php',
22182103
];
2219-
$ignoreErrors[] = [
2220-
'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:_compileTemplate\\(\\) has no return type specified\\.$#',
2221-
'count' => 1,
2222-
'path' => __DIR__ . '/system/View/Table.php',
2223-
];
2224-
$ignoreErrors[] = [
2225-
'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:_setFromArray\\(\\) has no return type specified\\.$#',
2226-
'count' => 1,
2227-
'path' => __DIR__ . '/system/View/Table.php',
2228-
];
2229-
$ignoreErrors[] = [
2230-
'message' => '#^Method CodeIgniter\\\\View\\\\Table\\:\\:_setFromDBResult\\(\\) has no return type specified\\.$#',
2231-
'count' => 1,
2232-
'path' => __DIR__ . '/system/View/Table.php',
2233-
];
22342104
$ignoreErrors[] = [
22352105
'message' => '#^Property CodeIgniter\\\\View\\\\Table\\:\\:\\$function type has no signature specified for callable\\.$#',
22362106
'count' => 1,
22372107
'path' => __DIR__ . '/system/View/Table.php',
22382108
];
2239-
$ignoreErrors[] = [
2240-
'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:endSection\\(\\) has no return type specified\\.$#',
2241-
'count' => 1,
2242-
'path' => __DIR__ . '/system/View/View.php',
2243-
];
2244-
$ignoreErrors[] = [
2245-
'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:extend\\(\\) has no return type specified\\.$#',
2246-
'count' => 1,
2247-
'path' => __DIR__ . '/system/View/View.php',
2248-
];
2249-
$ignoreErrors[] = [
2250-
'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:logPerformance\\(\\) has no return type specified\\.$#',
2251-
'count' => 1,
2252-
'path' => __DIR__ . '/system/View/View.php',
2253-
];
2254-
$ignoreErrors[] = [
2255-
'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:renderSection\\(\\) has no return type specified\\.$#',
2256-
'count' => 1,
2257-
'path' => __DIR__ . '/system/View/View.php',
2258-
];
2259-
$ignoreErrors[] = [
2260-
'message' => '#^Method CodeIgniter\\\\View\\\\View\\:\\:section\\(\\) has no return type specified\\.$#',
2261-
'count' => 1,
2262-
'path' => __DIR__ . '/system/View/View.php',
2263-
];
22642109

22652110
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];

system/Controller.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class Controller
7070
/**
7171
* Constructor.
7272
*
73+
* @return void
74+
*
7375
* @throws HTTPException
7476
*/
7577
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
@@ -96,6 +98,8 @@ public function initController(RequestInterface $request, ResponseInterface $res
9698
* considered secure for. Only with HSTS header.
9799
* Default value is 1 year.
98100
*
101+
* @return void
102+
*
99103
* @throws HTTPException
100104
*/
101105
protected function forceHTTPS(int $duration = 31_536_000)
@@ -107,6 +111,8 @@ protected function forceHTTPS(int $duration = 31_536_000)
107111
* How long to cache the current page for.
108112
*
109113
* @params int $time time to live in seconds.
114+
*
115+
* @return void
110116
*/
111117
protected function cachePage(int $time)
112118
{
@@ -119,6 +125,8 @@ protected function cachePage(int $time)
119125
* @deprecated Use `helper` function instead of using this method.
120126
*
121127
* @codeCoverageIgnore
128+
*
129+
* @return void
122130
*/
123131
protected function loadHelpers()
124132
{

system/Files/Exceptions/FileException.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class FileException extends RuntimeException implements ExceptionInterface
1919
{
2020
use DebugTraceableTrait;
2121

22+
/**
23+
* @return static
24+
*/
2225
public static function forUnableToMove(?string $from = null, ?string $to = null, ?string $error = null)
2326
{
2427
return new static(lang('Files.cannotMove', [$from, $to, $error]));
@@ -28,6 +31,8 @@ public static function forUnableToMove(?string $from = null, ?string $to = null,
2831
* Throws when an item is expected to be a directory but is not or is missing.
2932
*
3033
* @param string $caller The method causing the exception
34+
*
35+
* @return static
3136
*/
3237
public static function forExpectedDirectory(string $caller)
3338
{
@@ -38,6 +43,8 @@ public static function forExpectedDirectory(string $caller)
3843
* Throws when an item is expected to be a file but is not or is missing.
3944
*
4045
* @param string $caller The method causing the exception
46+
*
47+
* @return static
4148
*/
4249
public static function forExpectedFile(string $caller)
4350
{

system/Files/Exceptions/FileNotFoundException.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ class FileNotFoundException extends RuntimeException implements ExceptionInterfa
1919
{
2020
use DebugTraceableTrait;
2121

22+
/**
23+
* @return static
24+
*/
2225
public static function forFileNotFound(string $path)
2326
{
2427
return new static(lang('Files.fileNotFound', [$path]));

system/Format/Exceptions/FormatException.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class FormatException extends RuntimeException implements ExceptionInterface
2525
/**
2626
* Thrown when the instantiated class does not exist.
2727
*
28-
* @return FormatException
28+
* @return static
2929
*/
3030
public static function forInvalidFormatter(string $class)
3131
{
@@ -38,7 +38,7 @@ public static function forInvalidFormatter(string $class)
3838
*
3939
* @param string $error
4040
*
41-
* @return FormatException
41+
* @return static
4242
*/
4343
public static function forInvalidJSON(?string $error = null)
4444
{
@@ -49,7 +49,7 @@ public static function forInvalidJSON(?string $error = null)
4949
* Thrown when the supplied MIME type has no
5050
* defined Formatter class.
5151
*
52-
* @return FormatException
52+
* @return static
5353
*/
5454
public static function forInvalidMime(string $mime)
5555
{
@@ -60,7 +60,7 @@ public static function forInvalidMime(string $mime)
6060
* Thrown on XMLFormatter when the `simplexml` extension
6161
* is not installed.
6262
*
63-
* @return FormatException
63+
* @return static
6464
*
6565
* @codeCoverageIgnore
6666
*/

system/Format/XMLFormatter.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ public function format($data)
5353
* @see http://www.codexworld.com/convert-array-to-xml-in-php/
5454
*
5555
* @param SimpleXMLElement $output
56+
*
57+
* @return void
5658
*/
5759
protected function arrayToXML(array $data, &$output)
5860
{

system/Log/Exceptions/LogException.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,17 @@
1515

1616
class LogException extends FrameworkException
1717
{
18+
/**
19+
* @return static
20+
*/
1821
public static function forInvalidLogLevel(string $level)
1922
{
2023
return new static(lang('Log.invalidLogLevel', [$level]));
2124
}
2225

26+
/**
27+
* @return static
28+
*/
2329
public static function forInvalidMessageType(string $messageType)
2430
{
2531
return new static(lang('Log.invalidMessageType', [$messageType]));

system/Log/Handlers/ChromeLoggerHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ protected function format($object)
150150
* Attaches the header and the content to the passed in request object.
151151
*
152152
* @param ResponseInterface $response
153+
*
154+
* @return void
153155
*/
154156
public function sendLogs(?ResponseInterface &$response = null)
155157
{

system/Traits/PropertiesTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ final public function fill(array $params): self
4545
final public function getPublicProperties(): array
4646
{
4747
$worker = new class () {
48-
public function getProperties($obj)
48+
public function getProperties(object $obj): array
4949
{
5050
return get_object_vars($obj);
5151
}

system/View/Cell.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ final protected function renderCell(BaseCell $instance, string $method, array $p
234234
* for a method, in the order they are defined. This allows
235235
* them to be passed directly into the method.
236236
*/
237-
private function getMethodParams(BaseCell $instance, string $method, array $params)
237+
private function getMethodParams(BaseCell $instance, string $method, array $params): array
238238
{
239239
$mountParams = [];
240240

0 commit comments

Comments
 (0)