Skip to content

Commit

Permalink
refs vufind-org#2999 fix styles with vufind rules
Browse files Browse the repository at this point in the history
  • Loading branch information
RLangeUni committed Oct 16, 2024
1 parent 6ee8f92 commit 010756c
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 14 deletions.
10 changes: 6 additions & 4 deletions module/VuFindSearch/src/VuFindSearch/Backend/AbstractBackend.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,19 @@ protected function injectSourceIdentifier(RecordCollectionInterface $response)

return $response;
}

/**
* Sets the result set identifier for the record collection.
*
* @param string $uuid A valid UUID associated with the data set.
*
* @return void
*/
public function setResultSetIdentifier(string $uuid) {
public function setResultSetIdentifier(string $uuid)
{
$this->recordCollection->setResultSetIdentifier($uuid);
}

/**
* Generates a shorter UUID-like identifier.
*
Expand All @@ -141,7 +142,8 @@ public function setResultSetIdentifier(string $uuid) {
*
* @return string A randomly generated shorter UUID-like identifier.
*/
function generateUuid(): string {
public function generateUuid(): string
{
$data = bin2hex(Rand::getBytes(8));
return sprintf(
'%08s-%04s-%04s',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ public function count(): int
{
return count($this->records);
}

/**
* Sets the result set identifier for all records in the collection.
*
Expand All @@ -308,7 +308,8 @@ public function count(): int
*
* @return void
*/
public function setResultSetIdentifier(string $uuid) {
public function setResultSetIdentifier(string $uuid)
{
foreach ($this->records as $record) {
$record->setResultSetIdentifier($uuid);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,13 @@ public function setSourceIdentifiers($identifier, $searchBackendId = '');
* @return string
*/
public function getSourceIdentifier();

/**
* Return the result set identifier.
* Sets the result set identifier for the record.
*
* This method assigns a UUID or a unique string identifier to the result set.
*
* @param string $uuid A valid UUID or unique identifier to be assigned to the result set.
*
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,23 @@ public function getSourceIdentifier();
*/
public function getSearchBackendIdentifier();

/**
* Sets the result set identifier for the record collection.
*
* @param string $uuid A valid UUID associated with the data set.
*
* @return void
*/
public function setResultSetIdentifier(string $uuid);


/**
* Retrieves the unique result set identifier.
*
* This method returns the UUID or similar identifier associated with the result set.
* If no identifier has been set, it will return null.
*
* @return string|null The UUID of the result set, or null if not set.
*/
public function getResultSetIdentifier();

/**
Expand Down
12 changes: 7 additions & 5 deletions module/VuFindSearch/src/VuFindSearch/Response/RecordTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ trait RecordTrait
* @var string
*/
protected $sourceIdentifier = '';

/**
* The unique identifier for the result set.
*
Expand Down Expand Up @@ -119,7 +119,7 @@ public function getSearchBackendIdentifier()
{
return $this->searchBackendIdentifier;
}

/**
* Sets the unique result set identifier.
*
Expand All @@ -129,10 +129,11 @@ public function getSearchBackendIdentifier()
*
* @return void
*/
public function setResultSetIdentifier(string $uuid) {
public function setResultSetIdentifier(string $uuid)
{
$this->resultSetIdentifier = $uuid;
}

/**
* Retrieves the unique result set identifier.
*
Expand All @@ -141,7 +142,8 @@ public function setResultSetIdentifier(string $uuid) {
*
* @return string|null The UUID of the result set, or null if not set.
*/
public function getResultSetIdentifier(): ?string {
public function getResultSetIdentifier(): ?string
{
return $this->resultSetIdentifier;
}

Expand Down

0 comments on commit 010756c

Please sign in to comment.