Code Duplication    Length = 9-9 lines in 2 locations

lib/Elastica/Query/SpanNear.php 1 location

@@ 24-32 (lines=9) @@
21
     */
22
    public function __construct($clauses = [], $slop = 1, $inOrder = false)
23
    {
24
        if (!empty($clauses)) {
25
            foreach ($clauses as $clause) {
26
                if (!is_subclass_of($clause, AbstractSpanQuery::class)) {
27
                    throw new InvalidException(
28
                        'Invalid parameter. Has to be array or instance of Elastica\Query\SpanQuery'
29
                    );
30
                }
31
            }
32
        }
33
        $this->setParams(['clauses' => $clauses]);
34
        $this->setSlop($slop);
35
        $this->setInOrder($inOrder);

lib/Elastica/Query/SpanOr.php 1 location

@@ 22-30 (lines=9) @@
19
     */
20
    public function __construct($clauses = [])
21
    {
22
        if (!empty($clauses)) {
23
            foreach ($clauses as $clause) {
24
                if (!is_subclass_of($clause, AbstractSpanQuery::class)) {
25
                    throw new InvalidException(
26
                        'Invalid parameter. Has to be array or instance of Elastica\Query\SpanQuery'
27
                    );
28
                }
29
            }
30
        }
31
        $this->setParams(['clauses' => $clauses]);
32
    }
33