1 | <?php |
||
14 | class PrefixFormatter implements OutputFormatterInterface |
||
15 | { |
||
16 | public $prefix = ''; |
||
17 | |||
18 | public function __construct(OutputFormatterInterface $innerFormatter) |
||
22 | |||
23 | |||
24 | /** |
||
25 | * @{inheritDoc} |
||
26 | */ |
||
27 | public function setDecorated($decorated) |
||
31 | |||
32 | /** |
||
33 | * @{inheritDoc} |
||
34 | */ |
||
35 | public function isDecorated() |
||
39 | |||
40 | /** |
||
41 | * @{inheritDoc} |
||
42 | */ |
||
43 | public function setStyle($name, OutputFormatterStyleInterface $style) |
||
47 | |||
48 | /** |
||
49 | * @{inheritDoc} |
||
50 | */ |
||
51 | public function hasStyle($name) |
||
55 | |||
56 | /** |
||
57 | * @{inheritDoc} |
||
58 | */ |
||
59 | public function getStyle($name) |
||
63 | |||
64 | /** |
||
65 | * @{inheritDoc} |
||
66 | */ |
||
67 | public function format($message) |
||
76 | } |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: