Skip to content

Commit 7d1fa16

Browse files
committed
Refactored isset
1 parent c64f22e commit 7d1fa16

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/NMeta.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ class NMeta
8383
public function __construct(?string $header = null, Config $config = null)
8484
{
8585
if (empty($header)) {
86-
throw new BadRequestException($config->getHeader() . ' header: header is missing');
86+
throw new BadRequestException($config->getHeader() . ' header is missing');
8787
}
8888

8989
if (!$config) {
@@ -127,9 +127,9 @@ public function __construct(?string $header = null, Config $config = null)
127127

128128
$this->version = $headerArr[2];
129129
$versionArr = explode('.', $this->version);
130-
$this->majorVersion = isset($versionArr[0]) ? $versionArr[0] : 0;
131-
$this->minorVersion = isset($versionArr[1]) ? $versionArr[1] : 0;
132-
$this->patchVersion = isset($versionArr[2]) ? $versionArr[2] : 0;
130+
$this->majorVersion = $versionArr[0] ?? 0;
131+
$this->minorVersion = $versionArr[1] ?? 0;
132+
$this->patchVersion = $versionArr[2] ?? 0;
133133

134134
// Parse device os version
135135
if (!isset($headerArr[3])) {

0 commit comments

Comments
 (0)