3232 */
3333class UpdateComposerJson extends Builder
3434{
35- private const WHITELIST_REQUIRE = [
35+ private const ALLOWLIST_REQUIRE = [
3636 'php ' ,
3737 ];
3838
39- private const WHITELIST_REQUIRE_DEV = [
39+ private const ALLOWLIST_REQUIRE_DEV = [
4040 'ramsey/devtools ' ,
4141 ];
4242
43- private const WHITELIST_AUTOLOAD = [
43+ private const ALLOWLIST_AUTOLOAD = [
4444 'Vendor \\SubNamespace \\' ,
4545 ];
4646
47- private const WHITELIST_AUTOLOAD_DEV = [
47+ private const ALLOWLIST_AUTOLOAD_DEV = [
4848 'Vendor \\Test \\SubNamespace \\' ,
4949 ];
5050
@@ -86,16 +86,16 @@ public function build(): void
8686
8787 /**
8888 * @param array<string, string> $data
89- * @param string[] $whitelist
89+ * @param string[] $allowlist
9090 *
9191 * @return array<string, string>
9292 */
93- private function filterPropertiesByWhitelist (array $ data , array $ whitelist ): array
93+ private function filterPropertiesByAllowlist (array $ data , array $ allowlist ): array
9494 {
9595 $ filtered = [];
9696
9797 foreach ($ data as $ property => $ value ) {
98- if (in_array ($ property , $ whitelist )) {
98+ if (in_array ($ property , $ allowlist )) {
9999 $ filtered [$ property ] = $ value ;
100100 }
101101 }
@@ -155,9 +155,9 @@ private function buildRequire(array &$composer): void
155155 return ;
156156 }
157157
158- $ composer ['require ' ] = $ this ->filterPropertiesByWhitelist (
158+ $ composer ['require ' ] = $ this ->filterPropertiesByAllowlist (
159159 $ composer ['require ' ],
160- self ::WHITELIST_REQUIRE ,
160+ self ::ALLOWLIST_REQUIRE ,
161161 );
162162 }
163163
@@ -170,9 +170,9 @@ private function buildRequireDev(array &$composer): void
170170 return ;
171171 }
172172
173- $ composer ['require-dev ' ] = $ this ->filterPropertiesByWhitelist (
173+ $ composer ['require-dev ' ] = $ this ->filterPropertiesByAllowlist (
174174 $ composer ['require-dev ' ],
175- self ::WHITELIST_REQUIRE_DEV ,
175+ self ::ALLOWLIST_REQUIRE_DEV ,
176176 );
177177 }
178178
@@ -185,9 +185,9 @@ private function buildAutoload(array &$composer): void
185185 return ;
186186 }
187187
188- $ composer ['autoload ' ]['psr-4 ' ] = $ this ->filterPropertiesByWhitelist (
188+ $ composer ['autoload ' ]['psr-4 ' ] = $ this ->filterPropertiesByAllowlist (
189189 $ composer ['autoload ' ]['psr-4 ' ],
190- self ::WHITELIST_AUTOLOAD ,
190+ self ::ALLOWLIST_AUTOLOAD ,
191191 );
192192 }
193193
@@ -200,9 +200,9 @@ private function buildAutoloadDev(array &$composer): void
200200 return ;
201201 }
202202
203- $ composer ['autoload-dev ' ]['psr-4 ' ] = $ this ->filterPropertiesByWhitelist (
203+ $ composer ['autoload-dev ' ]['psr-4 ' ] = $ this ->filterPropertiesByAllowlist (
204204 $ composer ['autoload-dev ' ]['psr-4 ' ],
205- self ::WHITELIST_AUTOLOAD_DEV ,
205+ self ::ALLOWLIST_AUTOLOAD_DEV ,
206206 );
207207 }
208208}
0 commit comments