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

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