Skip to content

Commit 66215a6

Browse files
committed
Require PHP >= 7.2
- remove test on Composer v1 - remove deprecated function - move `loadHtml()` into `init()` instead of `__construct` Kinda prepare 2.0 version :)
1 parent b1a20a9 commit 66215a6

File tree

9 files changed

+130
-233
lines changed

9 files changed

+130
-233
lines changed

.github/workflows/coding-standards.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ on:
88
branches:
99
- master
1010

11-
env:
12-
SYMFONY_PHPUNIT_VERSION: 7.5
13-
1411
jobs:
1512
coding-standards:
1613
name: "CS Fixer & PHPStan"
@@ -35,9 +32,6 @@ jobs:
3532
env:
3633
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3734

38-
- name: "Add PHPStan"
39-
run: "composer require phpstan/phpstan phpstan/phpstan-phpunit --dev --no-progress --no-suggest"
40-
4135
- name: "Install dependencies with Composer"
4236
uses: "ramsey/composer-install@v1"
4337
with:

.github/workflows/continuous-integration.yml

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ jobs:
1919
strategy:
2020
matrix:
2121
php:
22-
- "5.6"
23-
- "7.0"
24-
- "7.1"
2522
- "7.2"
2623
- "7.3"
2724
- "7.4"
2825
- "8.0"
26+
- "8.1"
2927

3028
steps:
3129
- name: "Checkout"
@@ -38,18 +36,12 @@ jobs:
3836
with:
3937
php-version: "${{ matrix.php }}"
4038
coverage: "none"
41-
tools: composer:v1
39+
tools: composer:v2
4240
extensions: tidy
4341
ini-values: "date.timezone=Europe/Paris"
4442
env:
4543
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4644

47-
- name: "Force PHPUnit version"
48-
if: matrix.php >= '7.2'
49-
run: "echo $SYMFONY_PHPUNIT_VERSION"
50-
env:
51-
SYMFONY_PHPUNIT_VERSION: 7.5
52-
5345
- name: "Remove useless deps"
5446
run: "composer remove friendsofphp/php-cs-fixer --dev --no-progress --no-update"
5547

@@ -84,7 +76,7 @@ jobs:
8476
with:
8577
php-version: "${{ matrix.php }}"
8678
coverage: "xdebug"
87-
tools: composer:v1
79+
tools: composer:v2
8880
extensions: tidy
8981
ini-values: "date.timezone=Europe/Paris"
9082
env:
@@ -103,8 +95,6 @@ jobs:
10395

10496
- name: "Run PHPUnit (with coverage)"
10597
run: "php vendor/bin/simple-phpunit -v --coverage-clover build/logs/clover.xml"
106-
env:
107-
SYMFONY_PHPUNIT_VERSION: 7.5
10898

10999
- name: "Retrieve Coveralls phar"
110100
run: "wget https://github.com/php-coveralls/php-coveralls/releases/download/v2.4.2/php-coveralls.phar"
@@ -126,49 +116,6 @@ jobs:
126116
php:
127117
- "7.2"
128118

129-
steps:
130-
- name: "Checkout"
131-
uses: "actions/checkout@v2"
132-
with:
133-
fetch-depth: 2
134-
135-
- name: "Install PHP"
136-
uses: "shivammathur/setup-php@v2"
137-
with:
138-
php-version: "${{ matrix.php }}"
139-
coverage: "none"
140-
tools: composer:v1
141-
extensions: tidy
142-
ini-values: "date.timezone=Europe/Paris"
143-
env:
144-
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145-
146-
- name: "Remove useless deps"
147-
run: "composer remove friendsofphp/php-cs-fixer --dev --no-progress --no-update"
148-
149-
- name: "Install dependencies with Composer"
150-
uses: "ramsey/composer-install@v1"
151-
with:
152-
composer-options: "--optimize-autoloader --prefer-dist"
153-
dependency-versions: "lowest"
154-
155-
- name: "Setup logs"
156-
run: "mkdir -p build/logs"
157-
158-
- name: "Run PHPUnit"
159-
run: "php vendor/bin/simple-phpunit -v"
160-
env:
161-
SYMFONY_PHPUNIT_VERSION: 7.5
162-
163-
phpunit-composerv2:
164-
name: "PHPUnit with Composer v2 (PHP ${{ matrix.php }})"
165-
runs-on: "ubuntu-20.04"
166-
167-
strategy:
168-
matrix:
169-
php:
170-
- "7.4"
171-
172119
steps:
173120
- name: "Checkout"
174121
uses: "actions/checkout@v2"
@@ -193,11 +140,10 @@ jobs:
193140
uses: "ramsey/composer-install@v1"
194141
with:
195142
composer-options: "--optimize-autoloader --prefer-dist"
143+
dependency-versions: "lowest"
196144

