Skip to content

Commit

Permalink
Removed unneccessary used libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
mehmet-yoti committed Jul 30, 2024
1 parent 2968192 commit fdcb0ab
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/DocScan/Session/Retrieve/GetSessionResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,10 +313,11 @@ function ($checkResponse) use ($class): bool {

public function getIdentityProfile(): ?IdentityProfileResponse
{
if (isset($this->identityProfile))
if (isset($this->identityProfile)) {
return $this->identityProfile;
else
} else {
return null;
}
}

public function getIdentityProfilePreview(): ?IdentityProfilePreviewResponse
Expand Down
2 changes: 1 addition & 1 deletion src/Identity/Policy/Policy.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Policy implements \JsonSerializable
* @param int[] $wantedAuthTypes
* Auth types represents the authentication type to be used.
* @param object $identityProfileRequirements
* @param object $advancedidentityProfileRequirements
* @param object $advancedIdentityProfileRequirements
*/
public function __construct(
array $wantedAttributes,
Expand Down
16 changes: 12 additions & 4 deletions src/Identity/Receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,28 @@ public function getTimestamp(): \DateTime

public function getProfile(): ?UserProfile
{
return $this->userContent->getProfile();
if ($this->userContent !== null) {
return $this->userContent->getProfile();
} else {
return null;
}
}

public function getExtraData(): ?ExtraData
{
return $this->userContent->getExtraData();
if ($this->userContent !== null) {
return $this->userContent->getExtraData();
} else {
return null;
}
}

public function getApplicationContent(): ApplicationContent
public function getApplicationContent(): ?ApplicationContent
{
return $this->applicationContent;
}

public function getUserContent(): UserContent
public function getUserContent(): ?UserContent
{
return $this->userContent;
}
Expand Down
5 changes: 4 additions & 1 deletion src/Identity/ReceiptParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ public function createFailure(WrappedReceipt $wrappedReceipt): Receipt
->build();
}

private function decryptReceiptKey(string $wrappedKey, ReceiptItemKey $wrappedItemKey, PemFile $pemFile): string
private function decryptReceiptKey(?string $wrappedKey, ReceiptItemKey $wrappedItemKey, PemFile $pemFile): string
{
if ($wrappedKey == null) {
throw new EncryptedDataException('Wrapped is null');
}
// Convert 'iv' and 'value' from base64 to binary
$iv = (string)base64_decode($wrappedItemKey->getIv(), true);
$encryptedItemKey = (string)base64_decode($wrappedItemKey->getValue(), true);
Expand Down
4 changes: 2 additions & 2 deletions src/Identity/WrappedReceipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,12 @@ public function getOtherPartyExtraData(): ?string
return $this->otherPartyContent->getExtraData();
}

public function getWrappedItemKeyId(): string
public function getWrappedItemKeyId(): ?string
{
return $this->wrappedItemKeyId;
}

public function getWrappedKey(): string
public function getWrappedKey(): ?string
{
return $this->wrappedKey;
}
Expand Down

0 comments on commit fdcb0ab

Please sign in to comment.