Skip to content

Instantly share code, notes, and snippets.

@ckdarby
Created January 6, 2014 16:22
Show Gist options
  • Save ckdarby/8285304 to your computer and use it in GitHub Desktop.
Save ckdarby/8285304 to your computer and use it in GitHub Desktop.
PSR2 Example
<?php
namespace Vendor\Package;
use FooInterface;
use BarClass as Bar;
use OtherVendor\OtherPackage\BazClass;
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