@@ -20,8 +20,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface
20
20
];
21
21
private array $ authenticationTokens = [];
22
22
private array $ repositories = [];
23
- private null | PackagingContract \AssetInterface |PackagingContract \FileInterface $ composerJsonFile = null ;
24
- private null | PackagingContract \AssetInterface |PackagingContract \FileInterface $ composerLockFile = null ;
23
+ private PackagingContract \AssetInterface |PackagingContract \FileInterface | null $ composerJsonFile = null ;
24
+ private PackagingContract \AssetInterface |PackagingContract \FileInterface | null $ composerLockFile = null ;
25
25
/** @var iterable<array<string, string>> */
26
26
private iterable $ paths = [];
27
27
/** @var \AppendIterator<string,PackagingContract\FileInterface, \Iterator<string,PackagingContract\FileInterface>> */
@@ -55,7 +55,7 @@ public function withComposerRequire(string ...$package): self
55
55
56
56
public function withComposerFile (
57
57
PackagingContract \AssetInterface |PackagingContract \FileInterface $ composerJsonFile ,
58
- PackagingContract \AssetInterface |PackagingContract \FileInterface $ composerLockFile = null
58
+ PackagingContract \AssetInterface |PackagingContract \FileInterface | null $ composerLockFile = null
59
59
): self {
60
60
$ this ->composerJsonFile = $ composerJsonFile ;
61
61
$ this ->composerLockFile = $ composerLockFile ;
@@ -65,7 +65,7 @@ public function withComposerFile(
65
65
66
66
public function withFile (
67
67
PackagingContract \AssetInterface |PackagingContract \FileInterface $ source ,
68
- string $ destinationPath = null
68
+ ? string $ destinationPath = null
69
69
): self {
70
70
if (!$ source instanceof PackagingContract \FileInterface) {
71
71
$ source = new Packaging \VirtualFile ($ source );
@@ -80,7 +80,7 @@ public function withFile(
80
80
return $ this ;
81
81
}
82
82
83
- public function withDirectory (PackagingContract \DirectoryInterface $ source , string $ destinationPath = null ): self
83
+ public function withDirectory (PackagingContract \DirectoryInterface $ source , ? string $ destinationPath = null ): self
84
84
{
85
85
$ this ->paths [] = [$ source ->getPath (), $ destinationPath ?? $ source ->getPath ()];
86
86
@@ -110,7 +110,6 @@ public function withGitlabOauthAuthentication(string $token, string $domain = 'g
110
110
{
111
111
$ this ->authenticationTokens [$ domain ] = [
112
112
'type ' => 'gitlab-oauth ' ,
113
- 'url ' => $ domain ,
114
113
'token ' => $ token ,
115
114
];
116
115
@@ -121,7 +120,6 @@ public function withGitlabTokenAuthentication(string $token, string $domain = 'g
121
120
{
122
121
$ this ->authenticationTokens [$ domain ] = [
123
122
'type ' => 'gitlab-token ' ,
124
- 'url ' => $ domain ,
125
123
'token ' => $ token ,
126
124
];
127
125
@@ -132,7 +130,6 @@ public function withGithubOauthAuthentication(string $token, string $domain = 'g
132
130
{
133
131
$ this ->authenticationTokens [$ domain ] = [
134
132
'type ' => 'github-oauth ' ,
135
- 'url ' => $ domain ,
136
133
'token ' => $ token ,
137
134
];
138
135
@@ -143,7 +140,6 @@ public function withHttpBasicAuthentication(string $domain, string $username, st
143
140
{
144
141
$ this ->authenticationTokens [$ domain ] = [
145
142
'type ' => 'http-basic ' ,
146
- 'url ' => $ domain ,
147
143
'username ' => $ username ,
148
144
'password ' => $ password ,
149
145
];
@@ -155,7 +151,6 @@ public function withHttpBearerAuthentication(string $domain, string $token): sel
155
151
{
156
152
$ this ->authenticationTokens [$ domain ] = [
157
153
'type ' => 'http-basic ' ,
158
- 'url ' => $ domain ,
159
154
'token ' => $ token ,
160
155
];
161
156
@@ -211,10 +206,10 @@ public function build(): Configurator\SatelliteInterface
211
206
if (\count ($ this ->authenticationTokens ) > 0 ) {
212
207
foreach ($ this ->authenticationTokens as $ url => $ authentication ) {
213
208
match ($ authentication ['type ' ]) {
214
- 'gitlab-oauth ' => $ composer ->addGitlabOauthAuthentication ($ authentication ['token ' ]),
215
- 'gitlab-token ' => $ composer ->addGitlabTokenAuthentication ($ authentication ['token ' ]),
216
- 'github-oauth ' => $ composer ->addGithubOauthAuthentication ($ authentication ['token ' ]),
217
- 'http-basic ' => $ composer ->addHttpBasicAuthentication ($ url , $ authentication ['username ' ], $ authentication [ ' password ' ] ),
209
+ 'gitlab-oauth ' => $ composer ->addGitlabOauthAuthentication ($ authentication ['token ' ], $ url ),
210
+ 'gitlab-token ' => $ composer ->addGitlabTokenAuthentication ($ authentication ['token ' ], $ url ),
211
+ 'github-oauth ' => $ composer ->addGithubOauthAuthentication ($ authentication ['token ' ], $ url ),
212
+ 'http-basic ' => $ composer ->addHttpBasicAuthentication ($ url , $ authentication ['username ' ], $ url ),
218
213
'http-bearer ' => $ composer ->addHttpBearerAuthentication ($ url , $ authentication ['token ' ]),
219
214
default => $ composer ->addAuthenticationToken ($ url , $ authentication ['token ' ]),
220
215
};
0 commit comments