Count SimpleXMLElement with the count method
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
This commit is contained in:
parent
ec22dd707a
commit
54f839f573
@ -192,7 +192,7 @@ class ImportOds extends ImportPlugin
|
||||
continue;
|
||||
}
|
||||
/* Iterate over columns */
|
||||
$cellCount = count($row);
|
||||
$cellCount = $row->count();
|
||||
$a = 0;
|
||||
/** @var SimpleXMLElement $cell */
|
||||
foreach ($row as $cell) {
|
||||
@ -200,7 +200,7 @@ class ImportOds extends ImportPlugin
|
||||
$text = $cell->children('text', true);
|
||||
$cell_attrs = $cell->attributes('office', true);
|
||||
|
||||
if (count($text) != 0) {
|
||||
if ($text->count() != 0) {
|
||||
$attr = $cell->attributes('table', true);
|
||||
$num_repeat = (int) $attr['number-columns-repeated'];
|
||||
$num_iterations = $num_repeat ?: 1;
|
||||
|
||||
@ -237,7 +237,7 @@ class ImportXml extends ImportPlugin
|
||||
/**
|
||||
* Only attempt to analyze/collect data if there is data present
|
||||
*/
|
||||
if ($xml && @count($xml->children())) {
|
||||
if ($xml && $xml->children()->count()) {
|
||||
$data_present = true;
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user