Skip to content

Commit a98f01e

Browse files
authored
Merge pull request #416 from PHPCSStandards/develop
Release 1.0.0-rc1
2 parents 37c6da9 + 95a8d74 commit a98f01e

File tree

67 files changed

+902
-6722
lines changed

Some content is hidden

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

67 files changed

+902
-6722
lines changed

.github/workflows/basics.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: Install PHP
3232
uses: shivammathur/setup-php@v2
3333
with:
34-
php-version: '7.4'
34+
php-version: 'latest'
3535
coverage: none
3636
tools: cs2pr
3737

@@ -51,6 +51,9 @@ jobs:
5151
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
5252
- name: Install Composer dependencies
5353
uses: "ramsey/composer-install@v2"
54+
with:
55+
# Bust the cache at least once a month - output format: YYYY-MM.
56+
custom-cache-suffix: $(date -u "+%Y-%m")
5457

5558
- name: Install xmllint
5659
run: |
@@ -68,9 +71,7 @@ jobs:
6871

6972
# Check the code-style consistency of the XML file.
7073
- name: Check XML code style
71-
run: |
72-
diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml")
73-
diff -B ./PHPCS23Utils/ruleset.xml <(xmllint --format "./PHPCS23Utils/ruleset.xml")
74+
run: diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml")
7475

7576
# Check the code-style consistency of the PHP files.
7677
- name: Check PHP code style

.github/workflows/quicktest.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ jobs:
6767
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
6868
- name: Install Composer dependencies
6969
uses: "ramsey/composer-install@v2"
70+
with:
71+
# Bust the cache at least once a month - output format: YYYY-MM.
72+
custom-cache-suffix: $(date -u "+%Y-%m")
7073

7174
- name: Lint against parse errors
7275
if: matrix.phpcs_version == 'dev-master'

.github/workflows/test.yml

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ jobs:
3030

3131
strategy:
3232
matrix:
33-
php: ['5.4', '7.0', '7.4', '8.0', '8.1', '8.2']
33+
php: ['5.4', '7.0', '7.4', '8.0', '8.1', '8.2', '8.3']
3434

3535
name: "Lint: PHP ${{ matrix.php }}"
3636

37-
continue-on-error: ${{ matrix.php == '8.2' }}
37+
continue-on-error: ${{ matrix.php == '8.3' }}
3838

3939
steps:
4040
- name: Checkout code
@@ -49,15 +49,19 @@ jobs:
4949
tools: cs2pr
5050

5151
- name: Install Composer dependencies - normal
52-
if: ${{ matrix.php < 8.2 }}
52+
if: ${{ matrix.php < 8.3 }}
5353
uses: "ramsey/composer-install@v2"
54+
with:
55+
# Bust the cache at least once a month - output format: YYYY-MM.
56+
custom-cache-suffix: $(date -u "+%Y-%m")
5457

5558
# For the PHP "nightly", we need to install with ignore platform reqs as not all dependencies allow it yet.
5659
- name: Install Composer dependencies - with ignore platform
57-
if: ${{ matrix.php >= 8.2 }}
60+
if: ${{ matrix.php >= 8.3 }}
5861
uses: "ramsey/composer-install@v2"
5962
with:
6063
composer-options: --ignore-platform-reqs
64+
custom-cache-suffix: $(date -u "+%Y-%m")
6165

6266
- name: Lint against parse errors
6367
run: composer lint -- --checkstyle | cs2pr
@@ -82,7 +86,7 @@ jobs:
8286
# IMPORTANT: test runs shouldn't fail because of PHPCS being incompatible with a PHP version.
8387
#
8488
# The matrix is set up so as not to duplicate the builds which are run for code coverage.
85-
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0']
89+
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
8690
phpcs_version: ['3.7.1', 'dev-master']
8791
risky: [false]
8892
experimental: [false]
@@ -100,7 +104,7 @@ jobs:
100104
extensions: ':iconv' # Run with iconv disabled.
101105

102106
# Experimental builds. These are allowed to fail.
103-
- php: '8.2'
107+
- php: '8.3'
104108
phpcs_version: 'dev-master'
105109
risky: false
106110
experimental: true
@@ -126,12 +130,12 @@ jobs:
126130
risky: true
127131
experimental: true
128132

129-
- php: '8.1'
133+
- php: '8.2'
130134
phpcs_version: '3.7.1'
131135
risky: true
132136
experimental: true
133137

134-
- php: '8.1'
138+
- php: '8.2'
135139
phpcs_version: 'dev-master'
136140
risky: true
137141
experimental: true
@@ -173,15 +177,19 @@ jobs:
173177
# Install dependencies and handle caching in one go.
174178
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
175179
- name: Install Composer dependencies - normal
176-
if: ${{ matrix.php < 8.2 }}
180+
if: ${{ matrix.php < 8.3 }}
177181
uses: "ramsey/composer-install@v2"
182+
with:
183+
# Bust the cache at least once a month - output format: YYYY-MM.
184+
custom-cache-suffix: $(date -u "+%Y-%m")
178185

179-
# For the PHP "nightly", we need to install with ignore platform reqs as not all dependencies allow it yet.
186+
# For PHP "nightly", we need to install with ignore platform reqs as not all dependencies allow it yet.
180187
- name: Install Composer dependencies - with ignore platform
181-
if: ${{ matrix.php >= 8.2 }}
188+
if: ${{ matrix.php >= 8.3 }}
182189
uses: "ramsey/composer-install@v2"
183190
with:
184191
composer-options: --ignore-platform-reqs
192+
custom-cache-suffix: $(date -u "+%Y-%m")
185193

186194
- name: Run the unit tests without caching (non-risky)
187195
if: ${{ matrix.risky == false }}
@@ -230,9 +238,9 @@ jobs:
230238
strategy:
231239
matrix:
232240
include:
233-
- php: '8.1'
241+
- php: '8.2'
234242
phpcs_version: 'dev-master'
235-
- php: '8.1'
243+
- php: '8.2'
236244
phpcs_version: '3.7.1'
237245
extensions: ':iconv' # Run one build with iconv disabled.
238246
- php: '5.4'
@@ -275,6 +283,9 @@ jobs:
275283
276284
- name: Install Composer dependencies
277285
uses: "ramsey/composer-install@v2"
286+
with:
287+
# Bust the cache at least once a month - output format: YYYY-MM.
288+
custom-cache-suffix: $(date -u "+%Y-%m")
278289

279290
- name: Grab PHPUnit version
280291
id: phpunit_version

CHANGELOG.md

