File tree Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Expand file tree Collapse file tree 2 files changed +2
-12
lines changed Original file line number Diff line number Diff line change @@ -159,12 +159,7 @@ public function offsetExists($offset): bool
159
159
160
160
$ offset = (int ) $ offset ;
161
161
162
- // If we've looked for the value, return the cached result
163
- if (isset ($ this ->exists [$ offset ])) {
164
- return $ this ->exists [$ offset ];
165
- }
166
-
167
- return $ this ->exists [$ offset ] = $ this ->bson ->has ($ offset );
162
+ return $ this ->exists [$ offset ] ??= $ this ->bson ->has ($ offset );
168
163
}
169
164
170
165
/**
Original file line number Diff line number Diff line change @@ -127,12 +127,7 @@ public function __get(string $property)
127
127
128
128
public function __isset (string $ name ): bool
129
129
{
130
- // If we've looked for the value, return the cached result
131
- if (isset ($ this ->exists [$ name ])) {
132
- return $ this ->exists [$ name ];
133
- }
134
-
135
- return $ this ->exists [$ name ] = $ this ->bson ->has ($ name );
130
+ return $ this ->exists [$ name ] ??= $ this ->bson ->has ($ name );
136
131
}
137
132
138
133
/** @param TValue $value */
You can’t perform that action at this time.
0 commit comments