Missing class import via use statement (line '45', column '15'). Open
$row = (new \App\Db\Query())->from('vtiger_module_dashboard_widgets')
- 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\Json' in method 'getLastSavedDate'. Open
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- 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\Purifier' in method 'getLastSavedDate'. Open
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- 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\Json' in method 'getContent'. Open
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- 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 'getUserInstance'. Open
->where(['vtiger_links.linktype' => 'DASHBOARDWIDGET', 'vtiger_module_dashboard_widgets.id' => $widgetId, 'vtiger_module_dashboard_widgets.userid' => \App\User::getCurrentUserId()])
- 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\Purifier' in method 'getContent'. Open
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- 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
Call to undeclared method \Vtiger_Notebook_Model::setData
Open
$self->setData($row);
- Exclude checks
Call to undeclared method \App\Db::createCommand
Open
return App\Db::getInstance()->createCommand()->update('vtiger_module_dashboard_widgets', ['data' => $this->get('data')], ['id' => $this->get('id')])->execute();
- Exclude checks
Return type of getUserInstance()
is undeclared type \self
Open
public static function getUserInstance($widgetId)
- Exclude checks
Call to method getCurrentUserId
from undeclared class \App\User
(Did you mean class \Tests\App\User) Open
->where(['vtiger_links.linktype' => 'DASHBOARDWIDGET', 'vtiger_module_dashboard_widgets.id' => $widgetId, 'vtiger_module_dashboard_widgets.userid' => \App\User::getCurrentUserId()])
- Exclude checks
Call to undeclared method \Vtiger_Notebook_Model::get
Open
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- Exclude checks
Class extends undeclared class \Vtiger_Widget_Model
Open
class Vtiger_Notebook_Model extends Vtiger_Widget_Model
- Exclude checks
Call to undeclared method \Vtiger_Notebook_Model::get
Open
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- Exclude checks
Call to undeclared method \App\Db\Query::from
Open
$row = (new \App\Db\Query())->from('vtiger_module_dashboard_widgets')
- Exclude checks
Call to undeclared method \Vtiger_Notebook_Model::get
Open
return App\Db::getInstance()->createCommand()->update('vtiger_module_dashboard_widgets', ['data' => $this->get('data')], ['id' => $this->get('id')])->execute();
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
class Vtiger_Notebook_Model extends Vtiger_Widget_Model
- Exclude checks
The class Vtiger_Notebook_Model is not named in CamelCase. Open
class Vtiger_Notebook_Model extends Vtiger_Widget_Model
{
public function getContent()
{
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Spaces must be used to indent lines; tabs are not allowed Open
public function save(): bool
- Exclude checks
Line exceeds 120 characters; contains 193 characters Open
->where(['vtiger_links.linktype' => 'DASHBOARDWIDGET', 'vtiger_module_dashboard_widgets.id' => $widgetId, 'vtiger_module_dashboard_widgets.userid' => \App\User::getCurrentUserId()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->where(['vtiger_links.linktype' => 'DASHBOARDWIDGET', 'vtiger_module_dashboard_widgets.id' => $widgetId, 'vtiger_module_dashboard_widgets.userid' => \App\User::getCurrentUserId()])
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $data['lastSavedOn'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to get info about widget.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $data['contents'];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
if ($row) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public static function getUserInstance($widgetId)
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->innerJoin('vtiger_links', 'vtiger_links.linkid = vtiger_module_dashboard_widgets.linkid')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return $self;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
->one();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* Function to update the widget.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getContent()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @param int $widgetId
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$self->setData($row);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
* @return \self
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$self = new self();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
public function getLastSavedDate()
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$row = (new \App\Db\Query())->from('vtiger_module_dashboard_widgets')
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
$data = \App\Json::decode(App\Purifier::decodeHtml($this->get('data')));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
return App\Db::getInstance()->createCommand()->update('vtiger_module_dashboard_widgets', ['data' => $this->get('data')], ['id' => $this->get('id')])->execute();
- Exclude checks
Line exceeds 120 characters; contains 168 characters Open
return App\Db::getInstance()->createCommand()->update('vtiger_module_dashboard_widgets', ['data' => $this->get('data')], ['id' => $this->get('id')])->execute();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
}
- Exclude checks
Class name "Vtiger_Notebook_Model" is not in camel caps format Open
class Vtiger_Notebook_Model extends Vtiger_Widget_Model
- Exclude checks