@@ -20,8 +20,8 @@ final class SatelliteBuilder implements Configurator\SatelliteBuilderInterface
2020 ];
2121 private array $ authenticationTokens = [];
2222 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 ;
2525 /** @var iterable<array<string, string>> */
2626 private iterable $ paths = [];
2727 /** @var \AppendIterator<string,PackagingContract\FileInterface, \Iterator<string,PackagingContract\FileInterface>> */
@@ -55,7 +55,7 @@ public function withComposerRequire(string ...$package): self
5555
5656 public function withComposerFile (
5757 PackagingContract \AssetInterface |PackagingContract \FileInterface $ composerJsonFile ,
58- PackagingContract \AssetInterface |PackagingContract \FileInterface $ composerLockFile = null
58+ PackagingContract \AssetInterface |PackagingContract \FileInterface | null $ composerLockFile = null
5959 ): self {
6060 $ this ->composerJsonFile = $ composerJsonFile ;
6161 $ this ->composerLockFile = $ composerLockFile ;
@@ -65,7 +65,7 @@ public function withComposerFile(
6565
6666 public function withFile (
6767 PackagingContract \AssetInterface |PackagingContract \FileInterface $ source ,
68- string $ destinationPath = null
68+ ? string $ destinationPath = null
6969 ): self {
7070 if (!$ source instanceof PackagingContract \FileInterface) {
7171 $ source = new Packaging \VirtualFile ($ source );
@@ -80,7 +80,7 @@ public function withFile(
8080 return $ this ;
8181 }
8282
83- public function withDirectory (PackagingContract \DirectoryInterface $ source , string $ destinationPath = null ): self
83+ public function withDirectory (PackagingContract \DirectoryInterface $ source , ? string $ destinationPath = null ): self
8484 {
8585 $ this ->paths [] = [$ source ->getPath (), $ destinationPath ?? $ source ->getPath ()];
8686
@@ -110,7 +110,6 @@ public function withGitlabOauthAuthentication(string $token, string $domain = 'g
110110 {
111111 $ this ->authenticationTokens [$ domain ] = [
112112 'type ' => 'gitlab-oauth ' ,
113- 'url ' => $ domain ,
114113 'token ' => $ token ,
115114 ];
116115
@@ -121,7 +120,6 @@ public function withGitlabTokenAuthentication(string $token, string $domain = 'g
121120 {
122121 $ this ->authenticationTokens [$ domain ] = [
123122 'type ' => 'gitlab-token ' ,
124- 'url ' => $ domain ,
125123 'token ' => $ token ,
126124 ];
127125
@@ -132,7 +130,6 @@ public function withGithubOauthAuthentication(string $token, string $domain = 'g
132130 {
133131 $ this ->authenticationTokens [$ domain ] = [
134132 'type ' => 'github-oauth ' ,
135- 'url ' => $ domain ,
136133 'token ' => $ token ,
137134 ];
138135
@@ -143,7 +140,6 @@ public function withHttpBasicAuthentication(string $domain, string $username, st
143140 {
144141 $ this ->authenticationTokens [$ domain ] = [
145142 'type ' => 'http-basic ' ,
146- 'url ' => $ domain ,
147143 'username ' => $ username ,
148144 'password ' => $ password ,
149145 ];
@@ -155,7 +151,6 @@ public function withHttpBearerAuthentication(string $domain, string $token): sel
155151 {
156152 $ this ->authenticationTokens [$ domain ] = [
157153 'type ' => 'http-basic ' ,
158- 'url ' => $ domain ,
159154 'token ' => $ token ,
160155 ];
161156
@@ -211,10 +206,10 @@ public function build(): Configurator\SatelliteInterface
211206 if (\count ($ this ->authenticationTokens ) > 0 ) {
212207 foreach ($ this ->authenticationTokens as $ url => $ authentication ) {
213208 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 ),
218213 'http-bearer ' => $ composer ->addHttpBearerAuthentication ($ url , $ authentication ['token ' ]),
219214 default => $ composer ->addAuthenticationToken ($ url , $ authentication ['token ' ]),
220215 };
0 commit comments