-
Notifications
You must be signed in to change notification settings - Fork 574
Expand file tree
/
Copy pathbug-14178.php
More file actions
43 lines (35 loc) · 845 Bytes
/
bug-14178.php
File metadata and controls
43 lines (35 loc) · 845 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php declare(strict_types = 1);
namespace Bug14178;
use function PHPStan\Testing\assertType;
class HelloWorld {
/**
* @return list<string>
*/
public static function diff(
?self $previousVersion,
?self $newVersion,
): array {
$previousVersionExists = $previousVersion !== null;
$newVersionExists = $newVersion !== null;
if (!$previousVersionExists && !$newVersionExists) {
return [];
}
if ($previousVersionExists && !$newVersionExists) {
return ['bar'];
}
if (!$previousVersionExists) {
assertType('true', $newVersionExists);
assertType('Bug14178\\HelloWorld', $newVersion);
$result = [];
$result[] = 'foo';
$categoryString = implode(', ', $newVersion->getSomething());
}
return [];
}
/**
* @return array<string>
*/
private function getSomething(): array {
return ['foo'];
}
}