@@ -27,11 +27,11 @@ public function __construct(Stringify $stringify, Config $config)
27
27
$ this ->config = $ config ;
28
28
}
29
29
30
- public function items (array $ items , array $ target = []): self
30
+ public function items (array $ items , array $ target = [], bool $ secure = true ): self
31
31
{
32
- $ this -> items = $ this ->map (
33
- $ this -> filter ( $ items , $ target )
34
- );
32
+ $ filtered = $ this ->filter ( $ items , $ target );
33
+
34
+ $ this -> items = $ this -> map ( $ filtered , $ secure );
35
35
36
36
return $ this ;
37
37
}
@@ -69,14 +69,14 @@ protected function filter(array $items, array $target): array
69
69
return $ items ;
70
70
}
71
71
72
- protected function map (array $ items ): array
72
+ protected function map (array $ items, bool $ secure ): array
73
73
{
74
74
$ result = [];
75
75
76
76
foreach ($ items as $ key => $ value ) {
77
77
$ key = Str::upper ($ key );
78
78
79
- $ replaced = $ this ->replace ($ key , $ value );
79
+ $ replaced = $ this ->replace ($ key , $ value, $ secure );
80
80
81
81
$ result [$ key ] = $ this ->parseStringValue ($ replaced );
82
82
}
@@ -117,9 +117,9 @@ protected function compile(array $items): string
117
117
return trim ($ result ) . $ separator ;
118
118
}
119
119
120
- protected function replace (string $ key , $ value )
120
+ protected function replace (string $ key , $ value, bool $ secure )
121
121
{
122
- return $ this ->isForceHiding ($ key ) ? null : $ this ->value ($ key , $ value );
122
+ return $ this ->isForceHiding ($ key ) && $ secure ? null : $ this ->value ($ key , $ value );
123
123
}
124
124
125
125
protected function isForceHiding (string $ key ): bool
0 commit comments