mirror of
https://github.com/parsecsv/parsecsv-for-php.git
synced 2026-02-19 08:36:39 +00:00
_validate_row_conditions readability
This commit is contained in:
@@ -881,11 +881,14 @@ class parseCSV {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate a row against specified conditions
|
* Validate a row against specified conditions
|
||||||
|
*
|
||||||
|
* @access public
|
||||||
* @param row array with values from a row
|
* @param row array with values from a row
|
||||||
* @param conditions specified conditions that the row must match
|
* @param conditions specified conditions that the row must match
|
||||||
|
*
|
||||||
* @return true of false
|
* @return true of false
|
||||||
*/
|
*/
|
||||||
function _validate_row_conditions ($row = array(), $conditions = null) {
|
public function _validate_row_conditions ($row = array(), $conditions = null) {
|
||||||
if ( !empty($row) ) {
|
if ( !empty($row) ) {
|
||||||
if ( !empty($conditions) ) {
|
if ( !empty($conditions) ) {
|
||||||
$conditions = (strpos($conditions, ' OR ') !== false) ? explode(' OR ', $conditions) : array($conditions) ;
|
$conditions = (strpos($conditions, ' OR ') !== false) ? explode(' OR ', $conditions) : array($conditions) ;
|
||||||
@@ -905,10 +908,13 @@ class parseCSV {
|
|||||||
$or .= $this->_validate_row_condition($row, $value);
|
$or .= $this->_validate_row_condition($row, $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (strpos($or, '1') !== false) ? true : false ;
|
return (strpos($or, '1') !== false) ? true : false ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user