1 | <?php |
||
11 | trait MongodbAdapter |
||
12 | { |
||
13 | /** |
||
14 | * @param \MongoDB\BSON\UTCDatetime $mongoDate |
||
15 | * @return UniversalTimestamp |
||
16 | */ |
||
17 | 2 | public static function fromMongodbUTCDateTime(\MongoDB\BSON\UTCDatetime $mongoDate) |
|
21 | |||
22 | /** |
||
23 | * @return \MongoDate |
||
24 | */ |
||
25 | 1 | public function asMongodbUTCDateTime() |
|
29 | } |
||
30 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: