File tree Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Expand file tree Collapse file tree 2 files changed +15
-11
lines changed Original file line number Diff line number Diff line change 5
5
// start-person-class
6
6
class Person implements MongoDB \BSON \Persistable
7
7
{
8
- private MongoDB \BSON \ObjectId $ id ;
9
- private string $ name ;
10
- private MongoDB \BSON \UTCDateTime $ createdAt ;
8
+ private \MongoDB \BSON \ObjectId $ id ;
9
+ private \MongoDB \BSON \UTCDateTime $ createdAt ;
11
10
12
- public function __construct (string $ name )
13
- {
14
- $ this ->id = new MongoDB \BSON \ObjectId ;
15
- $ this ->name = $ name ;
16
- $ this ->createdAt = new MongoDB \BSON \UTCDateTime ;
11
+ public function __construct (private string $ name ) {
12
+ $ this ->id = new \MongoDB \BSON \ObjectId ();
13
+ $ this ->createdAt = new \MongoDB \BSON \UTCDateTime ();
17
14
}
18
15
19
16
public function bsonSerialize (): array
Original file line number Diff line number Diff line change @@ -21,16 +21,23 @@ public function commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $ev
21
21
));
22
22
}
23
23
24
- public function commandSucceeded (MongoDB \Driver \Monitoring \CommandSucceededEvent $ event ): void {}
25
- public function commandFailed (MongoDB \Driver \Monitoring \CommandFailedEvent $ event ): void {}
24
+ public function commandSucceeded (MongoDB \Driver \Monitoring \CommandSucceededEvent $ event ): void
25
+ {
26
+ }
27
+
28
+ public function commandFailed (MongoDB \Driver \Monitoring \CommandFailedEvent $ event ): void
29
+ {
30
+ }
26
31
}
27
32
// end-command-subscriber
28
33
29
34
// start-sdam-subscriber
30
35
class MySDAMSubscriber implements MongoDB \Driver \Monitoring \SDAMSubscriber
31
36
{
32
37
/** @param resource $stream */
33
- public function __construct (private $ stream ) {}
38
+ public function __construct (private $ stream )
39
+ {
40
+ }
34
41
35
42
public function serverOpening (MongoDB \Driver \Monitoring \ServerOpeningEvent $ event ): void {
36
43
fprintf (
You can’t perform that action at this time.
0 commit comments