Skip to content

Commit 092e4f8

Browse files
Update PHPStan configuration, fix some issues
1 parent ba05d2b commit 092e4f8

3 files changed

Lines changed: 2 additions & 15 deletions

File tree

phpstan.neon

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
parameters:
22
level: 5
3-
checkMissingIterableValueType: false
43
paths:
54
- src
6-
- tests
7-
ignoreErrors:
8-
# Ignore skipped tests:
9-
- message: "#Unreachable statement#"
10-
paths:
11-
- tests/Idoit/APIClient/*

src/API.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ protected function execute(array $data): array {
622622
$lastResponse = json_decode(trim($body), true);
623623

624624
if (!is_array($lastResponse)) {
625-
if (is_string($body) && strlen($body) > 0) {
625+
if (strlen($body) > 0) {
626626
throw new RuntimeException(sprintf(
627627
'i-doit responded with an unknown message: %s',
628628
$body

src/CMDBCategoryInfo.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,7 @@ public function readAll(): array {
131131

132132
$categories = $this->batchRead($cleanCategoryConstants);
133133

134-
$combinedArray = array_combine($cleanCategoryConstants, $categories);
135-
136-
if (!is_array($combinedArray)) {
137-
throw new RuntimeException('Unable to restructure result');
138-
}
139-
140-
return $combinedArray;
134+
return array_combine($cleanCategoryConstants, $categories);
141135
}
142136

143137
/**

0 commit comments

Comments
 (0)