197145
- name: "Setup logs"
198146
run: "mkdir -p build/logs"
199147

200148
- name: "Run PHPUnit"
201149
run: "php vendor/bin/simple-phpunit -v"
202-
env:
203-
SYMFONY_PHPUNIT_VERSION: 7.5

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ vendor/
22
coverage/
33
composer.lock
44
.php_cs.cache
5+
.php-cs-fixer.cache
56
.phpunit.result.cache

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![Total Downloads](https://poser.pugx.org/j0k3r/php-readability/downloads)](https://packagist.org/packages/j0k3r/php-readability)
66
[![License](https://poser.pugx.org/j0k3r/php-readability/license)](https://packagist.org/packages/j0k3r/php-readability)
77

8-
This is an extract of the Readability class from this [full-text-rss](https://github.com/Dither/full-text-rss) fork. It can be defined as a better version of the original [php-readability](https://bitbucket.org/fivefilters/php-readability/overview).
8+
This is an extract of the Readability class from this [full-text-rss](https://github.com/Dither/full-text-rss) fork. It can be defined as a better version of the original [php-readability](https://bitbucket.org/fivefilters/php-readability).
99

1010
## Differences
1111

composer.json

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,17 @@
2424
"role": "Developer (original JS version)"
2525
}],
2626
"require": {
27-
"php": ">=5.6.0",
27+
"php": ">=7.2.0",
2828
"ext-mbstring": "*",
2929
"psr/log": "^1.0",
3030
"masterminds/html5": "^2.7"
3131
},
3232
"require-dev": {
33-
"friendsofphp/php-cs-fixer": "^2.14",
33+
"friendsofphp/php-cs-fixer": "^3.0",
3434
"monolog/monolog": "^1.24|^2.1",
35-
"symfony/phpunit-bridge": "^4.4|^5.3"
35+
"symfony/phpunit-bridge": "^4.4|^5.3|^6.0",
36+
"phpstan/phpstan": "^1.3",
37+
"phpstan/phpstan-phpunit": "^1.0"
3638
},
3739
"suggest": {
3840
"ext-tidy": "Used to clean up given HTML and to avoid problems with bad HTML structure."
@@ -42,5 +44,10 @@
4244
},
4345
"autoload-dev": {
4446
"psr-4": { "Tests\\Readability\\": "tests/" }
47+
},
48+
"config":{
49+
"platform": {
50+
"php": "7.2.34"
51+
}
4552
}
4653
}

phpstan.neon

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ parameters:
66

77
# https://github.com/phpstan/phpstan/issues/694#issuecomment-350724288
88
bootstrapFiles:
9-
- vendor/bin/.phpunit/phpunit-7.5-0/vendor/autoload.php
9+
- vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php
10+
11+
checkMissingIterableValueType: false
1012

1113
includes:
1214
- vendor/phpstan/phpstan-phpunit/extension.neon

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
>
1212

1313
<testsuites>
14-
<testsuite name="Readability Test Suite">
14+
<testsuite name="Readability">
1515
<directory>./tests/</directory>
1616
</testsuite>
1717
</testsuites>

0 commit comments

Comments
 (0)