Code Duplication    Length = 7-9 lines in 2 locations

src/Imposter/Stub/Predicate/Predicate.php 1 location

@@ 48-56 (lines=9) @@
45
    /**
46
     * @param string $operator
47
     */
48
    private function setOperator(string $operator)
49
    {
50
        if (!in_array($operator, self::ALLOWED_OPERATORS)) {
51
            throw new \InvalidArgumentException(
52
                "Cannot set predicate operator: operator '$operator' is not allowed. List of allowed operators: " . implode(',', self::ALLOWED_OPERATORS)
53
            );
54
        }
55
        $this->operator = $operator;
56
    }
57
58
    /**
59
     * @param array $fields

src/Imposter/Stub/Response/IsResponse.php 1 location

@@ 169-175 (lines=7) @@
166
    /**
167
     * @param string $mode
168
     */
169
    public function setMode(string $mode)
170
    {
171
        if (!in_array($mode, [self::MODE_TEXT, self::MODE_BINARY])) {
172
            throw new \InvalidArgumentException("Unable to set IsResponse mode; Invalid mode: '$mode'");
173
        }
174
        $this->mode = $mode;
175
    }
176
177
    /**
178
     * @return string