Skip to content

Commit ba21989

Browse files
Don't double-escape.
1 parent 559e204 commit ba21989

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/Chronicle/Handlers/Replica.php

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
declare(strict_types=1);
33
namespace ParagonIE\Chronicle\Handlers;
44

5-
use ParagonIE\Chronicle\{
6-
Chronicle,
5+
use ParagonIE\Chronicle\{Chronicle,
76
Exception\FilesystemException,
7+
Exception\InvalidInstanceException,
88
Exception\ReplicationSourceNotFound,
99
Exception\HashNotFound,
10-
HandlerInterface
11-
};
10+
HandlerInterface};
1211
use Psr\Http\Message\{
1312
RequestInterface,
1413
ResponseInterface
@@ -122,6 +121,7 @@ public function exportChain(): ResponseInterface
122121
*
123122
* @throws HashNotFound
124123
* @throws FilesystemException
124+
* @throws InvalidInstanceException
125125
*/
126126
public function getByHash(array $args = []): ResponseInterface
127127
{
@@ -169,6 +169,7 @@ public function getByHash(array $args = []): ResponseInterface
169169
* @return ResponseInterface
170170
*
171171
* @throws FilesystemException
172+
* @throws InvalidInstanceException
172173
*/
173174
public function getLastHash(): ResponseInterface
174175
{
@@ -210,6 +211,7 @@ public function getLastHash(): ResponseInterface
210211
* @return ResponseInterface
211212
*
212213
* @throws FilesystemException
214+
* @throws InvalidInstanceException
213215
*/
214216
protected function getIndex(): ResponseInterface
215217
{
@@ -264,6 +266,7 @@ protected function getIndex(): ResponseInterface
264266
*
265267
* @throws FilesystemException
266268
* @throws HashNotFound
269+
* @throws InvalidInstanceException
267270
*/
268271
public function getSince(array $args = []): ResponseInterface
269272
{
@@ -324,6 +327,7 @@ public function getSince(array $args = []): ResponseInterface
324327
* Export an entire replicated chain, as-is.
325328
*
326329
* @return array
330+
* @throws InvalidInstanceException
327331
*/
328332
protected function getFullChain(): array
329333
{
@@ -356,6 +360,7 @@ protected function getFullChain(): array
356360
* @return self
357361
*
358362
* @throws ReplicationSourceNotFound
363+
* @throws InvalidInstanceException
359364
*/
360365
protected function selectReplication(string $uniqueId): self
361366
{

src/Chronicle/Process/Replicate.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ protected function appendToChain(array $entry): bool
189189
}
190190

191191
/* Enter the new row to the replication table */
192-
$db->insert(Chronicle::getTableName('replication_chain'), [
192+
$db->insert(Chronicle::getTableName('replication_chain', true), [
193193
'source' => $this->id,
194194
'data' => $entry['contents'],
195195
'prevhash' => $prevhash,
@@ -208,6 +208,7 @@ protected function appendToChain(array $entry): bool
208208
* Get the latest summary hash from this replica.
209209
*
210210
* @return string
211+
* @throws InvalidInstanceException
211212
*/
212213
protected function getLatestSummaryHash(): string
213214
{

0 commit comments

Comments
 (0)