-
Notifications
You must be signed in to change notification settings - Fork 259
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
Public methods count #335
Comments
Hi @jakagacic, may I ask you for an example? $examples[] = ['getter', '<?php class A { function getName(): string { return $this->name; } }'];
$examples[] = ['setter', '<?php class A { function setName(string $name): void { $this->name = $name; } }']; |
Hi @UFOMelkor, thank you for your answer. I have testes both of your examples and they work as expected, but the problem seems to be when using types other then the primary ones. For example, this setter is recognized: /**
* @param string $role
*/
public function setRole(string $role)
{
$this->role = $role;
} while this one isn't: /**
* @param Role $role
*/
public function setRole(Role $role)
{
$this->role = $role;
} |
Thank your for your example, I could reproduce the error with them. I will try to find a fix for it tomorrow. |
Hi, I have noticed that the public methods count does not recognize getters and setters when using php7 type declarations for parameters and return types. This makes it very easy to get the following error on a good structured class, with a few private properties:
Blob / God object error
A blob object (or "god class") does not follow the Single responsability principle.
Is there any chance for this to be fixed?
The text was updated successfully, but these errors were encountered: