@@ -30,32 +30,40 @@ example containing most features described below:
30
30
31
31
namespace Acme;
32
32
33
- class Foo
33
+ class FooBar
34
34
{
35
35
const SOME_CONST = 42;
36
36
37
- private $foo ;
37
+ private $fooBar ;
38
38
39
39
/**
40
40
* @param string $dummy Some argument description
41
41
*/
42
42
public function __construct($dummy)
43
43
{
44
- $this->foo = $this->transform($dummy);
44
+ $this->fooBar = $this->transform($dummy);
45
45
}
46
46
47
47
/**
48
48
* @param string $dummy Some argument description
49
49
* @return string|null Transformed input
50
50
*/
51
- private function transform ($dummy)
51
+ private function transformText ($dummy, $options = array() )
52
52
{
53
+ $mergedOptions = array_merge($options, array(
54
+ 'some_default' => 'values',
55
+ ));
56
+
53
57
if (true === $dummy) {
54
58
return;
55
59
}
56
60
if ('string' === $dummy) {
57
- $dummy = substr($dummy, 0, 5);
58
- }
61
+ if ('values' === $mergedOptions['some_default']) {
62
+ $dummy = substr($dummy, 0, 5);
63
+ } else {
64
+ $dummy = ucwords($dummy);
65
+ }
66
+ }
59
67
60
68
return $dummy;
61
69
}
@@ -74,9 +82,6 @@ Structure
74
82
* Use braces to indicate control structure body regardless of the number of
75
83
statements it contains;
76
84
77
- * Declare visibility explicitly for class, methods, and properties (usage of
78
- `var ` is prohibited);
79
-
80
85
* Define one class per file - this does not apply to private helper classes
81
86
that are not intended to be instantiated from the outside and thus are not
82
87
concerned by the PSR-0 standard;
0 commit comments