src/Parser.php
protected function applyFilters($report, $removeEmpty = true)
    {
        if ((!empty(config("{$this->configBase}.feeds.{$this->feedName}.filters"))) &&
            (is_array(config("{$this->configBase}.feeds.{$this->feedName}.filters")))
        ) {
            $filter_columns = array_filter(config("{$this->configBase}.feeds.{$this->feedName}.filters"));
            foreach ($filter_columns as $column) {
                if (!empty($report[$column])) {
                    unset($report[$column]);
                }
            }
        }

        // No sense in adding empty fields, so we remove them
        if ($removeEmpty) {
            foreach ($report as $field => $value) {
                if ($value == "" && !is_bool($value)) {
                    unset($report[$field]);
                }
            }
        }

        return $report;
    }
protected function applyFilters($report, $removeEmpty = true)
    {
        if ((!empty(config("{$this->configBase}.feeds.{$this->feedName}.filters"))) &&
            (is_array(config("{$this->configBase}.feeds.{$this->feedName}.filters")))
        ) {
            $filter_columns = array_filter(config("{$this->configBase}.feeds.{$this->feedName}.filters"));
            foreach ($filter_columns as $column) {
                if (!empty($report[$column])) {
                    unset($report[$column]);
                }
            }
        }

        // No sense in adding empty fields, so we remove them
        if ($removeEmpty) {
            foreach ($report as $field => $value) {
                if ($value == "" && !is_bool($value)) {
                    unset($report[$field]);
                }
            }
        }

        return $report;
    }
protected function applyFilters ( $ report , $ removeEmpty = true ) { if ( ( ! empty ( config ( "{$this->configBase}.feeds.{$this->feedName}.filters" ) ) ) && ( is_array ( config ( "{$this->configBase}.feeds.{$this->feedName}.filters" ) ) ) ) { $ filter_columns = array_filter ( config ( "{$this->configBase}.feeds.{$this->feedName}.filters" ) ) ; foreach ( $ filter_columns as $ column ) { if ( ! empty ( $ report [ $ column ] ) ) { unset ( $ report [ $ column ] ) ; } } } // No sense in adding empty fields, so we remove them if ( $ removeEmpty ) { foreach ( $ report as $ field => $ value ) { if ( $ value == "" && ! is_bool ( $ value ) ) { unset ( $ report [ $ field ] ) ; } } } return $ report ; }
Filter the unwanted and empty fields from the report.
@param  array   $report      The report that needs filtering base on config elements
@param  boolean $removeEmpty Option to remove empty fields from report, default is true
@return array   $report      The filtered version of the report
Filter the unwanted and empty fields from the report .