for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Apps\Controller\Admin;
use Apps\Model\Admin\Newcontent\FormSettings;
use Extend\Core\Arch\AdminController;
use Ffcms\Core\App;
/**
* Class Newcontent. Admin controller of new content widget.
* @package Apps\Controller\Admin
*/
class Newcontent extends AdminController
{
const VERSION = '1.0.1';
public $type = 'widget';
* Show widget settings
* @return string
* @throws \Ffcms\Core\Exception\SyntaxException
public function actionIndex(): ?string
// init settings model
$model = new FormSettings($this->getConfigs());
// check if request is submited
if ($model->send() && $model->validate()) {
$this->setConfigs($model->getAllProperties());
$model->getAllProperties()
Ffcms\Core\Arch\Model::getAllProperties()
This check looks for function or method calls that always return null and whose return value is used.
class A { function getObject() { return null; } } $a = new A(); if ($a->getObject()) {
The method getObject() can return nothing but null, so it makes no sense to use the return value.
getObject()
The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.
App::$Session->getFlashBag()->add('success', __('Settings is successful updated'));
}
// render viewer
return $this->view->render('newcontent/index', [
'model' => $model
]);
This check looks for function or method calls that always return null and whose return value is used.
The method
getObject()
can return nothing but null, so it makes no sense to use the return value.The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.