StreamFilter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
dl 0
loc 16
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A filter() 0 11 2
1
<?php
2
/**
3
 * This file is part of PHP Mess Detector.
4
 *
5
 * Copyright (c) Manuel Pichler <[email protected]>.
6
 * All rights reserved.
7
 *
8
 * Licensed under BSD License
9
 * For full copyright and license information, please see the LICENSE file.
10
 * Redistributions of files must retain the above copyright notice.
11
 *
12
 * @author Manuel Pichler <[email protected]>
13
 * @copyright Manuel Pichler. All rights reserved.
14
 * @license https://opensource.org/licenses/bsd-license.php BSD License
15
 * @link http://phpmd.org/
16
 */
17
18
namespace PHPMD\TextUI;
19
20
/**
21
 * Utility to test stream related stuff
22
 */
23
class StreamFilter extends \php_user_filter
24
{
25
    public static $streamHandle;
26
27
    public function filter($in, $out, &$consumed, $closing)
28
    {
29
        self::$streamHandle = '';
30
31
        while ($bucket = stream_bucket_make_writeable($in)) {
32
            self::$streamHandle .= $bucket->data;
33
            $consumed += $bucket->datalen;
34
        }
35
36
        return PSFS_PASS_ON;
37
    }
38
}
39