Skip to content

Commit a744443

Browse files
committed
Provide a default string representation
1 parent bd25f8d commit a744443

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

src/main/php/com/mongodb/io/Compressor.class.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ public abstract function compress($data);
99

1010
public abstract function decompress($compressed);
1111

12+
public function toString() { return nameof($this).'#'.$this->id; }
13+
1214
public function hashCode() { return 'C'.$this->id; }
1315

1416
public function compareTo($value) { return $value instanceof self ? $this->id <=> $value->id : 1; }
17+
1518
}

src/main/php/com/mongodb/io/Zstd.class.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,9 @@
22

33
class Zstd extends Compressor {
44
public $id= 3;
5-
public $level;
6-
7-
/** @param int $level */
8-
public function __construct($level= -1) {
9-
$this->level= $level;
10-
}
115

126
public function compress($data) {
13-
return zstd_compress($data, $this->level);
7+
return zstd_compress($data);
148
}
159

1610
public function decompress($compressed) {

0 commit comments

Comments
 (0)