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

Add utils for recursively finding a key in an array when the depth of… #12183

Closed
wants to merge 1 commit into from

Conversation

eileenmcnaughton
Copy link
Contributor

Overview

Just adding a utility function

Before

no change

After

no change

Technical Details

@seamuslee001 as discussed this allows us to clean up some code places where this is handled badly. I can't think of a prettier way than a switch but I think containing it in functions makes it OK

Comments

@seamuslee001
Copy link
Contributor

I agree re switch can't see anything easier also ping @totten Tim you may want to have a view here but i think this is ok to me

@eileenmcnaughton
Copy link
Contributor Author

test this please

* @return bool
* @throws \CRM_Core_Exception
*/
public static function recursiveGetValue($array, $path, $default = FALSE) {
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't the default be NULL?

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.

3 participants