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

Commit

Permalink
Remove some now-unused helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Firehed committed Oct 27, 2021
1 parent dd24ca3 commit f527132
Showing 1 changed file with 0 additions and 22 deletions.
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;
}
}

0 comments on commit f527132

Please sign in to comment.