Code Duplication    Length = 5-5 lines in 2 locations

src/ObjectMap.php 2 locations

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