mirror of
https://github.com/j0k3r/php-readability.git
synced 2026-09-27 14:36:23 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8ed91105ea | ||
|
|
952588ee1f | ||
|
|
e4e975db96 | ||
|
|
774363e18d | ||
|
|
e6ca6f117f | ||
|
|
0b21d4ab2d | ||
|
|
720f0d5503 |
@@ -3,11 +3,9 @@ name: "CI"
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
|
||||||
- "1.x"
|
- "1.x"
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- "master"
|
|
||||||
- "1.x"
|
- "1.x"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -21,9 +19,6 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php:
|
php:
|
||||||
- "5.6"
|
|
||||||
- "7.0"
|
|
||||||
- "7.1"
|
|
||||||
- "7.2"
|
- "7.2"
|
||||||
- "7.3"
|
- "7.3"
|
||||||
- "7.4"
|
- "7.4"
|
||||||
@@ -32,6 +27,7 @@ jobs:
|
|||||||
- "8.2"
|
- "8.2"
|
||||||
- "8.3"
|
- "8.3"
|
||||||
- "8.4"
|
- "8.4"
|
||||||
|
- "8.5"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
@@ -122,7 +118,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
php:
|
php:
|
||||||
- "7.2"
|
- "7.4"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: "Checkout"
|
- name: "Checkout"
|
||||||
@@ -155,43 +151,3 @@ jobs:
|
|||||||
|
|
||||||
- name: "Run PHPUnit"
|
- name: "Run PHPUnit"
|
||||||
run: "php vendor/bin/simple-phpunit -v"
|
run: "php vendor/bin/simple-phpunit -v"
|
||||||
|
|
||||||
phpunit-composerv2:
|
|
||||||
name: "PHPUnit with Composer v1 (PHP ${{ matrix.php }})"
|
|
||||||
runs-on: "ubuntu-latest"
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
php:
|
|
||||||
- "7.4"
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: "Checkout"
|
|
||||||
uses: "actions/checkout@v2"
|
|
||||||
with:
|
|
||||||
fetch-depth: 2
|
|
||||||
|
|
||||||
- name: "Install PHP"
|
|
||||||
uses: "shivammathur/setup-php@v2"
|
|
||||||
with:
|
|
||||||
php-version: "${{ matrix.php }}"
|
|
||||||
coverage: "none"
|
|
||||||
tools: composer:v1
|
|
||||||
extensions: tidy
|
|
||||||
ini-values: "date.timezone=Europe/Paris"
|
|
||||||
env:
|
|
||||||
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
|
|
||||||
- name: "Remove useless deps"
|
|
||||||
run: "composer remove friendsofphp/php-cs-fixer --dev --no-progress --no-update"
|
|
||||||
|
|
||||||
- name: "Install dependencies with Composer"
|
|
||||||
uses: "ramsey/composer-install@v1"
|
|
||||||
with:
|
|
||||||
composer-options: "--optimize-autoloader --prefer-dist"
|
|
||||||
|
|
||||||
- name: "Setup logs"
|
|
||||||
run: "mkdir -p build/logs"
|
|
||||||
|
|
||||||
- name: "Run PHPUnit"
|
|
||||||
run: "php vendor/bin/simple-phpunit -v"
|
|
||||||
|
|||||||
+3
-3
@@ -24,14 +24,14 @@
|
|||||||
"role": "Developer (original JS version)"
|
"role": "Developer (original JS version)"
|
||||||
}],
|
}],
|
||||||
"require": {
|
"require": {
|
||||||
"php": ">=5.6.0",
|
"php": ">=7.2",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"psr/log": "^1.0",
|
"psr/log": "^1.0.1 || ^2.0 || ^3.0",
|
||||||
"masterminds/html5": "^2.7"
|
"masterminds/html5": "^2.7"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"friendsofphp/php-cs-fixer": "^2.14",
|
"friendsofphp/php-cs-fixer": "^2.14",
|
||||||
"monolog/monolog": "^1.24|^2.1",
|
"monolog/monolog": "^1.24|^2.1|^3.0",
|
||||||
"symfony/phpunit-bridge": "^4.4|^5.3|^6.0|^7.0"
|
"symfony/phpunit-bridge": "^4.4|^5.3|^6.0|^7.0"
|
||||||
},
|
},
|
||||||
"suggest": {
|
"suggest": {
|
||||||
|
|||||||
+2
-5
@@ -118,7 +118,7 @@ class Readability implements LoggerAwareInterface
|
|||||||
'enclose-text' => true,
|
'enclose-text' => true,
|
||||||
'merge-divs' => true,
|
'merge-divs' => true,
|
||||||
// 'merge-spans' => true,
|
// 'merge-spans' => true,
|
||||||
'input-encoding' => '????',
|
'input-encoding' => 'utf8',
|
||||||
'output-encoding' => 'utf8',
|
'output-encoding' => 'utf8',
|
||||||
'hide-comments' => true,
|
'hide-comments' => true,
|
||||||
];
|
];
|
||||||
@@ -183,10 +183,7 @@ class Readability implements LoggerAwareInterface
|
|||||||
$this->loadHtml();
|
$this->loadHtml();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function setLogger(LoggerInterface $logger): void
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function setLogger(LoggerInterface $logger)
|
|
||||||
{
|
{
|
||||||
$this->logger = $logger;
|
$this->logger = $logger;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ class ReadabilityTest extends \PHPUnit\Framework\TestCase
|
|||||||
public function testConstructDefault()
|
public function testConstructDefault()
|
||||||
{
|
{
|
||||||
$readability = $this->getReadability('');
|
$readability = $this->getReadability('');
|
||||||
|
$this->assertSame('utf8', $readability->tidy_config['input-encoding']);
|
||||||
|
|
||||||
$this->assertNull($readability->url);
|
$this->assertNull($readability->url);
|
||||||
$this->assertInstanceOf(\DOMDocument::class, $readability->dom);
|
$this->assertInstanceOf(\DOMDocument::class, $readability->dom);
|
||||||
|
|||||||
Reference in New Issue
Block a user