Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New Tokens\Collections class #19

Merged
merged 1 commit into from Jan 22, 2020
Merged

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jan 22, 2020

New PHPCSUtils\Tokens\Collections class which will hold "collections" of related tokens in static properties.

These are additional "token groups" to compliment the ones available through the PHPCS native \PHP_CodeSniffer\Util\Tokens class.

These properties are often needed for register() methods and/or to disseminate the results of calls to $phpcsFile->findNext()/$phpcsFile->findPrevious().

To start off the class, it currently holds the following properties:

  • $closedScopes - List of tokens which represent "closed" scopes.
  • $OOConstantScopes - OO scopes in which constants can be declared.
  • $OOPropertyScopes - OO scopes in which properties can be declared.

The available token collections will grow once more classes get added.

New `PHPCSUtils\Tokens\Collections` class which will hold "collections" of related tokens in static properties.

These are additional "token groups" to compliment the ones available through the PHPCS native `\PHP_CodeSniffer\Util\Tokens` class.

These properties are often needed for `register()` methods and/or to disseminate the results of calls to `$phpcsFile->findNext()`/`$phpcsFile->findPrevious()`.

To start off the class, it currently holds the following properties:
* `$closedScopes` - List of tokens which represent "closed" scopes.
* `$OOConstantScopes` - OO scopes in which constants can be declared.
* `$OOPropertyScopes` - OO scopes in which properties can be declared.

The available token collections will grow once more classes get added.
@jrfnl jrfnl added this to the 1.0.0 milestone Jan 22, 2020
@jrfnl jrfnl merged commit a15eb28 into develop Jan 22, 2020
@jrfnl jrfnl deleted the feature/new-tokens-collections-class branch January 22, 2020 00:57
@jrfnl jrfnl modified the milestones: 1.0.0, 1.0.0-alpha1 May 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant