| Total Complexity | 6 |
| Total Lines | 82 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | trait CsvHandlerTrait |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @var array|null |
||
| 19 | */ |
||
| 20 | protected $header; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * @var string |
||
| 24 | */ |
||
| 25 | protected $delimiter = ','; |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var string |
||
| 29 | */ |
||
| 30 | protected $enclosure = '"'; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * use more widespread " as default escape char instead of default \ |
||
| 34 | * |
||
| 35 | * @var string |
||
| 36 | */ |
||
| 37 | protected $escape = '"'; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @var bool |
||
| 41 | */ |
||
| 42 | protected $useHeader = true; |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @var bool |
||
| 46 | */ |
||
| 47 | protected $useSep = false; |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @return array|null |
||
| 51 | */ |
||
| 52 | public function getHeader() |
||
| 55 | } |
||
| 56 | |||
| 57 | /** |
||
| 58 | * @param bool $useHeader |
||
| 59 | * |
||
| 60 | * @return $this |
||
| 61 | */ |
||
| 62 | public function setUseHeader($useHeader) |
||
| 63 | { |
||
| 64 | $this->useHeader = (bool) $useHeader; |
||
| 65 | |||
| 66 | return $this; |
||
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param bool $useSep |
||
| 71 | * |
||
| 72 | * @return $this |
||
| 73 | */ |
||
| 74 | public function setUseSep($useSep) |
||
| 75 | { |
||
| 76 | $this->useSep = (bool) $useSep; |
||
| 77 | |||
| 78 | return $this; |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @param string|null $delimiter |
||
| 83 | * @param string|null $enclosure |
||
| 84 | * @param string|null $escape |
||
| 85 | * |
||
| 86 | * @return $this |
||
| 87 | */ |
||
| 88 | protected function initCsvOptions($delimiter = null, $enclosure = null, $escape = null) |
||
| 97 | } |
||
| 98 | } |
||
| 99 |