5
5
use JsonSerializable ;
6
6
use MongoDB \Driver \Exception \InvalidArgumentException ;
7
7
use MongoDB \Driver \Exception \UnexpectedValueException ;
8
+ use Stringable ;
8
9
9
10
/**
10
11
* Class Binary
11
12
* @link https://php.net/manual/en/class.mongodb-bson-binary.php
12
13
*/
13
- final class Binary implements Type, BinaryInterface, \Serializable, JsonSerializable
14
+ final class Binary implements Type, BinaryInterface, JsonSerializable, Stringable
14
15
{
15
16
public const TYPE_GENERIC = 0 , TYPE_FUNCTION = 1 ;
16
17
public const TYPE_OLD_BINARY = 2 ;
@@ -27,6 +28,11 @@ final class Binary implements Type, BinaryInterface, \Serializable, JsonSerializ
27
28
* @since 1.12.0
28
29
*/
29
30
public const TYPE_COLUMN = 7 ;
31
+
32
+ /**
33
+ * @since 1.17.0
34
+ */
35
+ public const TYPE_SENSITIVE = 8 ;
30
36
public const TYPE_USER_DEFINED = 128 ;
31
37
32
38
/**
@@ -47,37 +53,20 @@ final public function getData(): string {}
47
53
*/
48
54
final public function getType (): int {}
49
55
50
- public static function __set_state (array $ properties ) {}
56
+ public static function __set_state (array $ properties ): self {}
51
57
52
58
/**
53
59
* Returns the Binary's data
54
60
* @link https://www.php.net/manual/en/mongodb-bson-binary.tostring.php
55
61
*/
56
62
final public function __toString (): string {}
57
63
58
- /**
59
- * Serialize a Binary
60
- * @since 1.2.0
61
- * @link https://www.php.net/manual/en/mongodb-bson-binary.serialize.php
62
- * @throws InvalidArgumentException
63
- */
64
- final public function serialize (): string {}
65
-
66
- /**
67
- * Unserialize a Binary
68
- * @since 1.2.0
69
- * @link https://www.php.net/manual/en/mongodb-bson-binary.unserialize.php
70
- * @throws InvalidArgumentException on argument parsing errors or if the properties are invalid
71
- * @throws UnexpectedValueException if the properties cannot be unserialized (i.e. serialized was malformed)
72
- */
73
- final public function unserialize (string $ data ) {}
74
-
75
64
/**
76
65
* Returns a representation that can be converted to JSON
77
66
* @since 1.2.0
78
67
* @link https://www.php.net/manual/en/mongodb-bson-binary.jsonserialize.php
79
68
* @return mixed data which can be serialized by json_encode()
80
69
* @throws InvalidArgumentException on argument parsing errors
81
70
*/
82
- final public function jsonSerialize () {}
71
+ final public function jsonSerialize (): mixed {}
83
72
}
0 commit comments