From 7482a51008b70c1886e856060882dd034bcc8a13 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:20:40 +0900 Subject: [PATCH 1/2] fix!: change Factories to final class --- system/Config/Factories.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/system/Config/Factories.php b/system/Config/Factories.php index 4bf2428ab0e0..ce04d51662e8 100644 --- a/system/Config/Factories.php +++ b/system/Config/Factories.php @@ -28,7 +28,7 @@ * @method static Model|null models(string $alias, array $options = [], ?ConnectionInterface &$conn = null) * @see \CodeIgniter\Config\FactoriesTest */ -class Factories +final class Factories { /** * Store of component-specific options, usually @@ -36,7 +36,7 @@ class Factories * * @var array> */ - protected static $options = []; + private static $options = []; /** * Explicit options for the Config @@ -65,7 +65,7 @@ class Factories * @var array> * @phpstan-var array> */ - protected static $aliases = []; + private static $aliases = []; /** * Store for instances of any component that @@ -79,7 +79,7 @@ class Factories * @var array> * @phpstan-var array> */ - protected static $instances = []; + private static $instances = []; /** * Whether the component instances are updated? @@ -88,7 +88,7 @@ class Factories * * @internal For caching only */ - protected static $updated = []; + private static $updated = []; /** * Define the class to load. You can *override* the concrete class. @@ -252,7 +252,7 @@ private static function isConfig(string $component): bool * @param array $options The array of component-specific directives * @param string $alias Class alias. See the $aliases property. */ - protected static function locateClass(array $options, string $alias): ?string + private static function locateClass(array $options, string $alias): ?string { // Check for low-hanging fruit if ( @@ -328,7 +328,7 @@ private static function isNamespaced(string $alias): bool * @param array $options The array of component-specific directives * @param string $alias Class alias. See the $aliases property. */ - protected static function verifyPreferApp(array $options, string $alias): bool + private static function verifyPreferApp(array $options, string $alias): bool { // Anything without that restriction passes if (! $options['preferApp']) { @@ -349,7 +349,7 @@ protected static function verifyPreferApp(array $options, string $alias): bool * @param array $options The array of component-specific directives * @param string $alias Class alias. See the $aliases property. */ - protected static function verifyInstanceOf(array $options, string $alias): bool + private static function verifyInstanceOf(array $options, string $alias): bool { // Anything without that restriction passes if (! $options['instanceOf']) { From effc82cec9a33f73aa4008d7cf0d7e820d67d566 Mon Sep 17 00:00:00 2001 From: kenjis Date: Wed, 18 Oct 2023 10:49:37 +0900 Subject: [PATCH 2/2] docs: add changelog and upgrade --- user_guide_src/source/changelogs/v4.5.0.rst | 6 ++++++ user_guide_src/source/installation/upgrade_450.rst | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/user_guide_src/source/changelogs/v4.5.0.rst b/user_guide_src/source/changelogs/v4.5.0.rst index 1a1ac6fe901a..3dbb0ea42a59 100644 --- a/user_guide_src/source/changelogs/v4.5.0.rst +++ b/user_guide_src/source/changelogs/v4.5.0.rst @@ -34,6 +34,12 @@ Due to a bug fix, the behavior has changed so that options passed to the outer ``group()`` are merged with the options of the inner ``group()``. See :ref:`Upgrading Guide ` for details. +Factories class +--------------- + +:doc:`../concepts/factories` has been changed to a final class. It is a static +class, and even if it were extended, there is no way to replace it. + Others ------ diff --git a/user_guide_src/source/installation/upgrade_450.rst b/user_guide_src/source/installation/upgrade_450.rst index db022059d585..56b1f37c011e 100644 --- a/user_guide_src/source/installation/upgrade_450.rst +++ b/user_guide_src/source/installation/upgrade_450.rst @@ -119,6 +119,13 @@ has been removed. If you extneds ``BaseModel``, implement the ``getIdValue()`` method in the child class. +Factories +========= + +:doc:`../concepts/factories` has been changed to a final class. +In the unlikely event, you have inherited the Factories, stop inheriting and +copy the code into your Factories class. + Removed Deprecated Items ========================