Skip to content

Commit 713db9e

Browse files
committed
fix: change Services::security() param type
1 parent 2868f5c commit 713db9e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

system/Config/Services.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -627,16 +627,14 @@ public static function router(?RouteCollectionInterface $routes = null, ?Request
627627
* secure, most notably the CSRF protection tools.
628628
*
629629
* @return Security
630-
*
631-
* @TODO replace the first parameter type `?App` with `?SecurityConfig`
632630
*/
633-
public static function security(?App $config = null, bool $getShared = true)
631+
public static function security(?SecurityConfig $config = null, bool $getShared = true)
634632
{
635633
if ($getShared) {
636634
return static::getSharedInstance('security', $config);
637635
}
638636

639-
$config = config(SecurityConfig::class);
637+
$config ??= config(SecurityConfig::class);
640638

641639
return new Security($config);
642640
}

user_guide_src/source/changelogs/v4.4.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ Interface Changes
4545
Method Signature Changes
4646
========================
4747

48+
- **Services:** The first parameter of ``Services::security()`` has been
49+
changed from ``Config\App`` to ``Config\Security``.
4850
- **Routing:** The third parameter ``Routing $routing`` has been added to
4951
``RouteCollection::__construct()``.
5052
- **Validation:** The method signature of ``Validation::check()`` has been changed.

0 commit comments

Comments
 (0)