File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -31,8 +31,8 @@ $lazyCsvCollection = SimpleCsv::import(storage_path('collection.csv'));
31
31
32
32
### Empty Keys to Null
33
33
34
- PHP's 'putcsv' doesn't support writing ` null ` to csv files. The LazyCsvCollection returned by the import method
35
- exposes a lazy ' emptyToNull' method that will convert empty array keys to null values for convenience.
34
+ PHP's ` fputcsv() ` doesn't support writing ` null ` to csv files as it's not a string . The LazyCsvCollection returned by the import method
35
+ exposes a lazy ` emptyToNull() ` method that will convert empty values to null for convenience.
36
36
37
37
``` php
38
38
use BayAreaWebPro\SimpleCsv\SimpleCsv;
@@ -81,11 +81,9 @@ return SimpleCsv::download([...], 'download.csv');
81
81
``` php
82
82
use Illuminate\Support\Facades\Config;
83
83
84
- Config::set('simple-csv', [
85
- 'delimiter' => '?',
86
- 'enclosure' => '?',
87
- 'escape' => '?',
88
- ]);
84
+ Config::set('simple-csv.delimiter', ...);
85
+ Config::set('simple-csv.enclosure', ...);
86
+ Config::set('simple-csv.escape', ...);
89
87
```
90
88
91
89
## Or, Create a Config File
Original file line number Diff line number Diff line change 2
2
3
3
namespace BayAreaWebPro \SimpleCsv \Tests \Unit ;
4
4
5
- use BayAreaWebPro \SimpleCsv \SimpleCsv ;
6
5
use BayAreaWebPro \SimpleCsv \SimpleCsvService ;
7
6
use BayAreaWebPro \SimpleCsv \SimpleCsvServiceProvider ;
8
7
use BayAreaWebPro \SimpleCsv \Tests \TestCase ;
@@ -27,7 +26,7 @@ public function test_facade_can_resolve_instance()
27
26
public function test_service_can_be_resolved ()
28
27
{
29
28
$ csv = app ('simple-csv ' );
30
- $ this ->assertTrue (( $ csv instanceof SimpleCsvService) );
29
+ $ this ->assertInstanceOf (SimpleCsvService::class, $ csv );
31
30
}
32
31
33
32
public function test_declares_provided ()
You can’t perform that action at this time.
0 commit comments