-
-
Notifications
You must be signed in to change notification settings - Fork 7
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
PHP 8.0 | Add support for union types #168
Commits on Jul 15, 2020
-
Collections::propertyTypeTokensBC(): uncouple from the parameterTypeT…
…okensBC() method
Configuration menu - View commit details
-
Copy full SHA for 2302d69 - Browse repository at this point
Copy the full SHA 2302d69View commit details
Commits on Jul 17, 2020
-
Collections: deprecate $parameterTypeTokens in favour of parameterTyp…
…eTokens() Deprecate the `$parameterTypeTokens` property in favour of a new `Collections::parameterTypeTokens()` method. PHPCS is expected to introduce a new `T_TYPE_UNION` token. As that token would not always be available, a property can't handle this. In anticipation of the introduction of the new token, I'm deprecating the `Collections::$parameterTypeTokens` property straight away to prevent BC breaks at a later point. Includes adding unit tests for the new method.
Configuration menu - View commit details
-
Copy full SHA for 8fa856b - Browse repository at this point
Copy the full SHA 8fa856bView commit details -
PHP 8.0 | Collection::parameterTypeTokens[BC](): add support for unio…
…n types Includes adjusted unit test.
Configuration menu - View commit details
-
Copy full SHA for ea70634 - Browse repository at this point
Copy the full SHA ea70634View commit details -
Collections: deprecate $propertyTypeTokens in favour of propertyTypeT…
…okens() Deprecate the `$propertyTypeTokens` property in favour of a new `Collections::propertyTypeTokens()` method. PHPCS is expected to introduce a new `T_TYPE_UNION` token. As that token would not always be available, a property can't handle this. In anticipation of the introduction of the new token, I'm deprecating the `Collections::$propertyTypeTokens` property straight away to prevent BC breaks at a later point. Includes adding unit tests for the new method.
Configuration menu - View commit details
-
Copy full SHA for b3f7e68 - Browse repository at this point
Copy the full SHA b3f7e68View commit details -
PHP 8.0 | Collection::propertyTypeTokens[BC](): add support for union…
… types Includes adjusted unit test.
Configuration menu - View commit details
-
Copy full SHA for 27d5bed - Browse repository at this point
Copy the full SHA 27d5bedView commit details -
Collections: deprecate $returnTypeTokens in favour of returnTypeTokens()
Deprecate the `$returnTypeTokens` property in favour of a new `Collections::returnTypeTokens()` method. PHPCS is expected to introduce a new `T_TYPE_UNION` token. As that token would not always be available, a property can't handle this. In anticipation of the introduction of the new token, I'm deprecating the `Collections::$returnTypeTokens` property straight away to prevent BC breaks at a later point. Includes adding unit tests for the new method.
Configuration menu - View commit details
-
Copy full SHA for 311a2d5 - Browse repository at this point
Copy the full SHA 311a2d5View commit details -
PHP 8.0 | Collection::returnTypeTokens[BC](): add support for union t…
…ypes In addition to the other tokens needed to support union types, the `returnTypeTokens[BC]()` methods also needs the `T_ARRAY` token as the `array` keyword in union type return types is not always correctly re-tokenized to `T_STRING`. A change to the PHPCS tokenizer to mitigate this will be pulled upstream, but until that PR has been merged, `T_ARRAY` will continue to be needed. This changes the versions supported by the `returnTypeTokens()` method from "minimum PHPCS 3.5.4" to "minimum 3.3.0", which also brings the method more in line with the `parameterTypeTokens()` and the `propertyTypeTokens()` methods. Includes adjusted unit tests.
Configuration menu - View commit details
-
Copy full SHA for 9158cc7 - Browse repository at this point
Copy the full SHA 9158cc7View commit details -
FunctionDeclarations::getParameters(): add support for PHP 8 "union" …
…types This commit adds support for union types 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 extensive unit tests. Ref: https://wiki.php.net/rfc/union_types_v2
Configuration menu - View commit details
-
Copy full SHA for fb18be6 - Browse repository at this point
Copy the full SHA fb18be6View commit details -
FunctionDeclarations::getProperties(): add tests verifying support fo…
…r PHP 8 "union" types The commit which added union type support to the `Collections::returnTypeTokens[BC]()` methods implicitly added support for union types to the `FunctionDeclarations::getProperties()` method. This commit adds extensive unit tests to safeguard this support. The same commit also _silently_ added support for union types to the `BCFile::getMethodProperties()` method. Union types are not supported yet in PHPCS itself and until they are, the fact that the `BCFile::getMethodProperties()` method supports them should be regarded as an artefact and not as official support.
Configuration menu - View commit details
-
Copy full SHA for 6584ce4 - Browse repository at this point
Copy the full SHA 6584ce4View commit details -
Variables::getMemberProperties(): add tests verifying support for PHP…
… 8 "union" types The commit which added union type support to the `Collections::propertyTypeTokens[BC]()` methods implicitly added support for union types to the `Variables::getMemberProperties()` method. This commit adds extensive unit tests to safeguard this support. The same commit also _silently_ added support for union types to the `BCFile::getMemberProperties()` method. Union types are not supported yet in PHPCS itself and until they are, the fact that the `BCFile::getMemberProperties()` method supports them should be regarded as an artefact and not as official support.
Configuration menu - View commit details
-
Copy full SHA for d00a5b7 - Browse repository at this point
Copy the full SHA d00a5b7View commit details -
FunctionDeclarations::isArrowFunction(): add tests verifying support …
…for union types Adds tests, same as wil be pulled upstream, to the tests for the `FunctionDeclarations::isArrowFunction()` and the `FunctionDeclarations::getArrowFunctionOpenClose()` methods to verify and safeguard support for arrow functions using union type declarations.
Configuration menu - View commit details
-
Copy full SHA for 6b3bbef - Browse repository at this point
Copy the full SHA 6b3bbefView commit details -
Configuration menu - View commit details
-
Copy full SHA for 38ad2b0 - Browse repository at this point
Copy the full SHA 38ad2b0View commit details