@@ -68,6 +68,7 @@ The `OutputPipeline` is responsible transforming the Bag data to the desired out
68
68
``` mermaid
69
69
graph TD;
70
70
toArray("Bag->toArray()") --> processParameters
71
+ toCollection("Bag->toCollection()") --> processParameters
71
72
toJson("Bag->toJson()") --> processParameters
72
73
jsonEncode("json_encode($bag)") --> processParameters
73
74
get("Bag->get()") --> processParameters
@@ -82,11 +83,12 @@ processParameters(Process Parameters)
82
83
--> wrap(Wrap Output*)
83
84
--> output(array or JSON string)
84
85
85
- class toArray,toJson,jsonEncode,get,unwrapped mermaid-start
86
+ class toArray,toCollection, toJson,jsonEncode,get,unwrapped mermaid-start
86
87
class output mermaid-end
87
88
class hide,hideJson,wrap mermaid-conditional
88
89
89
90
click toArray "https://github.com/dshafik/bag/blob/main/src/Bag/Concerns/WithArrayable.php" _blank
91
+ click toCollection "https://github.com/dshafik/bag/blob/main/src/Bag/Concerns/WithCollections.php" _blank
90
92
click toJson "https://github.com/dshafik/bag/blob/main/src/Bag/Concerns/WithJson.php" _blank
91
93
click get "https://github.com/dshafik/bag/blob/main/src/Bag/Concerns/WithOutput.php" _blank
92
94
click unwrapped "https://github.com/dshafik/bag/blob/main/src/Bag/Concerns/WithOutput.php" _blank
@@ -138,6 +140,50 @@ click extra "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/Ex
138
140
click validate "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/Validate.php" _blank
139
141
```
140
142
143
+ ## The Without Validate Pipeline
144
+
145
+ The [ ` WithoutValidationPipeline ` ] ( https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/WithoutValidationPipeline.php ) is identical to the ` InputPipeline ` but does not perform validation. The pipeline
146
+ consists of the following steps:
147
+
148
+ ``` mermaid
149
+ graph TD;
150
+ start("Bag::from($data)")
151
+ --> transform(Transform Input)
152
+ --> process(Process Parameters)
153
+ --> variadic(Is Variadic?)
154
+ --> mapInput(Map Input)
155
+ --> laravelParams(Laravel Route Parameter Binding)
156
+ -- Finalized Input Values --> missing(Missing Parameters) --> missingError{Error?}
157
+ missingError -- Yes --> errorMissingParameters(MissingPropertiesException)
158
+ missingError -- No --> extra(Extra Parameters) --> extraError{Error?}
159
+ extraError -- Yes --> errorExtraParameters(ExtraPropertiesException)
160
+ extraError -- No
161
+ --> construct("new Bag(...)")
162
+ --> computed(Verify Computed Values)
163
+ --> initialized{Initialized?}
164
+ initialized -- No --> errorInitialization(ComputedPropertyUninitializedException)
165
+ initialized -- Yes
166
+ --> bag(Bag Value Returned)
167
+
168
+ class start mermaid-start
169
+ class missingError,extraError,valid,initialized mermaid-decision
170
+ class bag mermaid-end
171
+ class errorMissingParameters,errorExtraParameters,errorValidation,errorInitialization mermaid-error
172
+
173
+ click start "https://github.com/dshafik/bag/blob/main/src/Bag/Bag.php" _blank
174
+ click transform "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/Transform.php" _blank
175
+ click process "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/ProcessParameters.php" _blank
176
+ click variadic "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/IsVariadic.php" _blank
177
+ click mapInput "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/MapInput.php" _blank
178
+ click laravelParams "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/LaravelRouteParameters.php" _blank
179
+ click missing "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/MissingParameters.php" _blank
180
+ click extra "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/ExtraParameters.php" _blank
181
+ click validate "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/Validate.php" _blank
182
+ click cast "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/CastInputValues.php" _blank
183
+ click construct "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/FillBag.php" _blank
184
+ click computed "https://github.com/dshafik/bag/blob/main/src/Bag/Pipelines/Pipes/ComputedValues.php" _blank
185
+ ```
186
+
141
187
## The Output Collection Pipeline
142
188
143
189
The ` OutputCollectionPipeline ` is responsible for transforming the Bag collection data to the desired output array or JSON. The pipeline consists of the following steps:
0 commit comments