Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Batch extraction from Box #108

Closed
Tracked by #109
PandaHugMonster opened this issue Jul 28, 2022 · 1 comment · Fixed by #110
Closed
Tracked by #109

Batch extraction from Box #108

PandaHugMonster opened this issue Jul 28, 2022 · 1 comment · Fixed by #110
Milestone

Comments

@PandaHugMonster
Copy link
Owner

Batch extraction of values from Box.
Something like:

$b = bx(['var1' => 'value 1', 'var2' => 'value 2', 'var3' => 'value 3']);

[$var1, $var2, $var3] = $b->batch(['var1', 'var2', 'var3']);

Especially good could be with PHP::POST() and PHP::GET().

Additionally check the dynamic name sync on the left side with a right side.

@PandaHugMonster PandaHugMonster added this to the 1.1.3 milestone Jul 28, 2022
@PandaHugMonster PandaHugMonster mentioned this issue Jul 28, 2022
5 tasks
PandaHugMonster added a commit that referenced this issue Jul 28, 2022
Implemented nice functionality of batch/extract for `Box`
Closes #108
@PandaHugMonster
Copy link
Owner Author

PandaHugMonster commented Jul 29, 2022

Implemented 2 ways of extraction of vars:

$b = bx([
  'var1' => 'value 1',
  'value 2',
  'var3' => 'value 3',
  'var4' => 'value 4',
]);

// List style of assignment
[$var1, $var2, $var3] = $b->batch(['var1', 'var2', 'var3'], true);

 // PHP Extract style of assignment (slightly more elegant and easy to use)
extract($b->batch(['var1', 'var2', 'var3']));

Don't forget specify phpdoc blocks with @var to enable auto-completion in your IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant