Passed
Push — 8.x-2.x ( 9af07d...3011f1 )
by Frédéric G.
05:35
created

TopResult   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 22
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A bsonUnserialize() 0 3 1
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