1 | <?php |
||
28 | class RFC4180Field extends php_user_filter |
||
29 | { |
||
30 | use ValidatorTrait; |
||
31 | |||
32 | const FILTERNAME = 'convert.league.csv.rfc4180'; |
||
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 register the class as a stream filter |
||
50 | */ |
||
51 | 6 | public static function register() |
|
57 | |||
58 | /** |
||
59 | * Static method to return the stream filter filtername |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 4 | public static function getFiltername(): string |
|
67 | |||
68 | /** |
||
69 | * Static method to add the stream filter to a {@link AbstractCsv} object |
||
70 | * |
||
71 | * @param AbstractCsv $csv |
||
72 | * |
||
73 | * @return AbstractCsv |
||
74 | */ |
||
75 | 6 | public static function addTo(AbstractCsv $csv): AbstractCsv |
|
85 | |||
86 | /** |
||
87 | * @inheritdoc |
||
88 | */ |
||
89 | 16 | public function onCreate() |
|
99 | |||
100 | /** |
||
101 | * Filter and set param variable |
||
102 | * |
||
103 | * @throws InvalidArgumentException if a required parame key is missing |
||
104 | * @throws InvalidArgumentException if the stream filter mode is unknown or unsupported |
||
105 | * |
||
106 | */ |
||
107 | 14 | protected function init() |
|
126 | |||
127 | /** |
||
128 | * @inheritdoc |
||
129 | */ |
||
130 | 6 | public function filter($in, $out, &$consumed, $closing) |
|
140 | } |
||
141 |