Code Duplication    Length = 15-17 lines in 2 locations

src/Rule/BetweenRule.php 1 location

@@ 112-128 (lines=17) @@
109
110
    /**
111
     */
112
    public function toString(array $options=[])
113
    {
114
        try {
115
            $class = get_called_class();
116
117
            $operator = $class::operator;
118
119
            $stringified_limits = '[' . implode(', ', array_map(function($limit) {
120
                return var_export($limit, true);
121
            }, $this->getValues()) ) .']';
122
123
            return "['{$this->getField()}', '$operator', $stringified_limits]";
124
        }
125
        catch (\LogicException $e) {
126
            return parent::toString();
127
        }
128
    }
129
130
    /**/
131
}

src/Rule/NotInRule.php 1 location

@@ 152-166 (lines=15) @@
149
    /**
150
     * @todo cache support
151
     */
152
    public function toString(array $options=[])
153
    {
154
        try {
155
            $operator = self::operator;
156
157
            $stringified_possibilities = '[' . implode(', ', array_map(function($possibility) {
158
                return var_export($possibility, true);
159
            }, $this->getPossibilities()) ) .']';
160
161
            return "['{$this->getField()}', '$operator', $stringified_possibilities]";
162
        }
163
        catch (\LogicException $e) {
164
            return parent::toString();
165
        }
166
    }
167
168
    /**/
169
}