| @@ 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 | } |
|