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