Skip to content

Commit 029af41

Browse files
authored
Merge pull request #239 from PHPCSStandards/develop
Release PHPCSExtra 1.0.4
2 parents 7029c05 + c8ba5b3 commit 029af41

15 files changed

+99
-22
lines changed

.github/SECURITY.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
The latest patch version of the `1.x` release series is supported for security updates.
6+
7+
## Reporting a Vulnerability
8+
9+
PHPCSExtra is a developer tool and should generally not be used in a production (web accessible) environment.
10+
11+
Having said that, responsible disclosure of security issues is highly appreciated.
12+
13+
**Please do not report or discuss security vulnerabilities through public GitHub issues, discussions, or pull requests.**
14+
15+
Issues can be reported privately to the maintainers by opening a [Security vulnerability report](https://github.com/PHPCSStandards/PHPCSExtra/security/advisories/new).
16+
17+
### Preferences
18+
19+
* Please provide detailed reports with reproducible steps and a clearly defined impact.
20+
* Include the version number of the vulnerable package in your report.
21+
* Fixes are most welcome.
22+
A private PR can be created from the security report to work on and discuss the patch.

.github/release-checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ PR for tracking changes for the x.x.x release. Target release date: **DOW MONTH
2121
- [ ] Close the milestone
2222
- [ ] Open a new milestone for the next release
2323
- [ ] If any open PRs/issues which were milestoned for this release did not make it into the release, update their milestone.
24-
- [ ] Fast-forward `develop` to be equal to `master`
24+
- [ ] Fast-forward `develop` to be equal to `stable`
2525

2626
### Publicize
2727
- [ ] Tweet about the release.

.github/workflows/basics.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
# Run on all pushes and on all pull requests.
55
# Prevent the build from running when there are only irrelevant changes.
66
push:
7-
paths-ignore:
8-
- '**.md'
97
pull_request:
108
# Allow manually triggering the workflow.
119
workflow_dispatch:
@@ -141,8 +139,8 @@ jobs:
141139
remark-lint-heading-whitespace
142140
remark-lint-list-item-punctuation
143141
remark-lint-match-punctuation
142+
remark-lint-no-dead-urls
144143
remark-lint-no-hr-after-heading
145-
remark-lint-are-links-valid-alive
146144
remark-lint-are-links-valid-duplicate
147145
remark-validate-links
148146

.github/workflows/quicktest.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,11 @@ jobs:
7676
composer-options: --ignore-platform-req=php+
7777
custom-cache-suffix: $(date -u "+%Y-%m")
7878

79-
- name: "Composer: set PHPCS version for tests (lowest)"
79+
- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
8080
if: ${{ matrix.phpcs_version == 'lowest' }}
81-
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
81+
run: >
82+
composer update squizlabs/php_codesniffer phpcsstandards/phpcsutils
83+
--prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
8284
8385
- name: Lint against parse errors
8486
if: matrix.phpcs_version == 'dev-master'

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ jobs:
8282
composer-options: --ignore-platform-req=php+
8383
custom-cache-suffix: $(date -u "+%Y-%m")
8484

85-
- name: "Composer: set PHPCS version for tests (lowest)"
85+
- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
8686
if: ${{ matrix.phpcs_version == 'lowest' }}
87-
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
87+
run: >
88+
composer update squizlabs/php_codesniffer phpcsstandards/phpcsutils
89+
--prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
8890
8991
- name: Lint against parse errors
9092
if: matrix.phpcs_version == 'dev-master'
@@ -153,9 +155,11 @@ jobs:
153155
# Bust the cache at least once a month - output format: YYYY-MM.
154156
custom-cache-suffix: $(date -u "+%Y-%m")
155157

156-
- name: "Composer: set PHPCS version for tests (lowest)"
158+
- name: "Composer: set PHPCS/PHPCSUtils version for tests (lowest)"
157159
if: ${{ matrix.phpcs_version == 'lowest' }}
158-
run: composer update squizlabs/php_codesniffer --prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
160+
run: >
161+
composer update squizlabs/php_codesniffer phpcsstandards/phpcsutils
162+
--prefer-lowest --ignore-platform-req=php+ --no-scripts --no-interaction
159163
160164
- name: Lint against parse errors
161165
if: matrix.phpcs_version == 'dev-master'
@@ -180,7 +184,7 @@ jobs:
180184
- name: Upload coverage results to Coveralls
181185
if: ${{ success() }}
182186
env:
183-
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
187+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
184188
COVERALLS_PARALLEL: true
185189
COVERALLS_FLAG_NAME: php-${{ matrix.php }}-phpcs-${{ matrix.phpcs_version }}
186190
run: php-coveralls -v -x build/logs/clover.xml
@@ -195,5 +199,5 @@ jobs:
195199
- name: Coveralls Finished
196200
uses: coverallsapp/github-action@v2
197201
with:
198-
github-token: ${{ secrets.GITHUB_TOKEN }}
202+
github-token: ${{ secrets.COVERALLS_TOKEN }}
199203
parallel-finished: true

.remarkrc

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
["remark-lint-linebreak-style", "unix"],
99
["remark-lint-link-title-style", "\""],
1010
["remark-lint-ordered-list-marker-style", "."],
11+
[
12+
"remark-lint-no-dead-urls",
13+
{
14+
"skipUrlPatterns": [
15+
"https://www.php.net/",
16+
"^https?://github\\.com/PHPCSStandards/PHPCSExtra/compare/[0-9\\.]+?\\.{3}[0-9\\.]+"
17+
]
18+
}
19+
],
1120
"remark-lint-no-duplicate-defined-urls",
1221
"remark-lint-no-duplicate-definitions",
1322
"remark-lint-no-empty-url",
@@ -29,7 +38,6 @@
2938
"remark-lint-list-item-punctuation",
3039
"remark-lint-match-punctuation",
3140
"remark-lint-no-hr-after-heading",
32-
"remark-lint-are-links-valid-alive",
3341
"remark-lint-are-links-valid-duplicate",
3442
"remark-validate-links"
3543
]

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,25 @@ This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses
1414

