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\Search\FormSettings;
use Extend\Core\Arch\AdminController;
use Ffcms\Core\App;
/**
* Class Search. Admin configuration controller for search app.
* @package Apps\Controller\Admin
*/
class Search extends AdminController
{
const VERSION = '1.0.1';
public $type = 'app';
* Show search settings
* @return string
* @throws \Ffcms\Core\Exception\SyntaxException
public function actionIndex()
// initialize model and pass configs inside
$model = new FormSettings($this->getConfigs());
// check if submit request is sended
if ($model->send()) {
if ($model->validate()) {
// save configurations
$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'));
$this->response->redirect('search/index');
} else {
App::$Session->getFlashBag()->add('error', __('Form validation is failed'));
}
// render output view
return $this->view->render('search/settings', [
'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.