Skip to content

Commit

Permalink
Merge pull request #416 from PHPCSStandards/develop
Browse files Browse the repository at this point in the history
Release 1.0.0-rc1
  • Loading branch information
jrfnl authored Dec 27, 2022
2 parents 37c6da9 + 95a8d74 commit a98f01e
Show file tree
Hide file tree
Showing 67 changed files with 902 additions and 6,722 deletions.
9 changes: 5 additions & 4 deletions .github/workflows/basics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: 'latest'
coverage: none
tools: cs2pr

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

- name: Install xmllint
run: |
Expand All @@ -68,9 +71,7 @@ jobs:

# Check the code-style consistency of the XML file.
- name: Check XML code style
run: |
diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml")
diff -B ./PHPCS23Utils/ruleset.xml <(xmllint --format "./PHPCS23Utils/ruleset.xml")
run: diff -B ./PHPCSUtils/ruleset.xml <(xmllint --format "./PHPCSUtils/ruleset.xml")

# Check the code-style consistency of the PHP files.
- name: Check PHP code style
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/quicktest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ jobs:
# @link https://github.com/marketplace/actions/install-php-dependencies-with-composer
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Lint against parse errors
if: matrix.phpcs_version == 'dev-master'
Expand Down
37 changes: 24 additions & 13 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ jobs:

strategy:
matrix:
php: ['5.4', '7.0', '7.4', '8.0', '8.1', '8.2']
php: ['5.4', '7.0', '7.4', '8.0', '8.1', '8.2', '8.3']

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

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

steps:
- name: Checkout code
Expand All @@ -49,15 +49,19 @@ jobs:
tools: cs2pr

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

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

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

# Experimental builds. These are allowed to fail.
- php: '8.2'
- php: '8.3'
phpcs_version: 'dev-master'
risky: false
experimental: true
Expand All @@ -126,12 +130,12 @@ jobs:
risky: true
experimental: true

- php: '8.1'
- php: '8.2'
phpcs_version: '3.7.1'
risky: true
experimental: true

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

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

- name: Run the unit tests without caching (non-risky)
if: ${{ matrix.risky == false }}
Expand Down Expand Up @@ -230,9 +238,9 @@ jobs:
strategy:
matrix:
include:
- php: '8.1'
- php: '8.2'
phpcs_version: 'dev-master'
- php: '8.1'
- php: '8.2'
phpcs_version: '3.7.1'
extensions: ':iconv' # Run one build with iconv disabled.
- php: '5.4'
Expand Down Expand Up @@ -275,6 +283,9 @@ jobs:
- name: Install Composer dependencies
uses: "ramsey/composer-install@v2"
with:
# Bust the cache at least once a month - output format: YYYY-MM.
custom-cache-suffix: $(date -u "+%Y-%m")

- name: Grab PHPUnit version
id: phpunit_version
Expand Down
63 changes: 60 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,58 @@ This projects adheres to [Keep a CHANGELOG](https://keepachangelog.com/) and use
_Nothing yet._


## [1.0.0-rc1] - 2022-12-27

### Added

#### Tokens

* New [`Collections::constantModifierKeywords()`][`Collections`] method. [#400]
* New [`Collections::listOpenTokensBC()`][`Collections`] method. [#405]

### Changed

#### Utils

* `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]

#### Other

* Various housekeeping and CI maintainance.

### Removed

Everything which was previously deprecated in the [1.0.0-alpha4 release], has now been removed. [#410]

This includes:
* The `PHPCS23Utils` standard.
* [`Collections`] class: direct access to the properties in the class.
* [`Collections`] class: the `Collections::arrowFunctionTokensBC()`, `Collections::functionDeclarationTokensBC()`, `Collections::parameterTypeTokensBC()`, `Collections::propertyTypeTokensBC()` and `Collections::returnTypeTokensBC()` methods.
* The `ControlStructures::getDeclareScopeOpenClose()` method.
* The `FunctionDeclarations::getArrowFunctionOpenClose()` method.
* The `FunctionDeclarations::isArrowFunction()` method.

See the changelog for the [1.0.0-alpha4 release] for details about replacements for the removed functionality.

### Fixed

#### Utils

* `Arrays::getOpenClose()`: small efficiency fix. [#406]
* `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]
* `Lists::getOpenClose()`: small efficiency fix. [#407]

[1.0.0-alpha4 release]: https://github.com/PHPCSStandards/PHPCSUtils/releases/tag/1.0.0-alpha4

[#400]: https://github.com/PHPCSStandards/PHPCSUtils/pull/400
[#401]: https://github.com/PHPCSStandards/PHPCSUtils/pull/401
[#403]: https://github.com/PHPCSStandards/PHPCSUtils/pull/403
[#405]: https://github.com/PHPCSStandards/PHPCSUtils/pull/405
[#406]: https://github.com/PHPCSStandards/PHPCSUtils/pull/406
[#407]: https://github.com/PHPCSStandards/PHPCSUtils/pull/407
[#410]: https://github.com/PHPCSStandards/PHPCSUtils/pull/410


## [1.0.0-alpha4] - 2022-10-25

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

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

#### Other

* The `PHPCS23Utils` standard, which is no longer needed now support for PHPCS < 3.7.1 has been dropped. [#347]

### Removed

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


[Unreleased]: https://github.com/PHPCSStandards/PHPCSUtils/compare/stable...HEAD
[1.0.0-rc1]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha4...1.0.0-rc1
[1.0.0-alpha4]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha3...1.0.0-alpha4
[1.0.0-alpha3]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha2...1.0.0-alpha3
[1.0.0-alpha2]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-alpha1...1.0.0-alpha2
Expand Down
52 changes: 0 additions & 52 deletions PHPCS23Utils/Sniffs/Load/LoadUtilsSniff.php

This file was deleted.

4 changes: 0 additions & 4 deletions PHPCS23Utils/ruleset.xml

This file was deleted.

2 changes: 1 addition & 1 deletion PHPCSUtils/Internal/IsShortArrayOrList.php
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ private function walkInside($opener, $recursions = 0)
$skip = Tokens::$emptyTokens;
$skip[] = \T_BITWISE_AND;

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

foreach ($items as $item) {
/*
Expand Down
Loading

0 comments on commit a98f01e

Please sign in to comment.