Conditions | 2 |
Paths | 2 |
Total Lines | 15 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 10 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
7 | 8 | public function filter($in, $out, &$consumed, $closing) |
|
8 | { |
||
9 | 8 | while ($bucket = stream_bucket_make_writeable($in)) { |
|
10 | 2 | $lenbucket = stream_bucket_new($this->stream, dechex($bucket->datalen)."\r\n"); |
|
|
|||
11 | 2 | stream_bucket_append($out, $lenbucket); |
|
12 | |||
13 | 2 | $consumed += $bucket->datalen; |
|
14 | 2 | stream_bucket_append($out, $bucket); |
|
15 | |||
16 | 2 | $lenbucket = stream_bucket_new($this->stream, "\r\n"); |
|
17 | 2 | stream_bucket_append($out, $lenbucket); |
|
18 | 2 | } |
|
19 | |||
20 | 8 | return PSFS_PASS_ON; |
|
21 | } |
||
22 | } |
||
23 |
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: