19 declare(strict_types=1);
34 return new class ($string) extends
NullPath {
44 public array $executed_actions = [];
51 $cloned_set = clone
$set;
52 $cloned_set->actions[] = [
53 'action' =>
'create or update',
54 'path' => $path->string,
65 $cloned_set = clone
$set;
66 $cloned_set->actions[] = [
67 'action' =>
'force create',
68 'path' => $path->string,
78 $cloned_set = clone
$set;
79 $cloned_set->actions[] = [
81 'path' => $path->string
88 $set->executed_actions = $set->actions;
93 public array $actions = [];
94 public array $executed_actions = [];
108 'action' =>
'create or update',
110 'values' => [
'value 1']
113 'action' =>
'create or update',
115 'values' => [
'value 20',
'value 21',
'value 22']
118 $manipulator1 = $manipulator->prepareCreateOrUpdate(
122 $manipulator2 = $manipulator1->prepareCreateOrUpdate(
130 $manipulator->exposeSet()->actions
134 $manipulator1->exposeSet()->actions
138 $manipulator2->exposeSet()->actions
145 'action' =>
'force create',
147 'values' => [
'value 1']
150 'action' =>
'force create',
152 'values' => [
'value 20',
'value 21',
'value 22']
155 $manipulator1 = $manipulator->prepareForceCreate(
159 $manipulator2 = $manipulator1->prepareForceCreate(
167 $manipulator->exposeSet()->actions
171 $manipulator1->exposeSet()->actions
175 $manipulator2->exposeSet()->actions
182 'action' =>
'delete',
186 'action' =>
'delete',
190 $manipulator1 = $manipulator->prepareDelete($this->
getPath($exp1[
'path']));
191 $manipulator2 = $manipulator1->prepareDelete($this->
getPath($exp2[
'path']));
196 $manipulator->exposeSet()->actions
200 $manipulator1->exposeSet()->actions
204 $manipulator2->exposeSet()->actions
211 'action' =>
'delete',
215 'action' =>
'force create',
217 'values' => [
'value 20',
'value 21',
'value 22']
220 'action' =>
'delete',
224 'action' =>
'create or update',
229 'action' =>
'force create',
231 'values' => [
'value 50',
'value 51',
'value 52']
234 'action' =>
'delete',
238 'action' =>
'create or update',
240 'values' => [
'value 7']
244 ->prepareDelete($this->
getPath($exp1[
'path']))
245 ->prepareForceCreate($this->
getPath($exp2[
'path']), ...$exp2[
'values'])
246 ->prepareDelete($this->
getPath($exp3[
'path']))
247 ->prepareCreateOrUpdate($this->
getPath($exp4[
'path']), ...$exp4[
'values']);
248 $manipulator->execute();
249 $manipulator5 = $manipulator
250 ->prepareForceCreate($this->
getPath($exp5[
'path']), ...$exp5[
'values'])
251 ->prepareDelete($this->
getPath($exp6[
'path']))
252 ->prepareCreateOrUpdate($this->
getPath($exp7[
'path']), ...$exp7[
'values']);
253 $manipulator5->execute();
256 [$exp1, $exp2, $exp3, $exp4],
257 $manipulator->exposeSet()->executed_actions
260 [$exp1, $exp2, $exp3, $exp4, $exp5, $exp6, $exp7],
261 $manipulator5->exposeSet()->executed_actions