Skip to content

Commit f8dd44a

Browse files
committed
feat: increase to type coverage level 21
1 parent 3594912 commit f8dd44a

File tree

5 files changed

+34
-34
lines changed

5 files changed

+34
-34
lines changed

.rector.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//->withPhpSets()
1414
->withPhp74Sets()
1515
->withPhpVersion(70400)
16-
->withTypeCoverageLevel(13)
16+
->withTypeCoverageLevel(21)
1717
->withPreparedSets(
1818
true,
1919
true

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"psr/http-factory": "^1.0"
3131
},
3232
"require-dev": {
33-
"art4/rector-bc-library": "dev-main",
33+
"art4/rector-bc-library": "dev-main#1cf3b8908e28b2bebc2fb26f7d151491dd23471f",
3434
"behat/behat": "^3.14",
3535
"friendsofphp/php-cs-fixer": "^3.68",
3636
"guzzlehttp/psr7": "^2",

tests/Behat/Bootstrap/FeatureContext.php

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ final class FeatureContext implements Context
4545
/**
4646
* @BeforeSuite
4747
*/
48-
public static function prepare(BeforeSuiteScope $scope)
48+
public static function prepare(BeforeSuiteScope $scope): void
4949
{
5050
self::$tracer = new BehatHookTracer();
5151
self::$tracer->hook($scope);
@@ -54,15 +54,15 @@ public static function prepare(BeforeSuiteScope $scope)
5454
/**
5555
* @AfterScenario
5656
*/
57-
public static function reset(AfterScenarioScope $scope)
57+
public static function reset(AfterScenarioScope $scope): void
5858
{
5959
self::$tracer->hook($scope);
6060
}
6161

6262
/**
6363
* @AfterSuite
6464
*/
65-
public static function clean(AfterSuiteScope $scope)
65+
public static function clean(AfterSuiteScope $scope): void
6666
{
6767
self::$tracer->hook($scope);
6868
self::$tracer = null;
@@ -95,7 +95,7 @@ public function __construct(string $redmineVersion, string $rootPath)
9595
/**
9696
* @Given I have a :clientName client
9797
*/
98-
public function iHaveAClient($clientName)
98+
public function iHaveAClient($clientName): void
9999
{
100100
if ($clientName !== 'NativeCurlClient') {
101101
throw new InvalidArgumentException('Client ' . $clientName . ' is not supported.');
@@ -122,7 +122,7 @@ private function registerClientResponse(mixed $lastReturn, Response $lastRespons
122122
/**
123123
* @Then the response has the status code :statusCode
124124
*/
125-
public function theResponseHasTheStatusCode(int $statusCode)
125+
public function theResponseHasTheStatusCode(int $statusCode): void
126126
{
127127
TestCase::assertSame(
128128
$statusCode,
@@ -134,7 +134,7 @@ public function theResponseHasTheStatusCode(int $statusCode)
134134
/**
135135
* @Then the response has the content type :contentType
136136
*/
137-
public function theResponseHasTheContentType(string $contentType)
137+
public function theResponseHasTheContentType(string $contentType): void
138138
{
139139
TestCase::assertStringStartsWith(
140140
$contentType,
@@ -146,87 +146,87 @@ public function theResponseHasTheContentType(string $contentType)
146146
/**
147147
* @Then the response has an empty content type
148148
*/
149-
public function theResponseHasAnEmptyContentType()
149+
public function theResponseHasAnEmptyContentType(): void
150150
{
151151
TestCase::assertSame('', $this->lastResponse->getContentType());
152152
}
153153

154154
/**
155155
* @Then the response has the content :content
156156
*/
157-
public function theResponseHasTheContent(string $content)
157+
public function theResponseHasTheContent(string $content): void
158158
{
159159
TestCase::assertSame($content, $this->lastResponse->getContent());
160160
}
161161

162162
/**
163163
* @Then the response has the content
164164
*/
165-
public function theResponseHasTheContentWithMultipleLines(PyStringNode $string)
165+
public function theResponseHasTheContentWithMultipleLines(PyStringNode $string): void
166166
{
167167
TestCase::assertSame($string->getRaw(), $this->lastResponse->getContent());
168168
}
169169

170170
/**
171171
* @Then the returned data is true
172172
*/
173-
public function theReturnedDataIsTrue()
173+
public function theReturnedDataIsTrue(): void
174174
{
175175
TestCase::assertTrue($this->lastReturn);
176176
}
177177

178178
/**
179179
* @Then the returned data is false
180180
*/
181-
public function theReturnedDataIsFalse()
181+
public function theReturnedDataIsFalse(): void
182182
{
183183
TestCase::assertFalse($this->lastReturn);
184184
}
185185

186186
/**
187187
* @Then the returned data is exactly :content
188188
*/
189-
public function theReturnedDataIsExactly(string $content)
189+
public function theReturnedDataIsExactly(string $content): void
190190
{
191191
TestCase::assertSame($content, $this->lastReturn);
192192
}
193193

194194
/**
195195
* @Then the returned data is exactly
196196
*/
197-
public function theReturnedDataIsExactlyWithMultipleLines(PyStringNode $string)
197+
public function theReturnedDataIsExactlyWithMultipleLines(PyStringNode $string): void
198198
{
199199
TestCase::assertSame($string->getRaw(), $this->lastReturn);
200200
}
201201

202202
/**
203203
* @Then the returned data is an instance of :className
204204
*/
205-
public function theReturnedDataIsAnInstanceOf(string $className)
205+
public function theReturnedDataIsAnInstanceOf(string $className): void
206206
{
207207
TestCase::assertInstanceOf($className, $this->lastReturn);
208208
}
209209

210210
/**
211211
* @Then the returned data is an array
212212
*/
213-
public function theReturnedDataIsAnArray()
213+
public function theReturnedDataIsAnArray(): void
214214
{
215215
TestCase::assertIsArray($this->lastReturn);
216216
}
217217

218218
/**
219219
* @Then the returned data contains :count items
220220
*/
221-
public function theReturnedDataContainsItems(int $count)
221+
public function theReturnedDataContainsItems(int $count): void
222222
{
223223
TestCase::assertCount($count, $this->lastReturn);
224224
}
225225

226226
/**
227227
* @Then the returned data contains the following data
228228
*/
229-
public function theReturnedDataContainsTheFollowingData(TableNode $table)
229+
public function theReturnedDataContainsTheFollowingData(TableNode $table): void
230230
{
231231
$returnData = $this->lastReturn;
232232

@@ -240,23 +240,23 @@ public function theReturnedDataContainsTheFollowingData(TableNode $table)
240240
/**
241241
* @Then the returned data has only the following properties
242242
*/
243-
public function theReturnedDataHasOnlyTheFollowingProperties(PyStringNode $string)
243+
public function theReturnedDataHasOnlyTheFollowingProperties(PyStringNode $string): void
244244
{
245245
$this->theReturnedDataPropertyHasOnlyTheFollowingProperties(null, $string);
246246
}
247247

248248
/**
249249
* @Then the returned data has proterties with the following data
250250
*/
251-
public function theReturnedDataHasProtertiesWithTheFollowingData(TableNode $table)
251+
public function theReturnedDataHasProtertiesWithTheFollowingData(TableNode $table): void
252252
{
253253
$this->theReturnedDataPropertyContainsTheFollowingData(null, $table);
254254
}
255255

256256
/**
257257
* @Then the returned data :property property is an array
258258
*/
259-
public function theReturnedDataPropertyIsAnArray($property)
259+
public function theReturnedDataPropertyIsAnArray($property): void
260260
{
261261
$returnData = $this->getLastReturnAsArray();
262262

@@ -268,7 +268,7 @@ public function theReturnedDataPropertyIsAnArray($property)
268268
/**
269269
* @Then the returned data :property property contains :count items
270270
*/
271-
public function theReturnedDataPropertyContainsItems($property, int $count)
271+
public function theReturnedDataPropertyContainsItems($property, int $count): void
272272
{
273273
$returnData = $this->getLastReturnAsArray();
274274

@@ -281,7 +281,7 @@ public function theReturnedDataPropertyContainsItems($property, int $count)
281281
/**
282282
* @Then the returned data :property property contains the following data
283283
*/
284-
public function theReturnedDataPropertyContainsTheFollowingData($property, TableNode $table)
284+
public function theReturnedDataPropertyContainsTheFollowingData($property, TableNode $table): void
285285
{
286286
$returnData = $this->getItemFromArray($this->getLastReturnAsArray(), $property);
287287

@@ -295,7 +295,7 @@ public function theReturnedDataPropertyContainsTheFollowingData($property, Table
295295
/**
296296
* @Then the returned data :property property contains the following data with Redmine version :versionComparision
297297
*/
298-
public function theReturnedDataPropertyContainsTheFollowingDataWithRedmineVersion($property, string $versionComparision, TableNode $table)
298+
public function theReturnedDataPropertyContainsTheFollowingDataWithRedmineVersion($property, string $versionComparision, TableNode $table): void
299299
{
300300
$parts = explode(' ', $versionComparision);
301301

@@ -313,7 +313,7 @@ public function theReturnedDataPropertyContainsTheFollowingDataWithRedmineVersio
313313
/**
314314
* @Then the returned data :property property has only the following properties
315315
*/
316-
public function theReturnedDataPropertyHasOnlyTheFollowingProperties($property, PyStringNode $string)
316+
public function theReturnedDataPropertyHasOnlyTheFollowingProperties($property, PyStringNode $string): void
317317
{
318318
$value = $this->getItemFromArray($this->getLastReturnAsArray(), $property);
319319

@@ -325,7 +325,7 @@ public function theReturnedDataPropertyHasOnlyTheFollowingProperties($property,
325325
/**
326326
* @Then the returned data :property property has only the following properties with Redmine version :versionComparision
327327
*/
328-
public function theReturnedDataPropertyHasOnlyTheFollowingPropertiesWithRedmineVersion($property, string $versionComparision, PyStringNode $string)
328+
public function theReturnedDataPropertyHasOnlyTheFollowingPropertiesWithRedmineVersion($property, string $versionComparision, PyStringNode $string): void
329329
{
330330
$parts = explode(' ', $versionComparision);
331331

@@ -388,7 +388,7 @@ private function getItemFromArray(array $array, $key): mixed
388388
return $array;
389389
}
390390

391-
private function assertTableNodeIsSameAsArray(TableNode $table, array $data)
391+
private function assertTableNodeIsSameAsArray(TableNode $table, array $data): void
392392
{
393393
foreach ($table as $row) {
394394
TestCase::assertArrayHasKey($row['property'], $data, 'Possible keys are: ' . implode(', ', array_keys($data)));

tests/Fixtures/AssertingHttpClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ private function assertRequestData(
5757
int $responseCode = 200,
5858
string $responseContentType = '',
5959
string $responseContent = ''
60-
) {
60+
): void {
6161
if ($responseContentType === '') {
6262
$responseContentType = $contentType;
6363
}

tests/RedmineExtension/RedmineInstance.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ public function excecuteDatabaseQuery(string $query, array $options = [], ?array
160160
$stmt->execute($params);
161161
}
162162

163-
private function runDatabaseMigration()
163+
private function runDatabaseMigration(): void
164164
{
165165
$now = new DateTimeImmutable();
166166
$pdo = new PDO('sqlite:' . $this->dataPath . $this->workingDB);
@@ -196,7 +196,7 @@ private function runDatabaseMigration()
196196
/**
197197
* Create backup of working database
198198
*/
199-
private function createDatabaseBackup()
199+
private function createDatabaseBackup(): void
200200
{
201201
$workingDB = new SQLite3($this->dataPath . $this->workingDB);
202202

@@ -211,7 +211,7 @@ private function createDatabaseBackup()
211211
/**
212212
* Create backup of migrated database
213213
*/
214-
private function saveMigratedDatabase()
214+
private function saveMigratedDatabase(): void
215215
{
216216
$workingDB = new SQLite3($this->dataPath . $this->workingDB);
217217

@@ -253,7 +253,7 @@ private function removeDatabaseBackups(): void
253253
unlink($this->dataPath . $this->backupDB);
254254
}
255255

256-
private function createFilesBackup()
256+
private function createFilesBackup(): void
257257
{
258258
// Add an empty file to avoid warnings about copying and removing content from an empty folder
259259
touch($this->dataPath . $this->workingFiles . 'empty');
@@ -264,7 +264,7 @@ private function createFilesBackup()
264264
));
265265
}
266266

267-
private function saveMigratedFiles()
267+
private function saveMigratedFiles(): void
268268
{
269269
exec(sprintf(
270270
'cp -r %s %s',

0 commit comments

Comments
 (0)