Skip to content

Commit 1e4b78e

Browse files
committed
Fix pipelines
1 parent 64312e4 commit 1e4b78e

4 files changed

Lines changed: 12 additions & 11 deletions

File tree

module/VuFind/src/VuFind/GetThis/GetThisLoader.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public function getLocationCode(?string $itemId = null): string
358358
*/
359359
public function getLink(?string $itemId = null): array|string
360360
{
361-
$isProvidedItemIdNull = is_null($itemId);
361+
$isProvidedItemIdNull = null === $itemId;
362362
// If $itemId is null, call getItem just in case $items returns the items in a different order
363363
// than the real time holdings information
364364
$itemId = $this->getItem($itemId)['item_id'] ?? null;
@@ -372,7 +372,7 @@ public function getLink(?string $itemId = null): array|string
372372
if (!isset($location['items'])) {
373373
continue;
374374
}
375-
foreach ((array) $location['items'] as $item) {
375+
foreach ((array)$location['items'] as $item) {
376376
if (empty($item['link'])) {
377377
continue;
378378
}

module/VuFind/src/VuFindTest/Integration/MinkTestCase.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
use Behat\Mink\Element\Element;
3535
use Behat\Mink\Element\NodeElement;
3636
use DMore\ChromeDriver\ChromeDriver;
37-
use League\CommonMark\Node\Query\OrExpr;
3837
use ReflectionException;
3938
use Symfony\Component\Yaml\Yaml;
4039
use VuFind\Config\PathResolver;

module/VuFind/tests/integration-tests/src/VuFindTest/Mink/GetThisTest.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434
use Exception;
3535
use PHPUnit\Framework\Attributes\DataProvider;
3636

37+
use function count;
38+
3739
/**
3840
* Test class for the GetThis functionality.
3941
*
@@ -138,7 +140,7 @@ public static function getRecordItems(string $recordId, string ...$callNumbers):
138140
foreach ($callNumbers as $callNumber) {
139141
$items[] = [
140142
'id' => $recordId,
141-
...$availableItems[$callNumber]
143+
...$availableItems[$callNumber],
142144
];
143145
}
144146
return $items;
@@ -192,7 +194,7 @@ public static function provideStandardStatusTestData(): array
192194
'CallNumberOne',
193195
'CallNumberTwo',
194196
'CallNumberThree',
195-
'CallNumberFour'
197+
'CallNumberFour',
196198
]
197199
),
198200
// $expectedPresence
@@ -279,7 +281,7 @@ public static function provideFullStatusTestData(): array
279281
'CallNumberOne',
280282
'CallNumberTwo',
281283
'CallNumberThree',
282-
'CallNumberFour'
284+
'CallNumberFour',
283285
]
284286
),
285287
// $expectedBlockPresence

module/VuFind/tests/unit-tests/src/VuFindTest/GetThisLoaderTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function setUp(): void
9292
$regexConfig = $this->yamlReader->get('Regex.yaml');
9393
$regexConfig['LOCATION_EXCLUSIVE'][] = '/OUR CAMPUS/i';
9494
$translator = $this->createMock(Translate::class);
95-
$translator->expects($this->any())->method('translate')->willReturnCallback(fn($p) => $p);
95+
$translator->expects($this->any())->method('translate')->willReturnCallback(fn ($p) => $p);
9696
$this->getThis = new GetThisLoader(
9797
$this->config,
9898
new Regex($regexConfig),
@@ -112,7 +112,7 @@ public function setGetThisConfig(array $config): void
112112
try {
113113
$this->setProperty($this->getThis, 'config', $config);
114114
} catch (ReflectionException $e) {
115-
die("Reflection exception when trying to set the config: " . $e->getMessage());
115+
die('Reflection exception when trying to set the config: ' . $e->getMessage());
116116
}
117117
}
118118

@@ -126,7 +126,7 @@ public function getMockRecordDriver(): SolrDefault|MockObject
126126
try {
127127
return $this->createMock(SolrDefault::class);
128128
} catch (\PHPUnit\Framework\MockObject\Exception $e) {
129-
die("An exception has occurred while creating a mock for the record driver: " . $e->getMessage());
129+
die('An exception has occurred while creating a mock for the record driver: ' . $e->getMessage());
130130
}
131131
}
132132

@@ -624,7 +624,7 @@ public function testGetLink()
624624
],
625625
],
626626
],
627-
]
627+
],
628628
]);
629629
$this->setProperty($this->getThis, 'record', $driver);
630630
$this->assertEquals('https://what_a_great_link.com', $this->getThis->getLink());
@@ -931,7 +931,7 @@ public function testFactory()
931931
$regex = $this->createMock(Regex::class);
932932

933933
$translator = $this->createMock(Translate::class);
934-
$translator->expects($this->any())->method('translate')->willReturnCallback(fn($p) => $p);
934+
$translator->expects($this->any())->method('translate')->willReturnCallback(fn ($p) => $p);
935935

936936
$viewHelperManager = $this->createMock(HelperPluginManager::class);
937937
$viewHelperManager->expects($this->once())->method('get')->willReturn($translator);

0 commit comments

Comments
 (0)