-
-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed Issue with encoding 227
- Loading branch information
Showing
23 changed files
with
3,059 additions
and
792 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
<?php | ||
|
||
namespace PHPHtmlParser\Contracts\Dom; | ||
|
||
use PHPHtmlParser\Exceptions\LogicalException; | ||
use PHPHtmlParser\Options; | ||
|
||
interface CleanerInterface | ||
{ | ||
/** | ||
* Cleans the html of any none-html information. | ||
* | ||
* @throws LogicalException | ||
*/ | ||
public function clean(string $str, Options $options): string; | ||
} | ||
<?php | ||
|
||
namespace PHPHtmlParser\Contracts\Dom; | ||
|
||
use PHPHtmlParser\Exceptions\LogicalException; | ||
use PHPHtmlParser\Options; | ||
|
||
interface CleanerInterface | ||
{ | ||
/** | ||
* Cleans the html of any none-html information. | ||
* | ||
* @throws LogicalException | ||
*/ | ||
public function clean(string $str, Options $options, string $defaultCharset): string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,33 @@ | ||
<?php | ||
|
||
namespace PHPHtmlParser\Contracts\Dom; | ||
|
||
use PHPHtmlParser\Content; | ||
use PHPHtmlParser\Dom\Node\AbstractNode; | ||
use PHPHtmlParser\Exceptions\ChildNotFoundException; | ||
use PHPHtmlParser\Exceptions\CircularException; | ||
use PHPHtmlParser\Exceptions\ContentLengthException; | ||
use PHPHtmlParser\Exceptions\LogicalException; | ||
use PHPHtmlParser\Exceptions\StrictException; | ||
use PHPHtmlParser\Options; | ||
|
||
interface ParserInterface | ||
{ | ||
/** | ||
* Attempts to parse the html in content. | ||
* | ||
* @throws ChildNotFoundException | ||
* @throws CircularException | ||
* @throws ContentLengthException | ||
* @throws LogicalException | ||
* @throws StrictException | ||
*/ | ||
public function parse(Options $options, Content $content, int $size): AbstractNode; | ||
|
||
/** | ||
* Attempts to detect the charset that the html was sent in. | ||
* | ||
* @throws ChildNotFoundException | ||
*/ | ||
public function detectCharset(Options $options, string $defaultCharset, AbstractNode $root): bool; | ||
} | ||
<?php | ||
|
||
namespace PHPHtmlParser\Contracts\Dom; | ||
|
||
use PHPHtmlParser\Content; | ||
use PHPHtmlParser\Dom\Node\AbstractNode; | ||
use PHPHtmlParser\Exceptions\ChildNotFoundException; | ||
use PHPHtmlParser\Exceptions\CircularException; | ||
use PHPHtmlParser\Exceptions\ContentLengthException; | ||
use PHPHtmlParser\Exceptions\LogicalException; | ||
use PHPHtmlParser\Exceptions\StrictException; | ||
use PHPHtmlParser\Options; | ||
|
||
interface ParserInterface | ||
{ | ||
/** | ||
* Attempts to parse the html in content. | ||
* | ||
* @throws ChildNotFoundException | ||
* @throws CircularException | ||
* @throws ContentLengthException | ||
* @throws LogicalException | ||
* @throws StrictException | ||
*/ | ||
public function parse(Options $options, Content $content, int $size): AbstractNode; | ||
|
||
/** | ||
* Attempts to detect the charset that the html was sent in. | ||
* | ||
* @throws ChildNotFoundException | ||
*/ | ||
public function detectCharset(Options $options, string $defaultCharset, AbstractNode $root): bool; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PHPHtmlParser\Contracts; | ||
|
||
use PHPHtmlParser\Dom; | ||
use PHPHtmlParser\Options; | ||
use Psr\Http\Client\ClientInterface; | ||
use Psr\Http\Message\RequestInterface; | ||
|
||
interface DomInterface | ||
{ | ||
public function loadFromFile(string $file, ?Options $options = null): Dom; | ||
|
||
public function loadFromUrl(string $url, ?Options $options, ?ClientInterface $client = null, ?RequestInterface $request = null): Dom; | ||
|
||
public function loadStr(string $str, ?Options $options = null): Dom; | ||
|
||
public function setOptions(Options $options): Dom; | ||
|
||
public function find(string $selector, int $nth = null); | ||
} | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace PHPHtmlParser\Contracts; | ||
|
||
use PHPHtmlParser\Dom; | ||
use PHPHtmlParser\Options; | ||
use Psr\Http\Client\ClientInterface; | ||
use Psr\Http\Message\RequestInterface; | ||
|
||
interface DomInterface | ||
{ | ||
public function loadFromFile(string $file, ?Options $options = null): Dom; | ||
|
||
public function loadFromUrl(string $url, ?Options $options, ?ClientInterface $client = null, ?RequestInterface $request = null): Dom; | ||
|
||
public function loadStr(string $str, ?Options $options = null): Dom; | ||
|
||
public function setOptions(Options $options): Dom; | ||
|
||
public function find(string $selector, int $nth = null); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.