Code Duplication    Length = 20-20 lines in 2 locations

Persister/PagerPersister.php 1 location

@@ 81-100 (lines=20) @@
78
     * @param array $objects
79
     * @return array
80
     */
81
    protected function filterObjects(array $options, array $objects)
82
    {
83
        if ($options['skip_indexable_check']) {
84
            return $objects;
85
        }
86
87
        $index = $options['indexName'];
88
        $type = $options['typeName'];
89
90
        $return = array();
91
        foreach ($objects as $object) {
92
            if (!$this->indexable->isObjectIndexable($index, $type, $object)) {
93
                continue;
94
            }
95
96
            $return[] = $object;
97
        }
98
99
        return $return;
100
    }
101
}
102

Provider/AbstractProvider.php 1 location

@@ 137-156 (lines=20) @@
134
     *
135
     * @return array
136
     */
137
    protected function filterObjects(array $options, array $objects)
138
    {
139
        if ($options['skip_indexable_check']) {
140
            return $objects;
141
        }
142
143
        $index = $options['indexName'];
144
        $type = $options['typeName'];
145
146
        $return = [];
147
        foreach ($objects as $object) {
148
            if (!$this->indexable->isObjectIndexable($index, $type, $object)) {
149
                continue;
150
            }
151
152
            $return[] = $object;
153
        }
154
155
        return $return;
156
    }
157
158
    /**
159
     * Merges the base options provided by the class with options passed to the populate