Skip to content

Instantly share code, notes, and snippets.

@timuruski
Created December 3, 2013 20:51
Show Gist options
  • Save timuruski/7777265 to your computer and use it in GitHub Desktop.
Save timuruski/7777265 to your computer and use it in GitHub Desktop.
Is there any way to get this sort of thing working in PHP?
Environment::build( function () {
$api_key = 'ABC123';
$partials_path = array('app/views/');
});
// Dumps something like this:
// => array('api_key' = 'ABC123', $partials_path => array('app/views/'))
// The method should be able to digest things like $api_key into an actual API connection instance.
@timuruski
Copy link
Author

I'm trying to avoid this ugliess:

Environment::build( array(
  'api_key' => 'ABC123',
  'partials_path' => array('app/views/')
));

... though with all the required semicolons, it's not significantly uglier than the goal. Now I'm depressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment