api.rho.social/modules/v1/helpers/Client.php
Avoid using static access to class '\common\models\OauthClient' in method 'checkId'. Open
Open
$model = OauthClient::findOne($client_id);
- 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
The parameter $client_secret is not named in camelCase. Open
Open
public static function checkSecret(OauthClient $client, $client_secret)
{
if ($client->client_secret !== $client_secret) {
throw new ForbiddenHttpException("Invalid Client Secret.", 10032);
}
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The parameter $client_id is not named in camelCase. Open
Open
public static function checkId($client_id)
{
$model = OauthClient::findOne($client_id);
if (!$model) {
throw new ForbiddenHttpException("Invalid Client Id.", 10031);
- Read upRead up
- Exclude checks
CamelCaseParameterName
Since: 0.2
It is considered best practice to use the camelCase notation to name parameters.
Example
class ClassName {
public function doSomething($user_name) {
}
}
Source
The variable $client_id is not named in camelCase. Open
Open
public static function checkId($client_id)
{
$model = OauthClient::findOne($client_id);
if (!$model) {
throw new ForbiddenHttpException("Invalid Client Id.", 10031);
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}
Source
The variable $client_secret is not named in camelCase. Open
Open
public static function checkSecret(OauthClient $client, $client_secret)
{
if ($client->client_secret !== $client_secret) {
throw new ForbiddenHttpException("Invalid Client Secret.", 10032);
}
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}