Skip to content

Commit b74816f

Browse files
committed
minor #20274 [String] Add the AbstractString::kebab() method (alexandre-daubois)
This PR was merged into the 7.2 branch. Discussion ---------- [String] Add the `AbstractString::kebab()` method Waiting code merge * symfony/symfony#58385 Commits ------- 0bb5a68 [String] Add the `AbstractString::kebab()` method
2 parents d810f6c + 0bb5a68 commit b74816f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

string.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ Methods to Change Case
232232
u('Foo: Bar-baz.')->camel(); // 'fooBarBaz'
233233
// changes all graphemes/code points to snake_case
234234
u('Foo: Bar-baz.')->snake(); // 'foo_bar_baz'
235+
// changes all graphemes/code points to kebab-case
236+
u('Foo: Bar-baz.')->kebab(); // 'foo-bar-baz'
235237
// other cases can be achieved by chaining methods. E.g. PascalCase:
236238
u('Foo: Bar-baz.')->camel()->title(); // 'FooBarBaz'
237239

@@ -240,6 +242,10 @@ Methods to Change Case
240242
The ``localeLower()``, ``localeUpper()`` and ``localeTitle()`` methods were
241243
introduced in Symfony 7.1.
242244

245+
.. versionadded:: 7.2
246+
247+
The ``kebab()`` method was introduced in Symfony 7.2.
248+
243249
The methods of all string classes are case-sensitive by default. You can perform
244250
case-insensitive operations with the ``ignoreCase()`` method::
245251

0 commit comments

Comments
 (0)