From 8d2d9f188b7311f536d59200c88472c69006d7a4 Mon Sep 17 00:00:00 2001 From: kenjis Date: Sat, 19 Aug 2023 06:47:30 +0900 Subject: [PATCH 1/2] docs: improve description --- user_guide_src/source/changelogs/v4.4.0.rst | 13 +++++++++++-- user_guide_src/source/installation/upgrade_440.rst | 6 +++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/user_guide_src/source/changelogs/v4.4.0.rst b/user_guide_src/source/changelogs/v4.4.0.rst index a6a3bdde7d88..47d3b4e270a2 100644 --- a/user_guide_src/source/changelogs/v4.4.0.rst +++ b/user_guide_src/source/changelogs/v4.4.0.rst @@ -34,8 +34,8 @@ The next segment (``+1``) of the current last segment can be set as before. Factories --------- -Passing Fully Qualified Classname -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Passing Classname with Namespace +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Now ``preferApp`` works only when you request :ref:`a classname without a namespace `. @@ -53,6 +53,15 @@ For example, when you call ``model(\Myth\Auth\Models\UserModel::class)`` or - returns ``Myth\Auth\Models\UserModel`` even if ``preferApp`` is true (default) - returns ``App\Models\UserModel`` if you define ``Factories::define('models', 'Myth\Auth\Models\UserModel', 'App\Models\UserModel')`` before calling the ``model()`` +If you had passed a non-existent classname by mistake, the previous version +would have returned a class instance in the ``App`` or ``Config`` namespace +because of the ``preferApp`` feature. + +For example, in a controller (``namespace App\Controllers``), if you call +``config(Config\App::class)`` by mistake (note that you forgot the leading ``\`` +in ``Config\App::class``), that means you pass ``App\Controllers\Config\App``. +But the class does not exist, so now Factories return ``null``. + Property Name ^^^^^^^^^^^^^ diff --git a/user_guide_src/source/installation/upgrade_440.rst b/user_guide_src/source/installation/upgrade_440.rst index c4bdfe0c81ff..3c34b0241746 100644 --- a/user_guide_src/source/installation/upgrade_440.rst +++ b/user_guide_src/source/installation/upgrade_440.rst @@ -85,10 +85,10 @@ This bug was fixed and now URIs for underscores (**foo_bar**) is not accessible. If you have links to URIs for underscores (**foo_bar**), update them with URIs for dashes (**foo-bar**). -When Passing Fully Qualified Classnames to Factories -==================================================== +When Passing Classname with Namespace to Factories +================================================== -The behavior of passing fully qualified classnames to Factories has been changed. +The behavior of passing a classname with a namespace to Factories has been changed. See :ref:`ChangeLog ` for details. If you have code like ``model('\Myth\Auth\Models\UserModel::class')`` or From 5ba1b9cf4433622486e2977183c35a32ed77521c Mon Sep 17 00:00:00 2001 From: kenjis Date: Mon, 21 Aug 2023 09:48:57 +0900 Subject: [PATCH 2/2] docs: fix by proofreading Co-authored-by: MGatner --- user_guide_src/source/changelogs/v4.4.0.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/user_guide_src/source/changelogs/v4.4.0.rst b/user_guide_src/source/changelogs/v4.4.0.rst index 47d3b4e270a2..4f7615c42e3f 100644 --- a/user_guide_src/source/changelogs/v4.4.0.rst +++ b/user_guide_src/source/changelogs/v4.4.0.rst @@ -57,10 +57,10 @@ If you had passed a non-existent classname by mistake, the previous version would have returned a class instance in the ``App`` or ``Config`` namespace because of the ``preferApp`` feature. -For example, in a controller (``namespace App\Controllers``), if you call -``config(Config\App::class)`` by mistake (note that you forgot the leading ``\`` -in ``Config\App::class``), that means you pass ``App\Controllers\Config\App``. -But the class does not exist, so now Factories return ``null``. +For example, in a controller (``namespace App\Controllers``), if you called +``config(Config\App::class)`` by mistake (note the class is missing the leading ``\``), +meaning you actually passed ``App\Controllers\Config\App``. +But that class does not exist, so now Factories will return ``null``. Property Name ^^^^^^^^^^^^^