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 Arrays::changeKeyCase #1

Merged
merged 1 commit into from
Oct 26, 2016

Conversation

chadicus
Copy link
Contributor

@chadicus chadicus commented Jan 4, 2016

Allow arrays to go from underscored keys to camel caps keys, or vice versa.

$input = [
    'EMAIL_ADDRESS' => '[email protected]',
    'FIRST_NAME' => 'John',
    'LAST_NAME' => 'Doe',
];

$output = Arrays::changeKeyCase($input, Arrays::CASE_CAMEL_CAPS);

var_dump($output);

The above code would output

array(3) {
  'emailAddress' =>
  string(16) "[email protected]"
  'firstName' =>
  string(4) "John"
  'lastName' =>
  string(3) "Doe"
}

This pull request was originally submitted as #51 of the util-php repository

@chadicus chadicus force-pushed the fea/changeKeyCase branch 2 times, most recently from a50a794 to 4064bd2 Compare January 4, 2016 23:28
@chadicus chadicus force-pushed the fea/changeKeyCase branch from 4064bd2 to 0c29de7 Compare April 5, 2016 13:06
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 0c29de7 on chadicus:fea/changeKeyCase into bd9114b on dominionenterprises:master.

@chadicus chadicus force-pushed the fea/changeKeyCase branch 2 times, most recently from 2ab983d to 3c59f54 Compare April 6, 2016 17:38
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 3c59f54 on chadicus:fea/changeKeyCase into bd9114b on dominionenterprises:master.

@chadicus chadicus merged commit 80804ab into traderinteractive:master Oct 26, 2016
@chadicus chadicus deleted the fea/changeKeyCase branch October 26, 2016 01:48
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.

2 participants