Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sstok committed Nov 5, 2023
1 parent fda7e3d commit 099201c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Encoder/GZipCompressionDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(private UriEncoderInterface $encoder) {}

public function encodeUri(string $data): string
{
return $this->encoder->encodeUri((string) gzcompress($data));
return $this->encoder->encodeUri((string) @gzcompress($data));
}

public function decodeUri(string $data): ?string
Expand All @@ -37,7 +37,7 @@ public function decodeUri(string $data): ?string
}

try {
$compressed = gzuncompress($decoded);
$compressed = @gzuncompress($decoded);

return $compressed === false ? null : $compressed;
} catch (\Throwable) {
Expand Down
8 changes: 2 additions & 6 deletions src/UriEncoderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,9 @@
*/
interface UriEncoderInterface
{
/**
* Encodes the URI to a usable format.
*/
/** Encodes the URI to a usable format. */
public function encodeUri(string $data): string;

/**
* Decodes the encoded URI back to the original format.
*/
/** Decodes the encoded URI back to the original format. */
public function decodeUri(string $data): ?string;
}

0 comments on commit 099201c

Please sign in to comment.