cakephp / cakephp/cakephp-codesniffer
Problems with Property Hooks
Open
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 232
- Forks
- 85
- PR merge metrics
- No merged PRs in 30d
Description
Doing a simple
class ConfigChecker
{
public FTPInterface $ftpCheckObject {
get {
return $this->ftpCheckObject;
}
set(FTPInterface $value) {
$this->ftpCheckObject = $value;
}
}
}
causes the following errors:
--------------------------------------------------------------------------------
FOUND 10 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
10 | ERROR | There must not be more than one property declared per statement
12 | ERROR | Visibility must be declared on property "$this"
12 | ERROR | Scope modifier not specified for member variable "$this"
14 | WARNING | Code after the RETURN statement on line 12 cannot be executed
14 | ERROR | There must not be more than one property declared per statement
14 | ERROR | Visibility must be declared on property "$value"
14 | ERROR | Scope modifier not specified for member variable "$value"
15 | WARNING | Code after the RETURN statement on line 12 cannot be executed
15 | ERROR | There must not be more than one property declared per statement
15 | ERROR | Visibility must be declared on property "$this"
15 | ERROR | Scope modifier not specified for member variable "$this"
15 | ERROR | Scope modifier not specified for member variable "$value"
--------------------------------------------------------------------------------
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the PHP code sample through the repository's checker and compare the reported diagnostics with the expected handling of property hooks. Trace the parsing and property-validation entry points responsible for the listed errors. Done means the sample no longer produces false property and unreachable-code errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100