Skip to content

Commit 14b5cc3

Browse files
committed
Use null instead of set/unset
1 parent 48e5786 commit 14b5cc3

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/LocalDB.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*/
1414
class LocalDB
1515
{
16-
/** @var SQLite3 */
16+
/** @var SQLite3|null */
1717
private $handle;
1818

1919
/** @var string */
@@ -42,7 +42,7 @@ public function __construct(string $location, LoggerInterface $logger, $stats)
4242
*/
4343
public function open()
4444
{
45-
if (!isset($this->handle)) {
45+
if ($this->handle === null) {
4646
$this->handle = new SQLite3($this->location);
4747
$this->handle->busyTimeout(15000);
4848
$this->handle->enableExceptions(true);
@@ -54,9 +54,9 @@ public function open()
5454
*/
5555
public function close()
5656
{
57-
if (isset($this->handle)) {
57+
if ($this->handle !== null) {
5858
$this->handle->close();
59-
unset($this->handle);
59+
$this->handle = null;
6060
}
6161
}
6262

@@ -117,7 +117,7 @@ public function write(string $query)
117117
*/
118118
public function getLastInsertedRowID()
119119
{
120-
if (!isset($this->handle)) {
120+
if ($this->handle === null) {
121121
return null;
122122
}
123123

0 commit comments

Comments
 (0)