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

ObjectDeclarations::getDeclaredProperties(): improve documentation #641

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions PHPCSUtils/Utils/ObjectDeclarations.php
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,13 @@ public static function getDeclaredEnumCases(File $phpcsFile, $stackPtr)
/**
* Retrieve all properties declared in an OO structure.
*
* Note: interfaces and enums cannot contain properties. This method does not take this into
* account to allow sniffs to flag this kind of incorrect PHP code.
* Notes:
* - Properties declared via PHP 8.0+ contructor property promotion **will** be included
* in the return value.
* However, keep in mind that passing the stack pointer of such a property to the
* {@see Variables::getMemberProperties()} method is not supported.
* - Interfaces and enums cannot contain properties. This method does not take this into
* account to allow sniffs to flag this kind of incorrect PHP code.
*
* @since 1.1.0
*
Expand Down
Loading