Skip to content

Commit 53df044

Browse files
committed
Merge tag '8.4.0' into fix/malformed-identifier
* tag '8.4.0': (133 commits) Prepare release 8.4.0 Test on PHP 8.2-dev Fix PHP 8.1 compatibility in ParserState::strsplit() Update ci.yml Also run PHP-linting with PHP 8.1 Install the development tools in the CI build the proper way Make the tests for `AtRuleBlockList` more fine-grained Fix invalid or impossible PHPDoc type annotations Make the existing tests for `Document` for fine-grained Add and clean up the type annotations for the tests Add type annotations for `Settings` Add type annotations for `URL` Add type annotations for `Size` Add more type annotations for `ValueList` Add type annotations for `LineName` Add type annotations for `PrimitiveValue` Add type annotations for `CSSString` Fix a typo in a variable name Add type annotations for `Color` Add type annotations for `CSSFunction` ...
2 parents 113df5d + e41d214 commit 53df044

File tree

165 files changed

+8688
-6852
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+8688
-6852
lines changed

.editorconfig

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
# Unix-style newlines with a newline ending every file, and with sane defaults
5+
[*]
6+
charset = utf-8
7+
end_of_line = lf
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
indent_style = space
11+
indent_size = 4
12+
max_line_length = 120
13+
14+
[*.md]
15+
max_line_length = 80
16+
# GitHub-flavored markdown uses two spaces and the end of a line to indicate a linebreak.
17+
trim_trailing_whitespace = false

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.editorconfig export-ignore
2+
/.gitattributes export-ignore
3+
/.github/ export-ignore
4+
/.gitignore export-ignore
5+
/.phive/ export-ignore
6+
/bin/ export-ignore
7+
/config/ export-ignore
8+
/phpunit.xml export-ignore
9+
/tests/ export-ignore

.github/workflows/ci.yml

Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
2+
3+
on:
4+
pull_request:
5+
push:
6+
schedule:
7+
- cron: '3 3 * * 1'
8+
9+
name: CI
10+
11+
jobs:
12+
php-lint:
13+
name: PHP Lint
14+
runs-on: ubuntu-20.04
15+
strategy:
16+
matrix:
17+
php-version: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2' ]
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Install PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php-version }}
27+
coverage: none
28+
29+
- name: PHP Lint
30+
run: find src tests -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
31+
32+
unit-tests:
33+
name: Unit tests
34+
35+
runs-on: ubuntu-20.04
36+
37+
needs: [ php-lint ]
38+
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
php-version: [ '5.6', '7.0', '7.1', '7.2', '7.3' ]
43+
coverage: [ 'none' ]
44+
include:
45+
- php-version: 7.4
46+
coverage: xdebug
47+
48+
steps:
49+
- name: Checkout
50+
uses: actions/checkout@v2
51+
52+
- name: Install PHP
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php-version }}
56+
tools: composer:v2
57+
coverage: "${{ matrix.coverage }}"
58+
59+
- name: Cache dependencies installed with composer
60+
uses: actions/cache@v1
61+
with:
62+
path: ~/.cache/composer
63+
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
64+
restore-keys: |
65+
php${{ matrix.php-version }}-composer-
66+
67+
- name: Install Composer dependencies
68+
run: |
69+
composer update --with-dependencies --no-progress;
70+
composer show;
71+
72+
- name: Run Tests
73+
run: ./vendor/bin/phpunit --coverage-clover build/coverage/xml
74+
75+
- name: Upload coverage results to Codacy
76+
env:
77+
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
78+
if: "${{ matrix.coverage != 'none' && env.CODACY_PROJECT_TOKEN != '' }}"
79+
run: |
80+
./vendor/bin/codacycoverage clover build/coverage/xml
81+
82+
static-analysis:
83+
name: Static Analysis
84+
85+
runs-on: ubuntu-20.04
86+
87+
needs: [ php-lint ]
88+
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
include:
93+
- command: sniffer
94+
php-version: 7.4
95+
- command: fixer
96+
php-version: 7.4
97+
- command: stan
98+
php-version: 7.4
99+
100+
steps:
101+
- name: Checkout
102+
uses: actions/checkout@v2
103+
104+
- name: Install PHP
105+
uses: shivammathur/setup-php@v2
106+
with:
107+
php-version: ${{ matrix.php-version }}
108+
tools: "composer:v2, phive"
109+
coverage: none
110+
111+
- name: Cache dependencies installed with composer
112+
uses: actions/cache@v1
113+
with:
114+
path: ~/.cache/composer
115+
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
116+
restore-keys: |
117+
php${{ matrix.php-version }}-composer-
118+
119+
- name: Install Composer dependencies
120+
run: |
121+
composer update --with-dependencies --no-progress;
122+
composer show;
123+
124+
- name: Install development tools
125+
run: |
126+
phive --no-progress install --trust-gpg-keys BBAB5DF0A0D6672989CF1869E82B2FB314E9906E,A972B9ABB95D0B760B51442231C7E470E2138192,D32680D5957DC7116BE29C14CF1A108D0E7AE720
127+
128+
- name: Run Command
129+
run: composer ci:php:${{ matrix.command }}

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,7 @@
1-
vendor/
1+
/.phive/*
2+
/.php-cs-fixer.cache
3+
/.php_cs.cache
4+
/composer.lock
5+
/phpstan.neon
6+
/vendor/
7+
!/.phive/phars.xml

.phive/phars.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phive xmlns="https://phar.io/phive">
3+
<phar name="php-cs-fixer" version="^3.0.0" installed="3.0.0" location="./.phive/php-cs-fixer.phar" copy="false"/>
4+
<phar name="phpcbf" version="^3.6.0" location="./.phive/phpcbf.phar" copy="false" installed="3.6.0"/>
5+
<phar name="phpcs" version="^3.6.0" location="./.phive/phpcs.phar" copy="false" installed="3.6.0"/>
6+
<phar name="phpstan" version="^0.12.88" installed="0.12.88" location="./.phive/phpstan.phar" copy="false"/>
7+
</phive>

.travis.yml

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)