web/organization/controllers/my/MemberAction.php
Method run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function run($org)
{
$organization = Module::getOrganization($org);
$user = Yii::$app->user->identity;
static::checkAccess($organization, $user);
Avoid using static access to class '\rhosocial\organization\web\organization\Module' in method 'run'. Open
Open
$organization = Module::getOrganization($org);
- Read upRead up
- Exclude checks
StaticAccess
Since: 1.4.0
Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.
Example
class Foo
{
public function bar()
{
Bar::baz();
}
}
Source https://phpmd.org/rules/cleancode.html#staticaccess
Line exceeds 120 characters; contains 121 characters Open
Open
* The organization is null or new record, it will be considered as invalid. If so, the OrganizationNotFoundException
- Exclude checks