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

Validating array indexes #116

Closed
wants to merge 1 commit into from

Conversation

camcima
Copy link
Contributor

@camcima camcima commented Feb 16, 2016

Added the functionality to validate the indexes of the arrays within the each command.

@@ -57,6 +57,7 @@ public function validate($value)

$result = true;
foreach ($value as $index => $innerValue) {
$innerValue['array_index'] = $index;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice hack to be able to validate the array keys, I like it! The only thing that I'm thinking about is the key name. Do we want to go with an underscore here, or do we want to go with camelCase, like php variables should be?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was one of my doubts as well. I only added the underscore because the output reads better when you do it, but it could be anything.

@rick-nu
Copy link

rick-nu commented Feb 18, 2016

Thank you @camcima, I'm in favor of adding this. @berry-langerak what do you think?

@berry-langerak
Copy link
Member

I'm not in favour just yet. Having one API to mix name of fields and a "magically" appearing name seems a little off to me. Let me consider an alternative, if you will, because I do think the functionality is very interesting.

@rick-nu
Copy link

rick-nu commented Aug 5, 2016

I'm going to close this PR, and convert this into a feature (#143). We still could consider to go with this PR, but we need to give it more thought.

@rick-nu rick-nu closed this Aug 5, 2016
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 this pull request may close these issues.

None yet

3 participants