File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -481,14 +481,15 @@ letter A with ring above"*) or a sequence of two code points (``U+0061`` =
481
481
u('å')->normalize(UnicodeString::NFD);
482
482
u('å')->normalize(UnicodeString::NFKD);
483
483
484
- Lazily -loaded Strings
485
- ---------------------
484
+ Lazy -loaded Strings
485
+ -------------------
486
486
487
- Additionally to other types of strings presented above, the
488
- :class: `Symfony\\ Component\\ String\\ LazyString ` allows to store
489
- a string whose value is only generated when you need it. This is
490
- useful when the string needs a heavy computation to determine its value,
491
- like a hash for example. A lazy string can be declared like this::
487
+ Sometimes, creating a string with the methods presented in the previous sections
488
+ is not optimal. For example, consider a hash value that requires certain
489
+ computation to obtain and which you might end up not using it.
490
+
491
+ In those cases, it's better to use the :class: `Symfony\\ Component\\ String\\ LazyString `
492
+ class that allows to store a string whose value is only generated when you need it::
492
493
493
494
use Symfony\Component\String\LazyString;
494
495
@@ -501,9 +502,8 @@ like a hash for example. A lazy string can be declared like this::
501
502
});
502
503
503
504
The callback will only be executed when the value of the lazy string is
504
- requested in the program execution.
505
-
506
- A lazy string can also be created from a ``Stringable `` object::
505
+ requested during the program execution. You can also create lazy strings from a
506
+ ``Stringable `` object::
507
507
508
508
class Hash implements \Stringable
509
509
{
You can’t perform that action at this time.
0 commit comments