Skip to content

Commit 4c378c7

Browse files
committed
Merge upstream/main into explicitly-check-for-false
2 parents 2320afc + 3316f73 commit 4c378c7

80 files changed

Lines changed: 4961 additions & 2216 deletions

File tree

Some content is hidden

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

.gitattributes

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
/.github/ export-ignore
44
/.gitignore export-ignore
55
/.phive/ export-ignore
6+
/Build/ export-ignore
67
/CODE_OF_CONDUCT.md export-ignore
78
/CONTRIBUTING.md export-ignore
89
/bin/ export-ignore
9-
/config/ export-ignore
1010
/docs/ export-ignore
11-
/phpunit.xml export-ignore
11+
/src/PhpStan/ export-ignore
1212
/tests/ export-ignore

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ updates:
88
interval: "daily"
99
commit-message:
1010
prefix: "[Dependabot] "
11-
milestone: 10
11+
milestone: 13
1212

1313
- package-ecosystem: "composer"
1414
directory: "/"
@@ -26,4 +26,4 @@ updates:
2626
versioning-strategy: "increase"
2727
commit-message:
2828
prefix: "[Dependabot] "
29-
milestone: 10
29+
milestone: 13

.github/workflows/ci.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020

2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v6
23+
uses: actions/checkout@v7
2424

2525
- name: Install PHP
2626
uses: shivammathur/setup-php@v2
@@ -34,7 +34,7 @@ jobs:
3434
run: composer config --global --list
3535

3636
- name: Cache dependencies installed with composer
37-
uses: actions/cache@v5
37+
uses: actions/cache@v6
3838
with:
3939
path: ~/.cache/composer
4040
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
@@ -63,7 +63,7 @@ jobs:
6363

6464
steps:
6565
- name: Checkout
66-
uses: actions/checkout@v6
66+
uses: actions/checkout@v7
6767

6868
- name: Install PHP
6969
uses: shivammathur/setup-php@v2
@@ -77,7 +77,7 @@ jobs:
7777
run: composer config --global --list
7878

7979
- name: Cache dependencies installed with composer
80-
uses: actions/cache@v5
80+
uses: actions/cache@v6
8181
with:
8282
path: ~/.cache/composer
8383
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
@@ -90,7 +90,7 @@ jobs:
9090
composer show;
9191
9292
- name: Run Tests
93-
run: ./vendor/bin/phpunit
93+
run: composer check:tests:unit
9494

9595
static-analysis:
9696
name: Static Analysis
@@ -104,16 +104,16 @@ jobs:
104104
matrix:
105105
command:
106106
- composer:normalize
107-
- php:fixer
108-
- php:codesniffer
107+
- php:cs-fixer
108+
- php:sniff
109109
- php:stan
110110
- php:rector
111111
php-version:
112112
- '8.3'
113113

114114
steps:
115115
- name: Checkout
116-
uses: actions/checkout@v6
116+
uses: actions/checkout@v7
117117

118118
- name: Install PHP
119119
uses: shivammathur/setup-php@v2
@@ -127,7 +127,7 @@ jobs:
127127
run: composer config --global --list
128128

129129
- name: Cache dependencies installed with composer
130-
uses: actions/cache@v5
130+
uses: actions/cache@v6
131131
with:
132132
path: ~/.cache/composer
133133
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}

.github/workflows/codecoverage.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222

2323
steps:
2424
- name: Checkout
25-
uses: actions/checkout@v6
25+
uses: actions/checkout@v7
2626

2727
- name: Install PHP
2828
uses: shivammathur/setup-php@v2
@@ -39,7 +39,7 @@ jobs:
3939
run: composer config --global --list
4040

4141
- name: Cache dependencies installed with composer
42-
uses: actions/cache@v5
42+
uses: actions/cache@v6
4343
with:
4444
path: ~/.cache/composer
4545
key: php${{ matrix.php-version }}-composer-${{ hashFiles('**/composer.json') }}
@@ -59,6 +59,8 @@ jobs:
5959

