Passed
Push — 8.x-2.x ( bfb9ec...68110c )
by Frédéric G.
03:30
created

TopResult::bsonUnserialize()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Drupal\mongodb_watchdog\Controller;
4
5
use MongoDB\BSON\Unserializable;
6
7
/**
8
 * Class TopResult is a value object holding the Top aggregation results.
9
 */
10
final class TopResult implements Unserializable {
11
12
  /**
13
   * The number of hits on the grouped URL.
14
   *
15
   * @var int
16
   */
17
  public $count;
18
19
  /**
20
   * The URL on which the count of hits is grouped.
21
   *
22
   * @var string
23
   */
24
  public $uri;
25
26
  /**
27
   * {@inheritDoc}
28
   */
29
  public function bsonUnserialize(array $data) {
30
    $this->uri = $data['_id'];
31
    $this->count = $data['count'];
32
  }
33
34
}
35