Last active
December 21, 2015 23:39
-
-
Save karloscarweber/6383452 to your computer and use it in GitHub Desktop.
Code Styling for PHP Documentation
This file contains 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 | |
//Some Coding Standards that I want to follow. I might as well write it down. | |
/* | |
* Functions | |
*/ | |
/* | |
* Function Names should be lowerecased multiple words should be seperated by underscores | |
* private methods / functions should begin with an underscore | |
* Function Documentation should precede the function declaration including output type, | |
paramaters and their types, and a brief description of what the function does. | |
*/ | |
// Example: | |
/* | |
@output (#type) | |
@param (#type) $param_name | |
@param (#type) $param_name | |
description of lorem ipsum | |
*/ | |
function function_name($param_name = 'default_value'){ | |
// the actual code | |
} | |
/* | |
* Loops | |
* | |
*/ | |
if($something == 'true'){ | |
// statement | |
} else { //line of white space above fore readability | |
// statements | |
} // no whitespace at end , but after. | |
//----Example----// | |
if($something == 'true'){ | |
echo "It's true!"; | |
} else { | |
echo "It's false."; | |
} | |
if($somethingelse == 'true'){ | |
echo "It's also true!"; | |
} else { | |
echo "It's also false."; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment