Skip to content

Commit 6eb6ce8

Browse files
Declare classes readonly
1 parent 8e937ac commit 6eb6ce8

14 files changed

+44
-44
lines changed

src/Node/Builder.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
*
3131
* @phpstan-import-type TestType from \SebastianBergmann\CodeCoverage\CodeCoverage
3232
*/
33-
final class Builder
33+
final readonly class Builder
3434
{
35-
private readonly FileAnalyser $analyser;
35+
private FileAnalyser $analyser;
3636

3737
public function __construct(FileAnalyser $analyser)
3838
{

src/Node/CrapIndex.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
/**
1515
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
1616
*/
17-
final class CrapIndex
17+
final readonly class CrapIndex
1818
{
19-
private readonly int $cyclomaticComplexity;
20-
private readonly float $codeCoverage;
19+
private int $cyclomaticComplexity;
20+
private float $codeCoverage;
2121

2222
public function __construct(int $cyclomaticComplexity, float $codeCoverage)
2323
{

src/Report/Crap4j.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
use SebastianBergmann\CodeCoverage\Node\File;
2323
use SebastianBergmann\CodeCoverage\Util\Filesystem;
2424

25-
final class Crap4j
25+
final readonly class Crap4j
2626
{
27-
private readonly int $threshold;
27+
private int $threshold;
2828

2929
public function __construct(int $threshold = 30)
3030
{

src/Report/Html/Colors.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@
1212
/**
1313
* @immutable
1414
*/
15-
final class Colors
15+
final readonly class Colors
1616
{
17-
private readonly string $successLow;
18-
private readonly string $successMedium;
19-
private readonly string $successHigh;
20-
private readonly string $warning;
21-
private readonly string $danger;
17+
private string $successLow;
18+
private string $successMedium;
19+
private string $successHigh;
20+
private string $warning;
21+
private string $danger;
2222

2323
public static function default(): self
2424
{

src/Report/Html/CustomCssFile.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
/**
1616
* @immutable
1717
*/
18-
final class CustomCssFile
18+
final readonly class CustomCssFile
1919
{
20-
private readonly string $path;
20+
private string $path;
2121

2222
public static function default(): self
2323
{

src/Report/Html/Facade.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@
2222
use SebastianBergmann\Template\Exception;
2323
use SebastianBergmann\Template\Template;
2424

25-
final class Facade
25+
final readonly class Facade
2626
{
27-
private readonly string $templatePath;
28-
private readonly string $generator;
29-
private readonly Colors $colors;
30-
private readonly Thresholds $thresholds;
31-
private readonly CustomCssFile $customCssFile;
27+
private string $templatePath;
28+
private string $generator;
29+
private Colors $colors;
30+
private Thresholds $thresholds;
31+
private CustomCssFile $customCssFile;
3232

3333
public function __construct(string $generator = '', ?Colors $colors = null, ?Thresholds $thresholds = null, ?CustomCssFile $customCssFile = null)
3434
{

src/Report/Thresholds.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
/**
1515
* @immutable
1616
*/
17-
final class Thresholds
17+
final readonly class Thresholds
1818
{
19-
private readonly int $lowUpperBound;
20-
private readonly int $highLowerBound;
19+
private int $lowUpperBound;
20+
private int $highLowerBound;
2121

2222
public static function default(): self
2323
{

src/Report/Xml/BuildInformation.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
/**
1919
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
2020
*/
21-
final class BuildInformation
21+
final readonly class BuildInformation
2222
{
23-
private readonly DOMElement $contextNode;
23+
private DOMElement $contextNode;
2424

2525
public function __construct(DOMElement $contextNode)
2626
{

src/Report/Xml/Method.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
/**
1515
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
1616
*/
17-
final class Method
17+
final readonly class Method
1818
{
19-
private readonly DOMElement $contextNode;
19+
private DOMElement $contextNode;
2020

2121
public function __construct(DOMElement $context, string $name)
2222
{

src/Report/Xml/Source.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
/**
1818
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
1919
*/
20-
final class Source
20+
final readonly class Source
2121
{
22-
private readonly DOMElement $context;
22+
private DOMElement $context;
2323

2424
public function __construct(DOMElement $context)
2525
{

src/Report/Xml/Tests.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
*
1818
* @phpstan-import-type TestType from \SebastianBergmann\CodeCoverage\CodeCoverage
1919
*/
20-
final class Tests
20+
final readonly class Tests
2121
{
22-
private readonly DOMElement $contextNode;
22+
private DOMElement $contextNode;
2323

2424
public function __construct(DOMElement $context)
2525
{

src/Report/Xml/Totals.php

+7-7
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@
1717
/**
1818
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
1919
*/
20-
final class Totals
20+
final readonly class Totals
2121
{
22-
private readonly DOMNode $container;
23-
private readonly DOMElement $linesNode;
24-
private readonly DOMElement $methodsNode;
25-
private readonly DOMElement $functionsNode;
26-
private readonly DOMElement $classesNode;
27-
private readonly DOMElement $traitsNode;
22+
private DOMNode $container;
23+
private DOMElement $linesNode;
24+
private DOMElement $methodsNode;
25+
private DOMElement $functionsNode;
26+
private DOMElement $classesNode;
27+
private DOMElement $traitsNode;
2828

2929
public function __construct(DOMElement $container)
3030
{

src/Report/Xml/Unit.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
/**
1616
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
1717
*/
18-
final class Unit
18+
final readonly class Unit
1919
{
20-
private readonly DOMElement $contextNode;
20+
private DOMElement $contextNode;
2121

2222
public function __construct(DOMElement $context, string $name)
2323
{

src/Util/Percentage.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
/**
1515
* @internal This class is not covered by the backward compatibility promise for phpunit/php-code-coverage
1616
*/
17-
final class Percentage
17+
final readonly class Percentage
1818
{
19-
private readonly float $fraction;
20-
private readonly float $total;
19+
private float $fraction;
20+
private float $total;
2121

2222
public static function fromFractionAndTotal(float $fraction, float $total): self
2323
{

0 commit comments

Comments
 (0)