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']) { 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 ========================