Code Duplication    Length = 4-7 lines in 2 locations

src/PhpSpreadsheet/Reader/Xlsx.php 2 locations

@@ 1031-1034 (lines=4) @@
1028
                                            }
1029
                                            //    Standard filters are always an OR join, so no join rule needs to be set
1030
                                            //    Entries can be either filter elements
1031
                                            foreach ($filters->filter as $filterRule) {
1032
                                                //    Operator is undefined, but always treated as EQUAL
1033
                                                $column->createRule()->setRule(null, (string) $filterRule['val'])->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_FILTER);
1034
                                            }
1035
                                            //    Or Date Group elements
1036
                                            foreach ($filters->dateGroupItem as $dateGroupItem) {
1037
                                                $column->createRule()->setRule(
@@ 1062-1068 (lines=7) @@
1059
                                            if ((isset($customFilters['and'])) && ($customFilters['and'] == 1)) {
1060
                                                $column->setJoin(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column::AUTOFILTER_COLUMN_JOIN_AND);
1061
                                            }
1062
                                            foreach ($customFilters->customFilter as $filterRule) {
1063
                                                $column->createRule()->setRule(
1064
                                                    (string) $filterRule['operator'],
1065
                                                    (string) $filterRule['val']
1066
                                                )
1067
                                                ->setRuleType(\PhpOffice\PhpSpreadsheet\Worksheet\AutoFilter\Column\Rule::AUTOFILTER_RULETYPE_CUSTOMFILTER);
1068
                                            }
1069
                                        }
1070
                                        //    Check for dynamic filters
1071
                                        if ($filterColumn->dynamicFilter) {