Skip to content

Commit 2d22bba

Browse files
committed
ITKDEV: Adjust indention
1 parent 7b7d4b7 commit 2d22bba

File tree

1 file changed

+40
-39
lines changed
  • modules/os2forms_fbs_handler/src/Client

1 file changed

+40
-39
lines changed

modules/os2forms_fbs_handler/src/Client/FBS.php

Lines changed: 40 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function authenticatePatron(string $cpr): ?string {
9090
// Authenticate the patron.
9191
$json = $this->request('/external/{agency_id}/patrons/preauthenticated/v10', $cpr);
9292
if ($json->authenticateStatus === $this::AUTHENTICATE_STATUS_VALID) {
93-
return $json->patronId;
93+
return $json->patronId;
9494
}
9595

9696
return NULL;
@@ -124,48 +124,49 @@ public function createPatronWithGuardian(Patron $patron, Guardian $guardian) {
124124
return $this->request($uri, $payload);
125125
}
126126

127-
/**
128-
* Get patron information.
129-
*
130-
* @param string $patronId
131-
* The patron to update.
132-
*
133-
* @return \Drupal\os2forms_fbs_handler\Client\Model\Patron
134-
* Patron object
135-
*
136-
* @throws \GuzzleHttp\Exception\GuzzleException
137-
* @throws \JsonException
138-
*/
139-
public function getPatron(string $patronId): ?Patron {
140-
$uri = '/external/{agency_id}/patrons/' . $patronId . '/v4';
141-
142-
$json = $this->request($uri, [], RequestMethodInterface::METHOD_GET);
143-
144-
if ($json->authenticateStatus === "VALID") {
145-
return new Patron(
146-
$json->patron->patronId,
147-
(bool) $json->patron->receiveSms,
148-
(bool) $json->patron->receivePostalMail,
149-
$json->patron->notificationProtocols,
150-
$json->patron->phoneNumber,
151-
is_null($json->patron->onHold) ? $json->patron->onHold : (array) $json->patron->onHold,
152-
$json->patron->preferredLanguage,
153-
(bool) $json->patron->guardianVisibility,
154-
$json->patron->defaultInterestPeriod,
155-
(bool) $json->patron->resident,
127+
/**
128+
* Get patron information.
129+
*
130+
* @param string $patronId
131+
* The patron to update.
132+
*
133+
* @return \Drupal\os2forms_fbs_handler\Client\Model\Patron
134+
* Patron object
135+
*
136+
* @throws \GuzzleHttp\Exception\GuzzleException
137+
* @throws \JsonException
138+
*/
139+
public function getPatron(string $patronId): ?Patron {
140+
$uri = '/external/{agency_id}/patrons/' . $patronId . '/v4';
141+
142+
$json = $this->request($uri, [], RequestMethodInterface::METHOD_GET);
143+
144+
if ($json->authenticateStatus === "VALID") {
145+
return new Patron(
146+
$json->patron->patronId,
147+
(bool) $json->patron->receiveSms,
148+
(bool) $json->patron->receivePostalMail,
149+
$json->patron->notificationProtocols,
150+
$json->patron->phoneNumber,
151+
is_null($json->patron->onHold) ? $json->patron->onHold : (array) $json->patron->onHold,
152+
$json->patron->preferredLanguage,
153+
(bool) $json->patron->guardianVisibility,
154+
$json->patron->defaultInterestPeriod,
155+
(bool) $json->patron->resident,
156+
[
156157
[
157-
[
158-
'emailAddress' => $json->patron->emailAddress,
159-
'receiveNotification' => $json->patron->receiveEmail,
160-
],
158+
'emailAddress' => $json->patron->emailAddress,
159+
'receiveNotification' => $json->patron->receiveEmail,
161160
],
162-
(bool) $json->patron->receiveEmail,
163-
$json->patron->preferredPickupBranch
164-
);
165-
}
166-
return NULL;
161+
],
162+
(bool) $json->patron->receiveEmail,
163+
$json->patron->preferredPickupBranch
164+
);
167165
}
168166

167+
return NULL;
168+
}
169+
169170
/**
170171
* Update patron information.
171172
*

0 commit comments

Comments
 (0)