Skip to content

Commit

Permalink
Merge pull request #430 from PHPCSStandards/develop
Browse files Browse the repository at this point in the history
Release 1.0.1
  • Loading branch information
jrfnl authored Jan 5, 2023
2 parents 1d014df + 71851b6 commit 4fd2e30
Show file tree
Hide file tree
Showing 36 changed files with 184 additions and 301 deletions.
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,20 @@ This projects adheres to [Keep a CHANGELOG](https://keepachangelog.com/) and use

_Nothing yet._

## [1.0.1] - 2023-01-05

### Changed

#### Other

* Composer: The version requirements for the [Composer PHPCS plugin] have been widened to allow for version 1.0.0. [#428]
Please ensure you run `composer update phpcsstandards/phpcsutils --with-dependencies` to benefit from this.
* Removed the references to pre-1.0.0 QA releases from the docs. [#425]
* Various small housekeeping and maintainance updates. Thanks [@szepeviktor] for contributing.

[#425]: https://github.com/PHPCSStandards/PHPCSUtils/pull/425
[#428]: https://github.com/PHPCSStandards/PHPCSUtils/pull/428


## [1.0.0] - 2023-01-04

Expand Down Expand Up @@ -765,6 +779,7 @@ This initial alpha release contains the following utility classes:


[Unreleased]: https://github.com/PHPCSStandards/PHPCSUtils/compare/stable...HEAD
[1.0.1]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0...1.0.1
[1.0.0]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.0-rc1...1.0.0
[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
Expand Down Expand Up @@ -802,4 +817,5 @@ This initial alpha release contains the following utility classes:
[`UseStatements`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-UseStatements.html
[`Variables`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Variables.html

[@GaryJones]: https://github.com/GaryJones
[@GaryJones]: https://github.com/GaryJones
[@szepeviktor]: https://github.com/szepeviktor
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
* Abstract sniff to easily examine all parts of an array declaration.
*
* @since 1.0.0
* @since 1.0.0-alpha4 Dropped support for PHPCS < 3.7.1.
*/
abstract class AbstractArrayDeclarationSniff implements Sniff
{
Expand Down
3 changes: 0 additions & 3 deletions PHPCSUtils/BackCompat/BCFile.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
* @see \PHP_CodeSniffer\Files\File Original source of these utility methods.
*
* @since 1.0.0
* @since 1.0.0-alpha4 Dropped support for PHPCS < 3.7.1.
*/
final class BCFile
{
Expand Down Expand Up @@ -155,8 +154,6 @@ public static function getDeclarationName(File $phpcsFile, $stackPtr)
* @see \PHPCSUtils\Utils\FunctionDeclarations::getParameters() PHPCSUtils native improved version.
*
* @since 1.0.0
* @since 1.0.0-alpha2 Added support for PHP 7.4 arrow functions.
* @since 1.0.0-alpha4 Added support for PHP 8.0 identifier name tokens.
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position in the stack of the function token
Expand Down
1 change: 0 additions & 1 deletion PHPCSUtils/BackCompat/BCTokens.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
* the token arrays returned by this class.
*
* @since 1.0.0
* @since 1.0.0-alpha4 Dropped support for PHPCS < 3.7.1.
*
* @method static array arithmeticTokens() Tokens that represent arithmetic operators.
* @method static array assignmentTokens() Tokens that represent assignments.
Expand Down
7 changes: 3 additions & 4 deletions PHPCSUtils/BackCompat/Helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
*
* PHP_CodeSniffer cross-version compatibility helper.
*
* @since 1.0.0 The initial methods in this class have been ported over from
* the external PHPCompatibility & WPCS standards.
* @since 1.0.0-alpha4 Dropped support for PHPCS < 3.7.1.
* @since 1.0.0 The initial methods in this class have been ported over from
* the external PHPCompatibility & WPCS standards.
*/
final class Helper
{
Expand Down Expand Up @@ -143,7 +142,7 @@ public static function getTabWidth(File $phpcsFile)
* Get the applicable (file) encoding as passed to PHP_CodeSniffer from the
* command-line or the ruleset.
*
* @since 1.0.0-alpha3
* @since 1.0.0
*
* @param \PHP_CodeSniffer\Files\File|null $phpcsFile Optional. The current file being processed.
*
Expand Down
4 changes: 2 additions & 2 deletions PHPCSUtils/Exceptions/InvalidTokenArray.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
/**
* Exception thrown when an non-existent token array is requested.
*
* @since 1.0.0-alpha4
* @since 1.0.0
*/
final class InvalidTokenArray extends RuntimeException
{

/**
* Create a new invalid token array exception with a standardized text.
*
* @since 1.0.0-alpha4
* @since 1.0.0
*
* @param string $name The name of the token array requested.
*
Expand Down
4 changes: 2 additions & 2 deletions PHPCSUtils/Exceptions/TestFileNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
* Exception thrown when the UtilityMethodTestCase::getTargetToken() method is run without a
* tokenized test case file being available.
*
* @since 1.0.0-alpha4
* @since 1.0.0
*/
final class TestFileNotFound extends BadMethodCallException
{

/**
* Create a new "test file not found" exception with a standardized text.
*
* @since 1.0.0-alpha4
* @since 1.0.0
*
* @param string $message The Exception message to throw.
* @param int $code The Exception code.
Expand Down
4 changes: 2 additions & 2 deletions PHPCSUtils/Exceptions/TestMarkerNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
/**
* Exception thrown when a delimiter comment can not be found in a test case file.
*
* @since 1.0.0-alpha4
* @since 1.0.0
*/
final class TestMarkerNotFound extends OutOfBoundsException
{

/**
* Create a new "test marker not found" exception with a standardized text.
*
* @since 1.0.0-alpha4
* @since 1.0.0
*
* @param string $marker The delimiter comment.
* @param string $file The file in which the delimiter was not found.
Expand Down
4 changes: 2 additions & 2 deletions PHPCSUtils/Exceptions/TestTargetNotFound.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@
/**
* Exception thrown when a test target token can not be found in a test case file.
*
* @since 1.0.0-alpha4
* @since 1.0.0
*/
final class TestTargetNotFound extends OutOfBoundsException
{

/**
* Create a new "test target token not found" exception with a standardized text.
*
* @since 1.0.0-alpha4
* @since 1.0.0
*
* @param string $marker The delimiter comment.
* @param string $content The (optional) target token content.
Expand Down
14 changes: 14 additions & 0 deletions PHPCSUtils/Internal/Cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,20 +57,26 @@ final class Cache
*
* Don't forget to always turn the cache back on in a `tear_down()` method!
*
* @since 1.0.0
*
* @var bool
*/
public static $enabled = true;

/**
* Results cache.
*
* @since 1.0.0
*
* @var array<int, array<string, array>> Format: $cache[$loop][$fileName][$key][$id] = mixed $value;
*/
private static $cache = [];

/**
* Check whether a result has been cached for a certain utility function.
*
* @since 1.0.0
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param string $key The key to identify a particular set of results.
* It is recommended to pass __METHOD__ to this parameter.
Expand Down Expand Up @@ -98,6 +104,8 @@ public static function isCached(File $phpcsFile, $key, $id)
/**
* Retrieve a previously cached result for a certain utility function.
*
* @since 1.0.0
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param string $key The key to identify a particular set of results.
* It is recommended to pass __METHOD__ to this parameter.
Expand Down Expand Up @@ -130,6 +138,8 @@ public static function get(File $phpcsFile, $key, $id)
/**
* Retrieve all previously cached results for a certain utility function and a certain file.
*
* @since 1.0.0
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param string $key The key to identify a particular set of results.
* It is recommended to pass __METHOD__ to this parameter.
Expand Down Expand Up @@ -157,6 +167,8 @@ public static function getForFile(File $phpcsFile, $key)
/**
* Cache the result for a certain utility function.
*
* @since 1.0.0
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param string $key The key to identify a particular set of results.
* It is recommended to pass __METHOD__ to this parameter.
Expand Down Expand Up @@ -194,6 +206,8 @@ public static function set(File $phpcsFile, $key, $id, $value)
/**
* Clear the cache.
*
* @since 1.0.0
*
* @return void
*/
public static function clear()
Expand Down
Loading

0 comments on commit 4fd2e30

Please sign in to comment.