Skip to content

Commit 7d3b00b

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.8
2 parents f33fb84 + 0699287 commit 7d3b00b

12 files changed

Lines changed: 29 additions & 31 deletions

File tree

‎admin/docs-phpstan-baseline.php‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,14 @@
9292
],
9393
],
9494

95+
[
96+
'identifier' => 'codeigniter.castHandlerNotRegistered',
97+
'paths' => [
98+
'docs/models/entities.md:581',
99+
'docs/models/model.md:500',
100+
],
101+
],
102+
95103
[
96104
'identifier' => 'codeigniter.languageLineNotFound',
97105
'paths' => [

‎app/Config/Modules.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Modules extends BaseModules
7474
*/
7575
public $aliases = [
7676
'events',
77-
'filters',
77+
'filters', // @deprecated 4.4.2 Use Registrar instead.
7878
'registrars',
7979
'routes',
8080
'services',

‎composer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"require-dev": {
2020
"boundwize/structarmed": "^0.21",
21-
"codeigniter/phpstan-codeigniter": "^2.3",
21+
"codeigniter/phpstan-codeigniter": "^2.4",
2222
"fakerphp/faker": "^1.24",
2323
"kint-php/kint": "^6.1",
2424
"mikey179/vfsstream": "^1.6.12",

‎docs/changelogs/v4.7.7.md‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ Release Date: Unreleased
1818

1919
## Deprecations
2020

21+
- **Filters:** `CodeIgniter\Filters\Filters::$modules` and the `$modules` constructor parameter are now marked as deprecated since v4.4.2, to complete the deprecation of the auto-discovery of Filters. Only that feature uses them.
22+
- **Modules:** The `filters` entry in `Config\Modules::$aliases` is likewise part of the Filters auto-discovery deprecated since v4.4.2, and is not needed once it is removed.
23+
2124
## Bugs Fixed
2225

2326
- **API:** Fixed HTTP 500 errors in `ResponseTrait::paginate()` when using a Query Builder with a very large page number or `$perPage = 0`.

‎docs/models/entities.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -663,6 +663,7 @@ Now you need to register it:
663663

664664
namespace App\Entities;
665665

666+
use App\Entities\Cast\CastBase64;
666667
use CodeIgniter\Entity\Entity;
667668

668669
class MyEntity extends Entity
@@ -674,7 +675,7 @@ class MyEntity extends Entity
674675

675676
// Bind the type to the handler
676677
protected $castHandlers = [
677-
'base64' => Cast\CastBase64::class,
678+
'base64' => CastBase64::class,
678679
];
679680
}
680681

@@ -713,6 +714,7 @@ In some cases, one type is not enough. In this situation, you can use additional
713714

714715
namespace App\Entities;
715716

717+
use App\Entities\Cast\SomeHandler;
716718
use CodeIgniter\Entity\Entity;
717719

718720
class MyEntity extends Entity
@@ -724,7 +726,7 @@ class MyEntity extends Entity
724726

725727
// Bind the type to the handler
726728
protected $castHandlers = [
727-
'class' => 'SomeHandler',
729+
'class' => SomeHandler::class,
728730
];
729731
}
730732
```

‎psalm-baseline.xml‎

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<files psalm-version="6.16.1@f1f5de594dc76faf8784e02d3dc4716c91c6f6ac">
2+
<files psalm-version="7.12.0@67cfa8476f9f2d666a5d3b54817738d1536afa77">
33
<file src="system/Database/OCI8/Connection.php">
44
<UndefinedConstant>
55
<code><![CDATA[OCI_COMMIT_ON_SUCCESS]]></code>
@@ -33,29 +33,13 @@
3333
<code><![CDATA[$timestamp]]></code>
3434
</LoopInvalidation>
3535
</file>
36-
<file src="system/HTTP/Files/FileCollection.php">
37-
<EmptyArrayAccess>
38-
<code><![CDATA[$output[$name]]]></code>
39-
</EmptyArrayAccess>
40-
</file>
4136
<file src="system/Helpers/text_helper.php">
4237
<LoopInvalidation>
4338
<code><![CDATA[$count]]></code>
4439
<code><![CDATA[$count]]></code>
4540
<code><![CDATA[$count]]></code>
4641
</LoopInvalidation>
4742
</file>
48-
<file src="system/I18n/TimeTrait.php">
49-
<MissingImmutableAnnotation>
50-
<code><![CDATA[public function setTimezone($timezone): static]]></code>
51-
</MissingImmutableAnnotation>
52-
</file>
53-
<file src="system/Language/Language.php">
54-
<NoValue>
55-
<code><![CDATA[$message]]></code>
56-
<code><![CDATA[$message]]></code>
57-
</NoValue>
58-
</file>
5943
<file src="tests/_support/Config/Filters.php">
6044
<UndefinedGlobalVariable>
6145
<code><![CDATA[$filters]]></code>
@@ -95,9 +79,6 @@
9579
</UndefinedConstant>
9680
</file>
9781
<file src="tests/system/Entity/EntityTest.php">
98-
<EmptyArrayAccess>
99-
<code><![CDATA[$current[$key]]]></code>
100-
</EmptyArrayAccess>
10182
<InaccessibleProperty>
10283
<code><![CDATA[$entity->attributes]]></code>
10384
<code><![CDATA[$entity->casts]]></code>

‎psalm.xml‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
ensureOverrideAttribute="false"
1212
findUnusedBaselineEntry="false"
1313
findUnusedCode="false"
14+
runTaintAnalysis="false"
1415
>
1516
<projectFiles>
1617
<directory name="app/" />
@@ -43,6 +44,7 @@
4344
<directory name="system/Entity/Cast" />
4445
</errorLevel>
4546
</UndefinedDocblockClass>
47+
<PluginIssue name="MissingParentCall" errorLevel="suppress" />
4648
<UndefinedGlobalVariable>
4749
<errorLevel type="suppress">
4850
<directory name="tests/_support/View/Cells" />

‎system/Filters/Filters.php‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class Filters
4848
* The Config\Modules instance
4949
*
5050
* @var Modules
51+
*
52+
* @deprecated 4.4.2 Only used by the deprecated auto-discovery of Filters.
5153
*/
5254
protected $modules;
5355

@@ -121,6 +123,7 @@ class Filters
121123

122124
/**
123125
* @param FiltersConfig $config
126+
* @param Modules|null $modules Deprecated. Only used by the deprecated auto-discovery of Filters.
124127
*/
125128
public function __construct($config, RequestInterface $request, ResponseInterface $response, ?Modules $modules = null)
126129
{

‎system/HTTP/ResponseInterface.php‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ public function sendBody();
318318
* @param string $domain Cookie domain (e.g.: '.yourdomain.com')
319319
* @param string $path Cookie path (default: '/')
320320
* @param string $prefix Cookie name prefix
321-
* @param bool $secure Whether to only transfer cookies via SSL
322-
* @param bool $httponly Whether only make the cookie accessible via HTTP (no javascript)
321+
* @param bool|null $secure Whether to only transfer cookies via SSL
322+
* @param bool|null $httponly Whether only make the cookie accessible via HTTP (no javascript)
323323
* @param string|null $samesite
324324
*
325325
* @return $this

‎system/I18n/TimeTrait.php‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,6 @@ public static function create(
237237
* Provides a replacement for DateTime's own createFromFormat function, that provides
238238
* more flexible timeZone handling
239239
*
240-
* @psalm-external-mutation-free
241-
*
242240
* @param string $format
243241
* @param string $datetime
244242
* @param DateTimeZone|string|null $timezone
@@ -1203,6 +1201,7 @@ public function getUTCObject($time, ?string $timezone = null)
12031201
return $time->setTimezone(new DateTimeZone('UTC'));
12041202
}
12051203

1204+
/** @psalm-suppress NoValue Callers can still pass a value that the docblock does not allow. */
12061205
return $time;
12071206
}
12081207

0 commit comments

Comments
 (0)