I use this template for PHP methods in Eclipse:
${cursor}
${visibility} function ${functionName}(${dollar}${param})
{
// @todo method body for ${class_container}::${functionName}()
return ${value};
}
| <?php | |
| function hasIntegerRoot($number, $power, &$root = null) { | |
| $root = round(pow($number, 1.0 / $power)); | |
| return round(pow($root, $power)) == $number; | |
| } | |
| function testHasIntegerRoot() | |
| { | |
| // calculate squares |
| alias composer='php composer.phar' | |
| alias composerinit='curl -s http://getcomposer.org/installer | php; composer init; echo composer.phar >> .gitignore' | |
| alias composerdump='composer dumpautoload --optimize' |
I use this template for PHP methods in Eclipse:
${cursor}
${visibility} function ${functionName}(${dollar}${param})
{
// @todo method body for ${class_container}::${functionName}()
return ${value};
}
| <?php | |
| class FactoryClass | |
| { | |
| public static function build() | |
| { | |
| return new ProductClass(); | |
| } | |
| } |
| <?php | |
| function factorial($number) | |
| { | |
| $factorial = $number; | |
| $i = $number - 1; | |
| while ($i > 0) { | |
| $factorial *= $i--; | |
| } | |
| return $factorial; |
| <?php | |
| $answer = 11; | |
| while (!check($answer)) { | |
| echo "{$answer} is not correct."; | |
| $answer += 11; | |
| echo " trying {$answer}...\n"; | |
| } |
| <?php | |
| class FactorFinder | |
| { | |
| protected $pairSets = array(); | |
| public function findFactorCombinations($number, $factorCount) | |
| { | |
| if ($factorCount < 2) { | |
| return false; |
| <?php | |
| class CalendarEvent | |
| { | |
| /** | |
| * Holds the event | |
| * | |
| * @var string | |
| */ | |
| protected $event; |
| $page-header-height: 50px; | |
| $page-footer-height: 50px; | |
| $gutter: 20px; | |
| .page-wrap { | |
| max-width: 1024px; | |
| margin: 0 auto; | |
| @include box-sizing(border-box); | |
| padding: 0 $gutter; | |
| } |
| <?php | |
| class Sass | |
| { | |
| /** | |
| * Options for sass command | |
| * | |
| * @var array | |
| */ | |
| protected $options = array(); |