Code Duplication    Length = 20-20 lines in 2 locations

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

Persister/PagerPersister.php 1 location

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