Missing class import via use statement (line '59', column '14'). Open
throw new \Api\Core\Exception('Invalid data access', 401);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '50', column '20'). Open
$userData = (new \App\Db\Query())
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Avoid using static access to class '\App\Db' in method 'checkPermission'. Open
$db = \App\Db::getInstance('webservice');
- 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
Avoid using static access to class '\App\User' in method 'checkPermission'. Open
\App\User::setCurrentUserId($userData['user_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
Possibly zero references to use statement for classlike/namespace OA
(\OpenApi\Annotations)
Open
use OpenApi\Annotations as OA;
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
$db->createCommand()->update($userTable, ['login_time' => date('Y-m-d H:i:s')], ['id' => $userData['id']])->execute();
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$userData = (new \App\Db\Query())
- Exclude checks
Call to method setCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
\App\User::setCurrentUserId($userData['user_id']);
- Exclude checks
Avoid variables with short names like $db. Configured minimum length is 3. Open
$db = \App\Db::getInstance('webservice');
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Spaces must be used for alignment; tabs are not allowed Open
* url="https://yetiforce.com/"
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
->where([
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$db->createCommand()->update($userTable, ['login_time' => date('Y-m-d H:i:s')], ['id' => $userData['id']])->execute();
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
public function updateSession(array $data = []): void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\Contact(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Demo server of the latest stable version",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
{
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* title="YetiForce API for SMS. Type: SMS",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* version="0.1",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
protected function checkPermission(): void
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'server_id' => $this->controller->app['id'],
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* termsOfService="https://yetiforce.com/",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
->from($userTable)
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
\App\User::setCurrentUserId($userData['user_id']);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* email="devs@yetiforce.com",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* ),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* url="https://gitdeveloper.yetiforce.com",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'token' => $this->controller->request->getByType('x-token', \App\Purifier::ALNUM),
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
if (!$userData) {
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$db = \App\Db::getInstance('webservice');
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$userTable = 'w_#__sms_user';
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
->limit(1)->one($db);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$this->setAllUserData($userData);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
'status' => 1,
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
$userData = (new \App\Db\Query())
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
throw new \Api\Core\Exception('Invalid data access', 401);
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* @OA\License(
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
])
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
}
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* name="Devs API Team",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* description="Demo server of the development version",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* url="https://gitstable.yetiforce.com",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* name="YetiForce Public License",
- Exclude checks
Spaces must be used for alignment; tabs are not allowed Open
* url="https://yetiforce.com/en/yetiforce/license"
- Exclude checks
Line exceeds 120 characters; contains 126 characters Open
$db->createCommand()->update($userTable, ['login_time' => date('Y-m-d H:i:s')], ['id' => $userData['id']])->execute();
- Exclude checks