Lines changed: 60 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,58 @@ This projects adheres to [Keep a CHANGELOG](https://keepachangelog.com/) and use
1010
_Nothing yet._
1111

1212

13+
## [1.0.0-rc1] - 2022-12-27
14+
15+
### Added
16+
17+
#### Tokens
18+
19+
* New [`Collections::constantModifierKeywords()`][`Collections`] method. [#400]
20+
* New [`Collections::listOpenTokensBC()`][`Collections`] method. [#405]
21+
22+
### Changed
23+
24+
#### Utils
25+
26+
* `ObjectDeclarations::getClassProperties()`: the array return value will now include `'abstract_token'`, `'final_token'`, and `'readonly_token'` indexes identifying the stack pointers to these keyword, where applicable. If the keyword is not used, the value will be set to `false`. [#401]
27+
28+
#### Other
29+
30+
* Various housekeeping and CI maintainance.
31+
32+
### Removed
33+
34+
Everything which was previously deprecated in the [1.0.0-alpha4 release], has now been removed. [#410]
35+
36+
This includes:
37+
* The `PHPCS23Utils` standard.
38+
* [`Collections`] class: direct access to the properties in the class.
39+
* [`Collections`] class: the `Collections::arrowFunctionTokensBC()`, `Collections::functionDeclarationTokensBC()`, `Collections::parameterTypeTokensBC()`, `Collections::propertyTypeTokensBC()` and `Collections::returnTypeTokensBC()` methods.
40+
* The `ControlStructures::getDeclareScopeOpenClose()` method.
41+
* The `FunctionDeclarations::getArrowFunctionOpenClose()` method.
42+
* The `FunctionDeclarations::isArrowFunction()` method.
43+
44+
See the changelog for the [1.0.0-alpha4 release] for details about replacements for the removed functionality.
45+
46+
### Fixed
47+
48+
#### Utils
49+
50+
* `Arrays::getOpenClose()`: small efficiency fix. [#406]
51+
* `ControlStructures::hasBody()`: correctly identify that a control structure does not have a body - `'has_body' = false` -, when the control structure is ended by a PHP close tag. [#403]
52+
* `Lists::getOpenClose()`: small efficiency fix. [#407]
53+
54+
[1.0.0-alpha4 release]: https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.0-alpha4
55+
56+
[#400]: https://github.com/PHPCSStandards/PHPCSUtils/pull/400
57+
[#401]: https://github.com/PHPCSStandards/PHPCSUtils/pull/401
58+
[#403]: https://github.com/PHPCSStandards/PHPCSUtils/pull/403
59+
[#405]: https://github.com/PHPCSStandards/PHPCSUtils/pull/405
60+
[#406]: https://github.com/PHPCSStandards/PHPCSUtils/pull/406
61+
[#407]: https://github.com/PHPCSStandards/PHPCSUtils/pull/407
62+
[#410]: https://github.com/PHPCSStandards/PHPCSUtils/pull/410
63+
64+
1365
## [1.0.0-alpha4] - 2022-10-25
1466

1567
Notes:
@@ -46,7 +98,7 @@ This means that support for the following syntaxes/features has been added (or e
4698
- Explicit octal notation. [#293]
4799
- Array unpacking with string keys.
48100
- `never` type.
49-
- Named parameters after argument unpacking.
101+
- Named parameters after argument unpacking. [#383]
50102
- First class callables. [#362]
51103
- Readonly properties. [#363]
52104
- `new` in initializers.
@@ -190,8 +242,8 @@ All properties have a replacement which should be used instead, in most cases th
190242

191243
| Deprecated | Replacement | PR | Remarks |
192244
|---------------------------------------------------------------|------------------------------------------------------------------------------------------------------|----------------|------------------------------------------|
193-
| `Collections::$alternativeControlStructureSyntaxTokens` | `Collections::alternativeControlStructureSyntaxes()` | [#311] | Mind the change name! |
194-
| `Collections::$alternativeControlStructureSyntaxCloserTokens` | `Collections::alternativeControlStructureSyntaxClosers()` | [#311] | Mind the change name! |
245+
| `Collections::$alternativeControlStructureSyntaxTokens` | `Collections::alternativeControlStructureSyntaxes()` | [#311] | Mind the change in the name! |
246+
| `Collections::$alternativeControlStructureSyntaxCloserTokens` | `Collections::alternativeControlStructureSyntaxClosers()` | [#311] | Mind the change in the name! |
195247
| `Collections::$arrayTokens` | `Collections::arrayTokens()` | [#311] | |
196248
| `Collections::$arrayTokensBC` | `Collections::arrayTokensBC()` | [#311] | |
197249
| `Collections::$classModifierKeywords` | `Collections::classModifierKeywords()` | [#311] | |
@@ -235,6 +287,10 @@ Additionally, the following methods in the `Collections` class have been depreca
235287
* `FunctionDeclarations::getArrowFunctionOpenClose()`: this method is no longer needed, check the `scope_opener`/`scope_closer` etc on the `T_FN` token instead. [#347]
236288
* `FunctionDeclarations::isArrowFunction()`: this method is no longer needed, use the `T_FN` token instead. [#347]
237289

290+
#### Other
291+
292+
* The `PHPCS23Utils` standard, which is no longer needed now support for PHPCS < 3.7.1 has been dropped. [#347]
293+
238294
### Removed
239295

240296
* Support for PHPCS < 3.7.1. [#347]
@@ -692,6 +748,7 @@ This initial alpha release contains the following utility classes:
692748

693749

694750
[Unreleased]: https://github.com/PHPCSStandards/PHPCSUtils/compare/stable...HEAD
751+
[1.0.0-rc1]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha4...1.0.0-rc1
695752
[1.0.0-alpha4]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha3...1.0.0-alpha4
696753
[1.0.0-alpha3]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha2...1.0.0-alpha3
697754
[1.0.0-alpha2]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha1...1.0.0-alpha2

PHPCS23Utils/Sniffs/Load/LoadUtilsSniff.php

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

PHPCS23Utils/ruleset.xml

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

PHPCSUtils/Internal/IsShortArrayOrList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ private function walkInside($opener, $recursions = 0)
464464
$skip = Tokens::$emptyTokens;
465465
$skip[] = \T_BITWISE_AND;
466466

467-
$skipNames = Collections::namespacedNameTokens() + Collections::$OOHierarchyKeywords;
467+
$skipNames = Collections::namespacedNameTokens() + Collections::ooHierarchyKeywords();
468468

469469
foreach ($items as $item) {
470470
/*

0 commit comments

Comments
 (0)