Skip to content

Commit d32a6fa

Browse files
Stefan WeilUBMA Sysadmins
authored andcommitted
Fix runtime exceptions
1 parent 84194be commit d32a6fa

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

module/VuFind/src/VuFind/ILS/Connection.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public function __construct(
185185
\Laminas\Config\Config $config,
186186
\VuFind\ILS\Driver\PluginManager $driverManager,
187187
\VuFind\Config\PluginManager $configReader,
188-
\Laminas\Http\Request $request = null
188+
?\Laminas\Http\Request $request = null
189189
) {
190190
if (!isset($config->driver)) {
191191
throw new \Exception('ILS driver setting missing.');
@@ -288,7 +288,7 @@ protected function hasNoILSFailover()
288288
*
289289
* @return bool
290290
*/
291-
protected function failOverToNoILS(\Exception $e = null)
291+
protected function failOverToNoILS(?\Exception $e = null)
292292
{
293293
// If the exception is caused by a configuration error, the administrator
294294
// needs to fix it, but failing over to NoILS will mask the error and cause
@@ -1218,7 +1218,7 @@ public function getStatus($id)
12181218
$status = $this->__call('getStatus', [$id]);
12191219

12201220
// parse availability and status to AvailabilityStatus object
1221-
return array_map($this->getStatusParser(), $status);
1221+
return array_map($this->getStatusParser(), $status ?: []);
12221222
}
12231223

12241224
/**

module/VuFind/src/VuFind/ILS/Driver/Demo.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ public function __construct(
208208
\VuFind\Date\Converter $dateConverter,
209209
SearchService $ss,
210210
$sessionFactory,
211-
HttpRequest $request = null
211+
?HttpRequest $request = null
212212
) {
213213
$this->dateConverter = $dateConverter;
214214
$this->searchService = $ss;
@@ -471,7 +471,7 @@ public function getAccountBlocks($patron)
471471
*
472472
* @return array
473473
*/
474-
protected function getRandomHolding($id, $number, array $patron = null)
474+
protected function getRandomHolding($id, $number, ?array $patron = null)
475475
{
476476
$status = $this->getFakeStatus();
477477
$location = $this->getFakeLoc();
@@ -730,7 +730,7 @@ protected function getSession($patron = null)
730730
*
731731
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
732732
*/
733-
protected function getSimulatedStatus($id, array $patron = null)
733+
protected function getSimulatedStatus($id, ?array $patron = null)
734734
{
735735
$id = (string)$id;
736736

@@ -872,7 +872,7 @@ protected function getNotesAndSummary(int $itemNum): array
872872
* id, availability (boolean), status, location, reserve, callnumber,
873873
* duedate, number, barcode.
874874
*/
875-
public function getHolding($id, array $patron = null, array $options = [])
875+
public function getHolding($id, ?array $patron = null, array $options = [])
876876
{
877877
$this->checkIntermittentFailure();
878878

0 commit comments

Comments
 (0)