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

Support namespace operator in type declarations #180

Merged
merged 5 commits into from
Aug 31, 2020

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Aug 31, 2020

Largely the same changes as pulled upstream in squizlabs/PHP_CodeSniffer#3066


Collections: allow for namespace operator in type declarations

This adds support for the namespace keyword used as an operator in property, parameter and return type declarations.

Includes adjusted unit tests.

FunctionDeclarations: add test for namespace operator in arrow function type declarations

The commit which added namespace operator support to the Collections::returnTypeTokens[BC]() methods implicitly added support for the namespace operator in type declarations for arrow functions, i.e. to the FunctionDeclarations::isArrowFunction() and the FunctionDeclarations::getArrowFunctionOpenClose() methods.

This commit adds a unit test to safeguard this support.

FunctionDeclarations::getProperties(): add tests verifying support for namespace operator in types

The commit which added support for the namespace keyword used as an operator to the Collections::returnTypeTokens[BC]() methods implicitly added support for this to the FunctionDeclarations::getProperties() method.

This commit adds a unit test to safeguard this support.

The same commit also silently added support for the namespace operator to the BCFile::getMethodProperties() method. Namespace operators in return types are not supported yet in PHPCS itself and until they are, the fact that the BCFile::getMethodProperties() method supports this should be regarded as an artifact and not as official support.

FunctionDeclarations::getParameters(): add support for namespace operator in types

This commit adds support for the namespace keyword used as an operator to the FunctionDeclarations::getParameters() method.

Changes along the same lines as included in this PR will also be pulled upstream to PHPCS itself. Once the upstream PR has been merged, those changes will also be applied to the BCFile::getMethodParameters() method.

Includes unit test.

Variables::getMemberProperties(): add tests verifying support for namespace operator in types

The commit which added support for the namespace keyword used as an operator to the Collections::propertyTypeTokens[BC]() methods implicitly added support for this to the Variables::getMemberProperties() method.

This commit adds a unit test to safeguard this support.

The same commit also silently added support for the namespace operator to the BCFile::getMemberProperties() method. Namespace operators in property types are not supported yet in PHPCS itself and until they are, the fact that the BCFile::getMemberProperties() method supports this should be regarded as an artifact and not as official support.

This adds support for the namespace keyword used as an operator in property, parameter and return type declarations.

Includes adjusted unit tests.
…on type declarations

The commit which added namespace operator support to the `Collections::returnTypeTokens[BC]()` methods implicitly added support for the namespace operator in type declarations for arrow functions, i.e. to the `FunctionDeclarations::isArrowFunction()` and the `FunctionDeclarations::getArrowFunctionOpenClose()` methods.

This commit adds a unit test to safeguard this support.
…r namespace operator in types

The commit which added support for the namespace keyword used as an operator to the `Collections::returnTypeTokens[BC]()` methods implicitly added support for this to the `FunctionDeclarations::getProperties()` method.

This commit adds a unit test to safeguard this support.

The same commit also _silently_ added support for the namespace operator to the `BCFile::getMethodProperties()` method. Namespace operators in return types are not supported yet in PHPCS itself and until they are, the fact that the `BCFile::getMethodProperties()` method supports this should be regarded as an artefact and not as official support.
…ator in types

This commit adds support for the namespace keyword used as an operator to the `FunctionDeclarations::getParameters()` method.

Changes along the same lines as included in this PR will also be pulled upstream to PHPCS itself. Once the upstream PR has been merged, those changes will also be applied to the `BCFile::getMethodParameters()` method.

Includes unit test.
…espace operator in types

The commit which added support for the namespace keyword used as an operator to the `Collections::propertyTypeTokens[BC]()` methods implicitly added support for this to the `Variables::getMemberProperties()` method.

This commit adds a unit test to safeguard this support.

The same commit also _silently_ added support for the namespace operator to the `BCFile::getMemberProperties()` method. Namespace operators in property types are not supported yet in PHPCS itself and until they are, the fact that the `BCFile::getMemberProperties()` method supports this should be regarded as an artefact and not as official support.
@jrfnl jrfnl added this to the 1.0.0-alpha4 milestone Aug 31, 2020
@jrfnl jrfnl merged commit 4d22790 into develop Aug 31, 2020
@jrfnl jrfnl deleted the feature/support-namespace-operator-in-types branch August 31, 2020 03:05
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