Skip to content

Conversation

@jrfnl
Copy link
Member

@jrfnl jrfnl commented Dec 25, 2022

NewParamTypeDeclarations: various minor doc fixes

NewParamTypeDeclarations: remove redundant try/catch

The try-catch is no longer needed now support for PHPCS < 3.7.1 has been dropped.

PHP 8.0 | NewParamTypeDeclarations: add support for union types [1]

  • Add tests with union types.
  • Add the new false and null types to the $newTypes array.
  • Explode the type received from the FunctionDeclarations::getParameters() method on the | bitwise or operator and do the existing checks for each type found.

This maintains the existing behaviour, while allowing for union types.

PHP 8.0 | NewParamTypeDeclarations: add support for union types [2]

Union Types

Support for union types has been added.

Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported.

Ref:

PHP 8.0 | NewParamTypeDeclarations: add support for union types [3]

Detect stand-alone false/null types and throw an error when these are encountered.

NewReturnTypeDeclarations: various minor doc fixes

NewReturnTypeDeclarations: remove redundant try/catch

The try-catch is no longer needed now support for PHPCS < 3.7.1 has been dropped.

PHP 8.0 | NewReturnTypeDeclarations: add support for union types [1]

  • Add tests with union types.
  • Add the new false and null types to the $newTypes array.
  • Explode the type received from the FunctionDeclarations::getProperties() method on the | bitwise or operator and do the existing checks for each type found.

This maintains the existing behaviour, while allowing for union types.

PHP 8.0 | NewReturnTypeDeclarations: add support for union types [2]

Union Types

Support for union types has been added.

Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported.

Ref:

PHP 8.0 | NewReturnTypeDeclarations: add support for union types [3]

Detect stand-alone false/null types and throw an error when these are encountered.

NewTypedProperties: various minor doc fixes

PHP 8.0 | NewTypedProperties: add support for union types [1]

  • Add tests with union types.
  • Add the new false and null types to the $newTypes array.
  • Explode the type received from the Variables::getMemberProperties() method on the | bitwise or operator and do the existing checks for each type found.

This maintains the existing behaviour, while allowing for union types.

PHP 8.0 | NewTypedProperties: add support for union types [2]

Union Types

Support for union types has been added.

Detect whether a type is a union type and throw an error if PHP < 8 needs to be supported.

Ref:

PHP 8.0 | NewTypedProperties: add support for union types [3]

Detect stand-alone false/null types and throw an error when these are encountered.

Related to #809

Fixes #1444

jrfnl added 14 commits December 25, 2022 04:41
The `try-catch` is no longer needed now support for PHPCS < 3.7.1 has been dropped.
* Add tests with union types.
* Add the new `false` and `null` types to the `$newTypes` array.
* Explode the type received from the `FunctionDeclarations::getParameters()` method on the `|` bitwise or operator and do the existing checks for each type found.

This maintains the existing behaviour, while allowing for union types.
Detect stand-alone `false`/`null` types and throw an error when these are encountered.
The `try-catch` is no longer needed now support for PHPCS < 3.7.1 has been dropped.
* Add tests with union types.
* Add the new `false` and `null` types to the `$newTypes` array.
* Explode the type received from the `FunctionDeclarations::getProperties()` method on the `|` bitwise or operator and do the existing checks for each type found.

This maintains the existing behaviour, while allowing for union types.
Detect stand-alone `false`/`null` types and throw an error when these are encountered.
* Add tests with union types.
* Add the new `false` and `null` types to the `$newTypes` array.
* Explode the type received from the `Variables::getMemberProperties()` method on the `|` bitwise or operator and do the existing checks for each type found.

This maintains the existing behaviour, while allowing for union types.
Detect stand-alone `false`/`null` types and throw an error when these are encountered.
@wimg wimg merged commit 43caf02 into develop Dec 25, 2022
@wimg wimg deleted the php-8.0/various-support-and-detect-union-types branch December 25, 2022 15:32
@jrfnl jrfnl added the PHP: 8.0 label Nov 4, 2025
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.

3 participants