Created
March 17, 2011 19:01
-
-
Save josegonzalez/874914 to your computer and use it in GitHub Desktop.
PHP Variables, method names, and class names are ridiculous
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$classMap = array( | |
'AggregateRecordSales' => 'band_id', | |
'BandInfoDaily' => 'team_id', | |
'DivisionStandings' => 'team_id', | |
'TeambandPriceCache' => 'teamband_id', | |
); | |
$baseClassVar = 'baseClass'; | |
$inflection = 'inflect'; | |
foreach ($classMap as $baseClass => $fieldName) { | |
${Inflector::pluralize(Inflector::underscore($baseClass))} = ${$$baseClassVar . 'Peer'}::${'retrieveBy' . Inflector::camelize($fieldName)}(${'some' . Inflector::camelize(substr($fieldName, -2))}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hahaha, cool