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