On Thu, 15 Dec 2022, Tim Düsterhus wrote:

> On 12/15/22 16:34, Derick Rethans wrote:
> > You can find it at:
> > https://wiki.php.net/rfc/unicode_text_processing
> > 
> > I'm looking forwards to hearing your opinions, additions, and
> > suggestions — the RFC specifically asks for these in places.
> 
> Some first remarks:
> 
> ----------
> 
> replaceText():
> 
> In the replaceText() section the description refers to a non-existent
> parameters '$maxReplacements' and '$collator'. Also the second paragraph in
> that section looks like a word is missing there.

I will update this. the ''$collator'' would be an argument to the 
constructor of the Text/$search argument, not the method itself.

> ----------
> 
> getPositionOfFirstOccurrence():
> 
> I agree this is too long. How about:
> 
> - findOffset()
> - findOffsetLast()
> 
> And for returnFromFirstOccurence():
> 
> - startingWith()
> - startingWithLast()

I have included these as suggested names. I suspect we'll get more :-)

> ----------
> 
> firstToTitle():
> 
> I don't see how this differs from toTitle() and/or firstToUpper(). An example
> would likely be helpful.

It doesn't differ from firstToUpper, so I will remove it.

> ----------
> 
> wordsToTitle():
> 
> Likewise.

It doesn't differ either from toTitle, so I will remove it.

I have also added examples for the others.

> ----------
> 
> The return of many methods is not explicitly listed. I'd put it everywhere to
> make it 100% clear that all those functions return 'Text'.

I will update that.

cheers,
Derick

-- 
https://derickrethans.nl | https://xdebug.org | https://dram.io

Author of Xdebug. Like it? Consider supporting me: https://xdebug.org/support
Host of PHP Internals News: https://phpinternals.news

mastodon: @derickr@phpc.social @xdebug@phpc.social
twitter: @derickr and @xdebug
-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to