Skip to content

Comments

Adding support for PHP 7.4 typed properties#52

Draft
mattjanssen wants to merge 1 commit intotebru:masterfrom
mattjanssen:feature/php-7.4-typed-properties
Draft

Adding support for PHP 7.4 typed properties#52
mattjanssen wants to merge 1 commit intotebru:masterfrom
mattjanssen:feature/php-7.4-typed-properties

Conversation

@mattjanssen
Copy link

@mattjanssen mattjanssen commented Sep 11, 2020

Closes #51

Breaking Change: Requires PHP 7.4 (can this be avoided?)

This adds checking of the reflection property type just after checking getter and setter types.

@mattjanssen mattjanssen force-pushed the feature/php-7.4-typed-properties branch 4 times, most recently from 495866c to d4b570b Compare September 11, 2020 12:20
@mattjanssen mattjanssen force-pushed the feature/php-7.4-typed-properties branch from d4b570b to 38dd2a1 Compare September 11, 2020 12:22
}
}

if ($property !== null && $property->getType() !== null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can check to see if $property has the method getType() and support back to 7.1

* @var string
*/
private $city;
private string $city;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd make new mocks for 7.4 that we can combine later

@natebrunette
Copy link
Member

I'd like to wait for a major version change until php 8.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for PHP 7.4 typed properties while type guessing

2 participants