Re: [VOTE] Object-based token_get_all() alternative

This is only part of a thread. view whole thread
  109229
March 23, 2020 14:07 nikita.ppv@gmail.com (Nikita Popov)
On Fri, Mar 6, 2020 at 10:33 AM Nikita Popov ppv@gmail.com> wrote:

> Hi internals, > > I've opened voting on https://wiki.php.net/rfc/token_as_object, which > adds a new object-based interface to the tokenizer. Voting closes on > 2020-03-20. >
This RFC has been accepted unanimously, with 47 votes in favor. Based on the additional feedback in this thread, I'll also add a __toString() method that returns the value of $token->text, unless anyone has objects to that... Regards, Nikita
  109232
March 23, 2020 16:03 larry@garfieldtech.com ("Larry Garfield")
On Mon, Mar 23, 2020, at 9:07 AM, Nikita Popov wrote:
> On Fri, Mar 6, 2020 at 10:33 AM Nikita Popov ppv@gmail.com> wrote: > > > Hi internals, > > > > I've opened voting on https://wiki.php.net/rfc/token_as_object, which > > adds a new object-based interface to the tokenizer. Voting closes on > > 2020-03-20. > > > > This RFC has been accepted unanimously, with 47 votes in favor. > > Based on the additional feedback in this thread, I'll also add a > __toString() method that returns the value of $token->text, unless anyone > has objects to that... > > Regards, > Nikita
As long as __toString() is overridable in subclasses, that seems fine to me. --Larry Garfield
  109285
March 25, 2020 10:50 lisachenko.it@gmail.com (Alexander Lisachenko)
Hello, internals team!

I would like to propose to rename the PhpToken::getAll() method into the
PhpToken::tokenize(string $source) or PhpToken::lex(string $source) to use
a more meaningful verb word.

After renaming, it will sound more natural: $tokenStream =
PhpToken::tokenize($sourceCode)

Best regards,
Alexander


пн, 23 мар. 2020 г. в 19:04, Larry Garfield <larry@garfieldtech.com>:

> On Mon, Mar 23, 2020, at 9:07 AM, Nikita Popov wrote: > > On Fri, Mar 6, 2020 at 10:33 AM Nikita Popov ppv@gmail.com> > wrote: > > > > > Hi internals, > > > > > > I've opened voting on https://wiki.php.net/rfc/token_as_object, which > > > adds a new object-based interface to the tokenizer. Voting closes on > > > 2020-03-20. > > > > > > > This RFC has been accepted unanimously, with 47 votes in favor. > > > > Based on the additional feedback in this thread, I'll also add a > > __toString() method that returns the value of $token->text, unless anyone > > has objects to that... > > > > Regards, > > Nikita > > As long as __toString() is overridable in subclasses, that seems fine to > me. > > --Larry Garfield > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >