Skip to content

Commit 4b52c89

Browse files
committed
Minor code tweaks for return types and conformity.
1 parent dea3ff1 commit 4b52c89

5 files changed

Lines changed: 15 additions & 10 deletions

File tree

src/Objects/AbstractMacPower.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ abstract class AbstractMacPower
88
{
99
use ShellTrait;
1010

11+
/**
12+
* @param string $key
13+
*
14+
* @return string|null
15+
*/
1116
protected function getPowerDataType($key)
1217
{
1318
$data = explode("\n", $this->getShellExec('system_profiler SPPowerDataType'));

src/Objects/AdobeApplication.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ function ($v) {
6868

6969
if (file_exists($file))
7070
{
71-
return new AdobeApplication(dirname(dirname($file)));
71+
return new AdobeApplication(dirname($file, 2));
7272
}
7373
}
7474
}
@@ -79,7 +79,7 @@ function ($v) {
7979
}
8080

8181
/**
82-
* @return false|string
82+
* @return false|SemanticVersion
8383
*/
8484
public function getBaseVersion()
8585
{
@@ -113,7 +113,7 @@ public function getSap()
113113
{
114114
$info = $this->getAdobeAppInfo($this->getSlug());
115115

116-
$this->_sap = isset($info['sap']) ? $info['sap'] : false;
116+
$this->_sap = $info['sap'] ?? false;
117117
}
118118

119119
return $this->_sap;
@@ -218,13 +218,13 @@ private static function getAppInfoFromAdbArg($str)
218218
$tYear = $year;
219219
}
220220

221-
$paths[] = dirname(dirname($template));
221+
$paths[] = dirname($template, 2);
222222
}
223223
}
224224
}
225225

226226
$names[] = $tInfo['productName'];
227-
$bVer[$ver] = isset($tYear) ? $tYear : $tInfo['productName'];
227+
$bVer[$ver] = $tYear ?? $tInfo['productName'];
228228
}
229229
}
230230
}

src/Objects/MacApplication.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getIdentifier()
5050
}
5151

5252
/**
53-
* @return SemanticVersion|Version|null
53+
* @return SemanticVersion|null
5454
*/
5555
public function getShortVersion()
5656
{
@@ -65,7 +65,7 @@ public function getShortVersion()
6565
}
6666

6767
/**
68-
* @return SemanticVersion|Version|null
68+
* @return SemanticVersion|null
6969
*/
7070
public function getVersion()
7171
{

src/Objects/MacBattery.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function getCondition()
6565
}
6666

6767
/**
68-
* @return int|null
68+
* @return string|null
6969
*/
7070
public function getCycles()
7171
{

src/Objects/MacDevice.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ public function isBatteryPowered()
186186
* Determines if the display is prevented from sleeping by an assertation, usually an indicator that a presentation
187187
* or video conference is currently running.
188188
*
189-
* @return string|null
189+
* @return bool
190190
*/
191191
public function isDisplaySleepPrevented()
192192
{
@@ -239,7 +239,7 @@ public function isSecurityChip()
239239
}
240240

241241
/**
242-
* Determines if the MacOS Secure Boot feature is set to "full".
242+
* Determines if the macOS Secure Boot feature is set to "full".
243243
*
244244
* @return bool
245245
*/

0 commit comments

Comments
 (0)