Skip to content

Commit 8da58bd

Browse files
committed
tests: Add type declaration to undocumented class property and functions
Change-Id: I90621355353780e1e000c80c349da68e60c48172
1 parent edf8e07 commit 8da58bd

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

.phpcs.xml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
<ruleset>
33
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
44
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
5-
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
6-
<exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPrivate" />
75
<exclude name="MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate" />
86
<exclude name="Generic.Files.OneObjectStructurePerFile.MultipleFound" />
97
</rule>

test/CSSJanusBenchmark.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
class CSSJanusBenchmark {
4-
private $fixtures;
4+
private array $fixtures;
55

66
/**
77
* @param null|array<string,string> $fixtures Map from label to input CSS
@@ -27,7 +27,7 @@ public function run() {
2727
}
2828
}
2929

30-
protected function outputStat( $name, $data, $iterations, $total, $max ) {
30+
protected function outputStat( string $name, array $data, int $iterations, float $total, float $max ) {
3131
$version = hash( 'fnv132', $data );
3232
$mean = $total / $iterations; // in milliseconds
3333
$ratePerSecond = 1.0 / ( $mean / 1000.0 );
@@ -42,12 +42,12 @@ protected function outputStat( $name, $data, $iterations, $total, $max ) {
4242
);
4343
}
4444

45-
private function formatSize( $size ) {
45+
private function formatSize( int $size ): int {
4646
$i = floor( log( $size, 1024 ) );
4747
return round( $size / pow( 1024, $i ), [ 0, 0, 2, 2, 3 ][$i] ) . ' ' . [ 'B', 'KB', 'MB', 'GB', 'TB' ][$i];
4848
}
4949

50-
protected function getFixtures() {
50+
protected function getFixtures(): array {
5151
$fixtures = [
5252
'mediawiki-legacy-shared' => [
5353
'version' => '1064426',

0 commit comments

Comments
 (0)