Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
BracketResult
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 3
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2declare( strict_types = 1 );
3
4namespace Wikimedia\LangConv;
5
6/**
7 * A simple tuple type for the results of ReplacementMachine::countBrackets().
8 */
9class BracketResult {
10    /**
11     * The number of codepoints we wouldn't have to escape.
12     * @var int
13     */
14    public $safe;
15    /**
16     * The number of codepoints we'd have to specially escape.
17     * @var int
18     */
19    public $unsafe;
20    /**
21     * The total number of codepoints (sum of `safe` and `unsafe`).
22     * @var int
23     */
24    public $length;
25
26    /**
27     * Create a new BracketResult.
28     * @param int $safe
29     * @param int $unsafe
30     * @param int $length
31     */
32    public function __construct( int $safe, int $unsafe, int $length ) {
33        $this->safe = $safe;
34        $this->unsafe = $unsafe;
35        $this->length = $length;
36    }
37}