1 | <?php |
||
19 | class MongoDB extends AbstractStorage { |
||
20 | |||
21 | /** |
||
22 | * @var \MongoDB\Driver\Manager |
||
23 | * The MongoDB Driver Manager. |
||
24 | */ |
||
25 | protected $mongoDBManager; |
||
26 | |||
27 | /** |
||
28 | * @var string |
||
29 | * The database name for the data. |
||
30 | */ |
||
31 | protected $database; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | * The collection name for the data. |
||
36 | */ |
||
37 | protected $collection; |
||
38 | |||
39 | /** |
||
40 | * MongoDB constructor. |
||
41 | * |
||
42 | * @param string $host |
||
43 | * a mongodb:// connection URI |
||
44 | * @param string $database |
||
45 | * the database to use, defaults to "phppromdb" |
||
46 | * @param string $collection |
||
47 | * the collection to use, defaults to "measurements" |
||
48 | * @param array $options |
||
49 | * connection string options, defaults to [] |
||
50 | * @param array $driverOptions |
||
51 | * any driver-specific options not included in MongoDB connection spec, defaults to [] |
||
52 | */ |
||
53 | public function __construct($host, $database = 'phppromdb', $collection = 'measurements', array $options = [], array $driverOptions = []) { |
||
59 | |||
60 | /** |
||
61 | * {@inheritdoc} |
||
62 | */ |
||
63 | public function storeMeasurement($metric, $key, $value) { |
||
71 | |||
72 | /** |
||
73 | * {@inheritdoc} |
||
74 | */ |
||
75 | public function incrementMeasurement($metric, $key) { |
||
87 | |||
88 | /** |
||
89 | * {@inheritdoc} |
||
90 | */ |
||
91 | public function getMeasurements($metric, array $keys, $defaultValue = 'Nan') { |
||
109 | } |
||
110 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.