e107_handlers/model_class.php
File model_class.php
has 2131 lines of code (exceeds 2000 allowed). Consider refactoring. Open
Open
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2010 e107 Inc (e107.org)
Avoid too many return
statements within this method. Open
Open
return $data;
Avoid too many return
statements within this method. Open
Open
return (isset($arr[$index]) ? $arr[$index] : $default);
Avoid too many return
statements within this method. Open
Open
return $default;
Avoid too many return
statements within this method. Open
Open
return $this;
Avoid too many return
statements within this method. Open
Open
return $this->{$data_src}[$key];
Avoid too many return
statements within this method. Open
Open
return $value[$index];
Avoid too many return
statements within this method. Open
Open
return $default;
Avoid too many return
statements within this method. Open
Open
return $default;
array to string
conversion Open
Open
$this->_addData($key.'/'.$k, $v, $override, $data_src);
- Exclude checks
Assigning array{}
to property but \e_model->_field_input_types
is string
Open
Open
protected $_field_input_types = array();
- Exclude checks
Assigning array{}
to property but \e_model->_featurebox
is string
Open
Open
protected $_featurebox = array();
- Exclude checks
Call to method mergePostedData
on non-class type ?array|?mixed
Open
Open
$ret = $value->mergePostedData(false, true, true);
- Exclude checks
Returning type false
but dbInsert()
is declared to return int
Open
Open
return false;
- Exclude checks
Method \e_model::__isset
is declared to return bool
but has no return value Open
Open
public function __isset($key)
- Exclude checks
Default value for \boolen
$from_post
can't be true
Open
Open
public function save($from_post = true, $force = false, $session_messages = false)
- Exclude checks
Assigning array{}
to property but \e_front_model->data_has_changed
is bool|false
Open
Open
$this->data_has_changed = array();
- Exclude checks
Default value for \boolen
$from_post
can't be true
Open
Open
public function save($from_post = true, $force = false, $session_messages = false)
- Exclude checks
Saw misspelled annotation @returns.
Did you mean @return?
Open
Open
* @returns null
- Exclude checks
Assigning null
to property but \e_front_model->_db_errno
is int
Open
Open
$this->_db_errno = null;
- Exclude checks
Argument 1 (node_id)
is string
but \e_tree_model::isNode()
takes int
defined at /code/e107_handlers/model_class.php:3816
Open
Open
if (null !== $node_id && $this->isNode($node_id))
- Exclude checks
Argument 4 (noWhere)
is 'default'
but \e_db::select()
takes bool|false
defined at /code/e107_handlers/e_db_interface.php:265
Open
Open
$this->getModelTable(),
- Exclude checks
Parameter $from_post
has undeclared type \boolen
(Did you mean bool) Open
Open
public function insert($from_post = true, $session_messages = false)
- Exclude checks
Assigning int
to property but \e_tree_model->_total
is bool|false|string
Open
Open
$this->_total = $num;
- Exclude checks
Call to undeclared method \e_model::removePostedData
Open
Open
$this->setData($field, $dt, $strict)
- Exclude checks
Assigning false
to property but \e_tree_model->_total
is string
Open
Open
protected $_total = false;
- Exclude checks
Assigning array{}
to property but \e_model->_url
is string
Open
Open
protected $_url = array();
- Exclude checks
Assigning null
to property but \e_front_model->_validator
is \e_validator
Open
Open
$this->_validator = null;
- Exclude checks
Saw possibly unextractable annotation for a fragment of comment '* @param array &rows The remaining rows that have yet to be converted into children of nodes':
after array,
did not see an element name (will guess based on comment order) Open
Open
* @param array &rows The remaining rows that have yet to be converted into children of nodes
- Exclude checks
Method \e_model::__get
is declared to return mixed
but has no return value Open
Open
public function __get($key)
- Exclude checks
Returning type array{validator_valid_data:array,model_modified_ismodfied:bool,model_modified_data:mixed,posted_data:mixed,model_base_data:mixed,model_base_ismodfied:bool,optional_validation_rules:array,validation_rules:array}
but saveDebug()
is declared to return void
Open
Open
if($return) return $ret;
- Exclude checks
Parameter $from_post
has undeclared type \boolen
(Did you mean bool) Open
Open
public function save($from_post = true, $force = false, $session_messages = false)
- Exclude checks
Returning type false
but dbInsert()
is declared to return int
Open
Open
return false;
- Exclude checks
Suspicious array access to ?mixed
Open
Open
$item['_depth'] = $depth;
- Exclude checks
Saw misspelled annotation @returns.
Did you mean @return?
Open
Open
* @returns null
- Exclude checks
Argument 3 (index)
is int
but \e_front_model::_getData()
takes null
defined at /code/e107_handlers/model_class.php:951
Open
Open
return $this->_getData($key, $default, $index, '_posted_data');
- Exclude checks
Returning type array
but getIfPosted()
is declared to return string
Open
Open
return e107::unserialize($this->getData((string) $key, $default, $index));
- Exclude checks
Saw misspelled annotation @returns.
Did you mean @return?
Open
Open
* @returns null
- Exclude checks
Argument 2 (node_id)
is null
but \e_tree_model::toString()
takes string
defined at /code/e107_handlers/model_class.php:3918
Open
Open
$this->toString(false, null, $this->getParam('nocount') ? false : true),
- Exclude checks
Reference to undeclared property \e_db->total_results
Open
Open
$this->_total = $sql->total_results = false;
- Exclude checks
Returning type bool|false|string
but countResults()
is declared to return int
Open
Open
return $this->_total;
- Exclude checks
Returning type array
but getRowsList()
is declared to return false
Open
Open
return $sql->rows();
- Exclude checks
Parameter $from_post
has undeclared type \boolen
(Did you mean bool) Open
Open
public function save($from_post = true, $force = false, $session_messages = false)
- Exclude checks
Argument 1 (str)
is null
but \e_front_model::setCacheString()
takes string
defined at /code/e107_handlers/model_class.php:1664
Open
Open
return parent::setCacheString($str);
- Exclude checks
Argument 1 (node_id)
is string
but \e_tree_model::getNode()
takes int
defined at /code/e107_handlers/model_class.php:3786
Open
Open
return $this->getNode($node_id)->toString($AddSlashes);
- Exclude checks
Argument 3 (index)
is int
but \e_model::_getData()
takes null
defined at /code/e107_handlers/model_class.php:951
Open
Open
return $this->_getData($key, $default, $index);
- Exclude checks
Argument 2 (session)
is null
but \e_front_model::addMessageDebug()
takes bool|false
defined at /code/e107_handlers/model_class.php:1430
Open
Open
$this->addMessageDebug('SQL Qry: '.print_a($qry,true), null);
- Exclude checks
Default value for \boolen
$from_post
can't be true
Open
Open
public function insert($from_post = true, $session_messages = false)
- Exclude checks
Declaration of function delete(mixed $ids, bool|true $destroy = null, bool|false $session_messages = null) : int
should be compatible with function delete($ids, bool|mixed $destroy = null, mixed $session_messages = null) : void
defined in /code/e107_handlers/model_class.php:3943
Open
Open
public function delete($ids, $destroy = true, $session_messages = false)
- Exclude checks
Argument 1 (node_id)
is string
but \e_admin_tree_model::getNode()
takes int
defined at /code/e107_handlers/model_class.php:3786
Open
Open
call_user_func(array($this->getNode(trim($id)), 'destroy')); // first call model destroy method if any
- Exclude checks
Argument 1 (url)
is array
but \e_model::setUrl()
takes string
defined at /code/e107_handlers/model_class.php:615
Open
Open
if($this->getUrl()) $model->setUrl($this->getUrl()); // copy url config data if available
- Exclude checks
Returning type false
but export()
is declared to return null
Open
Open
return false;
- Exclude checks
Call to undeclared method \e_db::db_CopyRow
Open
Open
$res = $sql->db_CopyRow($this->getModelTable(), "*", $this->getFieldIdName().' IN ('.$idstr.')');
- Exclude checks
Argument 2 (node)
is null
but \e_admin_tree_model::setNode()
takes \e_model
defined at /code/e107_handlers/model_class.php:3798
Open
Open
$this->setNode($id, null);
- Exclude checks
Argument 1 (xmlprefs)
is null
but \xmlClass::e107Export()
takes array
defined at /code/e107_handlers/xml_class.php:953
Open
Open
e107::getXml()->e107Export(null,$table,null,null, array('file'=>$filename,'query'=>$query));
- Exclude checks