6060
- name: Upload coverage results to Coveralls
6161
uses: coverallsapp/github-action@v2
62+
with:
63+
fail-on-error: false
6264
env:
6365
github-token: ${{ secrets.GITHUB_TOKEN }}
6466
file: coverage.xml

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/.idea/*
12
/.phive/*
23
/.php-cs-fixer.cache
34
/.php_cs.cache

.phive/phars.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phive xmlns="https://phar.io/phive">
3-
<phar name="composer-normalize" version="^2.44.0" installed="2.48.2" location="./.phive/composer-normalize" copy="false"/>
4-
<phar name="php-cs-fixer" version="^3.59.3" installed="3.89.2" location="./.phive/php-cs-fixer" copy="false"/>
3+
<phar name="composer-normalize" version="^2.44.0" installed="2.52.0" location="./.phive/composer-normalize" copy="false"/>
4+
<phar name="php-cs-fixer" version="^3.59.3" installed="3.95.10" location="./.phive/php-cs-fixer" copy="false"/>
55
</phive>

config/Doxyfile renamed to Build/doxyfile/config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ PROJECT_LOGO =
5858
# entered, it will be relative to the location where doxygen was started. If
5959
# left blank the current directory will be used.
6060

61-
OUTPUT_DIRECTORY = "../PHP-CSS-Parser-Documentation"
61+
OUTPUT_DIRECTORY = "PHP-CSS-Parser-Documentation"
6262

6363
# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 4096 sub-
6464
# directories (in 2 levels) under the output directory of each output format and
@@ -281,7 +281,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
281281
# Note that for custom extensions you also need to set FILE_PATTERNS otherwise
282282
# the files are not read by doxygen.
283283

284-
EXTENSION_MAPPING =
284+
EXTENSION_MAPPING =
285285

286286
# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments
287287
# according to the Markdown format, which allows for more readable
@@ -754,7 +754,7 @@ WARN_LOGFILE =
754754
# spaces.
755755
# Note: If this tag is empty the current directory is searched.
756756

757-
INPUT =
757+
INPUT =
758758

759759
# This tag can be used to specify the character encoding of the source files
760760
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22

33
declare(strict_types=1);
44

5-
return (new \PhpCsFixer\Config())
5+
use PhpCsFixer\Config;
6+
7+
return (new Config())
68
->setRiskyAllowed(true)
79
->setRules(
810
[
9-
'@PER-CS2x0' => true,
10-
'@PER-CS2x0:risky' => true,
11+
'@PER-CS3x0' => true,
12+
'@PER-CS3x0:risky' => true,
1113

1214
'@PHPUnit5x0Migration:risky' => true,
1315
'@PHPUnit5x2Migration:risky' => true,

Build/phpcs/config.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ruleset name="MyIntervals coding standard">
3+
<arg name="colors"/>
4+
<arg name="extensions" value="php"/>
5+
6+
<rule ref="Generic.Files.LineLength">
7+
<properties>
8+
<property name="lineLimit" value="120"/>
9+
<property name="absoluteLineLimit" value="120"/>
10+
</properties>
11+
</rule>
12+
<rule ref="Squiz.PHP.Heredoc"/>
13+
</ruleset>
Lines changed: 16 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -4,106 +4,76 @@ parameters:
44
message: '#^Parameter \#2 \$found of class Sabberworm\\CSS\\Parsing\\UnexpectedTokenException constructor expects string, Sabberworm\\CSS\\Value\\CSSFunction\|Sabberworm\\CSS\\Value\\CSSString\|Sabberworm\\CSS\\Value\\LineName\|Sabberworm\\CSS\\Value\\Size\|Sabberworm\\CSS\\Value\\URL given\.$#'
55
identifier: argument.type
66
count: 1
7-
path: ../src/CSSList/CSSList.php
8-
9-
-
10-
message: '#^Parameters should have "Sabberworm\\CSS\\CSSList\\CSSListItem\|array" types as the only types passed to this method$#'
11-
identifier: typePerfect.narrowPublicClassMethodParamType
12-
count: 1
13-
path: ../src/CSSList/CSSList.php
14-
15-
-
16-
message: '#^Parameters should have "string\|null" types as the only types passed to this method$#'
17-
identifier: typePerfect.narrowPublicClassMethodParamType
18-
count: 1
19-
path: ../src/CSSList/Document.php
7+
path: ../../src/CSSList/CSSList.php
208

219
-
2210
message: '#^Negated boolean expression is always true\.$#'
2311
identifier: booleanNot.alwaysTrue
2412
count: 1
25-
path: ../src/Parsing/ParserState.php
26-
27-
-
28-
message: '#^Parameters should have "string" types as the only types passed to this method$#'
29-
identifier: typePerfect.narrowPublicClassMethodParamType
30-
count: 1
31-
path: ../src/RuleSet/DeclarationBlock.php
13+
path: ../../src/Parsing/ParserState.php
3214

3315
-
3416
message: '#^Parameter \#2 \$arguments of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects array\<Sabberworm\\CSS\\Value\\Value\|string\>\|Sabberworm\\CSS\\Value\\RuleValueList, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
3517
identifier: argument.type
3618
count: 1
37-
path: ../src/Value/CSSFunction.php
19+
path: ../../src/Value/CSSFunction.php
3820

3921
-
4022
message: '#^Parameter \#2 \$offset of method Sabberworm\\CSS\\Parsing\\ParserState\:\:peek\(\) expects int\<0, max\>, \-1 given\.$#'
4123
identifier: argument.type
4224
count: 2
43-
path: ../src/Value/CalcFunction.php
25+
path: ../../src/Value/CalcFunction.php
4426

4527
-
4628
message: '#^Cannot call method getSize\(\) on Sabberworm\\CSS\\Value\\Value\|string\.$#'
4729
identifier: method.nonObject
4830
count: 3
49-
path: ../src/Value/Color.php
50-
51-
-
52-
message: '#^Parameters should have "float" types as the only types passed to this method$#'
53-
identifier: typePerfect.narrowPublicClassMethodParamType
54-
count: 1
55-
path: ../src/Value/Size.php
31+
path: ../../src/Value/Color.php
5632

5733
-
5834
message: '#^Strict comparison using \!\=\= between non\-empty\-string and null will always evaluate to true\.$#'
5935
identifier: notIdentical.alwaysTrue
6036
count: 1
61-
path: ../src/Value/Size.php
37+
path: ../../src/Value/Size.php
6238

6339
-
6440
message: '#^Parameter \#2 \$arguments of class Sabberworm\\CSS\\Value\\CSSFunction constructor expects array\<Sabberworm\\CSS\\Value\\Value\|string\>\|Sabberworm\\CSS\\Value\\RuleValueList, Sabberworm\\CSS\\Value\\Value\|string given\.$#'
6541
identifier: argument.type
6642
count: 1
67-
path: ../src/Value/Value.php
43+
path: ../../src/Value/Value.php
6844

6945
-
7046
message: '#^Parameter \#2 \$offset of method Sabberworm\\CSS\\Parsing\\ParserState\:\:peek\(\) expects int\<0, max\>, \-1 given\.$#'
7147
identifier: argument.type
7248
count: 1
73-
path: ../src/Value/Value.php
74-
75-
-
76-
message: '#^Call to static method PHPUnit\\Framework\\Assert\:\:assertSame\(\) with ''red'' and Sabberworm\\CSS\\Value\\Value will always evaluate to false\.$#'
77-
identifier: staticMethod.impossibleType
78-
count: 1
79-
path: ../tests/ParserTest.php
49+
path: ../../src/Value/Value.php
8050

8151
-
82-
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Rule\\Rule\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#'
52+
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\Size given\.$#'
8353
identifier: argument.type
8454
count: 3
85-
path: ../tests/RuleSet/DeclarationBlockTest.php
55+
path: ../../tests/RuleSet/DeclarationBlockTest.php
8656

8757
-
8858
message: '#^Parameter \#1 \$type of class Sabberworm\\CSS\\CSSList\\AtRuleBlockList constructor expects non\-empty\-string, '''' given\.$#'
8959
identifier: argument.type
9060
count: 3
91-
path: ../tests/Unit/CSSList/AtRuleBlockListTest.php
61+
path: ../../tests/Unit/CSSList/AtRuleBlockListTest.php
9262

9363
-
94-
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Rule\\Rule\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\CSSFunction given\.$#'
64+
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\CSSFunction given\.$#'
9565
identifier: argument.type
9666
count: 2
97-
path: ../tests/Unit/CSSList/CSSBlockListTest.php
67+
path: ../../tests/Unit/CSSList/CSSBlockListTest.php
9868

9969
-
100-
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Rule\\Rule\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\CSSString given\.$#'
70+
message: '#^Parameter \#1 \$value of method Sabberworm\\CSS\\Property\\Declaration\:\:setValue\(\) expects Sabberworm\\CSS\\Value\\RuleValueList\|string\|null, Sabberworm\\CSS\\Value\\CSSString given\.$#'
10171
identifier: argument.type
10272
count: 10
103-
path: ../tests/Unit/CSSList/CSSBlockListTest.php
73+
path: ../../tests/Unit/CSSList/CSSBlockListTest.php
10474

10575
-
10676
message: '#^Parameter \#1 \$selectors of method Sabberworm\\CSS\\CSSList\\CSSList\:\:removeDeclarationBlockBySelector\(\) expects array\<Sabberworm\\CSS\\Property\\Selector\>\|Sabberworm\\CSS\\RuleSet\\DeclarationBlock\|string, array\<int, string\> given\.$#'
10777
identifier: argument.type
10878
count: 2
109-
path: ../tests/Unit/CSSList/CSSListTest.php
79+
path: ../../tests/Unit/CSSList/CSSListTest.php

0 commit comments

Comments
 (0)