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