modules/Settings/Companies/views/EditModal.php
Missing class import via use statement (line '66', column '19'). Open
Open
$company = new Settings_Companies_Record_Model();
- 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\Company' in method 'process'. Open
Open
$company = \App\Company::getCompany();
- 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
syntax error, unexpected 'bool' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
Open
Open
protected bool $blurBackground = true;
- Exclude checks
Each class must be in a namespace of at least one level (a top-level vendor name) Open
Open
class Settings_Companies_EditModal_View extends \App\Controller\ModalSettings
- Exclude checks
The class Settings_Companies_EditModal_View is not named in CamelCase. Open
Open
class Settings_Companies_EditModal_View extends \App\Controller\ModalSettings
{
/**
* Registration modal event parameters.
*/
- 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
Open
public const MODAL_EVENT = [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'data' => ['isForced' => true],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
],
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'execution' => 'constant',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'type' => 'modal',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'type' => 'GET',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (!$company) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'name' => 'YetiForceRegistration',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('RECORD_ID', $company['id']);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'url' => [
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
];
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $showFooter = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function process(App\Request $request): void
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer = $this->getViewer($request);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
{
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->view('EditModal.tpl', $request->getModule(false));
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $modalSize = 'modal-full';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected bool $blurBackground = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
'url' => 'index.php?parent=Settings&module=Companies&view=EditModal',
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** @var string The name of the send button. */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $successBtn = 'LBL_SEND';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected bool $draggable = false;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Registration modal event parameters.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/** {@inheritdoc} */
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $pageTitle = 'LBL_YETIFORCE_REGISTRATION';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$company = \App\Company::getCompany();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $modalIcon = 'fas fa-globe';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('RECORD_MODEL', $company);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if (\App\User::getCurrentUserModel()->isAdmin()) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* {@inheritdoc}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public $lockExit = true;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$company = new Settings_Companies_Record_Model();
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('IS_MODAL', true);
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$viewer->assign('EMAIL_URL', Settings_Companies_EmailVerificationModal_View::MODAL_EVENT['url']);
- Exclude checks
Class name "Settings_Companies_EditModal_View" is not in camel caps format Open
Open
class Settings_Companies_EditModal_View extends \App\Controller\ModalSettings
- Exclude checks