Skip to content

Commit 97c9246

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [String] add named arguments
2 parents 6e11752 + 819e7f2 commit 97c9246

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

components/string.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ Methods to Change Case
217217

218218
// changes all graphemes/code points to "title case"
219219
u('foo bar')->title(); // 'Foo bar'
220-
u('foo bar')->title(true); // 'Foo Bar'
220+
u('foo bar')->title(allWords: true); // 'Foo Bar'
221221

222222
// changes all graphemes/code points to camelCase
223223
u('Foo: Bar-baz.')->camel(); // 'fooBarBaz'
@@ -255,20 +255,20 @@ Methods to Append and Prepend
255255
u('UserControllerController')->ensureEnd('Controller'); // 'UserController'
256256

257257
// returns the contents found before/after the first occurrence of the given string
258-
u('hello world')->before('world'); // 'hello '
259-
u('hello world')->before('o'); // 'hell'
260-
u('hello world')->before('o', true); // 'hello'
258+
u('hello world')->before('world'); // 'hello '
259+
u('hello world')->before('o'); // 'hell'
260+
u('hello world')->before('o', includeNeedle: true); // 'hello'
261261

262-
u('hello world')->after('hello'); // ' world'
263-
u('hello world')->after('o'); // ' world'
264-
u('hello world')->after('o', true); // 'o world'
262+
u('hello world')->after('hello'); // ' world'
263+
u('hello world')->after('o'); // ' world'
264+
u('hello world')->after('o', includeNeedle: true); // 'o world'
265265

266266
// returns the contents found before/after the last occurrence of the given string
267-
u('hello world')->beforeLast('o'); // 'hello w'
268-
u('hello world')->beforeLast('o', true); // 'hello wo'
267+
u('hello world')->beforeLast('o'); // 'hello w'
268+
u('hello world')->beforeLast('o', includeNeedle: true); // 'hello wo'
269269

270-
u('hello world')->afterLast('o'); // 'rld'
271-
u('hello world')->afterLast('o', true); // 'orld'
270+
u('hello world')->afterLast('o'); // 'rld'
271+
u('hello world')->afterLast('o', includeNeedle: true); // 'orld'
272272

273273
Methods to Pad and Trim
274274
~~~~~~~~~~~~~~~~~~~~~~~
@@ -381,17 +381,17 @@ Methods to Join, Split, Truncate and Reverse
381381
u('Lorem Ipsum')->truncate(80); // 'Lorem Ipsum'
382382
// the second argument is the character(s) added when a string is cut
383383
// (the total length includes the length of this character(s))
384-
u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
384+
u('Lorem Ipsum')->truncate(8, '…'); // 'Lorem I…'
385385
// if the third argument is false, the last word before the cut is kept
386386
// even if that generates a string longer than the desired length
387-
u('Lorem Ipsum')->truncate(8, '…', false); // 'Lorem Ipsum'
387+
u('Lorem Ipsum')->truncate(8, '…', cut: false); // 'Lorem Ipsum'
388388

389389
::
390390

391391
// breaks the string into lines of the given length
392-
u('Lorem Ipsum')->wordwrap(4); // 'Lorem\nIpsum'
392+
u('Lorem Ipsum')->wordwrap(4); // 'Lorem\nIpsum'
393393
// by default it breaks by white space; pass TRUE to break unconditionally
394-
u('Lorem Ipsum')->wordwrap(4, "\n", true); // 'Lore\nm\nIpsu\nm'
394+
u('Lorem Ipsum')->wordwrap(4, "\n", cut: true); // 'Lore\nm\nIpsu\nm'
395395

396396
// replaces a portion of the string with the given contents:
397397
// the second argument is the position where the replacement starts;
@@ -405,7 +405,7 @@ Methods to Join, Split, Truncate and Reverse
405405
u('0123456789')->chunk(3); // ['012', '345', '678', '9']
406406

407407
// reverses the order of the string contents
408-
u('foo bar')->reverse(); // 'rab oof'
408+
u('foo bar')->reverse(); // 'rab oof'
409409
u('さよなら')->reverse(); // 'らなよさ'
410410

411411
Methods Added by ByteString

reference/configuration/kernel.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ have deleted it entirely (for example in the production servers), override the
283283

284284
public function getProjectDir(): string
285285
{
286-
// when defining a hardcoded string, don't add the triailing slash to the path
286+
// when defining a hardcoded string, don't add the trailing slash to the path
287287
// e.g. '/home/user/my_project', '/app', '/var/www/example.com'
288288
return \dirname(__DIR__);
289289
}

0 commit comments

Comments
 (0)