Skip to content

Commit ecc728b

Browse files
committed
updates namespace in docs
1 parent 0118336 commit ecc728b

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

README.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
tabular data represented as HTML Table. Once installed you will be able to do the following:
1212

1313
```php
14-
use Bakame\TabularData\HtmlTable\Parser;
14+
use Bakame\HtmlTable\Parser;
1515

1616
$table = Parser::new()
1717
->tableHeader(['rank', 'move', 'team', 'player', 'won', 'drawn', 'lost', 'for', 'against', 'gd', 'points'])
@@ -57,7 +57,7 @@ for more information.
5757
**The `Parser` constructor is private to instantiate the object you are required to use the `new` method instead**
5858

5959
```php
60-
use Bakame\TabularData\HtmlTable\Parser;
60+
use Bakame\HtmlTable\Parser;
6161

6262
$parser = Parser::new()
6363
->ignoreTableHeader()
@@ -72,7 +72,7 @@ To extract and parse your table use either the `parseHtml` or `parseFile` method
7272
If parsing is not possible a `ParseError` exception will be thrown.
7373

7474
```php
75-
use Bakame\TabularData\HtmlTable\Parser;
75+
use Bakame\HtmlTable\Parser;
7676

7777
$parser = Parser::new();
7878

@@ -97,7 +97,7 @@ Both methods return a `Table` instance which implements the `League\Csv\TabularD
9797
interface and also give access to the table caption if present via the `getCaption` method.
9898

9999
```php
100-
use Bakame\TabularData\HtmlTable\Parser;
100+
use Bakame\HtmlTable\Parser;
101101

102102
$html = <<<HTML
103103
<div>
@@ -161,7 +161,7 @@ favor `Parser::tableXpathPosition` which expects an `xpath` expression.
161161
If the expression is valid, and a list of table is found, the first result will be returned.
162162

163163
```php
164-
use Bakame\TabularData\HtmlTable\Parser;
164+
use Bakame\HtmlTable\Parser;
165165

166166
$parser = Parser::new()->tablePosition('table-id'); // parses the <table id='table-id'>
167167
$parser = Parser::new()->tablePosition(3); // parses the 4th table of the page
@@ -177,7 +177,7 @@ recommended to use one or the other but not both at the same time.**
177177
You can optionally define a caption for your table if none is present or found during parsing.
178178

179179
```php
180-
use Bakame\TabularData\HtmlTable\Parser;
180+
use Bakame\HtmlTable\Parser;
181181

182182
$parser = Parser::new()->tableCaption('this is a generated caption');
183183
$parser = Parser::new()->tableCaption(null); // remove any default caption set
@@ -194,18 +194,18 @@ But you can override this behaviour using one of these settings:
194194
Tells where to locate and resolve the table header
195195

196196
```php
197-
use Bakame\TabularData\HtmlTable\Parser;
198-
use Bakame\TabularData\HtmlTable\Section;
197+
use Bakame\HtmlTable\Parser;
198+
use Bakame\HtmlTable\Section;
199199

200200
$parser = Parser::new()->tableHeaderPosition(Section::Thead, 3);
201201
// header is the 4th row in the <thead> table section
202202
```
203203

204-
The method uses the `Bakame\TabularData\HtmlTable\Section` enum to designate which table section to use
204+
The method uses the `Bakame\HtmlTable\Section` enum to designate which table section to use
205205
to resolve the header
206206

207207
```php
208-
use Bakame\TabularData\HtmlTable\Section;
208+
use Bakame\HtmlTable\Section;
209209

210210
enum Section
211211
{
@@ -225,7 +225,7 @@ Instructs the parser to resolve or not the table header using `tableHeaderPositi
225225
If no resolution is done, no header will be included in the returned `Table` instance.
226226

227227
```php
228-
use Bakame\TabularData\HtmlTable\Parser;
228+
use Bakame\HtmlTable\Parser;
229229

230230
$parser = Parser::new()->ignoreTableHeader(); // no table header will be resolved
231231
$parser = Parser::new()->resolveTableHeader(); // will attempt to resolve the table header
@@ -237,8 +237,8 @@ You can specify directly the header of your table and override any other table h
237237
related configuration with this configuration
238238

239239
```php
240-
use Bakame\TabularData\HtmlTable\Parser;
241-
use Bakame\TabularData\HtmlTable\Section;
240+
use Bakame\HtmlTable\Parser;
241+
use Bakame\HtmlTable\Section;
242242

243243
$parser = Parser::new()->tableHeader(['rank', 'team', 'winner']);
244244
```
@@ -251,8 +251,8 @@ You can skip or re-arrange the source columns by skipping them by their offsets
251251
re-ordering the offsets.
252252

253253
```php
254-
use Bakame\TabularData\HtmlTable\Parser;
255-
use Bakame\TabularData\HtmlTable\Section;
254+
use Bakame\HtmlTable\Parser;
255+
use Bakame\HtmlTable\Section;
256256

257257
$parser = Parser::new()->tableHeader([3 => 'rank', 7 => 'winner', 5 => 'team']);
258258
// only 3 column will be extracted the 4th, 6th and 8th columns
@@ -265,8 +265,8 @@ $parser = Parser::new()->tableHeader([3 => 'rank', 7 => 'winner', 5 => 'team'])
265265
Tells which section should be parsed based on the `Section` enum
266266

267267
```php
268-
use Bakame\TabularData\HtmlTable\Parser;
269-
use Bakame\TabularData\HtmlTable\Section;
268+
use Bakame\HtmlTable\Parser;
269+
use Bakame\HtmlTable\Section;
270270

271271
$parser = Parser::new()->includeSection(Section::Tbody); // thead and tfoot are included during parsing
272272
$parser = Parser::new()->excludeSection(Section::Tr, Section::Tfoot); // table direct tr children and tfoot are not included during parsing
@@ -292,7 +292,7 @@ Adds or remove a record formatter applied to the data extracted from the table b
292292
can access it. The header is not affected by the formatter if it is defined.
293293

294294
```php
295-
use Bakame\TabularData\HtmlTable\Parser;
295+
use Bakame\HtmlTable\Parser;
296296

297297
$parser = Parser::new()->withFormatter($formatter); // attach a formatter to the parser
298298
$parser = Parser::new()->withoutFormatter(); // removed the attached formatter if it exists
@@ -331,7 +331,7 @@ $formatter = function (array $record): array {
331331
Tells whether the parser should ignore or throw in case of malformed HTML content.
332332

333333
```php
334-
use Bakame\TabularData\HtmlTable\Parser;
334+
use Bakame\HtmlTable\Parser;
335335

336336
$parser = Parser::new()->ignoreXmlErrors(); // ignore the XML errors
337337
$parser = Parser::new()->failOnXmlErrors(3); // throw on XML errors

0 commit comments

Comments
 (0)