From 63f00f2f0343d4b4998f3f9196eba45510424918 Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 3 Jan 2025 18:41:00 +0530 Subject: [PATCH 1/3] Add info about Text::insert() change. Refs cakephp/cakephp#18117 --- en/appendices/6-0-migration-guide.rst | 6 ++++++ en/core-libraries/text.rst | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/en/appendices/6-0-migration-guide.rst b/en/appendices/6-0-migration-guide.rst index 7f64ab0603..26bf9d71ae 100644 --- a/en/appendices/6-0-migration-guide.rst +++ b/en/appendices/6-0-migration-guide.rst @@ -16,3 +16,9 @@ Behavior Changes ``JsonType`` by default. - ``Cake\View\Widget\FileWidget`` was removed as it was redundant. The standard input widget will be used for file inputs in 6.x. + +Breaking Changes +================ +- The default placeholder format for ``Text::insert()`` has been changed. + They are now of the form ``{foo}`` instead of ``:foo``. You can get the old + behavior by using the ``before`` and ``after`` keys of ``$options``. diff --git a/en/core-libraries/text.rst b/en/core-libraries/text.rst index 16c60c3a30..3238e11c1c 100644 --- a/en/core-libraries/text.rst +++ b/en/core-libraries/text.rst @@ -129,18 +129,18 @@ The insert method is used to create string templates and to allow for key/value replacements:: Text::insert( - 'My name is :name and I am :age years old.', + 'My name is {name} and I am {age} years old.', ['name' => 'Bob', 'age' => '65'] ); // Returns: "My name is Bob and I am 65 years old." .. php:staticmethod:: cleanInsert($string, $options = []) -Cleans up a ``Text::insert`` formatted string with given ``$options`` depending +Cleans up a ``Text::insert()`` formatted string with given ``$options`` depending on the 'clean' key in ``$options``. The default method used is text but html is also available. The goal of this function is to replace all whitespace and unneeded markup around placeholders that did not get replaced by -``Text::insert``. +``Text::insert()``. You can use the following options in the options array:: From 2389f7e0ab93dcb2b4e50cb51dfa736df5e5ee38 Mon Sep 17 00:00:00 2001 From: ADmad Date: Fri, 3 Jan 2025 23:24:13 +0530 Subject: [PATCH 2/3] Update en/appendices/6-0-migration-guide.rst Co-authored-by: othercorey --- en/appendices/6-0-migration-guide.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/en/appendices/6-0-migration-guide.rst b/en/appendices/6-0-migration-guide.rst index 26bf9d71ae..f1da953f0a 100644 --- a/en/appendices/6-0-migration-guide.rst +++ b/en/appendices/6-0-migration-guide.rst @@ -20,5 +20,5 @@ Behavior Changes Breaking Changes ================ - The default placeholder format for ``Text::insert()`` has been changed. - They are now of the form ``{foo}`` instead of ``:foo``. You can get the old + They now use ``{foo}`` instead of ``:foo``. You can get the old behavior by using the ``before`` and ``after`` keys of ``$options``. From f9cdf7953279efa3b92c86fe822298e37d14ee81 Mon Sep 17 00:00:00 2001 From: ADmad Date: Sat, 4 Jan 2025 17:15:12 +0530 Subject: [PATCH 3/3] Add 6.0 migration guide to toctree --- en/appendices/migration-guides.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/en/appendices/migration-guides.rst b/en/appendices/migration-guides.rst index 2a86606039..b2bb03dd6a 100644 --- a/en/appendices/migration-guides.rst +++ b/en/appendices/migration-guides.rst @@ -11,4 +11,5 @@ each version and the migration path between 5.x minor releases. ./5-0-migration-guide ./5-1-migration-guide ./5-2-migration-guide + ./6-0-migration-guide ./phpunit10