1515
_Nothing yet._
1616

17+
## [1.0.4] - 2023-06-18
18+
19+
### Changed
20+
21+
#### Other
22+
23+
* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.6` (was ^1.0.0). [#237]
24+
* Various housekeeping.
25+
26+
### Fixed
27+
28+
#### Universal
29+
30+
* `Universal.Constants.LowercaseClassResolutionKeyword`: prevent false positives for function calls to methods called `class`. [#226]
31+
32+
[#226]: https://github.com/PHPCSStandards/PHPCSExtra/pull/226
33+
[#237]: https://github.com/PHPCSStandards/PHPCSExtra/pull/237
34+
35+
1736
## [1.0.3] - 2023-03-28
1837

1938
### Changed
@@ -319,7 +338,7 @@ The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which pote
319338
[#64]: https://github.com/PHPCSStandards/PHPCSExtra/pull/64
320339
[#65]: https://github.com/PHPCSStandards/PHPCSExtra/pull/65
321340

322-
[operator precedence]: https://www.php.net/manual/en/language.operators.precedence.php
341+
[operator precedence]: https://www.php.net/language.operators.precedence
323342

324343

325344
## [1.0.0-alpha2] - 2020-02-18
@@ -422,6 +441,7 @@ This initial alpha release contains the following sniffs:
422441
[php_version-config]: https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
423442

424443
[Unreleased]: https://github.com/PHPCSStandards/PHPCSExtra/compare/stable...HEAD
444+
[1.0.4]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.3...1.0.4
425445
[1.0.3]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.2...1.0.3
426446
[1.0.2]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.1...1.0.2
427447
[1.0.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.0.0...1.0.1

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ Enforce that the names used in a class/enum "implements" statement or an interfa
337337

338338
Enforce the use of the boolean `&&` and `||` operators instead of the logical `and`/`or` operators.
339339

340-
:information_source: Note: as the [operator precedence](https://www.php.net/manual/en/language.operators.precedence.php) of the logical operators is significantly lower than the operator precedence of boolean operators, this sniff does not contain an auto-fixer.
340+
:information_source: Note: as the [operator precedence](https://www.php.net/language.operators.precedence) of the logical operators is significantly lower than the operator precedence of boolean operators, this sniff does not contain an auto-fixer.
341341

342342
#### `Universal.Operators.DisallowShortTernary` :bar_chart: :books:
343343

Universal/Sniffs/Classes/ModifierKeywordOrderSniff.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212

1313
use PHP_CodeSniffer\Files\File;
1414
use PHP_CodeSniffer\Sniffs\Sniff;
15-
use PHP_CodeSniffer\Util\Tokens;
1615
use PHPCSUtils\Utils\ObjectDeclarations;
1716

1817
/**
@@ -177,7 +176,7 @@ private function handleError(File $phpcsFile, $firstKeyword, $secondKeyword)
177176
$i = ($secondKeyword + 1);
178177
while ($tokens[$i]['code'] === \T_WHITESPACE) {
179178
$phpcsFile->fixer->replaceToken($i, '');
180-
$i++;
179+
++$i;
181180
}
182181

183182
// Use the original token content as the case used for keywords is not the concern of this sniff.

Universal/Sniffs/Constants/LowercaseClassResolutionKeywordSniff.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ public function process(File $phpcsFile, $stackPtr)
6767
return;
6868
}
6969

70+
$nextToken = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
71+
if ($nextToken !== false && $tokens[$nextToken]['code'] === \T_OPEN_PARENTHESIS) {
72+
// Function call or declaration for a function called "class".
73+
return;
74+
}
75+
7076
$prevToken = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);
7177
if ($prevToken === false || $tokens[$prevToken]['code'] !== \T_DOUBLE_COLON) {
7278
return;

0 commit comments

Comments
 (0)