Code Duplication    Length = 14-14 lines in 3 locations

src/Ds/Set.php 1 location

@@ 111-124 (lines=14) @@
108
     * @return bool true if at least one value was provided and the set
109
     *              contains all given values, false otherwise.
110
     */
111
    public function contains(...$values): bool
112
    {
113
        if ( ! $values) {
114
            return false;
115
        }
116
117
        foreach ($values as $value) {
118
            if ( ! $this->internal->containsKey($value)) {
119
                return false;
120
            }
121
        }
122
123
        return true;
124
    }
125
126
    /**
127
     * @inheritDoc

src/Ds/Traits/Sequence.php 1 location

@@ 63-76 (lines=14) @@
60
    /**
61
     * @inheritDoc
62
     */
63
    public function contains(...$values): bool
64
    {
65
        if ( ! $values) {
66
            return false;
67
        }
68
69
        foreach ($values as $value) {
70
            if ($this->find($value) === false) {
71
                return false;
72
            }
73
        }
74
75
        return true;
76
    }
77
78
    /**
79
     * @inheritDoc

src/Ds/Map.php 1 location

@@ 227-240 (lines=14) @@
224
    /**
225
     *
226
     */
227
    private function contains(string $lookup, array $values): bool
228
    {
229
        if (empty($values)) {
230
            return false;
231
        }
232
233
        foreach ($values as $value) {
234
            if ( ! $this->$lookup($value)) {
235
                return false;
236
            }
237
        }
238
239
        return true;
240
    }
241
242
    /**
243
     * Returns whether an association for all of zero or more keys exist.