| @@ 159-163 (lines=5) @@ | ||
| 156 | */ |
|
| 157 | protected function createBucket($key, $value, string $hash) |
|
| 158 | { |
|
| 159 | if ($this->behavior & self::WEAK_KEY) { |
|
| 160 | $key = new WeakReference($key, function () use ($hash) { |
|
| 161 | $this->doRemove($hash); |
|
| 162 | }); |
|
| 163 | } |
|
| 164 | ||
| 165 | if ($this->behavior & self::WEAK_VALUE) { |
|
| 166 | $value = new WeakReference($value, function () use ($hash) { |
|
| @@ 165-169 (lines=5) @@ | ||
| 162 | }); |
|
| 163 | } |
|
| 164 | ||
| 165 | if ($this->behavior & self::WEAK_VALUE) { |
|
| 166 | $value = new WeakReference($value, function () use ($hash) { |
|
| 167 | $this->doRemove($hash); |
|
| 168 | }); |
|
| 169 | } |
|
| 170 | ||
| 171 | return new Bucket($key, $value); |
|
| 172 | } |
|