Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

Finish deprecation of all U2F-specific classes #36

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove some now-unused helpers
  • Loading branch information
Firehed committed Oct 27, 2021
commit f527132ced7add3e2cd06390e206ca165d4e2ecf
22 changes: 0 additions & 22 deletions tests/ServerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -896,32 +896,10 @@ public function getDefaultPublicKey(): PublicKeyInterface
return new ECPublicKey($pk);
}

/** @return mixed[] */
private function readJsonFile(string $file): array
{
return $this->safeDecode($this->safeReadFile($file));
}

private function safeReadFile(string $file): string
{
$body = file_get_contents(__DIR__.'/'.$file);
assert($body !== false);
return $body;
}

/** @return mixed[] */
private function safeDecode(string $json): array
{
$data = json_decode($json, true);
assert($data !== false);
return $data;
}

/** @param mixed[] $data */
private function safeEncode(array $data): string
{
$json = json_encode($data);
assert($json !== false);
return $json;
}
}