Skip to content

Commit 7c66baf

Browse files
committed
Adjusted code example
1 parent 5c0565f commit 7c66baf

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

contributing/code/standards.rst

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,31 @@ example containing most features described below:
2929
3030
class Foo
3131
{
32-
private $foo;
33-
3432
const SOME_CONST = 42;
3533
34+
private $foo;
35+
36+
/**
37+
* @param string $dummy Some argument description
38+
*/
3639
public function __construct($dummy)
3740
{
38-
$this->foo = $this->init($dummy);
41+
$this->foo = $this->transform($dummy);
3942
}
4043
41-
private function init($dummy)
44+
/**
45+
* @param string $dummy Some argument description
46+
* @return string|null Transformed input
47+
*/
48+
private function transform($dummy)
4249
{
4350
if (true === $dummy) {
4451
return;
4552
} elseif ('string' === $dummy) {
46-
$var = substr($dummy, 0, 5);
53+
$dummy = substr($dummy, 0, 5);
4754
}
4855
49-
return $var;
56+
return $dummy;
5057
}
5158
}
5259

0 commit comments

Comments
 (0)