Code Duplication    Length = 5-5 lines in 2 locations

src/ObjectMap.php 2 locations

@@ 149-153 (lines=5) @@
146
     */
147
    protected function createBucket($key, $value, string $hash)
148
    {
149
        if ($this->behavior & self::WEAK_KEY) {
150
            $key = new WeakReference($key, function () use ($hash) {
151
                $this->doRemove($hash);
152
            });
153
        }
154
155
        if ($this->behavior & self::WEAK_VALUE) {
156
            $value = new WeakReference($value, function () use ($hash) {
@@ 155-159 (lines=5) @@
152
            });
153
        }
154
155
        if ($this->behavior & self::WEAK_VALUE) {
156
            $value = new WeakReference($value, function () use ($hash) {
157
                $this->doRemove($hash);
158
            });
159
        }
160
161
        return new Bucket($key, $value);
162
    }