Skip to content

Commit

Permalink
Merge pull request #1 from Seldaek/patch-1
Browse files Browse the repository at this point in the history
Overview example
  • Loading branch information
pmjones committed May 11, 2012
2 parents bdd2d8b + ef8efb6 commit 277184a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions proposed/PSR-2-advanced.md
Expand Up @@ -55,6 +55,38 @@ interpreted as described in [RFC 2119][].
- Opening parentheses for control structures MUST NOT have a space after them,
and closing parentheses for control structures MUST NOT have a space before.

### 1.1 Example

This example encompasses some of the rules below as a quick overview:

```php
<?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
}
}
```

2. General
----------
Expand Down

0 comments on commit 277184a

Please sign in to comment.