Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
1 / 1
BlockInfo
100.00% covered (success)
100.00%
5 / 5
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
1 / 1
 __construct
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 getNumActiveBlocks
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 jsonSerialize
100.00% covered (success)
100.00%
3 / 3
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace MediaWiki\IPInfo\Info;
4
5use JsonSerializable;
6
7class BlockInfo implements JsonSerializable {
8
9    private int $numActiveBlocks;
10
11    public function __construct( int $numActiveBlocks = 0 ) {
12        $this->numActiveBlocks = $numActiveBlocks;
13    }
14
15    public function getNumActiveBlocks(): int {
16        return $this->numActiveBlocks;
17    }
18
19    public function jsonSerialize(): array {
20        return [
21            'numActiveBlocks' => $this->getNumActiveBlocks(),
22        ];
23    }
24}