e107_handlers/admin_ui.php
File admin_ui.php
has 5070 lines of code (exceeds 2000 allowed). Consider refactoring. Open
Open
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2012 e107 Inc (e107.org)
Method _modifyListQrySearch
has 16 arguments (exceeds 7 allowed). Consider refactoring. Open
Open
public function _modifyListQrySearch($listQry, $searchTerm, $filterOptions, string $tablePath, string $tableFrom, string $primaryName, $raw, $orderField, $qryAsc, $forceFrom, int $qryFrom, $forceTo, int $perPage, $qryField, $isfilter, $handleAction)
Consider simplifying this complex logical expression. Open
Open
if($field['type'] === 'method' && !empty($field['data']) && ($field['data'] === 'string' || $field['data'] === 'str' || $field['data'] === 'safestr' || $field['data'] === 'int'))
{
$searchable_types[] = 'method';
}
Avoid too many return
statements within this method. Open
Open
return $this;
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return $this;
Avoid too many return
statements within this method. Open
Open
return $this;
Avoid too many return
statements within this method. Open
Open
return $this;
Avoid too many return
statements within this method. Open
Open
return $this;
Avoid too many return
statements within this method. Open
Open
return $this;
Avoid too many return
statements within this method. Open
Open
return $this;
Avoid too many return
statements within this method. Open
Open
return $this;
Suspicious array access to ?mixed
Open
Open
$var[$key]['link'] .= '&tab=' .$val['tab'];
- Exclude checks
Returning type void
but doAfterSubmit()
is declared to return null
Open
Open
return;
- Exclude checks
Call with 2 arg(s) to \e_model::save()
which only takes 0 arg(s) defined at /code/e107_handlers/model_class.php:1675
Open
Open
$check = $this->getModel()->setData($node->getData())->save(false, true);
- Exclude checks
Returning type void
but ListDeleteTrigger()
is declared to return null
Open
Open
return;
- Exclude checks
Returning type null
but SortAjaxPage()
is declared to return void
Open
Open
return null;
- Exclude checks
Call to undeclared method \e_db::hasLanguage
Open
Open
$val = e107::getDb()->hasLanguage($curTable, true);
- Exclude checks
Argument 2 (vals)
is 6
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
'nmonth6' => $tp->lanVars(LAN_UI_FILTER_NEXT_XMONTHS,6),
- Exclude checks
Reference to undeclared constant \LAN_MANAGE
Open
Open
'main/edit' => LAN_MANAGE,
- Exclude checks
Suspicious array access to ?mixed
Open
Open
if(varset($val['tab']))
- Exclude checks
Default value for object
$prefix
can't be false
Open
Open
public function getTableName($alias = false, $prefix = false)
- Exclude checks
Argument 2 (className)
is null
but \e107::getAddonConfig()
takes string
defined at /code/e107_handlers/e107_class.php:2962
Open
Open
e107::getAddonConfig('e_admin',null,'process', $this, $id);
- Exclude checks
Invalid offset "options"
of array type array{}
Open
Open
$opts = $this->fields['options'];
- Exclude checks
Declaration of function getPrimaryName() : false
should be compatible with function getPrimaryName() : string
defined in /code/e107_handlers/admin_ui.php:3178
Open
Open
public function getPrimaryName()
- Exclude checks
Reference to undeclared property \e_db->mySQLlanguage
Open
Open
$lang = e107::getDb()->mySQLlanguage;
- Exclude checks
Argument 4 (options)
is array{class:'ui-batch-option class',other:'style="padding-left: 15px"'}
but \e_admin_form_ui::option()
takes string
defined at /code/e107_handlers/form_handler.php:3604
Open
Open
array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '';
- Exclude checks
Argument 2 (vals)
is 9
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
'month9' => $tp->lanVars(LAN_UI_FILTER_PAST_XMONTHS,9),
- Exclude checks
Reference to undeclared property \e_admin_controller_ui->_prefs
(Did you mean expr->prefs or expr->_pref) Open
Open
$this->_prefs = $config; // XXX Discuss.
- Exclude checks
Call to undeclared method \e_admin_controller_ui::handleCommaBatch
Open
Open
$this->handleCommaBatch($selected, $field, array_keys($classes), $trigger[0] === 'ucdelall' ? 'clearAll' : 'addAll');
- Exclude checks
Argument 2 (vals)
is int
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
$legend = e107::getParser()->lanVars(LAN_UI_EDIT_LABEL, $controller->getId()); // sprintXXX(LAN_UI_EDIT_LABEL, $controller->getId());
- Exclude checks
Argument 2 (vals)
is 3
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
'month3' => $tp->lanVars(LAN_UI_FILTER_PAST_XMONTHS,3),
- Exclude checks
Argument 2 (fields)
is true
but \e_db::retrieve()
takes string
defined at /code/e107_handlers/e_db_interface.php:153
Open
Open
$row = $sql->retrieve($query,true);
- Exclude checks
Returning type null
but handleListSearchfieldFilter()
is declared to return string
Open
Open
return null;
- Exclude checks
Property \e_admin_controller_ui->listQrySql
has undeclared type \additional
Open
Open
protected $listQrySql = array();
- Exclude checks
Returning type void
but doAfterSubmit()
is declared to return null
Open
Open
return;
- Exclude checks
Returning type void
but doAfterSubmit()
is declared to return null
Open
Open
return;
- Exclude checks
Argument 2 (className)
is null
but \e107::getAddonConfig()
takes string
defined at /code/e107_handlers/e107_class.php:2962
Open
Open
$tmp = e107::getAddonConfig('e_admin', null, 'config', $this);
- Exclude checks
Returning type void
but ListBatchTrigger()
is declared to return null
Open
Open
return; // always break on cancel!
- Exclude checks
Argument 2 (vals)
is 0
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
$caption = e107::getParser()->lanVars(LAN_UI_BATCH_BOOL_SUCCESS, $c, true);
- Exclude checks
Argument 4 (options)
is array{class:'ui-batch-option class',other:'style="padding-left: 15px"'}
but \e_admin_form_ui::option()
takes string
defined at /code/e107_handlers/form_handler.php:3604
Open
Open
$selectOpt .= $this->option($val, $key, false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"'));
- Exclude checks
Argument 2 (vals)
is 3
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
'nmonth3' => $tp->lanVars(LAN_UI_FILTER_NEXT_XMONTHS,3),
- Exclude checks
Call to deprecated function \getperms()
defined at /code/class2.php:1322
Open
Open
if(isset($val['perm']) && $val['perm']!=='' && !getperms($val['perm']))
- Exclude checks
Argument 3 (exclude_query)
is true
but \e_admin_controller::redirect()
takes array|string
defined at /code/e107_handlers/admin_ui.php:2464
Open
Open
$this->redirect($action, $mode, true, $query, $path);
- Exclude checks
Call with 2 arg(s) to \e_model::save()
which only takes 0 arg(s) defined at /code/e107_handlers/model_class.php:1675
Open
Open
$check = $this->getModel()->setData($node->getData())->save(false, true);
- Exclude checks
Call with 2 arg(s) to \e_model::save()
which only takes 0 arg(s) defined at /code/e107_handlers/model_class.php:1675
Open
Open
$check = $this->getModel()->setData($node->getData())->save(false, true);
- Exclude checks
Assigning null
to property but \e_admin_ui->_model
is \e_admin_model
Open
Open
$this->_model = null;
- Exclude checks
Call to undeclared method \e_object::loadBatch
Open
Open
$this->getTreeModel()->setParam('db_query', $this->_modifyListQry(false, false, 0, false, $this->listQry))->loadBatch();
- Exclude checks
Argument 1 (number)
is bool|string
but \number_format()
takes float|int
Open
Open
<div id='admin-ui-list-total-records' class='span6 col-md-6 right'><span>".e107::getParser()->lanVars(LAN_UI_TOTAL_RECORDS,number_format($this->getController()->getTreeModel()->getTotal())). '</span></div>
- Exclude checks
Default value for bool
$glue
can't be string
Open
Open
public function getHeaderContent($reset = true, $glue = "\n\n")
- Exclude checks
Argument 1 (request_string)
is ?array|?string
but \e_admin_request::__construct()
takes null|string
defined at /code/e107_handlers/admin_ui.php:102
Open
Open
$request = new e_admin_request($request);
- Exclude checks
Call to undeclared method \e_admin_controller_ui::handleCommaBatch
Open
Open
$this->handleCommaBatch($selected, $field, $value, $trigger[0]);
- Exclude checks
Argument 2 (replace)
is int
but \str_replace()
takes array|string
Open
Open
$choice = explode('|', str_replace('{ID}', $id, $choice), 3);
- Exclude checks
Argument 2 (prefix)
is true
but \e_admin_controller_ui::getTableName()
takes false|object
defined at /code/e107_handlers/admin_ui.php:3332
Open
Open
$tableFrom = '`'.$this->getTableName(false, true).'`'.($this->getTableName(true) ? ' AS '.$this->getTableName(true) : '');
- Exclude checks
Call to undeclared method \e_admin_controller_ui::handleCommaBatch
Open
Open
$this->handleCommaBatch($selected, $field, $class, $trigger[0]);
- Exclude checks
Return type of _modifyListQrySearch()
is undeclared type \Custom
Open
Open
public function _modifyListQrySearch($listQry, $searchTerm, $filterOptions, string $tablePath, string $tableFrom, string $primaryName, $raw, $orderField, $qryAsc, $forceFrom, int $qryFrom, $forceTo, int $perPage, $qryField, $isfilter, $handleAction)
- Exclude checks
Argument 2 (value)
is ?'\'\''|?string
but \e_admin_tree_model::batchUpdate()
takes string
defined at /code/e107_handlers/model_class.php:4019
Open
Open
$cnt = $this->getTreeModel()->batchUpdate($field, $val, $selected, true, false);
- Exclude checks
Argument 2 (_posted)
is null
but \e_admin_ui::triggerEvent()
takes array
defined at /code/e107_handlers/admin_ui.php:4707
Open
Open
if($halt = $this->triggerEvent($triggerName, null, $data, $id))
- Exclude checks
Call to undeclared method \e_db::hasLanguage
Open
Open
if($curTable != e107::getDb()->hasLanguage($curTable))
- Exclude checks
Argument 2 (total)
is bool|string
but \e_admin_form_ui::pagination()
takes int
defined at /code/e107_handlers/form_handler.php:2262
Open
Open
return $this->pagination(e_REQUEST_SELF.'?'.$paginate,$totalRecords,$fromPage,$perPage,array('template'=>'basic'));
- Exclude checks
Assigning array{}
to property but \e_admin_response->_title
is \unknown_type
Open
Open
protected $_title = array();
- Exclude checks
Assigning false
to property but \e_admin_controller_ui->formQuery
is \e_admin_model
Open
Open
protected $formQuery = false; // custom form post query
- Exclude checks
Returning type void
but ListDeleteTrigger()
is declared to return null
Open
Open
return; // User confirmation expected
- Exclude checks
Argument 2 (_posted)
is null
but \e_admin_ui::triggerEvent()
takes array
defined at /code/e107_handlers/admin_ui.php:4707
Open
Open
$this->triggerEvent($triggerName, null, $data, $id);
- Exclude checks
When appending to a value of type array{},
found an array access index of type null,
but expected the index to be of type int|string
Open
Open
$forms[$id] = array(
- Exclude checks
Argument 4 (options)
is array{class:'ui-batch-option class',other:'style="padding-left: 15px"'}
but \e_admin_form_ui::option()
takes string
defined at /code/e107_handlers/form_handler.php:3604
Open
Open
array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '';
- Exclude checks
Argument 4 (options)
is array{class:'ui-batch-option class',other:'style="padding-left: 15px"'}
but \e_admin_form_ui::option()
takes string
defined at /code/e107_handlers/form_handler.php:3604
Open
Open
array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '';
- Exclude checks
Assigning string
to property but \e_admin_request->_id
is int
Open
Open
$this->_id = preg_replace('/[^\w\-:\.]/', '', $this->_request_qry[$this->_id_key]);
- Exclude checks
Property \e_admin_response->_title
has undeclared type \unknown_type
Open
Open
protected $_title = array();
- Exclude checks
Assigning array{}
to property but \e_admin_controller_ui->listQrySql
is \additional
Open
Open
protected $listQrySql = array();
- Exclude checks
Suspicious array access to ?mixed
Open
Open
if($attributes['data'] !== false)
- Exclude checks
Returning type void
but ListDeleteTrigger()
is declared to return null
Open
Open
return; // always break on cancel!
- Exclude checks
Argument 2 (tree_models)
is array<string>|array<string>|array<string>|array<string>|array<string>|array<string>|array<string>|array{}</string></string></string></string></string></string></string>
but \e_admin_form_ui::renderListForm()
takes \e_admin_tree_model
defined at /code/e107_handlers/form_handler.php:7397
Open
Open
return $this->renderListForm($options, $tree, $ajax);
- Exclude checks
Argument 4 (options)
is array{class:'ui-batch-option class',other:'style="padding-left: 15px"'}
but \e_admin_form_ui::option()
takes string
defined at /code/e107_handlers/form_handler.php:3604
Open
Open
array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '';
- Exclude checks
Assigning array{}
to property but \e_admin_dispatcher->adminMenuAliases
is string
Open
Open
protected $adminMenuAliases = array();
- Exclude checks
Assigning array{main/edit:mixed}
to property but \e_admin_dispatcher->pageTitles
is string
Open
Open
protected $pageTitles = array(
- Exclude checks
Default value for string
$title
can't be true
Open
Open
public function addTitle($title = true, $meta = true)
- Exclude checks
Invalid operator: left operand of +
is bool|resource
(expected array or number) Open
Open
$incVal = e107::getDb()->max($this->table, $this->sortField) + 1;
- Exclude checks
Saw an @param annotation for var,
but it was not found in the param list of function _isSearchField($field, string $searchQuery) : bool
Open
Open
* @param array $var
- Exclude checks
Call with 2 arg(s) to \e_model::save()
which only takes 0 arg(s) defined at /code/e107_handlers/model_class.php:1675
Open
Open
$this->getModel()->setData($data)->save(false,true);
- Exclude checks
Argument 2 (vals)
is int
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
$caption = e107::getParser()->lanVars(LAN_UI_BATCH_REVERSED_SUCCESS, $cnt, true);
- Exclude checks
Argument 3 (pid)
is false
but \e_admin_form_ui::setAdminAddonModel()
takes string
defined at /code/e107_handlers/admin_ui.php:7482
Open
Open
$this->setAdminAddonModel($tree[$id], array_keys($fields), $pid);
- Exclude checks
Argument 2 (mode)
is null
but \e_admin_controller::redirect()
takes string
defined at /code/e107_handlers/admin_ui.php:2464
Open
Open
$this->redirect($action, null, $exclude_query, $merge_query);
- Exclude checks
Property \e_admin_controller_ui->filterQry
has undeclared type \Custom
Open
Open
protected $filterQry;
- Exclude checks
Expected @param annotation for qryField
to be before the @param annotation for isfilter
Open
Open
* @param $isfilter
- Exclude checks
Assigning null
to property but \e_admin_ui->_model
is \e_admin_model
Open
Open
$this->_model = null;
- Exclude checks
Argument 2 (type)
is 'deleted'
but \e_admin_ui::getEventTriggerName()
takes null
defined at /code/e107_handlers/admin_ui.php:4769
Open
Open
if($triggerName = $this->getEventTriggerName($this->getEventName(), 'deleted')) // trigger for after.
- Exclude checks
Method \e_admin_ui::renderHelp
is declared to return string
but has no return value Open
Open
public function renderHelp()
- Exclude checks
Argument 4 (options)
is array{class:'ui-batch-option class',other:'style="padding-left: 15px"'}
but \e_admin_form_ui::option()
takes string
defined at /code/e107_handlers/form_handler.php:3604
Open
Open
array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"')) : '';
- Exclude checks
Default value for bool
$return
can't be string
Open
Open
public function run($run_header = true, $return = 'render')
- Exclude checks
Argument 2 (type)
is 'delete'
but \e_admin_ui::getEventTriggerName()
takes null
defined at /code/e107_handlers/admin_ui.php:4769
Open
Open
if($triggerName = $this->getEventTriggerName($this->getEventName(),'delete')) // trigger for before.
- Exclude checks
Call to undeclared method \e_object::loadBatch
Open
Open
$this->getTreeModel()->setParam('db_query', $this->_modifyListQry(false, false, false, false, $this->listQry))->loadBatch();
- Exclude checks
Argument 2 (vals)
is 9
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
'nmonth9' => $tp->lanVars(LAN_UI_FILTER_NEXT_XMONTHS,9),
- Exclude checks
Return type of _modifyListQry()
is undeclared type \Custom
Open
Open
protected function _modifyListQry($raw = false, $isfilter = false, $forceFrom = false, $forceTo = false, $listQry = '')
- Exclude checks
Returning type void
but GridBatchTrigger()
is declared to return null
Open
Open
return; // always break on cancel!
- Exclude checks
Argument 4 (options)
is array{class:'ui-batch-option class',other:'style="padding-left: 15px"'}
but \e_admin_form_ui::option()
takes string
defined at /code/e107_handlers/form_handler.php:3604
Open
Open
$selectOpt .= $this->option($v, $k, false, array('class' => 'ui-batch-option class', 'other' => 'style="padding-left: 15px"'));
- Exclude checks
Call to undeclared method \e_object::loadBatch
Open
Open
$this->getTreeModel()->setParam('db_query', $this->_modifyListQry(false, false, false, false, $this->listQry))->loadBatch();
- Exclude checks
Argument 2 (vals)
is 6
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
'month6' => $tp->lanVars(LAN_UI_FILTER_PAST_XMONTHS,6),
- Exclude checks
Variable $res
was undeclared, but array fields are being added to it. Open
Open
$res['caption'] = $data[$search];
- Exclude checks
array to string
conversion Open
Open
e107::getMessage()->addDebug('Searching for custom batch method: ' .$method. '(' .$selected. ',' .$value. ')');
- Exclude checks
Argument 2 (vals)
is int
but \e_parse::lanVars()
takes array|string
defined at /code/e107_handlers/e_parse_class.php:3842
Open
Open
$caption = e107::getParser()->lanVars(LAN_UI_BATCH_BOOL_SUCCESS, $cnt, true);
- Exclude checks
Call to undeclared method \e_object::loadBatch
Open
Open
$this->getTreeModel()->setParam('db_query', $this->_modifyListQry(false, false, false, false, $this->listQry))->loadBatch(true);
- Exclude checks