Skip to content

Instantly share code, notes, and snippets.

@tiggreen
Created May 12, 2016 13:26
Show Gist options
  • Save tiggreen/4a5106313f26d9dee371a7547960a81d to your computer and use it in GitHub Desktop.
Save tiggreen/4a5106313f26d9dee371a7547960a81d to your computer and use it in GitHub Desktop.
psr-2-sample.php
// PSR2 codin standard
class Foo extends Bar implements FooInterface
{
public function sampleFunction($a, $b = null)
{
if ($a === $b) {
bar();
} elseif ($a > $b) {
$foo->bar($arg1);
} else {
BazClass::bar($arg2, $arg3);
}
}
final public static function bar()
{
// method body
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment