File tree Expand file tree Collapse file tree 6 files changed +11
-32
lines changed Expand file tree Collapse file tree 6 files changed +11
-32
lines changed Original file line number Diff line number Diff line change @@ -36,19 +36,11 @@ class AssetInstaller
36
36
{
37
37
use UnparseableTokensTrait;
38
38
39
- /** @var Composer */
40
- private $ composer ;
41
-
42
- /** @var IOInterface */
43
- private $ io ;
44
-
45
39
/** @var string Base path for project; default is current working dir. */
46
40
private $ projectPath ;
47
41
48
- public function __construct (Composer $ composer , IOInterface $ io )
42
+ public function __construct (private Composer $ composer , private IOInterface $ io )
49
43
{
50
- $ this ->composer = $ composer ;
51
- $ this ->io = $ io ;
52
44
$ this ->projectPath = getcwd ();
53
45
}
54
46
Original file line number Diff line number Diff line change @@ -32,22 +32,14 @@ class AssetUninstaller
32
32
{
33
33
use UnparseableTokensTrait;
34
34
35
- /** @var Composer */
36
- private $ composer ;
37
-
38
35
/** @var string[] .gitignore rules */
39
- private $ gitignore = [];
40
-
41
- /** @var IOInterface */
42
- private $ io ;
36
+ private array $ gitignore = [];
43
37
44
38
/** @var string Base path for project; default is current working dir. */
45
39
private $ projectPath ;
46
40
47
- public function __construct (Composer $ composer , IOInterface $ io )
41
+ public function __construct (private Composer $ composer , private IOInterface $ io )
48
42
{
49
- $ this ->composer = $ composer ;
50
- $ this ->io = $ io ;
51
43
$ this ->projectPath = getcwd ();
52
44
}
53
45
Original file line number Diff line number Diff line change 18
18
19
19
class Plugin implements PluginInterface, EventSubscriberInterface
20
20
{
21
- /** @var Composer */
22
- private $ composer ;
21
+ private Composer $ composer ;
23
22
24
23
/**
25
24
* Array of installers to run following a dump-autoload operation.
26
25
*
27
26
* @var callable[]
28
27
*/
29
- private $ installers = [];
28
+ private array $ installers = [];
30
29
31
- /** @var IOInterface */
32
- private $ io ;
30
+ private IOInterface $ io ;
33
31
34
32
/**
35
33
* Provide composer event listeners.
Original file line number Diff line number Diff line change @@ -51,8 +51,7 @@ class AssetInstallerTest extends TestCase
51
51
/** @var IOInterface|ObjectProphecy */
52
52
private $ io ;
53
53
54
- /** @var vfsStreamDirectory */
55
- private $ filesystem ;
54
+ private vfsStreamDirectory $ filesystem ;
56
55
57
56
public function setUp (): void
58
57
{
Original file line number Diff line number Diff line change @@ -83,8 +83,7 @@ class AssetUninstallerTest extends TestCase
83
83
],
84
84
];
85
85
86
- /** @var vfsStreamDirectory */
87
- private $ filesystem ;
86
+ private vfsStreamDirectory $ filesystem ;
88
87
89
88
/** @var PackageInterface|ObjectProphecy */
90
89
private $ package ;
Original file line number Diff line number Diff line change @@ -24,8 +24,7 @@ class PluginTest extends TestCase
24
24
use DeprecatedAssertionsTrait;
25
25
use ProphecyTrait;
26
26
27
- /** @var vfsStreamDirectory */
28
- private $ filesystem ;
27
+ private vfsStreamDirectory $ filesystem ;
29
28
30
29
/** @var Composer|ObjectProphecy */
31
30
private $ composer ;
@@ -102,10 +101,10 @@ public function testOnPostAutoloadDumpTriggersInstallers(): void
102
101
/** @psalm-var object{operations: array<array-key,string>} $obj */
103
102
$ spy = (object ) ['operations ' => []];
104
103
105
- $ installer1 = function () use ($ spy ): void {
104
+ $ installer1 = static function () use ($ spy ): void {
106
105
$ spy ->operations [] = 'installer1 ' ;
107
106
};
108
- $ installer2 = function () use ($ spy ): void {
107
+ $ installer2 = static function () use ($ spy ): void {
109
108
$ spy ->operations [] = 'installer2 ' ;
110
109
};
111
110
You can’t perform that action at this time.
0 commit comments