1 | <?php |
||
29 | class RFC4180FieldFilter extends php_user_filter |
||
30 | { |
||
31 | use ValidatorTrait; |
||
32 | |||
33 | const STREAM_FILTERNAME = 'rfc4180.league.csv'; |
||
34 | |||
35 | /** |
||
36 | * The value being search for |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $search; |
||
41 | |||
42 | /** |
||
43 | * The replacement value that replace found $search values |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $replace; |
||
48 | |||
49 | /** |
||
50 | * Static method to add the stream filter to a Writer object |
||
51 | * |
||
52 | * @param AbstractCsv $csv |
||
53 | */ |
||
54 | 6 | public static function addTo(AbstractCsv $csv) |
|
66 | |||
67 | /** |
||
68 | * @inheritdoc |
||
69 | */ |
||
70 | 14 | public function onCreate() |
|
92 | |||
93 | /** |
||
94 | * Filter the given mode |
||
95 | * |
||
96 | * @param int $mode stream filter mode |
||
97 | * |
||
98 | * @throws InvalidArgumentException if the mode value is unknown |
||
99 | * |
||
100 | * @return int |
||
101 | */ |
||
102 | 8 | protected function filterMode(int $mode) |
|
110 | |||
111 | /** |
||
112 | * @inheritdoc |
||
113 | */ |
||
114 | 6 | public function filter($in, $out, &$consumed, $closing) |
|
124 | } |
||
125 |