@@ -24,34 +23,31 @@ PHPCSExtra
* [Introduction](#introduction)
* [Minimum Requirements](#minimum-requirements)
* [Installation](#installation)
- + [Composer Project-based Installation](#composer-project-based-installation)
- + [Composer Global Installation](#composer-global-installation)
- + [Updating to a newer version](#updating-to-a-newer-version)
+ - [Composer Project-based Installation](#composer-project-based-installation)
+ - [Composer Global Installation](#composer-global-installation)
+ - [Updating to a newer version](#updating-to-a-newer-version)
* [Features](#features)
* [Sniffs](#sniffs)
- + [Modernize](#modernize)
- + [NormalizedArrays](#normalizedarrays)
- + [Universal](#universal)
+ - [Modernize](#modernize)
+ - [NormalizedArrays](#normalizedarrays)
+ - [Universal](#universal)
* [Contributing](#contributing)
* [License](#license)
-Introduction
--------------------------------------------
+## Introduction
PHPCSExtra is a collection of sniffs and standards for use with [PHP_CodeSniffer][phpcs-gh].
-Minimum Requirements
--------------------------------------------
+## Minimum Requirements
* PHP 5.4 or higher.
* [PHP_CodeSniffer][phpcs-gh] version **3.12.1** or higher.
-* [PHPCSUtils][phpcsutils-gh] version **1.0.9** or higher.
+* [PHPCSUtils][phpcsutils-gh] version **1.0.12** or higher.
-Installation
--------------------------------------------
+## Installation
Installing via Composer is highly recommended.
@@ -93,8 +89,7 @@ composer global update phpcsstandards/phpcsextra --with-dependencies
> (and potential other external PHPCS standards you use), manage the version requirements for these packages.
-Features
--------------------------------------------
+## Features
Once this project is installed, you will see three new rulesets in the list of installed standards when you run `vendor/bin/phpcs -i`: `Modernize`, `NormalizedArrays` and `Universal`.
@@ -105,8 +100,7 @@ Once this project is installed, you will see three new rulesets in the list of i
Instead include individual sniffs from this standard in a custom project/company ruleset to use them.
-Sniffs
--------------------------------------------
+## Sniffs
**Legend**:
* :wrench: = Includes auto-fixer.
@@ -138,13 +132,13 @@ In effect, this means that the sniff will only report on modernizations which ca
Enforce consistent spacing for the open/close braces of array declarations.
The sniff allows for having different settings for:
-- Space between the array keyword and the open parenthesis for long arrays via the `keywordSpacing` property.
+* Space between the array keyword and the open parenthesis for long arrays via the `keywordSpacing` property.
Accepted values: (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces.
-- Spaces on the inside of the braces for empty arrays via the `spacesWhenEmpty` property.
+* Spaces on the inside of the braces for empty arrays via the `spacesWhenEmpty` property.
Accepted values: (string) `newline`, (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces.
-- Spaces on the inside of the braces for single-line arrays via the `spacesSingleLine` property;
+* Spaces on the inside of the braces for single-line arrays via the `spacesSingleLine` property;
Accepted values: (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces.
-- Spaces on the inside of the braces for multi-line arrays via the `spacesMultiLine` property.
+* Spaces on the inside of the braces for multi-line arrays via the `spacesMultiLine` property.
Accepted values: (string) `newline`, (int) number of spaces or `false` to turn this check off. Defaults to `newline`.
Note: if any of the above properties are set to `newline`, it is recommended to also include an array indentation sniff. This sniff will not handle the indentation.
@@ -539,7 +533,7 @@ The behaviour of the sniff is customizable via the following properties:
If this property is not set, the sniff will look to the `--tab-width` CLI value.
If that also isn't set, the default tab-width of `4` will be used.
* `ignoreAlignmentBefore`: allows for providing a list of token names for which (preceding) precision alignment should be ignored.
- Accepted values: (array) token constant names. Defaults to an empty array.
+ Accepted values: (`array`) token constant names. Defaults to an empty array.
Usage example:
```xml
@@ -559,14 +553,15 @@ The behaviour of the sniff is customizable via the following properties:
Accepted values: (bool)`true`|`false`. Defaults to `true`.
-Contributing
--------
+## Contributing
+
Contributions to this project are welcome. Clone the repo, branch off from `develop`, make your changes, commit them and send in a pull request.
If unsure whether the changes you are proposing would be welcome, open an issue first to discuss your proposal.
-License
--------
+
+## License
+
This code is released under the [GNU Lesser General Public License (LGPLv3)](LICENSE).
diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php
index 2bb240d..a57d363 100644
--- a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php
+++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php
@@ -157,14 +157,18 @@ public function process(File $phpcsFile, $stackPtr)
* Fix it.
*
* This fixer complies with the following (arbitrary) requirements:
- * - It will re-use the original base "group" name, i.e. the part before \{.
- * - It take take aliases into account, but only when something is aliased to a different name.
+ * - It will re-use the original base "group" name, i.e. the part before \{,
+ * though it will remove a potential leading backslash from it.
+ * - It takes aliases into account, but only when something is aliased to a different name.
* Aliases re-using the original name will be removed.
* - The fix will not add a trailing comma after the last group use sub-statement.
* This is a PHP 7.2+ feature.
* If a standard wants to enforce trailing commas, they should use a separate sniff for that.
* - If there is only 1 statement of a certain type, the replacement will be a single
* import use statement, not a group use statement.
+ * - If any of the partial use statements within a group contain leading backslashes,
+ * the sniff will not correct for this. This is a parse error and the fixed version will
+ * still contain a parse error.
*/
$phpcsFile->fixer->beginChangeset();
@@ -187,7 +191,7 @@ public function process(File $phpcsFile, $stackPtr)
$useIndent = \str_repeat(' ', ($tokens[$stackPtr]['column'] - 1));
$insideIndent = $useIndent . \str_repeat(' ', 4);
- $baseGroupName = GetTokensAsString::noEmpties($phpcsFile, ($stackPtr + 1), ($groupStart - 1));
+ $baseGroupName = \ltrim(GetTokensAsString::noEmpties($phpcsFile, ($stackPtr + 1), ($groupStart - 1)), '\\');
foreach ($useStatements as $type => $statements) {
$count = \count($statements);
@@ -201,12 +205,12 @@ public function process(File $phpcsFile, $stackPtr)
}
if ($count === 1) {
- $fqName = \reset($statements);
- $alias = \key($statements);
+ $qualifiedName = \reset($statements);
+ $alias = \key($statements);
- $newStatement = 'use ' . $typeName . $fqName;
+ $newStatement = 'use ' . $typeName . $qualifiedName;
- $unqualifiedName = \ltrim(\substr($fqName, \strrpos($fqName, '\\')), '\\');
+ $unqualifiedName = \ltrim(\substr($qualifiedName, (int) \strrpos($qualifiedName, '\\')), '\\');
if ($unqualifiedName !== $alias) {
$newStatement .= ' as ' . $alias;
}
@@ -220,11 +224,11 @@ public function process(File $phpcsFile, $stackPtr)
// Multiple statements, add a single-type group use statement.
$newStatement = 'use ' . $typeName . $baseGroupName . '{' . $phpcsFile->eolChar;
- foreach ($statements as $alias => $fqName) {
- $partialName = \str_replace($baseGroupName, '', $fqName);
+ foreach ($statements as $alias => $qualifiedName) {
+ $partialName = \str_replace($baseGroupName, '', $qualifiedName);
$newStatement .= $insideIndent . $partialName;
- $unqualifiedName = \ltrim(\substr($partialName, \strrpos($partialName, '\\')), '\\');
+ $unqualifiedName = \ltrim(\substr($partialName, (int) \strrpos($partialName, '\\')), '\\');
if ($unqualifiedName !== $alias) {
$newStatement .= ' as ' . $alias;
}
diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php
index 8dcf8dd..5df9317 100644
--- a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php
+++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php
@@ -127,7 +127,7 @@ public function process(File $phpcsFile, $stackPtr)
$endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1));
- foreach ($statements['name'] as $alias => $fullName) {
+ foreach ($statements['name'] as $alias => $qualifiedName) {
$reportPtr = $stackPtr;
do {
$reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias);
@@ -163,20 +163,19 @@ public function process(File $phpcsFile, $stackPtr)
$errorCode = 'Found';
$data = [
'',
- $fullName,
+ $qualifiedName,
];
$globalNamespace = false;
$sameNamespace = false;
- if (\strpos($fullName, '\\', 1) === false) {
+ if (\strpos($qualifiedName, '\\') === false) {
$globalNamespace = true;
$errorCode = 'FromGlobalNamespace';
$data[0] = ' from the global namespace';
$phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace');
} elseif ($this->currentNamespace !== ''
- && (\stripos($fullName, $this->currentNamespace . '\\') === 0
- || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0)
+ && \stripos($qualifiedName, $this->currentNamespace . '\\') === 0
) {
$sameNamespace = true;
$errorCode = 'FromSameNamespace';
@@ -188,7 +187,7 @@ public function process(File $phpcsFile, $stackPtr)
}
$hasAlias = false;
- $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1)));
+ $lastLeaf = \strtolower(\substr($qualifiedName, -(\strlen($alias) + 1)));
$aliasLC = \strtolower($alias);
if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) {
$hasAlias = true;
diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php
index 44388f6..e66ccc7 100644
--- a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php
+++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php
@@ -127,7 +127,7 @@ public function process(File $phpcsFile, $stackPtr)
$endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1));
- foreach ($statements['const'] as $alias => $fullName) {
+ foreach ($statements['const'] as $alias => $qualifiedName) {
$reportPtr = $stackPtr;
do {
$reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias);
@@ -163,20 +163,19 @@ public function process(File $phpcsFile, $stackPtr)
$errorCode = 'Found';
$data = [
'',
- $fullName,
+ $qualifiedName,
];
$globalNamespace = false;
$sameNamespace = false;
- if (\strpos($fullName, '\\', 1) === false) {
+ if (\strpos($qualifiedName, '\\') === false) {
$globalNamespace = true;
$errorCode = 'FromGlobalNamespace';
$data[0] = ' from the global namespace';
$phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace');
} elseif ($this->currentNamespace !== ''
- && (\stripos($fullName, $this->currentNamespace . '\\') === 0
- || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0)
+ && \stripos($qualifiedName, $this->currentNamespace . '\\') === 0
) {
$sameNamespace = true;
$errorCode = 'FromSameNamespace';
@@ -188,7 +187,7 @@ public function process(File $phpcsFile, $stackPtr)
}
$hasAlias = false;
- $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1)));
+ $lastLeaf = \strtolower(\substr($qualifiedName, -(\strlen($alias) + 1)));
$aliasLC = \strtolower($alias);
if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) {
$hasAlias = true;
diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php
index 46a39ed..c476352 100644
--- a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php
+++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php
@@ -127,7 +127,7 @@ public function process(File $phpcsFile, $stackPtr)
$endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1));
- foreach ($statements['function'] as $alias => $fullName) {
+ foreach ($statements['function'] as $alias => $qualifiedName) {
$reportPtr = $stackPtr;
do {
$reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias);
@@ -163,20 +163,19 @@ public function process(File $phpcsFile, $stackPtr)
$errorCode = 'Found';
$data = [
'',
- $fullName,
+ $qualifiedName,
];
$globalNamespace = false;
$sameNamespace = false;
- if (\strpos($fullName, '\\', 1) === false) {
+ if (\strpos($qualifiedName, '\\') === false) {
$globalNamespace = true;
$errorCode = 'FromGlobalNamespace';
$data[0] = ' from the global namespace';
$phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace');
} elseif ($this->currentNamespace !== ''
- && (\stripos($fullName, $this->currentNamespace . '\\') === 0
- || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0)
+ && \stripos($qualifiedName, $this->currentNamespace . '\\') === 0
) {
$sameNamespace = true;
$errorCode = 'FromSameNamespace';
@@ -188,7 +187,7 @@ public function process(File $phpcsFile, $stackPtr)
}
$hasAlias = false;
- $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1)));
+ $lastLeaf = \strtolower(\substr($qualifiedName, -(\strlen($alias) + 1)));
$aliasLC = \strtolower($alias);
if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) {
$hasAlias = true;
diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php
index 93de596..c5dcec6 100644
--- a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php
+++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php
@@ -92,8 +92,8 @@ public function process(File $phpcsFile, $stackPtr)
// Now check the names in each use statement for useless aliases.
foreach ($useStatements as $type => $statements) {
- foreach ($statements as $alias => $fqName) {
- $unqualifiedName = \ltrim(\substr($fqName, \strrpos($fqName, '\\')), '\\');
+ foreach ($statements as $alias => $qualifiedName) {
+ $unqualifiedName = \ltrim(\substr($qualifiedName, (int) \strrpos($qualifiedName, '\\')), '\\');
$uselessAlias = false;
if ($type === 'const') {
@@ -125,7 +125,7 @@ public function process(File $phpcsFile, $stackPtr)
$error = 'Useless alias "%s" found for import of "%s"';
$code = 'Found';
- $data = [$alias, $fqName];
+ $data = [$alias, $qualifiedName];
// Okay, so this is the one which should be flagged.
$hasComments = $phpcsFile->findNext(Tokens::$commentTokens, ($prev + 1), $aliasPtr);
diff --git a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
index af68968..89d914b 100644
--- a/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
+++ b/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
@@ -306,16 +306,7 @@ public function process(File $phpcsFile, $stackPtr)
case \T_END_HEREDOC:
case \T_END_NOWDOC:
- /*
- * PHPCS does not execute tab replacement in heredoc/nowdoc closer
- * tokens prior to PHPCS 3.7.2, so handle this ourselves.
- */
- $content = $tokens[$i]['content'];
- if (\strpos($tokens[$i]['content'], "\t") !== false) {
- $origContent = $content;
- $content = \str_replace("\t", \str_repeat(' ', $this->tabWidth), $content);
- }
-
+ $content = $tokens[$i]['content'];
$closer = \ltrim($content);
$whitespace = \str_replace($closer, '', $content);
$length = \strlen($whitespace);
diff --git a/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml b/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml
index 6c591eb..e29238f 100644
--- a/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml
+++ b/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml
@@ -1,5 +1,5 @@
-
+A collection of universal sniffs. This standard is not designed to be used to check code. Include individual sniffs from this standard in a custom ruleset instead.
diff --git a/vendor/phpcsstandards/phpcsextra/composer.json b/vendor/phpcsstandards/phpcsextra/composer.json
index b565df6..9edefc5 100644
--- a/vendor/phpcsstandards/phpcsextra/composer.json
+++ b/vendor/phpcsstandards/phpcsextra/composer.json
@@ -23,10 +23,10 @@
"require" : {
"php" : ">=5.4",
"squizlabs/php_codesniffer" : "^3.12.1",
- "phpcsstandards/phpcsutils" : "^1.0.9"
+ "phpcsstandards/phpcsutils" : "^1.0.12"
},
"require-dev" : {
- "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
"php-parallel-lint/php-console-highlighter": "^1.0",
"phpcsstandards/phpcsdevcs": "^1.1.6",
"phpcsstandards/phpcsdevtools": "^1.2.1",
diff --git a/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist b/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist
deleted file mode 100644
index 9ec6fd2..0000000
--- a/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
- PHPCSUtils
-
-
-
- build/docs/structure/
-
-
-
-
-
- phpcsutils-autoload.php
- PHPCSUtils
-
-
- PHPCSUtils/Internal/**/*
-
- public
- protected
-
- codeCoverageIgnore
- phpcs
-
-
-
-
-
-
-
diff --git a/vendor/phpcsstandards/phpcsutils/CHANGELOG.md b/vendor/phpcsstandards/phpcsutils/CHANGELOG.md
index b9f163f..fb1723a 100644
--- a/vendor/phpcsstandards/phpcsutils/CHANGELOG.md
+++ b/vendor/phpcsstandards/phpcsutils/CHANGELOG.md
@@ -9,6 +9,176 @@ This projects adheres to [Keep a CHANGELOG](https://keepachangelog.com/) and use
_Nothing yet._
+
+## [1.1.0] - 2025-06-12
+
+### Added
+
+Compatibility with the new PHP_CodeSniffer `4.x` branch in anticipation of the PHP_CodeSniffer 4.0 release. [#674], [#679]
+PHPCSUtils should now be fully compatible with PHP_CodeSniffer 4.0 (again). If you still find an issue, please report it.
+
+#### PHPCS BackCompat
+
+* `BCFile::findExtendedClassName()`: sync with PHPCS 4.0.0 - support for namespace relative names when used as the _extended_ parent class name. [#674]
+* `BCFile::findImplementedInterfaceNames()`: sync with PHPCS 4.0.0 - support for namespace relative names when used in _implemented_ interface names. [#674]
+* `BCFile::getMemberProperties()`: sync with PHPCS 3.12.0 - support for PHP 8.4 final properties. Thanks [@DanielEScherzer]! [#646]
+* `BCFile::getMemberProperties()`: sync with PHPCS 3.13.1 - support for PHP 8.4 asymmetric visibility. [#677]
+* `BCFile::getMemberProperties()`: sync with PHPCS 4.0.0. [#674]
+ - Add support for PHP 8.4 properties in interfaces.
+ - Removed parse error warning.
+* `BCFile::getMethodParameters()`: sync with PHPCS 3.13.1 - support for PHP 8.4 asymmetric visibility. [#677]
+* `BCFile::findStartOfStatement()`: sync with PHPCS 3.12.1 - support for `goto` as a `switch` - `case` terminating statement. [#661]
+* `BCTokens::nameTokens()` as introduced in PHPCS 4.0.0. [#674]
+ The same token array previously already existed in PHPCSUtils as `Collections::nameTokens()`.
+* `BCTokens::functionNameTokens()`: sync with PHPCS 4.0.0 - added the `T_ANON_CLASS` token. [#674]
+* `BCTokens::parenthesisOpeners()`: sync with PHPCS 4.0.0 - added the `T_USE`, `T_ISSET`, `T_UNSET`, `T_EMPTY`, `T_EVAL` and `T_EXIT` tokens. [#674]
+ Note: While `T_USE`, `T_ISSET`, `T_UNSET`, `T_EMPTY`, `T_EVAL` and `T_EXIT` will be included in the return value for this method,
+ the associated parentheses will not have the `'parenthesis_owner'` index set unless PHPCS 4.0.0 is used.
+ Use the [`Parentheses::getOwner()`][`Parentheses`] or the [`Parentheses::hasOwner()`][`Parentheses`] methods if you need to check
+ whether any of these tokens are a parentheses owner. The methods in the `Parentheses` class are PHPCS cross-version compatible.
+
+#### TestUtils
+
+* New [`PHPCSUtils\TestUtils\ConfigDouble`][`ConfigDouble`] class as a lightweight and more stable alternative to directly using the PHPCS native `Config` class in tests. [#550], [#612]
+ Props to [@fredden] for helping me find and fix a bug in this feature before it was released.
+* New [`PHPCSUtils\TestUtils\RulesetDouble`][`RulesetDouble`] class which allows for creating a `Ruleset` object without registering any sniffs. [#674]
+ This allows for the [`PHPCSUtils\TestUtils\UtilityMethodTestCase`][`UtilityMethodTestCase`] class to be cross-version compatible with both PHP_CodeSniffer 3.x as well as 4.x.
+* New [`PHPCSUtils\TestUtils\UtilityMethodTestCase::parseFile()`][`UtilityMethodTestCase`] method to allow for on-demand tokenizing of a (secondary) test case file. [#591], [#610]
+ This method is intended for tests which need to use multiple test case files, like, for example, tests which need to verify that a utility resets a `$fileName` property on seeing another file.
+* New [`PHPCSUtils\TestUtils\UtilityMethodTestCase::testTestMarkersAreUnique()` and `PHPCSUtils\TestUtils\UtilityMethodTestCase::assertTestMarkersAreUnique()`][`UtilityMethodTestCase`] methods which automatically check that code sample files used with this `TestCase` do not contain duplicate test case markers. [#642]
+ If needs be, the test method can be disabled by overloading it (discouraged). If a test uses multiple test case/code sample files, the assertion method can be called directly.
+
+#### Tokens
+
+* New [`Collections::constantTypeTokens()`][`Collections`] method to support PHP 8.3 typed class constants. [#562]
+* New [`Collections::ternaryOperators()`][`Collections`] method. [#549]
+* `T_EXIT` to the `Collections::functionCallTokens()` and `Collections::parameterPassingTokens()` in light of the PHP 8.4 "exit as function" change. [#618]
+* The PHP 8.4 asymmetric visibility tokens have been added to the [`Collections::propertyModifierKeywords()`][`Collections`] method. [#653]
+* `T_INTERFACE` has been added to the [`Collections::ooPropertyScopes()`][`Collections`] method for PHP 8.4 interface properties support. [#674]
+
+#### Utils
+
+* New [`PHPCSUtils\Utils\Constants`][`Constants`] class: Utility functions to examine (class) constants. [#562]
+ Initially available method: `getProperties()` to retrieve an array of information about an OO constant declaration.
+* New [`PHPCSUtils\Utils\FileInfo`][`FileInfo`] class: Utility functions to check characteristics of the file under scan. [#572]
+ Initial set of available methods: `hasByteOrderMark()` and `hasSheBang()`.
+* New [`PHPCSUtils\Utils\FilePath`][`FilePath`] class: Utility functions for handling and comparing file paths. [#593]
+ Initial set of available methods: `getName()` to retrieve the normalized path for the current file, `isStdin()`, `normalizeAbsolutePath()`, `normalizeDirectorySeparators()`, `trailingSlashIt()` and `startsWith()`.
+* New [`PHPCSUtils\Utils\TypeString`][`TypeString`] class: Utility functions for analysing typestrings as retrieved via the various available `getParameters()`/`getProperties()` methods. [#588]
+ Initial set of available methods: `getKeywordTypes()`, `isKeyword()`, `normalizeCase()`, `isSingular()`, `isNullable()`, `isUnion()`, `isIntersection()`, `isDNF()`, `toArray()`, `toArrayUnique()`, `filterKeywordTypes()` and `filterOOTypes()`.
+ Note: The `is*()` methods will not check if the type string provided is valid, as doing so would inhibit what sniffs can flag. The `is*()` methods will only look at the form of the type string to determine if it could be valid for a certain type.
+* New `PHPCSUtils\Utils\ObjectDeclarations::getDeclaredConstants()`, `PHPCSUtils\Utils\ObjectDeclarations::getDeclaredEnumCases()`, `PHPCSUtils\Utils\ObjectDeclarations::getDeclaredProperties()` and `PHPCSUtils\Utils\ObjectDeclarations::getDeclaredMethods()` utility methods. [#592]
+ These methods will each return an array with the name of the constant/case/property/method as the key and the typical stack pointer needed for further processing.
+ The retrieval of this information is highly optimized for performance. If a sniff needs to search for a named constant/enum case/property/method in an OO structure, in most cases, these methods should be the recommended way for finding the declaration, instead of the sniff attempting to do this itself.
+ Mind: the return value of the `getDeclaredProperties()` method includes constructor promoted properties. Passing the stack pointer of constructor promoted properties onto a call to the `Variables::getMemberProperties()` method, however, is currently not supported.
+* `FunctionDeclarations::getParameters()`: support for PHP 8.4 asymmetric visibility. [#677]
+* `Variables::getMemberProperties()`: support for PHP 8.4 final properties. Thanks [@DanielEScherzer]! [#646]
+* `Variables::getMemberProperties()`: support for PHP 8.4 asymmetric visibility. [#677]
+
+### Changed
+
+* The exceptions thrown by PHPCSUtils native utilities have been made more modular and more specific. [#598], [#599], [#600]
+ - Passing a parameter of the wrong type will now result in a `PHPCSUtils\Exceptions\TypeError` being thrown.
+ - Passing a parameter of the correct type, but with an invalid value, like an empty string when only non-empty strings are expected/accepted, will now result in a `PHPCSUtils\Exceptions\ValueError` being thrown.
+ - Passing a (positive) integer stack pointer, which doesn't exist in the token stack of the current file, will now result in a `PHPCSUtils\Exceptions\OutOfBoundsStackPtr` being thrown.
+ - Passing a stack pointer to a token which is not within the range of token types which is accepted by the method, will now result in a `PHPCSUtils\Exceptions\UnexpectedTokenType` being thrown.
+ - Logic errors will now result in a `PHPCSUtils\Exceptions\LogicException` being thrown.
+ This can occur, for instance, when a method takes a `$start` and `$end` parameter and the `$end` pointer is before the `$start` pointer.
+ - Missing, conditionally required, parameters, will now result in a `PHPCSUtils\Exceptions\MissingArgumentError` being thrown.
+ - Generic errors will now result in a `PHPCSUtils\Exceptions\RuntimeException` being thrown.
+ - Previously the PHPCS native `PHP_CodeSniffer\Exceptions\RuntimeException` was used for all these exceptions.
+ Catching the PHPCS native `RuntimeException` will still catch the new exceptions, but it is strongly recommended to be more selective when catching exceptions to prevent accidentally hiding errors in sniffs.
+ - Also note that the PHPCSUtils native utilities now include more and stricter type checking to help surface bugs in sniffs.
+
+#### Abstract Sniffs
+
+* The `AbstractArrayDeclarationSniff::process()` method will no longer hide exceptions about a non-integer or non-existent stack pointer being passed. [#600]
+* The `AbstractArrayDeclarationSniff::processArray()` method will no longer hide exceptions about non-integer or non-existent stack pointers being passed. [#600]
+
+#### PHPCS BackCompat
+
+* `BCFile::getDeclarationName()`: sync with PHPCS 3.12.0 - prevent incorrect result during live coding for unfinished closures. [#644]
+* `BCFile::getDeclarationName()`: sync with PHPCS 4.0.0 - no longer accept the `T_CLOSURE` or `T_ANON_CLASS` tokens. [#674]
+ Passing these will now result in an exception.
+* `BCFile::getDeclarationName()`: sync with PHPCS 4.0.0 - the method will now always return a string. [#674]
+ Previously, the method could return `null` when the name could not be determined. Now it will return an empty string.
+
+#### TestUtils
+
+* The [`PHPCSUtils\TestUtils\UtilityMethodTestCase`][`UtilityMethodTestCase`] is now officially compatible with PHPUnit 11 and will no longer generate any deprecation notices on PHPUnit 11.
+
+#### Utils
+
+* [`Parentheses`]: all methods will now recognize closer `use()` as a parentheses owner. [#674]
+ Note: PHPCS natively does not recognize closure `use` as a parentheses owners until PHP_CodeSniffer 4.0.
+* All methods in the [`PassedParameters`] class will now be able to analyze exit/die when used as a function call. [#618]
+* The `Scopes::isOOProperty()` method now allows for PHP 8.4 properties in interfaces. [#674]
+ - This also adds support for properties in interfaces to the `Variables::getMemberProperties()` method.
+* The `UseStatements::splitAndMergeImportUseStatement()` method will no longer hide exceptions about a non-integer, non-existent or non-`T_USE` stack pointer being passed. [#600]
+
+#### Other
+
+* Dropped support for [PHP_CodeSniffer] < 3.13.0. [#629], [#653]
+ Please ensure you run `composer update phpcsstandards/phpcsutils --with-dependencies` to benefit from this.
+* Various housekeeping, including making the test suite compatible with PHPUnit 11.
+
+### Deprecated
+
+#### TestUtils
+
+* The (internal) `PHPCSUtils\TestUtils\UtilityMethodTestCase::setStaticConfigProperty()` method. [#550]
+ This method has become redundant with the introduction of the `ConfigDouble` class.
+
+### Removed
+
+#### PHPCS BackCompat
+
+* The javascript specific `T_ZSR_EQUAL` token from the `BCTokens::assignmentTokens()` array, as per PHPCS 4.0.0. [#674]
+* The javascript specific `T_OBJECT` token from the `BCTokens::blockOpeners()` array, as per PHPCS 4.0.0. [#674]
+* The javascript specific `T_PROPERTY` and `T_OBJECT` tokens from the `BCTokens::blockOpeners()` array, as per PHPCS 4.0.0. [#674]
+
+### Fixed
+
+#### Abstract Sniffs
+
+* `AbstractArrayDeclarationSniff::getActualArrayKey()`: will now handle FQN `true`/`false`/`null` correctly. [#668]
+
+#### Utils
+
+* `Context::inForeachCondition()` could misidentify the `as` keyword for `foreach` when the iterable expression contained an array declaration in which the `as` keyword was being used. [#617]
+* The `Numbers::is*()` methods could misidentify strings which look like numeric literals with underscores, but are in actual fact invalid as numeric literals, as valid numbers. [#619], [#620]
+* `UseStatements::getType()` will now handle unfinished closure `use` statements (parse errors) more consistently and return `'closure'` for those cases. [#667]
+
+[#549]: https://github.com/PHPCSStandards/PHPCSUtils/pull/549
+[#550]: https://github.com/PHPCSStandards/PHPCSUtils/pull/550
+[#562]: https://github.com/PHPCSStandards/PHPCSUtils/pull/562
+[#572]: https://github.com/PHPCSStandards/PHPCSUtils/pull/572
+[#588]: https://github.com/PHPCSStandards/PHPCSUtils/pull/588
+[#591]: https://github.com/PHPCSStandards/PHPCSUtils/pull/591
+[#592]: https://github.com/PHPCSStandards/PHPCSUtils/pull/592
+[#593]: https://github.com/PHPCSStandards/PHPCSUtils/pull/593
+[#598]: https://github.com/PHPCSStandards/PHPCSUtils/pull/598
+[#599]: https://github.com/PHPCSStandards/PHPCSUtils/pull/599
+[#600]: https://github.com/PHPCSStandards/PHPCSUtils/pull/600
+[#610]: https://github.com/PHPCSStandards/PHPCSUtils/pull/610
+[#612]: https://github.com/PHPCSStandards/PHPCSUtils/pull/612
+[#617]: https://github.com/PHPCSStandards/PHPCSUtils/pull/617
+[#618]: https://github.com/PHPCSStandards/PHPCSUtils/pull/618
+[#619]: https://github.com/PHPCSStandards/PHPCSUtils/issues/619
+[#620]: https://github.com/PHPCSStandards/PHPCSUtils/pull/620
+[#629]: https://github.com/PHPCSStandards/PHPCSUtils/pull/629
+[#642]: https://github.com/PHPCSStandards/PHPCSUtils/pull/642
+[#644]: https://github.com/PHPCSStandards/PHPCSUtils/pull/644
+[#646]: https://github.com/PHPCSStandards/PHPCSUtils/pull/646
+[#653]: https://github.com/PHPCSStandards/PHPCSUtils/pull/653
+[#661]: https://github.com/PHPCSStandards/PHPCSUtils/pull/661
+[#667]: https://github.com/PHPCSStandards/PHPCSUtils/pull/667
+[#668]: https://github.com/PHPCSStandards/PHPCSUtils/pull/668
+[#674]: https://github.com/PHPCSStandards/PHPCSUtils/pull/674
+[#677]: https://github.com/PHPCSStandards/PHPCSUtils/pull/677
+[#679]: https://github.com/PHPCSStandards/PHPCSUtils/pull/679
+
+
## [1.0.12] - 2024-05-20
### Added
@@ -1051,6 +1221,7 @@ This initial alpha release contains the following utility classes:
[Unreleased]: https://github.com/PHPCSStandards/PHPCSUtils/compare/stable...HEAD
+[1.1.0]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.12...1.1.0
[1.0.12]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.11...1.0.12
[1.0.11]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.10...1.0.11
[1.0.10]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.9...1.0.10
@@ -1077,15 +1248,20 @@ This initial alpha release contains the following utility classes:
[`BCTokens`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-BackCompat-BCTokens.html
[`Helper`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-BackCompat-Helper.html
[`SpacesFixer`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Fixers-SpacesFixer.html
+[`ConfigDouble`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-TestUtils-ConfigDouble.html
+[`RulesetDouble`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-TestUtils-RulesetDouble.html
[`UtilityMethodTestCase`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-TestUtils-UtilityMethodTestCase.html
[`Collections`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Tokens-Collections.html
[`TokenHelper`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Tokens-TokenHelper.html
[`Arrays`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Arrays.html
[`Conditions`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Conditions.html
+[`Constants`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Constants.html
[`Context`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Context.html
[`ControlStructures`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-ControlStructures.html
[`FunctionDeclarations`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-FunctionDeclarations.html
[`GetTokensAsString`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-GetTokensAsString.html
+[`FileInfo`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-FileInfo.html
+[`FilePath`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-FilePath.html
[`Lists`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Lists.html
[`MessageHelper`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-MessageHelper.html
[`Namespaces`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Namespaces.html
@@ -1098,9 +1274,11 @@ This initial alpha release contains the following utility classes:
[`PassedParameters`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-PassedParameters.html
[`Scopes`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Scopes.html
[`TextStrings`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-TextStrings.html
+[`TypeString`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-TypeString.html
[`UseStatements`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-UseStatements.html
[`Variables`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Variables.html
-[@fredden]: https://github.com/fredden
-[@GaryJones]: https://github.com/GaryJones
-[@szepeviktor]: https://github.com/szepeviktor
+[@DanielEScherzer]: https://github.com/DanielEScherzer
+[@fredden]: https://github.com/fredden
+[@GaryJones]: https://github.com/GaryJones
+[@szepeviktor]: https://github.com/szepeviktor
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php
index b79a3fd..1480d25 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php
@@ -10,10 +10,11 @@
namespace PHPCSUtils\AbstractSniffs;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\LogicException;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
use PHPCSUtils\Tokens\Collections;
use PHPCSUtils\Utils\Arrays;
use PHPCSUtils\Utils\Numbers;
@@ -118,8 +119,6 @@ abstract class AbstractArrayDeclarationSniff implements Sniff
\T_DNUMBER => \T_DNUMBER,
\T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING,
\T_STRING_CONCAT => \T_STRING_CONCAT,
- \T_INLINE_THEN => \T_INLINE_THEN,
- \T_INLINE_ELSE => \T_INLINE_ELSE,
\T_BOOLEAN_NOT => \T_BOOLEAN_NOT,
];
@@ -143,6 +142,7 @@ final public function __construct()
$this->acceptedTokens += Tokens::$castTokens;
$this->acceptedTokens += Tokens::$bracketTokens;
$this->acceptedTokens += Tokens::$heredocTokens;
+ $this->acceptedTokens += Collections::ternaryOperators();
}
/**
@@ -179,7 +179,7 @@ final public function process(File $phpcsFile, $stackPtr)
{
try {
$this->arrayItems = PassedParameters::getParameters($phpcsFile, $stackPtr);
- } catch (RuntimeException $e) {
+ } catch (UnexpectedTokenType $e) {
// Parse error, short list, real square open bracket or incorrectly tokenized short array token.
return;
}
@@ -246,7 +246,7 @@ public function processArray(File $phpcsFile)
foreach ($this->arrayItems as $itemNr => $arrayItem) {
try {
$arrowPtr = Arrays::getDoubleArrowPtr($phpcsFile, $arrayItem['start'], $arrayItem['end']);
- } catch (RuntimeException $e) {
+ } catch (LogicException $e) {
// Parse error: empty array item. Ignore.
continue;
}
@@ -478,6 +478,37 @@ public function getActualArrayKey(File $phpcsFile, $startPtr, $endPtr)
continue;
}
+ // Handle FQN true/false/null.
+ if ($this->tokens[$i]['code'] === \T_NAME_FULLY_QUALIFIED) {
+ $compareReadyKeyword = \strtolower($this->tokens[$i]['content']);
+ if ($compareReadyKeyword === '\true'
+ || $compareReadyKeyword === '\false'
+ || $compareReadyKeyword === '\null'
+ ) {
+ // FQN true/false/null on PHPCS 4.x. This can be handled.
+ $content .= $this->tokens[$i]['content'];
+ continue;
+ }
+ } elseif ($this->tokens[$i]['code'] === \T_NS_SEPARATOR) {
+ // PHPCS 3.x.
+ $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true);
+ $nextNonEmptyLC = \strtolower($this->tokens[$nextNonEmpty]['content']);
+ if ($nextNonEmpty !== false
+ // PHPCS 3.x with PHP < 8.0.
+ && ($this->tokens[$nextNonEmpty]['code'] === \T_TRUE
+ || $this->tokens[$nextNonEmpty]['code'] === \T_FALSE
+ || $this->tokens[$nextNonEmpty]['code'] === \T_NULL
+ // PHPCS 3.x with PHP >= 8.0 where the namespaced name tokenization has been undone.
+ || ($this->tokens[$nextNonEmpty]['code'] === \T_STRING
+ && ($nextNonEmptyLC === 'true' || $nextNonEmptyLC === 'false' || $nextNonEmptyLC === 'null')))
+ ) {
+ // FQN true/false/null on PHPCS 3.x. This can be handled.
+ $content .= $this->tokens[$nextNonEmpty]['content'];
+ $i = $nextNonEmpty;
+ continue;
+ }
+ }
+
if (isset($this->acceptedTokens[$this->tokens[$i]['code']]) === false) {
// This is not a key we can evaluate. Might be a variable or constant.
return;
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php
index 8c06343..4a78601 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php
@@ -76,7 +76,8 @@ final class BCFile
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - PHPCS 4.0: The method no longer accepts `T_CLOSURE` and `T_ANON_CLASS` tokens.
+ * - PHPCS 4.0: The method will now always return a string.
*
* @see \PHP_CodeSniffer\Files\File::getDeclarationName() Original source.
* @see \PHPCSUtils\Utils\ObjectDeclarations::getName() PHPCSUtils native improved version.
@@ -88,17 +89,53 @@ final class BCFile
* which declared the class, interface,
* trait, enum or function.
*
- * @return string|null The name of the class, interface, trait, enum, or function;
- * or `NULL` if the function or class is anonymous or
- * in case of a parse error/live coding.
+ * @return string The name of the class, interface, trait, or function or an empty string
+ * if the name could not be determined (live coding).
*
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not of type
- * `T_FUNCTION`, `T_CLASS`, `T_ANON_CLASS`,
- * `T_CLOSURE`, `T_TRAIT`, `T_ENUM` or `T_INTERFACE`.
+ * `T_FUNCTION`, `T_CLASS`, `T_TRAIT`, `T_ENUM`, or `T_INTERFACE`.
*/
public static function getDeclarationName(File $phpcsFile, $stackPtr)
{
- return $phpcsFile->getDeclarationName($stackPtr);
+ $tokens = $phpcsFile->getTokens();
+
+ $tokenCode = $tokens[$stackPtr]['code'];
+
+ if ($tokenCode !== T_FUNCTION
+ && $tokenCode !== T_CLASS
+ && $tokenCode !== T_INTERFACE
+ && $tokenCode !== T_TRAIT
+ && $tokenCode !== T_ENUM
+ ) {
+ throw new RuntimeException('Token type "' . $tokens[$stackPtr]['type'] . '" is not T_FUNCTION, T_CLASS, T_INTERFACE, T_TRAIT or T_ENUM');
+ }
+
+ if ($tokenCode === T_FUNCTION
+ && strtolower($tokens[$stackPtr]['content']) !== 'function'
+ ) {
+ // This is a function declared without the "function" keyword.
+ // So this token is the function name.
+ return $tokens[$stackPtr]['content'];
+ }
+
+ $stopPoint = $phpcsFile->numTokens;
+ if (isset($tokens[$stackPtr]['parenthesis_opener']) === true) {
+ // For functions, stop searching at the parenthesis opener.
+ $stopPoint = $tokens[$stackPtr]['parenthesis_opener'];
+ } elseif (isset($tokens[$stackPtr]['scope_opener']) === true) {
+ // For OO tokens, stop searching at the open curly.
+ $stopPoint = $tokens[$stackPtr]['scope_opener'];
+ }
+
+ $content = '';
+ for ($i = $stackPtr; $i < $stopPoint; $i++) {
+ if ($tokens[$i]['code'] === T_STRING) {
+ $content = $tokens[$i]['content'];
+ break;
+ }
+ }
+
+ return $content;
}
/**
@@ -148,6 +185,12 @@ public static function getDeclarationName(File $phpcsFile, $stackPtr)
* // This index will only be set if the property is readonly.
* ```
*
+ * ... and if the promoted property uses asymmetric visibility, these additional array indexes will also be available:
+ * ```php
+ * 'set_visibility' => string, // The property set-visibility as declared.
+ * 'set_visibility_token' => integer, // The stack pointer to the set-visibility modifier token.
+ * ```
+ *
* PHPCS cross-version compatible version of the `File::getMethodParameters()` method.
*
* Changelog for the PHPCS native function:
@@ -159,6 +202,7 @@ public static function getDeclarationName(File $phpcsFile, $stackPtr)
*
* @since 1.0.0
* @since 1.0.6 Sync with PHPCS 3.8.0, support for readonly properties without explicit visibility. PHPCS#3801.
+ * @since 1.1.0 Sync with PHPCS 3.13.1, support for asymmetric properties. PHPCS(new)#851
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position in the stack of the function token
@@ -205,23 +249,24 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
$closer = $tokens[$opener]['parenthesis_closer'];
- $vars = [];
- $currVar = null;
- $paramStart = ($opener + 1);
- $defaultStart = null;
- $equalToken = null;
- $paramCount = 0;
- $hasAttributes = false;
- $passByReference = false;
- $referenceToken = false;
- $variableLength = false;
- $variadicToken = false;
- $typeHint = '';
- $typeHintToken = false;
- $typeHintEndToken = false;
- $nullableType = false;
- $visibilityToken = null;
- $readonlyToken = null;
+ $vars = [];
+ $currVar = null;
+ $paramStart = ($opener + 1);
+ $defaultStart = null;
+ $equalToken = null;
+ $paramCount = 0;
+ $hasAttributes = false;
+ $passByReference = false;
+ $referenceToken = false;
+ $variableLength = false;
+ $variadicToken = false;
+ $typeHint = '';
+ $typeHintToken = false;
+ $typeHintEndToken = false;
+ $nullableType = false;
+ $visibilityToken = null;
+ $setVisibilityToken = null;
+ $readonlyToken = null;
for ($i = $paramStart; $i <= $closer; $i++) {
// Check to see if this token has a parenthesis or bracket opener. If it does
@@ -355,6 +400,13 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
$visibilityToken = $i;
}
break;
+ case T_PUBLIC_SET:
+ case T_PROTECTED_SET:
+ case T_PRIVATE_SET:
+ if ($defaultStart === null) {
+ $setVisibilityToken = $i;
+ }
+ break;
case T_READONLY:
if ($defaultStart === null) {
$readonlyToken = $i;
@@ -389,16 +441,21 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
$vars[$paramCount]['type_hint_end_token'] = $typeHintEndToken;
$vars[$paramCount]['nullable_type'] = $nullableType;
- if ($visibilityToken !== null || $readonlyToken !== null) {
+ if ($visibilityToken !== null || $setVisibilityToken !== null || $readonlyToken !== null) {
$vars[$paramCount]['property_visibility'] = 'public';
$vars[$paramCount]['visibility_token'] = false;
- $vars[$paramCount]['property_readonly'] = false;
if ($visibilityToken !== null) {
$vars[$paramCount]['property_visibility'] = $tokens[$visibilityToken]['content'];
$vars[$paramCount]['visibility_token'] = $visibilityToken;
}
+ if ($setVisibilityToken !== null) {
+ $vars[$paramCount]['set_visibility'] = $tokens[$setVisibilityToken]['content'];
+ $vars[$paramCount]['set_visibility_token'] = $setVisibilityToken;
+ }
+
+ $vars[$paramCount]['property_readonly'] = false;
if ($readonlyToken !== null) {
$vars[$paramCount]['property_readonly'] = true;
$vars[$paramCount]['readonly_token'] = $readonlyToken;
@@ -412,21 +469,22 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
}
// Reset the vars, as we are about to process the next parameter.
- $currVar = null;
- $paramStart = ($i + 1);
- $defaultStart = null;
- $equalToken = null;
- $hasAttributes = false;
- $passByReference = false;
- $referenceToken = false;
- $variableLength = false;
- $variadicToken = false;
- $typeHint = '';
- $typeHintToken = false;
- $typeHintEndToken = false;
- $nullableType = false;
- $visibilityToken = null;
- $readonlyToken = null;
+ $currVar = null;
+ $paramStart = ($i + 1);
+ $defaultStart = null;
+ $equalToken = null;
+ $hasAttributes = false;
+ $passByReference = false;
+ $referenceToken = false;
+ $variableLength = false;
+ $variadicToken = false;
+ $typeHint = '';
+ $typeHintToken = false;
+ $typeHintEndToken = false;
+ $nullableType = false;
+ $visibilityToken = null;
+ $setVisibilityToken = null;
+ $readonlyToken = null;
++$paramCount;
break;
@@ -466,7 +524,7 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::getMethodProperties() Original source.
* @see \PHPCSUtils\Utils\FunctionDeclarations::getProperties() PHPCSUtils native improved version.
@@ -495,8 +553,12 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
* array(
* 'scope' => string, // Public, private, or protected.
* 'scope_specified' => boolean, // TRUE if the scope was explicitly specified.
+ * 'set_scope' => string|false, // Scope for asymmetric visibility.
+ * // Either public, private, or protected or
+ * // FALSE if no set scope is specified.
* 'is_static' => boolean, // TRUE if the static keyword was found.
* 'is_readonly' => boolean, // TRUE if the readonly keyword was found.
+ * 'is_final' => boolean, // TRUE if the final keyword was found.
* 'type' => string, // The type of the var (empty if no type specified).
* 'type_token' => integer|false, // The stack pointer to the start of the type
* // or FALSE if there is no type.
@@ -511,7 +573,8 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - PHPCS 4.0: properties in interfaces (PHP 8.4+) are accepted.
+ * - PHPCS 4.0: will no longer throw a parse error warning.
*
* @see \PHP_CodeSniffer\Files\File::getMemberProperties() Original source.
* @see \PHPCSUtils\Utils\Variables::getMemberProperties() PHPCSUtils native improved version.
@@ -530,7 +593,146 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
*/
public static function getMemberProperties(File $phpcsFile, $stackPtr)
{
- return $phpcsFile->getMemberProperties($stackPtr);
+ $tokens = $phpcsFile->getTokens();
+
+ if ($tokens[$stackPtr]['code'] !== T_VARIABLE) {
+ throw new RuntimeException('$stackPtr must be of type T_VARIABLE');
+ }
+
+ $conditions = $tokens[$stackPtr]['conditions'];
+ $conditions = array_keys($conditions);
+ $ptr = array_pop($conditions);
+ if (isset($tokens[$ptr]) === false
+ || isset(Tokens::$ooScopeTokens[$tokens[$ptr]['code']]) === false
+ || $tokens[$ptr]['code'] === T_ENUM
+ ) {
+ throw new RuntimeException('$stackPtr is not a class member var');
+ }
+
+ // Make sure it's not a method parameter.
+ if (empty($tokens[$stackPtr]['nested_parenthesis']) === false) {
+ $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']);
+ $deepestOpen = array_pop($parenthesis);
+ if ($deepestOpen > $ptr
+ && isset($tokens[$deepestOpen]['parenthesis_owner']) === true
+ && $tokens[$tokens[$deepestOpen]['parenthesis_owner']]['code'] === T_FUNCTION
+ ) {
+ throw new RuntimeException('$stackPtr is not a class member var');
+ }
+ }
+
+ $valid = [
+ T_STATIC => T_STATIC,
+ T_VAR => T_VAR,
+ T_READONLY => T_READONLY,
+ T_FINAL => T_FINAL,
+ ];
+
+ $valid += Tokens::$scopeModifiers;
+ $valid += Tokens::$emptyTokens;
+
+ $scope = 'public';
+ $scopeSpecified = false;
+ $setScope = false;
+ $isStatic = false;
+ $isReadonly = false;
+ $isFinal = false;
+
+ $startOfStatement = $phpcsFile->findPrevious(
+ [
+ T_SEMICOLON,
+ T_OPEN_CURLY_BRACKET,
+ T_CLOSE_CURLY_BRACKET,
+ T_ATTRIBUTE_END,
+ ],
+ ($stackPtr - 1)
+ );
+
+ for ($i = ($startOfStatement + 1); $i < $stackPtr; $i++) {
+ if (isset($valid[$tokens[$i]['code']]) === false) {
+ break;
+ }
+
+ switch ($tokens[$i]['code']) {
+ case T_PUBLIC:
+ $scope = 'public';
+ $scopeSpecified = true;
+ break;
+ case T_PRIVATE:
+ $scope = 'private';
+ $scopeSpecified = true;
+ break;
+ case T_PROTECTED:
+ $scope = 'protected';
+ $scopeSpecified = true;
+ break;
+ case T_PUBLIC_SET:
+ $setScope = 'public';
+ break;
+ case T_PROTECTED_SET:
+ $setScope = 'protected';
+ break;
+ case T_PRIVATE_SET:
+ $setScope = 'private';
+ break;
+ case T_STATIC:
+ $isStatic = true;
+ break;
+ case T_READONLY:
+ $isReadonly = true;
+ break;
+ case T_FINAL:
+ $isFinal = true;
+ break;
+ }
+ }
+
+ $type = '';
+ $typeToken = false;
+ $typeEndToken = false;
+ $nullableType = false;
+
+ if ($i < $stackPtr) {
+ // We've found a type.
+ $valid = Collections::propertyTypeTokens();
+
+ for ($i; $i < $stackPtr; $i++) {
+ if ($tokens[$i]['code'] === T_VARIABLE) {
+ // Hit another variable in a group definition.
+ break;
+ }
+
+ if ($tokens[$i]['code'] === T_NULLABLE) {
+ $nullableType = true;
+ }
+
+ if (isset($valid[$tokens[$i]['code']]) === true) {
+ $typeEndToken = $i;
+ if ($typeToken === false) {
+ $typeToken = $i;
+ }
+
+ $type .= $tokens[$i]['content'];
+ }
+ }
+
+ if ($type !== '' && $nullableType === true) {
+ $type = '?' . $type;
+ }
+ }
+
+ return [
+ 'scope' => $scope,
+ 'scope_specified' => $scopeSpecified,
+ 'set_scope' => $setScope,
+ 'is_static' => $isStatic,
+ 'is_readonly' => $isReadonly,
+ 'is_final' => $isFinal,
+ 'type' => $type,
+ 'type_token' => $typeToken,
+ 'type_end_token' => $typeEndToken,
+ 'nullable_type' => $nullableType,
+ ];
}
/**
@@ -549,7 +751,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 1.3.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::getClassProperties() Original source.
* @see \PHPCSUtils\Utils\ObjectDeclarations::getClassProperties() PHPCSUtils native improved version.
@@ -577,7 +779,7 @@ public static function getClassProperties(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::isReference() Original source.
* @see \PHPCSUtils\Utils\Operators::isReference() PHPCSUtils native improved version.
@@ -603,7 +805,7 @@ public static function isReference(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::getTokensAsString() Original source.
* @see \PHPCSUtils\Utils\GetTokensAsString Related set of functions.
@@ -632,7 +834,7 @@ public static function getTokensAsString(File $phpcsFile, $start, $length, $orig
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 2.1.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::findStartOfStatement() Original source.
*
@@ -656,7 +858,7 @@ public static function findStartOfStatement(File $phpcsFile, $start, $ignore = n
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 2.1.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::findEndOfStatement() Original source.
*
@@ -680,7 +882,7 @@ public static function findEndOfStatement(File $phpcsFile, $start, $ignore = nul
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::hasCondition() Original source.
* @see \PHPCSUtils\Utils\Conditions::hasCondition() PHPCSUtils native alternative.
@@ -705,7 +907,7 @@ public static function hasCondition(File $phpcsFile, $stackPtr, $types)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 1.3.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::getCondition() Original source.
* @see \PHPCSUtils\Utils\Conditions::getCondition() More versatile alternative.
@@ -736,7 +938,7 @@ public static function getCondition(File $phpcsFile, $stackPtr, $type, $first =
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 1.2.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - PHPCS 4.0.0: Handling of the namespace relative parent class using the namespace keyword as operator.
*
* @see \PHP_CodeSniffer\Files\File::findExtendedClassName() Original source.
* @see \PHPCSUtils\Utils\ObjectDeclarations::findExtendedClassName() PHPCSUtils native improved version.
@@ -751,7 +953,42 @@ public static function getCondition(File $phpcsFile, $stackPtr, $type, $first =
*/
public static function findExtendedClassName(File $phpcsFile, $stackPtr)
{
- return $phpcsFile->findExtendedClassName($stackPtr);
+ $tokens = $phpcsFile->getTokens();
+
+ // Check for the existence of the token.
+ if (isset($tokens[$stackPtr]) === false) {
+ return false;
+ }
+
+ if ($tokens[$stackPtr]['code'] !== T_CLASS
+ && $tokens[$stackPtr]['code'] !== T_ANON_CLASS
+ && $tokens[$stackPtr]['code'] !== T_INTERFACE
+ ) {
+ return false;
+ }
+
+ if (isset($tokens[$stackPtr]['scope_opener']) === false) {
+ return false;
+ }
+
+ $classOpenerIndex = $tokens[$stackPtr]['scope_opener'];
+ $extendsIndex = $phpcsFile->findNext(T_EXTENDS, $stackPtr, $classOpenerIndex);
+ if ($extendsIndex === false) {
+ return false;
+ }
+
+ $find = Collections::namespacedNameTokens();
+ $find[] = T_WHITESPACE;
+
+ $end = $phpcsFile->findNext($find, ($extendsIndex + 1), ($classOpenerIndex + 1), true);
+ $name = $phpcsFile->getTokensAsString(($extendsIndex + 1), ($end - $extendsIndex - 1));
+ $name = trim($name);
+
+ if ($name === '') {
+ return false;
+ }
+
+ return $name;
}
/**
@@ -761,7 +998,7 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 2.7.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - PHPCS 4.0.0: Handling of the namespace relative parent class using the namespace keyword as operator.
*
* @see \PHP_CodeSniffer\Files\File::findImplementedInterfaceNames() Original source.
* @see \PHPCSUtils\Utils\ObjectDeclarations::findImplementedInterfaceNames() PHPCSUtils native improved version.
@@ -776,6 +1013,44 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr)
*/
public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr)
{
- return $phpcsFile->findImplementedInterfaceNames($stackPtr);
+ $tokens = $phpcsFile->getTokens();
+
+ // Check for the existence of the token.
+ if (isset($tokens[$stackPtr]) === false) {
+ return false;
+ }
+
+ if ($tokens[$stackPtr]['code'] !== T_CLASS
+ && $tokens[$stackPtr]['code'] !== T_ANON_CLASS
+ && $tokens[$stackPtr]['code'] !== T_ENUM
+ ) {
+ return false;
+ }
+
+ if (isset($tokens[$stackPtr]['scope_closer']) === false) {
+ return false;
+ }
+
+ $classOpenerIndex = $tokens[$stackPtr]['scope_opener'];
+ $implementsIndex = $phpcsFile->findNext(T_IMPLEMENTS, $stackPtr, $classOpenerIndex);
+ if ($implementsIndex === false) {
+ return false;
+ }
+
+ $find = Collections::namespacedNameTokens();
+ $find[] = T_WHITESPACE;
+ $find[] = T_COMMA;
+
+ $end = $phpcsFile->findNext($find, ($implementsIndex + 1), ($classOpenerIndex + 1), true);
+ $name = $phpcsFile->getTokensAsString(($implementsIndex + 1), ($end - $implementsIndex - 1));
+ $name = trim($name);
+
+ if ($name === '') {
+ return false;
+ } else {
+ $names = explode(',', $name);
+ $names = array_map('trim', $names);
+ return $names;
+ }
}
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php
index 2d6a72f..49b8c15 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php
@@ -43,38 +43,36 @@
*
* @since 1.0.0
*
- * @method static array arithmeticTokens() Tokens that represent arithmetic operators.
- * @method static array assignmentTokens() Tokens that represent assignments.
- * @method static array blockOpeners() Tokens that open code blocks.
- * @method static array booleanOperators() Tokens that perform boolean operations.
- * @method static array bracketTokens() Tokens that represent brackets and parenthesis.
- * @method static array castTokens() Tokens that represent type casting.
- * @method static array commentTokens() Tokens that are comments.
- * @method static array comparisonTokens() Tokens that represent comparison operator.
- * @method static array contextSensitiveKeywords() Tokens representing context sensitive keywords in PHP.
- * @method static array emptyTokens() Tokens that don't represent code.
- * @method static array equalityTokens() Tokens that represent equality comparisons.
- * @method static array heredocTokens() Tokens that make up a heredoc string.
- * @method static array includeTokens() Tokens that include files.
- * @method static array magicConstants() Tokens representing PHP magic constants.
- * @method static array methodPrefixes() Tokens that can prefix a method name.
- * @method static array ooScopeTokens() Tokens that open class and object scopes.
- * @method static array operators() Tokens that perform operations.
- * @method static array parenthesisOpeners() Token types that open parenthesis.
- * @method static array phpcsCommentTokens() Tokens that are comments containing PHPCS instructions.
- * @method static array scopeModifiers() Tokens that represent scope modifiers.
- * @method static array scopeOpeners() Tokens that are allowed to open scopes.
- * @method static array stringTokens() Tokens that represent strings.
- * Note that `T_STRING`s are NOT represented in this list as this list
- * is about _text_ strings.
- * @method static array textStringTokens() Tokens that represent text strings.
+ * @method static array arithmeticTokens() Tokens that represent arithmetic operators.
+ * @method static array booleanOperators() Tokens that perform boolean operations.
+ * @method static array bracketTokens() Tokens that represent brackets and parenthesis.
+ * @method static array castTokens() Tokens that represent type casting.
+ * @method static array commentTokens() Tokens that are comments.
+ * @method static array comparisonTokens() Tokens that represent comparison operator.
+ * @method static array contextSensitiveKeywords() Tokens representing context sensitive keywords
+ * in PHP.
+ * @method static array emptyTokens() Tokens that don't represent code.
+ * @method static array equalityTokens() Tokens that represent equality comparisons.
+ * @method static array heredocTokens() Tokens that make up a heredoc string.
+ * @method static array includeTokens() Tokens that include files.
+ * @method static array magicConstants() Tokens representing PHP magic constants.
+ * @method static array methodPrefixes() Tokens that can prefix a method name.
+ * @method static array ooScopeTokens() Tokens that open class and object scopes.
+ * @method static array operators() Tokens that perform operations.
+ * @method static array phpcsCommentTokens() Tokens that are comments containing PHPCS
+ * instructions.
+ * @method static array scopeModifiers() Tokens that represent scope modifiers.
+ * @method static array stringTokens() Tokens that represent strings.
+ * Note that `T_STRING`s are NOT represented in this
+ * list as this list is about _text_ strings.
+ * @method static array textStringTokens() Tokens that represent text strings.
*/
final class BCTokens
{
/**
* Handle calls to (undeclared) methods for token arrays which haven't received any
- * changes since PHPCS 3.10.0.
+ * changes since PHPCS 3.13.0.
*
* @since 1.0.0
*
@@ -96,6 +94,56 @@ public static function __callStatic($name, $args)
throw InvalidTokenArray::create($name);
}
+ /**
+ * Tokens that represent assignments.
+ *
+ * Retrieve the PHPCS assignments tokens array in a cross-version compatible manner.
+ *
+ * Changelog for the PHPCS native array:
+ * - PHPCS 4.0.0: The JS specific `T_ZSR_EQUAL` token is no longer available and has been removed from the array.
+ *
+ * @see \PHP_CodeSniffer\Util\Tokens::$assignmentTokens Original array.
+ *
+ * @since 1.0.0
+ *
+ * @return array Token array.
+ */
+ public static function assignmentTokens()
+ {
+ $tokens = Tokens::$assignmentTokens;
+
+ if (\defined('T_ZSR_EQUAL') && isset($tokens[\T_ZSR_EQUAL])) {
+ unset($tokens[\T_ZSR_EQUAL]);
+ }
+
+ return $tokens;
+ }
+
+ /**
+ * Tokens that open code blocks.
+ *
+ * Retrieve the PHPCS block opener tokens array in a cross-version compatible manner.
+ *
+ * Changelog for the PHPCS native array:
+ * - PHPCS 4.0.0: The JS specific `T_OBJECT` token is no longer available and has been removed from the array.
+ *
+ * @see \PHP_CodeSniffer\Util\Tokens::$blockOpeners Original array.
+ *
+ * @since 1.0.0
+ *
+ * @return array Token array.
+ */
+ public static function blockOpeners()
+ {
+ $tokens = Tokens::$blockOpeners;
+
+ if (\defined('T_OBJECT') && isset($tokens[\T_OBJECT])) {
+ unset($tokens[\T_OBJECT]);
+ }
+
+ return $tokens;
+ }
+
/**
* Tokens that represent the names of called functions.
*
@@ -103,8 +151,7 @@ public static function __callStatic($name, $args)
*
* Changelog for the PHPCS native array:
* - Introduced in PHPCS 2.3.3.
- * - PHPCS 3.7.2: `T_PARENT` added to the array.
- * - PHPCS 4.0.0: `T_NAME_QUALIFIED`, `T_NAME_FULLY_QUALIFIED` and `T_NAME_RELATIVE` added to the array.
+ * - PHPCS 4.0.0: `T_NAME_QUALIFIED`, `T_NAME_FULLY_QUALIFIED`, `T_NAME_RELATIVE` and `T_ANON_CLASS` added to the array.
*
* @see \PHP_CodeSniffer\Util\Tokens::$functionNameTokens Original array.
*
@@ -114,9 +161,95 @@ public static function __callStatic($name, $args)
*/
public static function functionNameTokens()
{
- $tokens = Tokens::$functionNameTokens;
- $tokens += Collections::ooHierarchyKeywords();
- $tokens += Collections::nameTokens();
+ $tokens = Tokens::$functionNameTokens;
+ $tokens += Collections::nameTokens();
+ $tokens[\T_ANON_CLASS] = \T_ANON_CLASS;
+
+ return $tokens;
+ }
+
+ /**
+ * Tokens used for "names", be it namespace, OO, function or constant names.
+ *
+ * Retrieve the PHPCS name tokens array in a cross-version compatible manner.
+ *
+ * Changelog for the PHPCS native array:
+ * - Introduced in PHPCS 4.0.0.
+ *
+ * @see \PHP_CodeSniffer\Util\Tokens::NAME_TOKENS Original array.
+ *
+ * @since 1.1.0
+ *
+ * @return array Token array.
+ */
+ public static function nameTokens()
+ {
+ return Collections::nameTokens();
+ }
+
+ /**
+ * Token types that open parentheses.
+ *
+ * Retrieve the PHPCS parenthesis openers tokens array in a cross-version compatible manner.
+ *
+ * Changelog for the PHPCS native array:
+ * - Introduced in PHPCS 0.0.5.
+ * - PHPCS 4.0.0: `T_USE` (for closures), `T_ISSET`, `T_UNSET`, `T_EMPTY`, `T_EVAL` and `T_EXIT` added to the array.
+ *
+ * **Important**: While `T_USE`, `T_ISSET`, `T_UNSET`, `T_EMPTY`, `T_EVAL` and `T_EXIT` will be included
+ * in the return value for this method, the associated parentheses will not have the `'parenthesis_owner'` index
+ * set until PHPCS 4.0.0.
+ * Use the {@see \PHPCSUtils\Utils\Parentheses::getOwner()} or {@see \PHPCSUtils\Utils\Parentheses::hasOwner()} methods
+ * if you need to check for whether any of these tokens are a parentheses owner.
+ *
+ * @see \PHP_CodeSniffer\Util\Tokens::$parenthesisOpeners Original array.
+ * @see \PHPCSUtils\Utils\Parentheses Class holding utility methods for
+ * working with the `'parenthesis_...'`
+ * index keys in a token array.
+ *
+ * @since 1.0.0
+ *
+ * @return array Token array.
+ */
+ public static function parenthesisOpeners()
+ {
+ $tokens = Tokens::$parenthesisOpeners;
+ $tokens[\T_USE] = \T_USE;
+ $tokens[\T_ISSET] = \T_ISSET;
+ $tokens[\T_UNSET] = \T_UNSET;
+ $tokens[\T_EMPTY] = \T_EMPTY;
+ $tokens[\T_EVAL] = \T_EVAL;
+ $tokens[\T_EXIT] = \T_EXIT;
+
+ return $tokens;
+ }
+
+ /**
+ * Tokens that are allowed to open scopes.
+ *
+ * Retrieve the PHPCS scope opener tokens array in a cross-version compatible manner.
+ *
+ * Changelog for the PHPCS native array:
+ * - PHPCS 4.0.0: The JS specific `T_PROPERTY` and `T_OBJECT` tokens are no longer available
+ * and have been removed from the array.
+ *
+ * @see \PHP_CodeSniffer\Util\Tokens::$scopeOpeners Original array.
+ *
+ * @since 1.0.0
+ *
+ * @return array Token array.
+ */
+ public static function scopeOpeners()
+ {
+ $tokens = Tokens::$scopeOpeners;
+
+ if (\defined('T_PROPERTY') && isset($tokens[\T_PROPERTY])) {
+ unset($tokens[\T_PROPERTY]);
+ }
+
+ if (\defined('T_OBJECT') && isset($tokens[\T_OBJECT])) {
+ unset($tokens[\T_OBJECT]);
+ }
return $tokens;
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php
index aa033e9..408959d 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php
@@ -11,8 +11,8 @@
namespace PHPCSUtils\BackCompat;
use PHP_CodeSniffer\Config;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
+use PHPCSUtils\Exceptions\MissingArgumentError;
/**
* Utility methods to retrieve (configuration) information from PHP_CodeSniffer.
@@ -63,6 +63,8 @@ public static function getVersion()
* in PHPCS 3.x and higher.
*
* @return bool Whether the setting of the data was successfull.
+ *
+ * @throws \PHPCSUtils\Exceptions\MissingArgumentError When using PHPCS 4.x and not passing the $config parameter.
*/
public static function setConfigData($key, $value, $temp = false, $config = null)
{
@@ -72,7 +74,7 @@ public static function setConfigData($key, $value, $temp = false, $config = null
}
if (\version_compare(self::getVersion(), '3.99.99', '>') === true) {
- throw new RuntimeException('Passing the $config parameter is required in PHPCS 4.x');
+ throw MissingArgumentError::create(4, '$config', 'when running on PHPCS 4.x');
}
// PHPCS 3.x.
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php
index 8de6bd5..c3050b2 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php
@@ -10,7 +10,7 @@
namespace PHPCSUtils\Exceptions;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
+use PHPCSUtils\Exceptions\RuntimeException;
/**
* Exception thrown when an non-existent token array is requested.
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/LogicException.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/LogicException.php
new file mode 100644
index 0000000..1bd890b
--- /dev/null
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/LogicException.php
@@ -0,0 +1,47 @@
+findNext(Tokens::$emptyTokens, ($ptrA + 1), null, true);
if ($nextNonEmpty !== false && $nextNonEmpty < $ptrB) {
- throw new RuntimeException(
+ throw LogicException::create(
'The $stackPtr and the $secondPtr token must be adjacent tokens separated only'
. ' by whitespace and/or comments'
);
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php
index 36eb7a4..8fd22fd 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php
@@ -10,10 +10,12 @@
namespace PHPCSUtils\Internal;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
use PHPCSUtils\BackCompat\Helper;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Internal\IsShortArrayOrListWithCache;
use PHPCSUtils\Internal\StableCollections;
@@ -161,7 +163,7 @@ final class IsShortArrayOrList
*
* @var string
*/
- private $phpcsVersion; // @phpstan-ignore-line
+ private $phpcsVersion; // @phpstan-ignore property.onlyWritten
/**
* Tokens which can open a short array or short list (PHPCS cross-version compatible).
@@ -182,20 +184,26 @@ final class IsShortArrayOrList
*
* @return void
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the token passed is not one of the
- * accepted types or doesn't exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not one of the accepted types.
*/
public function __construct(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
$openBrackets = StableCollections::$shortArrayListOpenTokensBC;
- if (isset($tokens[$stackPtr]) === false
- || isset($openBrackets[$tokens[$stackPtr]['code']]) === false
- ) {
- throw new RuntimeException(
- 'The IsShortArrayOrList class expects to be passed a T_OPEN_SHORT_ARRAY or T_OPEN_SQUARE_BRACKET token.'
- );
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if (isset($openBrackets[$tokens[$stackPtr]['code']]) === false) {
+ $acceptedTokens = 'T_OPEN_SHORT_ARRAY or T_OPEN_SQUARE_BRACKET';
+ throw UnexpectedTokenType::create(2, '$stackPtr', $acceptedTokens, $tokens[$stackPtr]['type']);
}
$this->phpcsFile = $phpcsFile;
@@ -344,15 +352,13 @@ private function isSquareBracket()
/**
* Verify that the current set of brackets is not affected by known PHPCS cross-version tokenizer issues.
*
- * List of current tokenizer issues which affect the short array/short list tokenization:
- * - {@link https://github.com/squizlabs/PHP_CodeSniffer/pull/3632 PHPCS#3632} (PHPCS < 3.7.2)
- *
* List of previous tokenizer issues which affected the short array/short list tokenization for reference:
* - {@link https://github.com/squizlabs/PHP_CodeSniffer/issues/1284 PHPCS#1284} (PHPCS < 2.8.1)
* - {@link https://github.com/squizlabs/PHP_CodeSniffer/issues/1381 PHPCS#1381} (PHPCS < 2.9.0)
* - {@link https://github.com/squizlabs/PHP_CodeSniffer/issues/1971 PHPCS#1971} (PHPCS 2.8.0 - 3.2.3)
* - {@link https://github.com/squizlabs/PHP_CodeSniffer/pull/3013 PHPCS#3013} (PHPCS < 3.5.6)
* - {@link https://github.com/squizlabs/PHP_CodeSniffer/pull/3172 PHPCS#3172} (PHPCS < 3.6.0)
+ * - {@link https://github.com/squizlabs/PHP_CodeSniffer/pull/3632 PHPCS#3632} (PHPCS < 3.7.2)
*
* @since 1.0.0
*
@@ -362,7 +368,7 @@ private function isSquareBracket()
private function isShortArrayBracket()
{
if ($this->tokens[$this->opener]['code'] === \T_OPEN_SQUARE_BRACKET) {
- // Currently there are no known issues with the tokenization in PHPCS 3.9.0 and higher.
+ // Currently there are no known issues with the tokenization in PHPCS.
return false;
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/ConfigDouble.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/ConfigDouble.php
new file mode 100644
index 0000000..2f84796
--- /dev/null
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/ConfigDouble.php
@@ -0,0 +1,249 @@
+ $cliArgs An array of values gathered from CLI args.
+ * @param bool $skipSettingStandard Whether to skip setting a standard to prevent
+ * the Config class trying to auto-discover a ruleset file.
+ * Should only be set to `true` for tests which actually test
+ * the ruleset auto-discovery.
+ * Note: there is no need to set this to `true` when a standard
+ * is being passed via the `$cliArgs`. Those settings will always
+ * respected.
+ * Defaults to `false`. Will result in the standard being set
+ * to "PSR1" if not provided via `$cliArgs`.
+ * @param bool $skipSettingReportWidth Whether to skip setting a report-width to prevent
+ * the Config class trying to auto-discover the screen width.
+ * Should only be set to `true` for tests which actually test
+ * the screen width auto-discovery.
+ * Note: there is no need to set this to `true` when a report-width
+ * is being passed via the `$cliArgs`. Those settings will always
+ * respected.
+ * Defaults to `false`. Will result in the reportWidth being set
+ * to "80" if not provided via `$cliArgs`.
+ *
+ * @return void
+ */
+ public function __construct(array $cliArgs = [], $skipSettingStandard = false, $skipSettingReportWidth = false)
+ {
+ $this->skipSettingStandard = $skipSettingStandard;
+ $this->phpcsVersion = Helper::getVersion();
+
+ $this->resetSelectProperties();
+ $this->preventReadingCodeSnifferConfFile();
+
+ parent::__construct($cliArgs);
+
+ if ($skipSettingReportWidth !== true) {
+ $this->preventAutoDiscoveryScreenWidth();
+ }
+ }
+
+ /**
+ * Ensures the static properties in the Config class are reset to their default values
+ * when the ConfigDouble is no longer used.
+ *
+ * @since 1.1.0
+ *
+ * @return void
+ */
+ public function __destruct()
+ {
+ $this->setStaticConfigProperty('overriddenDefaults', []);
+ $this->setStaticConfigProperty('executablePaths', []);
+ $this->setStaticConfigProperty('configData', null);
+ $this->setStaticConfigProperty('configDataFile', null);
+ }
+
+ /**
+ * Sets the command line values and optionally prevents a file system search for a custom ruleset.
+ *
+ * {@internal Note: `array` type declaration can't be added as the parent class does not have a type declaration
+ * for the parameter in the original method.}
+ *
+ * @since 1.1.0
+ *
+ * @param array $args An array of command line arguments to set.
+ *
+ * @return void
+ */
+ public function setCommandLineValues($args)
+ {
+ parent::setCommandLineValues($args);
+
+ if ($this->skipSettingStandard !== true) {
+ $this->preventSearchingForRuleset();
+ }
+ }
+
+ /**
+ * Reset a few properties on the Config class to their default values.
+ *
+ * @since 1.1.0
+ *
+ * @return void
+ */
+ private function resetSelectProperties()
+ {
+ $this->setStaticConfigProperty('overriddenDefaults', []);
+ $this->setStaticConfigProperty('executablePaths', []);
+ }
+
+ /**
+ * Prevent the values in a potentially available user-specific `CodeSniffer.conf` file
+ * from influencing the tests.
+ *
+ * This also prevents some file system calls which can influence the test runtime.
+ *
+ * @since 1.1.0
+ *
+ * @return void
+ */
+ private function preventReadingCodeSnifferConfFile()
+ {
+ $this->setStaticConfigProperty('configData', []);
+ $this->setStaticConfigProperty('configDataFile', '');
+ }
+
+ /**
+ * Prevent searching for a custom ruleset by setting a standard, but only if the test
+ * being run doesn't set a standard itself.
+ *
+ * This also prevents some file system calls which can influence the test runtime.
+ *
+ * The standard being set is the smallest one available so the ruleset initialization
+ * will be the fastest possible.
+ *
+ * @since 1.1.0
+ *
+ * @return void
+ */
+ private function preventSearchingForRuleset()
+ {
+ $overriddenDefaults = $this->getStaticConfigProperty('overriddenDefaults');
+ if (isset($overriddenDefaults['standards']) === false) {
+ $this->standards = ['PSR1'];
+ $overriddenDefaults['standards'] = true;
+ }
+
+ self::setStaticConfigProperty('overriddenDefaults', $overriddenDefaults);
+ }
+
+ /**
+ * Prevent a call to stty to figure out the screen width, but only if the test being run
+ * doesn't set a report width itself.
+ *
+ * @since 1.1.0
+ *
+ * @return void
+ */
+ private function preventAutoDiscoveryScreenWidth()
+ {
+ $settings = $this->getSettings();
+ if ($settings['reportWidth'] === 'auto') {
+ $this->reportWidth = self::DEFAULT_REPORT_WIDTH;
+ }
+ }
+
+ /**
+ * Helper function to retrieve the value of a private static property on the Config class.
+ *
+ * Note: As of PHPCS 4.0, the "overriddenDefaults" property is no longer static, but this method
+ * will still handle this property.
+ *
+ * @since 1.1.0
+ *
+ * @param string $name The name of the property to retrieve.
+ *
+ * @return mixed
+ */
+ public function getStaticConfigProperty($name)
+ {
+ $property = new ReflectionProperty('PHP_CodeSniffer\Config', $name);
+ $property->setAccessible(true);
+
+ if ($name === 'overriddenDefaults' && \version_compare($this->phpcsVersion, '3.99.99', '>')) {
+ return $property->getValue($this);
+ }
+
+ return $property->getValue();
+ }
+
+ /**
+ * Helper function to set the value of a private static property on the Config class.
+ *
+ * Note: As of PHPCS 4.0, the "overriddenDefaults" property is no longer static, but this method
+ * will still handle this property.
+ *
+ * @since 1.1.0
+ *
+ * @param string $name The name of the property to set.
+ * @param mixed $value The value to set the property to.
+ *
+ * @return void
+ */
+ public function setStaticConfigProperty($name, $value)
+ {
+ $property = new ReflectionProperty('PHP_CodeSniffer\Config', $name);
+ $property->setAccessible(true);
+
+ if ($name === 'overriddenDefaults' && \version_compare($this->phpcsVersion, '3.99.99', '>')) {
+ $property->setValue($this, $value);
+ } else {
+ $property->setValue(null, $value);
+ }
+
+ $property->setAccessible(false);
+ }
+}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/RulesetDouble.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/RulesetDouble.php
new file mode 100644
index 0000000..10a3b6c
--- /dev/null
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/RulesetDouble.php
@@ -0,0 +1,57 @@
+getMessage()) !== 'ERROR: No sniffs were registered.') {
+ // Rethrow the exception to fail the test, as this is not the exception we expected.
+ throw $e;
+ }
+ }
+ }
+}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php
index 8242002..4a02ca0 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php
@@ -19,6 +19,11 @@
use PHPCSUtils\Exceptions\TestFileNotFound;
use PHPCSUtils\Exceptions\TestMarkerNotFound;
use PHPCSUtils\Exceptions\TestTargetNotFound;
+use PHPCSUtils\TestUtils\ConfigDouble;
+use PHPCSUtils\TestUtils\RulesetDouble;
+use PHPUnit\Framework\Attributes\AfterClass;
+use PHPUnit\Framework\Attributes\Before;
+use PHPUnit\Framework\Attributes\BeforeClass;
use PHPUnit\Framework\TestCase;
use ReflectionClass;
use ReflectionProperty;
@@ -26,10 +31,9 @@
/**
* Base class for use when testing utility methods for PHP_CodeSniffer.
*
- * This class is compatible with PHP_CodeSniffer 3.x and contains preliminary compatibility with 4.x
- * based on its currently known state/roadmap.
+ * This class is compatible with PHP_CodeSniffer 3.x and 4.x.
*
- * This class is compatible with {@link https://phpunit.de/ PHPUnit} 4.5 - 9.x providing the PHPCSUtils
+ * This class is compatible with {@link https://phpunit.de/ PHPUnit} 4.5 - 11.x providing the PHPCSUtils
* autoload file is included in the test bootstrap. For more information about that, please consult
* the project's {@link https://github.com/PHPCSStandards/PHPCSUtils/blob/develop/README.md README}.
*
@@ -104,6 +108,9 @@
* for the PHPCSUtils utility functions themselves.
*
* @since 1.0.0
+ * @since 1.0.7 Compatible with PHPUnit 10.
+ * @since 1.1.0 Compatible with PHPUnit 11.
+ * @since 1.1.0 Compatible with PHP_CodeSniffer 4.0.0.
*/
abstract class UtilityMethodTestCase extends TestCase
{
@@ -193,6 +200,7 @@ abstract class UtilityMethodTestCase extends TestCase
*
* @return void
*/
+ #[BeforeClass]
public static function setUpTestFile()
{
parent::setUpBeforeClass();
@@ -206,37 +214,10 @@ public static function setUpTestFile()
$caseFile = \substr($testFile, 0, -3) . static::$fileExtension;
}
- if (\is_readable($caseFile) === false) {
- parent::fail("Test case file missing. Expected case file location: $caseFile");
- }
-
- $contents = \file_get_contents($caseFile);
-
- /*
- * Set the static properties in the Config class to specific values for performance
- * and to clear out values from other tests.
- */
- self::setStaticConfigProperty('executablePaths', []);
-
- // Set to values which prevent the test-runner user's `CodeSniffer.conf` file
- // from being read and influencing the tests. Also prevent an `exec()` call to stty.
- self::setStaticConfigProperty('configData', ['report_width' => 80]);
- self::setStaticConfigProperty('configDataFile', '');
-
- $config = new Config();
-
- /*
- * Set to a usable value to circumvent Config trying to find a phpcs.xml config file.
- *
- * We just need to provide a standard so PHPCS will tokenize the file.
- * The standard itself doesn't actually matter for testing utility methods,
- * so use the smallest one to get the fastest results.
- */
- $config->standards = ['PSR1'];
+ $config = new ConfigDouble();
/*
- * Limiting the run to just one sniff will make it, yet again, slightly faster.
- * Picked the simplest/fastest sniff available which is registered in PSR1.
+ * Limiting the run to just one (dummy) sniff will make it, yet again, slightly faster.
*/
$config->sniffs = static::$selectedSniff;
@@ -246,24 +227,51 @@ public static function setUpTestFile()
// Also set a tab-width to enable testing tab-replaced vs `orig_content`.
$config->tabWidth = static::$tabWidth;
- $ruleset = new Ruleset($config);
+ $ruleset = new RulesetDouble($config);
+
+ self::$phpcsFile = self::parseFile($caseFile, $ruleset, $config);
+ }
+
+ /**
+ * Create a File object.
+ *
+ * The file will only be parsed, not processed.
+ *
+ * This helper method can also be used to create a secondary file object using the same sniff objects
+ * as used for the original test case file.
+ * To do so, pass `self::$phpcsFile->ruleset` for the $ruleset and `self::$phpcsFile->config` for the $config.
+ *
+ * @param string $caseFile The absolute path to the file.
+ * @param \PHP_CodeSniffer\Ruleset $ruleset The ruleset for the run.
+ * @param \PHP_CodeSniffer\Config $config The config data for the run.
+ *
+ * @return \PHP_CodeSniffer\Files\File
+ */
+ protected static function parseFile($caseFile, Ruleset $ruleset, Config $config)
+ {
+ if (\is_readable($caseFile) === false) {
+ parent::fail("Test case file missing. Expected case file location: $caseFile");
+ }
// Make sure the file gets parsed correctly based on the file type.
+ $contents = \file_get_contents($caseFile);
$contents = 'phpcs_input_file: ' . $caseFile . \PHP_EOL . $contents;
- self::$phpcsFile = new DummyFile($contents, $ruleset, $config);
+ $file = new DummyFile($contents, $ruleset, $config);
// Only tokenize the file, do not process it.
try {
- self::$phpcsFile->parse();
+ $file->parse();
} catch (TokenizerException $e) {
// PHPCS 3.5.0 and higher. This is handled below.
}
- // Fail the test if the case file failed to tokenize.
- if (self::$phpcsFile->numTokens === 0) {
+ // Fail the test if the file failed to tokenize.
+ if ($file->numTokens === 0) {
parent::fail("Tokenizing of the test case file failed for case file: $caseFile");
}
+
+ return $file;
}
/**
@@ -282,6 +290,7 @@ public static function setUpTestFile()
*
* @return void
*/
+ #[Before]
public function skipJSCSSTestsOnPHPCS4()
{
if (static::$fileExtension !== 'js' && static::$fileExtension !== 'css') {
@@ -307,25 +316,34 @@ public function skipJSCSSTestsOnPHPCS4()
*
* @return void
*/
+ #[AfterClass]
public static function resetTestFile()
{
+ /*
+ * Explicitly trigger __destruct() on the ConfigDouble to reset the Config statics.
+ * The explicit method call prevents potential stray test-local references to the $config object
+ * preventing the destructor from running the clean up (which without stray references would be
+ * automagically triggered when `self::$phpcsFile` is reset, but we can't definitively rely on that).
+ */
+ if (isset(self::$phpcsFile)) {
+ self::$phpcsFile->config->__destruct();
+ }
+
self::$phpcsVersion = '0';
self::$fileExtension = 'inc';
self::$caseFile = '';
self::$tabWidth = 4;
self::$phpcsFile = null;
self::$selectedSniff = ['Dummy.Dummy.Dummy'];
-
- // Reset the static properties in the Config class to their defaults to prevent tests influencing each other.
- self::setStaticConfigProperty('executablePaths', []);
- self::setStaticConfigProperty('configData', null);
- self::setStaticConfigProperty('configDataFile', null);
}
/**
* Helper function to set the value of a private static property on the PHPCS Config class.
*
- * @since 1.0.9
+ * @since 1.0.9
+ * @deprecated 1.1.0 Use the `PHPCSUtils\TestUtils\ConfigDouble::setStaticConfigProperty()` method instead.
+ *
+ * @codeCoverageIgnore
*
* @param string $name The name of the property to set.
* @param mixed $value The value to set the property to.
@@ -361,6 +379,57 @@ public static function usesPhp8NameTokens()
return \version_compare(Helper::getVersion(), '3.99.99', '>=');
}
+ /**
+ * Test QA: verify that a test case file does not contain any duplicate test markers.
+ *
+ * When a test case file contains a lot of test cases, it is easy to overlook that a test marker name
+ * is already in use.
+ * A test wouldn't necessarily fail on this, but would not be testing what is intended to be tested as
+ * it would be verifying token properties for the wrong token.
+ *
+ * This test safeguards against this.
+ *
+ * @since 1.1.0
+ *
+ * @coversNothing
+ *
+ * @return void
+ */
+ public function testTestMarkersAreUnique()
+ {
+ $this->assertTestMarkersAreUnique(self::$phpcsFile);
+ }
+
+ /**
+ * Assertion to verify that a test case file does not contain any duplicate test markers.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file to validate.
+ *
+ * @return void
+ */
+ public static function assertTestMarkersAreUnique(File $phpcsFile)
+ {
+ $tokens = $phpcsFile->getTokens();
+
+ // Collect all marker comments in the file.
+ $seenComments = [];
+ for ($i = 0; $i < $phpcsFile->numTokens; $i++) {
+ if ($tokens[$i]['code'] !== \T_COMMENT) {
+ continue;
+ }
+
+ if (\stripos($tokens[$i]['content'], '/* test') !== 0) {
+ continue;
+ }
+
+ $seenComments[] = $tokens[$i]['content'];
+ }
+
+ self::assertSame(\array_unique($seenComments), $seenComments, 'Duplicate test markers found.');
+ }
+
/**
* Get the token pointer for a target token based on a specific comment.
*
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php
index 3a40fdc..5cfada1 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php
@@ -23,40 +23,57 @@
*
* @since 1.0.0
*
- * @method static array alternativeControlStructureSyntaxes() Tokens for control structures which can use the
- * alternative control structure syntax.
- * @method static array alternativeControlStructureSyntaxClosers() Tokens representing alternative control structure
- * syntax closer keywords.
- * @method static array arrayTokens() Tokens which are used to create arrays.
- * @method static array classModifierKeywords() Modifier keywords which can be used for a class
- * declaration.
- * @method static array closedScopes() List of tokens which represent "closed" scopes.
- * @method static array constantModifierKeywords() Tokens which can be used as modifiers for a constant
- * declaration (in OO structures).
- * @method static array controlStructureTokens() Control structure tokens.
- * @method static array functionDeclarationTokens() Tokens which represent a keyword which starts
- * a function declaration.
- * @method static array incrementDecrementOperators() Increment/decrement operator tokens.
- * @method static array listTokens() Tokens which are used to create lists.
- * @method static array namespaceDeclarationClosers() List of tokens which can end a namespace
- * declaration statement.
- * @method static array nameTokens() Tokens used for "names", be it namespace, OO,
- * function
- * or constant names.
- * @method static array objectOperators() Object operator tokens.
- * @method static array ooCanExtend() OO structures which can use the "extends" keyword.
- * @method static array ooCanImplement() OO structures which can use the "implements" keyword.
- * @method static array ooConstantScopes() OO scopes in which constants can be declared.
- * @method static array ooHierarchyKeywords() Tokens types used for "forwarding" calls within
- * OO structures.
- * @method static array ooPropertyScopes() OO scopes in which properties can be declared.
- * @method static array phpOpenTags() Tokens which open PHP.
- * @method static array propertyModifierKeywords() Modifier keywords which can be used for a property
- * declaration.
- * @method static array shortArrayTokens() Tokens which are used for short arrays.
- * @method static array shortListTokens() Tokens which are used for short lists.
- * @method static array textStringStartTokens() Tokens which can start a - potentially multi-line -
- * text string.
+ * @method static array alternativeControlStructureSyntaxes() Tokens for control structures
+ * which can use the alternative
+ * control structure syntax.
+ * @method static array alternativeControlStructureSyntaxClosers() Tokens representing alternative
+ * control structure syntax closer
+ * keywords.
+ * @method static array arrayTokens() Tokens which are used to create
+ * arrays.
+ * @method static array classModifierKeywords() Modifier keywords which can be
+ * used for a class declaration.
+ * @method static array closedScopes() List of tokens which represent
+ * "closed" scopes.
+ * @method static array constantModifierKeywords() Tokens which can be used as
+ * modifiers for a constant
+ * declaration (in OO structures).
+ * @method static array controlStructureTokens() Control structure tokens.
+ * @method static array functionDeclarationTokens() Tokens which represent a keyword
+ * which starts a function
+ * declaration.
+ * @method static array incrementDecrementOperators() Increment/decrement operator
+ * tokens.
+ * @method static array listTokens() Tokens which are used to create
+ * lists.
+ * @method static array namespaceDeclarationClosers() List of tokens which can end a
+ * namespace declaration statement.
+ * @method static array nameTokens() Tokens used for "names", be it
+ * namespace, OO, function or
+ * constant names.
+ * @method static array objectOperators() Object operator tokens.
+ * @method static array ooCanExtend() OO structures which can use the
+ * "extends" keyword.
+ * @method static array ooCanImplement() OO structures which can use the
+ * "implements" keyword.
+ * @method static array ooConstantScopes() OO scopes in which constants can
+ * be declared.
+ * @method static array ooHierarchyKeywords() Tokens types used for "forwarding"
+ * calls within OO structures.
+ * @method static array ooPropertyScopes() OO scopes in which properties can
+ * be declared.
+ * @method static array phpOpenTags() Tokens which open PHP.
+ * @method static array propertyModifierKeywords() Modifier keywords which can be
+ * used for a property declaration.
+ * @method static array shortArrayTokens() Tokens which are used for
+ * short arrays.
+ * @method static array shortListTokens() Tokens which are used for
+ * short lists.
+ * @method static array ternaryOperators() Tokens which represent ternary
+ * operators.
+ * @method static array textStringStartTokens() Tokens which can start a
+ * - potentially multi-line -
+ * text string.
*/
final class Collections
{
@@ -188,6 +205,24 @@ final class Collections
\T_FINAL => \T_FINAL,
];
+ /**
+ * Token types which can be encountered in an OO constant type declaration.
+ *
+ * @since 1.1.0 Use the {@see Collections::constantTypeTokens()} method for access.
+ *
+ * @var array
+ */
+ private static $constantTypeTokens = [
+ \T_CALLABLE => \T_CALLABLE, // Not allowed in PHP, but in this list to allow for flagging code errors.
+ \T_FALSE => \T_FALSE,
+ \T_TRUE => \T_TRUE,
+ \T_NULL => \T_NULL,
+ \T_TYPE_UNION => \T_TYPE_UNION,
+ \T_TYPE_INTERSECTION => \T_TYPE_INTERSECTION,
+ \T_TYPE_OPEN_PARENTHESIS => \T_TYPE_OPEN_PARENTHESIS,
+ \T_TYPE_CLOSE_PARENTHESIS => \T_TYPE_CLOSE_PARENTHESIS,
+ ];
+
/**
* Control structure tokens.
*
@@ -348,7 +383,7 @@ final class Collections
/**
* OO scopes in which constants can be declared.
*
- * Note: traits can only declare constants since PHP 8.2.
+ * - PHP 8.2 added support for constants in traits.
*
* @since 1.0.0 Use the {@see Collections::ooConstantScopes()} method for access.
*
@@ -380,7 +415,7 @@ final class Collections
/**
* OO scopes in which properties can be declared.
*
- * Note: interfaces can not declare properties.
+ * - PHP 8.4 added support for properties in interfaces.
*
* @since 1.0.0 Use the {@see Collections::ooPropertyScopes()} method for access.
*
@@ -389,6 +424,7 @@ final class Collections
private static $ooPropertyScopes = [
\T_CLASS => \T_CLASS,
\T_ANON_CLASS => \T_ANON_CLASS,
+ \T_INTERFACE => \T_INTERFACE,
\T_TRAIT => \T_TRAIT,
];
@@ -432,12 +468,16 @@ final class Collections
* @var array
*/
private static $propertyModifierKeywords = [
- \T_PUBLIC => \T_PUBLIC,
- \T_PRIVATE => \T_PRIVATE,
- \T_PROTECTED => \T_PROTECTED,
- \T_STATIC => \T_STATIC,
- \T_VAR => \T_VAR,
- \T_READONLY => \T_READONLY,
+ \T_PUBLIC => \T_PUBLIC,
+ \T_PUBLIC_SET => \T_PUBLIC_SET,
+ \T_PROTECTED => \T_PROTECTED,
+ \T_PROTECTED_SET => \T_PROTECTED_SET,
+ \T_PRIVATE => \T_PRIVATE,
+ \T_PRIVATE_SET => \T_PRIVATE_SET,
+ \T_STATIC => \T_STATIC,
+ \T_VAR => \T_VAR,
+ \T_READONLY => \T_READONLY,
+ \T_FINAL => \T_FINAL,
];
/**
@@ -520,6 +560,18 @@ final class Collections
\T_CLOSE_SHORT_ARRAY => \T_CLOSE_SHORT_ARRAY,
];
+ /**
+ * Tokens which represent ternary operators.
+ *
+ * @since 1.1.0 Use the {@see Collections::ternaryOperators()} method for access.
+ *
+ * @var array
+ */
+ private static $ternaryOperators = [
+ \T_INLINE_THEN => \T_INLINE_THEN,
+ \T_INLINE_ELSE => \T_INLINE_ELSE,
+ ];
+
/**
* Tokens which can start a - potentially multi-line - text string.
*
@@ -625,6 +677,23 @@ public static function arrayTokensBC()
return self::$arrayTokens;
}
+ /**
+ * Token types which can be encountered in OO constant type declaration.
+ *
+ * @since 1.1.0
+ *
+ * @return array
+ */
+ public static function constantTypeTokens()
+ {
+ $tokens = self::$constantTypeTokens;
+ // Self and static are only allowed in enums, but that's not the concern of this method.
+ $tokens += self::$ooHierarchyKeywords;
+ $tokens += self::namespacedNameTokens();
+
+ return $tokens;
+ }
+
/**
* Tokens which can represent function calls and function-call-like language constructs.
*
@@ -644,6 +713,10 @@ public static function functionCallTokens()
$tokens[\T_ANON_CLASS] = \T_ANON_CLASS;
$tokens += self::$ooHierarchyKeywords;
+ // As of PHP 8.4, exit()/die() should be treated as function call tokens.
+ // Sniffs using this collection should safeguard against use as a constant.
+ $tokens[\T_EXIT] = \T_EXIT;
+
return $tokens;
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php
index 1e22841..ff39d53 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php
@@ -10,8 +10,10 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
+use PHPCSUtils\Exceptions\LogicException;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Internal\IsShortArrayOrListWithCache;
use PHPCSUtils\Tokens\Collections;
@@ -151,16 +153,33 @@ public static function getOpenClose(File $phpcsFile, $stackPtr, $isShortArray =
*
* @return int|false Stack pointer to the double arrow if this array item has a key; or `FALSE` otherwise.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the start or end positions are invalid.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $start or $end parameters are not integers.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the tokens passed do not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\LogicException If $end pointer is before the $start pointer.
*/
public static function getDoubleArrowPtr(File $phpcsFile, $start, $end)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$start], $tokens[$end]) === false || $start > $end) {
- throw new RuntimeException(
- 'Invalid start and/or end position passed to getDoubleArrowPtr().'
- . ' Received: $start ' . $start . ', $end ' . $end
+ if (\is_int($start) === false) {
+ throw TypeError::create(2, '$start', 'integer', $start);
+ }
+
+ if (\is_int($end) === false) {
+ throw TypeError::create(3, '$end', 'integer', $end);
+ }
+
+ if (isset($tokens[$start]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$start', $start);
+ }
+
+ if (isset($tokens[$end]) === false) {
+ throw OutOfBoundsStackPtr::create(3, '$end', $end);
+ }
+
+ if ($start > $end) {
+ throw LogicException::create(
+ \sprintf('The $start token must be before the $end token. Received: $start %d, $end %d', $start, $end)
);
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Constants.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Constants.php
new file mode 100644
index 0000000..d07620d
--- /dev/null
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Constants.php
@@ -0,0 +1,194 @@
+ Array with information about the constant declaration.
+ * The format of the return value is:
+ * ```php
+ * array(
+ * 'scope' => string, // Public, private, or protected.
+ * 'scope_token' => integer|false, // The stack pointer to the scope keyword or
+ * // FALSE if the scope was not explicitly specified.
+ * 'is_final' => boolean, // TRUE if the final keyword was found.
+ * 'final_token' => integer|false, // The stack pointer to the final keyword
+ * // or FALSE if the const is not declared final.
+ * 'type' => string, // The type of the const (empty if no type specified).
+ * 'type_token' => integer|false, // The stack pointer to the start of the type
+ * // or FALSE if there is no type.
+ * 'type_end_token' => integer|false, // The stack pointer to the end of the type
+ * // or FALSE if there is no type.
+ * 'nullable_type' => boolean, // TRUE if the type is preceded by the
+ * // nullability operator.
+ * 'name_token' => integer, // The stack pointer to the constant name.
+ * // Note: for group declarations this points to the
+ * // name of the first constant.
+ * 'equal_token' => integer, // The stack pointer to the equal sign.
+ * // Note: for group declarations this points to the
+ * // equal sign of the first constant.
+ * );
+ * ```
+ *
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_CONST` token.
+ * @throws \PHPCSUtils\Exceptions\ValueError If the specified position is not an OO constant.
+ */
+ public static function getProperties(File $phpcsFile, $stackPtr)
+ {
+ $tokens = $phpcsFile->getTokens();
+
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if ($tokens[$stackPtr]['code'] !== \T_CONST) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_CONST', $tokens[$stackPtr]['type']);
+ }
+
+ if (Scopes::isOOConstant($phpcsFile, $stackPtr) === false) {
+ throw ValueError::create(2, '$stackPtr', 'must be the pointer to an OO constant');
+ }
+
+ if (Cache::isCached($phpcsFile, __METHOD__, $stackPtr) === true) {
+ return Cache::get($phpcsFile, __METHOD__, $stackPtr);
+ }
+
+ $find = [\T_EQUAL, \T_SEMICOLON, \T_OPEN_CURLY_BRACKET, \T_CLOSE_CURLY_BRACKET, \T_CLOSE_TAG];
+ $assignmentPtr = $phpcsFile->findNext($find, ($stackPtr + 1));
+ if ($assignmentPtr === false || $tokens[$assignmentPtr]['code'] !== \T_EQUAL) {
+ // Probably a parse error. Don't cache the result.
+ throw ValueError::create(2, '$stackPtr', 'must be the pointer to an OO constant');
+ }
+
+ $namePtr = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($assignmentPtr - 1), ($stackPtr + 1), true);
+
+ $returnValue = [
+ 'scope' => 'public',
+ 'scope_token' => false,
+ 'is_final' => false,
+ 'final_token' => false,
+ 'type' => '',
+ 'type_token' => false,
+ 'type_end_token' => false,
+ 'nullable_type' => false,
+ 'name_token' => $namePtr,
+ 'equal_token' => $assignmentPtr,
+ ];
+
+ for ($i = ($stackPtr - 1);; $i--) {
+ // Skip over potentially large docblocks.
+ if ($tokens[$i]['code'] === \T_DOC_COMMENT_CLOSE_TAG
+ && isset($tokens[$i]['comment_opener'])
+ ) {
+ $i = $tokens[$i]['comment_opener'];
+ continue;
+ }
+
+ if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) {
+ continue;
+ }
+
+ switch ($tokens[$i]['code']) {
+ case \T_PUBLIC:
+ $returnValue['scope'] = 'public';
+ $returnValue['scope_token'] = $i;
+ break;
+
+ case \T_PROTECTED:
+ $returnValue['scope'] = 'protected';
+ $returnValue['scope_token'] = $i;
+ break;
+
+ case \T_PRIVATE:
+ $returnValue['scope'] = 'private';
+ $returnValue['scope_token'] = $i;
+ break;
+
+ case \T_FINAL:
+ $returnValue['is_final'] = true;
+ $returnValue['final_token'] = $i;
+ break;
+
+ default:
+ // Any other token means that the start of the statement has been reached.
+ break 2;
+ }
+ }
+
+ $type = '';
+ $typeToken = false;
+ $typeEndToken = false;
+ $constantTypeTokens = Collections::constantTypeTokens();
+
+ // Now, let's check for a type.
+ for ($i = ($stackPtr + 1); $i < $namePtr; $i++) {
+ if (isset(Tokens::$emptyTokens[$tokens[$i]['code']]) === true) {
+ continue;
+ }
+
+ if ($tokens[$i]['code'] === \T_NULLABLE) {
+ $returnValue['nullable_type'] = true;
+ continue;
+ }
+
+ if (isset($constantTypeTokens[$tokens[$i]['code']]) === true) {
+ $typeEndToken = $i;
+ if ($typeToken === false) {
+ $typeToken = $i;
+ }
+
+ $type .= $tokens[$i]['content'];
+ }
+ }
+
+ if ($type !== '' && $returnValue['nullable_type'] === true) {
+ $type = '?' . $type;
+ }
+
+ $returnValue['type'] = $type;
+ $returnValue['type_token'] = $typeToken;
+ $returnValue['type_end_token'] = $typeEndToken;
+
+ Cache::set($phpcsFile, __METHOD__, $stackPtr, $returnValue);
+ return $returnValue;
+ }
+}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php
index b488060..98bcdda 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php
@@ -138,21 +138,37 @@ public static function inForeachCondition(File $phpcsFile, $stackPtr)
return false;
}
- if ($tokens[$stackPtr]['code'] === \T_AS) {
- return 'as';
- }
+ $opener = $tokens[$foreach]['parenthesis_opener'];
+ $closer = $tokens[$foreach]['parenthesis_closer'];
+
+ for ($i = ($opener + 1); $i < $closer; $i++) {
+ // Skip past a short array declaration in the "before as" part.
+ if (isset($tokens[$i]['bracket_closer'])) {
+ $i = $tokens[$i]['bracket_closer'];
+ continue;
+ }
+
+ // Skip past a long array declaration in the "before as" part.
+ if (isset($tokens[$i]['parenthesis_closer'])) {
+ $i = $tokens[$i]['parenthesis_closer'];
+ continue;
+ }
- $asPtr = $phpcsFile->findNext(
- \T_AS,
- ($tokens[$foreach]['parenthesis_opener'] + 1),
- $tokens[$foreach]['parenthesis_closer']
- );
+ if ($tokens[$i]['code'] === \T_AS) {
+ $asPtr = $i;
+ break;
+ }
+ }
- if ($asPtr === false) {
+ if (isset($asPtr) === false) {
// Parse error or live coding.
return false;
}
+ if ($asPtr === $stackPtr) {
+ return 'as';
+ }
+
if ($stackPtr < $asPtr) {
return 'beforeAs';
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php
index 02bbf02..e8d8169 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php
@@ -10,9 +10,11 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
use PHPCSUtils\Tokens\Collections;
/**
@@ -76,7 +78,7 @@ public static function hasBody(File $phpcsFile, $stackPtr, $allowEmpty = true)
// Check whether the body is empty.
$start = ($tokens[$stackPtr]['scope_opener'] + 1);
- $end = ($phpcsFile->numTokens + 1);
+ $end = $phpcsFile->numTokens;
if (isset($tokens[$stackPtr]['scope_closer']) === true) {
$end = $tokens[$stackPtr]['scope_closer'];
}
@@ -212,17 +214,24 @@ public static function isElseIf(File $phpcsFile, $stackPtr)
* ```
* In case of an invalid catch structure, the array may be empty.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified `$stackPtr` is not of
- * type `T_CATCH` or doesn't exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_CATCH` token.
*/
public static function getCaughtExceptions(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false
- || $tokens[$stackPtr]['code'] !== \T_CATCH
- ) {
- throw new RuntimeException('$stackPtr must be of type T_CATCH');
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if ($tokens[$stackPtr]['code'] !== \T_CATCH) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_CATCH', $tokens[$stackPtr]['type']);
}
if (isset($tokens[$stackPtr]['parenthesis_opener'], $tokens[$stackPtr]['parenthesis_closer']) === false) {
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FileInfo.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FileInfo.php
new file mode 100644
index 0000000..7e4540e
--- /dev/null
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FileInfo.php
@@ -0,0 +1,92 @@
+
+ */
+ private static $bomDefinitions = [
+ 'UTF-8' => 'efbbbf',
+ 'UTF-16 (BE)' => 'feff',
+ 'UTF-16 (LE)' => 'fffe',
+ ];
+
+ /**
+ * Determine whether the file under scan has a byte-order mark at the start.
+ *
+ * Inspired by similar code being used in a couple of PHPCS native sniffs.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
+ *
+ * @return string|false Name of the type of BOM found or FALSE when the file does not start with a BOM.
+ */
+ public static function hasByteOrderMark(File $phpcsFile)
+ {
+ $tokens = $phpcsFile->getTokens();
+
+ if ($tokens[0]['code'] !== \T_INLINE_HTML) {
+ return false;
+ }
+
+ foreach (self::$bomDefinitions as $bomName => $expectedBomHex) {
+ $bomByteLength = (int) (\strlen($expectedBomHex) / 2);
+ $htmlBomHex = \bin2hex(\substr($tokens[0]['content'], 0, $bomByteLength));
+ if ($htmlBomHex === $expectedBomHex) {
+ return $bomName;
+ }
+ }
+
+ return false;
+ }
+
+ /**
+ * Determine whether the file under scan has a shebang line at the start.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
+ *
+ * @return bool
+ */
+ public static function hasSheBang(File $phpcsFile)
+ {
+ $tokens = $phpcsFile->getTokens();
+ if ($tokens[0]['code'] !== \T_INLINE_HTML) {
+ return false;
+ }
+
+ $start = 0;
+ $hasByteOrderMark = self::hasByteOrderMark($phpcsFile);
+ if ($hasByteOrderMark !== false) {
+ $start = (int) (\strlen(self::$bomDefinitions[$hasByteOrderMark]) / 2);
+ }
+
+ return (\substr($tokens[0]['content'], $start, 2) === '#!');
+ }
+}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FilePath.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FilePath.php
new file mode 100644
index 0000000..f08651f
--- /dev/null
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FilePath.php
@@ -0,0 +1,154 @@
+getFileName());
+ if ($fileName !== 'STDIN') {
+ $fileName = self::normalizeAbsolutePath($fileName);
+ }
+
+ return \trim($fileName);
+ }
+
+ /**
+ * Check whether the input was received via STDIN.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
+ *
+ * @return bool
+ */
+ public static function isStdin(File $phpcsFile)
+ {
+ return (self::getName($phpcsFile) === 'STDIN');
+ }
+
+ /**
+ * Normalize an absolute path to forward slashes and to include a trailing slash for directories.
+ *
+ * @since 1.1.0
+ *
+ * @param string $path Absolute file or directory path.
+ *
+ * @return string
+ */
+ public static function normalizeAbsolutePath($path)
+ {
+ return self::trailingSlashIt(self::normalizeDirectorySeparators($path));
+ }
+
+ /**
+ * Normalize all directory separators to be a forward slash.
+ *
+ * {@internal We cannot rely on the OS on which PHPCS is being run to determine the
+ * the expected slashes, as the file name could also come from a text string in a
+ * tokenized file or have been set by an IDE...}
+ *
+ * @since 1.1.0
+ *
+ * @param string $path File or directory path.
+ *
+ * @return string
+ */
+ public static function normalizeDirectorySeparators($path)
+ {
+ return \strtr((string) $path, '\\', '/');
+ }
+
+ /**
+ * Ensure that a directory path ends on a trailing slash.
+ *
+ * Includes safeguard against adding a trailing slash to path ending on a file name.
+ *
+ * @since 1.1.0
+ *
+ * @param string $path File or directory path.
+ *
+ * @return string
+ */
+ public static function trailingSlashIt($path)
+ {
+ if (\is_string($path) === false || $path === '') {
+ return '';
+ }
+
+ $extension = '';
+ $lastChar = \substr($path, -1);
+ if ($lastChar !== '/' && $lastChar !== '\\') {
+ // This may be a file, check if it has a file extension.
+ $extension = \pathinfo($path, \PATHINFO_EXTENSION);
+ }
+
+ if ($extension !== '') {
+ return $path;
+ }
+
+ return \rtrim((string) $path, '/\\') . '/';
+ }
+
+ /**
+ * Check whether one file/directory path starts with another path.
+ *
+ * Recommended to be used only when both paths are absolute.
+ *
+ * Note: this function does not normalize paths prior to comparing them.
+ * If this is needed, normalization should be done prior to passing
+ * the `$haystack` and `$needle` parameters to this function.
+ *
+ * Also note that this function does a case-sensitive comparison as most OS-es are case-sensitive.
+ *
+ * @since 1.1.0
+ *
+ * @param string $haystack Path to examine.
+ * @param string $needle Partial path which the haystack path should start with.
+ *
+ * @return bool
+ */
+ public static function startsWith($haystack, $needle)
+ {
+ return (\strncmp($haystack, $needle, \strlen($needle)) === 0);
+ }
+}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php
index 353ffdb..ca1890c 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php
@@ -10,9 +10,12 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
+use PHPCSUtils\Exceptions\ValueError;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Tokens\Collections;
use PHPCSUtils\Utils\GetTokensAsString;
@@ -129,8 +132,8 @@ final class FunctionDeclarations
* @return string|null The name of the function; or `NULL` if the passed token doesn't exist,
* the function is anonymous or in case of a parse error/live coding.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not of type
- * `T_FUNCTION`.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_FUNCTION` token.
*/
public static function getName(File $phpcsFile, $stackPtr)
{
@@ -179,17 +182,25 @@ public static function getName(File $phpcsFile, $stackPtr)
* );
* ```
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a T_FUNCTION
- * or T_CLOSURE token, nor an arrow function.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a T_FUNCTION, T_CLOSURE
+ * or T_FN token.
*/
public static function getProperties(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false
- || isset(Collections::functionDeclarationTokens()[$tokens[$stackPtr]['code']]) === false
- ) {
- throw new RuntimeException('$stackPtr must be of type T_FUNCTION or T_CLOSURE or an arrow function');
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if (isset(Collections::functionDeclarationTokens()[$tokens[$stackPtr]['code']]) === false) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_FUNCTION, T_CLOSURE or T_FN', $tokens[$stackPtr]['type']);
}
if (Cache::isCached($phpcsFile, __METHOD__, $stackPtr) === true) {
@@ -373,6 +384,12 @@ public static function getProperties(File $phpcsFile, $stackPtr)
* // This index will only be set if the property is readonly.
* ```
*
+ * ... and if the promoted property uses asymmetric visibility, these additional array indexes will also be available:
+ * ```php
+ * 'set_visibility' => string, // The property set-visibility as declared.
+ * 'set_visibility_token' => int, // The stack pointer to the set-visibility modifier token.
+ * ```
+ *
* Main differences with the PHPCS version:
* - Defensive coding against incorrect calls to this method.
* - More efficient and more stable checking whether a `T_USE` token is a closure use.
@@ -392,21 +409,29 @@ public static function getProperties(File $phpcsFile, $stackPtr)
*
* @return array>
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of
- * type `T_FUNCTION`, `T_CLOSURE` or `T_USE`,
- * nor an arrow function.
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If a passed `T_USE` token is not a closure
- * use token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a T_FUNCTION, T_CLOSURE,
+ * T_FN or T_USE token.
+ * @throws \PHPCSUtils\Exceptions\ValueError If a passed `T_USE` token is not a closure use token.
*/
public static function getParameters(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false
- || (isset(Collections::functionDeclarationTokens()[$tokens[$stackPtr]['code']]) === false
- && $tokens[$stackPtr]['code'] !== \T_USE)
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if (isset(Collections::functionDeclarationTokens()[$tokens[$stackPtr]['code']]) === false
+ && $tokens[$stackPtr]['code'] !== \T_USE
) {
- throw new RuntimeException('$stackPtr must be of type T_FUNCTION, T_CLOSURE or T_USE or an arrow function');
+ $acceptedTokens = 'T_FUNCTION, T_CLOSURE, T_FN or T_USE';
+ throw UnexpectedTokenType::create(2, '$stackPtr', $acceptedTokens, $tokens[$stackPtr]['type']);
}
if ($tokens[$stackPtr]['code'] === \T_USE) {
@@ -416,7 +441,7 @@ public static function getParameters(File $phpcsFile, $stackPtr)
|| $tokens[$opener]['code'] !== \T_OPEN_PARENTHESIS
|| UseStatements::isClosureUse($phpcsFile, $stackPtr) === false
) {
- throw new RuntimeException('$stackPtr was not a valid closure T_USE');
+ throw ValueError::create(2, '$stackPtr', 'must be the pointer to a closure use statement');
}
} else {
if (isset($tokens[$stackPtr]['parenthesis_opener']) === false) {
@@ -438,23 +463,24 @@ public static function getParameters(File $phpcsFile, $stackPtr)
$closer = $tokens[$opener]['parenthesis_closer'];
- $vars = [];
- $currVar = null;
- $paramStart = ($opener + 1);
- $defaultStart = null;
- $equalToken = null;
- $paramCount = 0;
- $hasAttributes = false;
- $passByReference = false;
- $referenceToken = false;
- $variableLength = false;
- $variadicToken = false;
- $typeHint = '';
- $typeHintToken = false;
- $typeHintEndToken = false;
- $nullableType = false;
- $visibilityToken = null;
- $readonlyToken = null;
+ $vars = [];
+ $currVar = null;
+ $paramStart = ($opener + 1);
+ $defaultStart = null;
+ $equalToken = null;
+ $paramCount = 0;
+ $hasAttributes = false;
+ $passByReference = false;
+ $referenceToken = false;
+ $variableLength = false;
+ $variadicToken = false;
+ $typeHint = '';
+ $typeHintToken = false;
+ $typeHintEndToken = false;
+ $nullableType = false;
+ $visibilityToken = null;
+ $setVisibilityToken = null;
+ $readonlyToken = null;
$parameterTypeTokens = Collections::parameterTypeTokens();
@@ -510,6 +536,12 @@ public static function getParameters(File $phpcsFile, $stackPtr)
$visibilityToken = $i;
break;
+ case \T_PUBLIC_SET:
+ case \T_PROTECTED_SET:
+ case \T_PRIVATE_SET:
+ $setVisibilityToken = $i;
+ break;
+
case \T_READONLY:
$readonlyToken = $i;
break;
@@ -547,16 +579,21 @@ public static function getParameters(File $phpcsFile, $stackPtr)
$vars[$paramCount]['type_hint_end_token'] = $typeHintEndToken;
$vars[$paramCount]['nullable_type'] = $nullableType;
- if ($visibilityToken !== null || $readonlyToken !== null) {
+ if ($visibilityToken !== null || $setVisibilityToken !== null || $readonlyToken !== null) {
$vars[$paramCount]['property_visibility'] = 'public';
$vars[$paramCount]['visibility_token'] = false;
- $vars[$paramCount]['property_readonly'] = false;
if ($visibilityToken !== null) {
$vars[$paramCount]['property_visibility'] = $tokens[$visibilityToken]['content'];
$vars[$paramCount]['visibility_token'] = $visibilityToken;
}
+ if ($setVisibilityToken !== null) {
+ $vars[$paramCount]['set_visibility'] = $tokens[$setVisibilityToken]['content'];
+ $vars[$paramCount]['set_visibility_token'] = $setVisibilityToken;
+ }
+
+ $vars[$paramCount]['property_readonly'] = false;
if ($readonlyToken !== null) {
$vars[$paramCount]['property_readonly'] = true;
$vars[$paramCount]['readonly_token'] = $readonlyToken;
@@ -570,21 +607,22 @@ public static function getParameters(File $phpcsFile, $stackPtr)
}
// Reset the vars, as we are about to process the next parameter.
- $currVar = null;
- $paramStart = ($i + 1);
- $defaultStart = null;
- $equalToken = null;
- $hasAttributes = false;
- $passByReference = false;
- $referenceToken = false;
- $variableLength = false;
- $variadicToken = false;
- $typeHint = '';
- $typeHintToken = false;
- $typeHintEndToken = false;
- $nullableType = false;
- $visibilityToken = null;
- $readonlyToken = null;
+ $currVar = null;
+ $paramStart = ($i + 1);
+ $defaultStart = null;
+ $equalToken = null;
+ $hasAttributes = false;
+ $passByReference = false;
+ $referenceToken = false;
+ $variableLength = false;
+ $variadicToken = false;
+ $typeHint = '';
+ $typeHintToken = false;
+ $typeHintEndToken = false;
+ $nullableType = false;
+ $visibilityToken = null;
+ $setVisibilityToken = null;
+ $readonlyToken = null;
++$paramCount;
break;
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php
index f18b0c0..a9b31da 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php
@@ -10,9 +10,10 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
/**
* Utility functions to retrieve the content of a set of tokens as a string.
@@ -43,7 +44,8 @@ final class GetTokensAsString
*
* @return string The token contents.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified start position does not exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $start parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the $start token does not exist in the $phpcsFile.
*/
public static function normal(File $phpcsFile, $start, $end)
{
@@ -72,7 +74,8 @@ public static function normal(File $phpcsFile, $start, $end)
*
* @return string The token contents.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified start position does not exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $start parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the $start token does not exist in the $phpcsFile.
*/
public static function tabReplaced(File $phpcsFile, $start, $end)
{
@@ -103,7 +106,8 @@ public static function tabReplaced(File $phpcsFile, $start, $end)
*
* @return string The token contents.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified start position does not exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $start parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the $start token does not exist in the $phpcsFile.
*/
public static function origContent(File $phpcsFile, $start, $end)
{
@@ -124,7 +128,8 @@ public static function origContent(File $phpcsFile, $start, $end)
*
* @return string The token contents stripped off comments.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified start position does not exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $start parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the $start token does not exist in the $phpcsFile.
*/
public static function noComments(File $phpcsFile, $start, $end)
{
@@ -148,7 +153,8 @@ public static function noComments(File $phpcsFile, $start, $end)
*
* @return string The token contents stripped off comments and whitespace.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified start position does not exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $start parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the $start token does not exist in the $phpcsFile.
*/
public static function noEmpties(File $phpcsFile, $start, $end)
{
@@ -172,7 +178,8 @@ public static function noEmpties(File $phpcsFile, $start, $end)
*
* @return string The token contents with compacted whitespace and optionally stripped off comments.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified start position does not exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $start parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the $start token does not exist in the $phpcsFile.
*/
public static function compact(File $phpcsFile, $start, $end, $stripComments = false)
{
@@ -200,7 +207,8 @@ public static function compact(File $phpcsFile, $start, $end, $stripComments = f
*
* @return string The token contents.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified start position does not exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $start parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the $start token does not exist in the $phpcsFile.
*/
protected static function getString(
File $phpcsFile,
@@ -213,10 +221,12 @@ protected static function getString(
) {
$tokens = $phpcsFile->getTokens();
- if (\is_int($start) === false || isset($tokens[$start]) === false) {
- throw new RuntimeException(
- 'The $start position for GetTokensAsString methods must exist in the token stack'
- );
+ if (\is_int($start) === false) {
+ throw TypeError::create(2, '$start', 'integer', $start);
+ }
+
+ if (isset($tokens[$start]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$start', $start);
}
if (\is_int($end) === false || $end < $start) {
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php
index 167d650..31c8936 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php
@@ -10,9 +10,9 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Internal\IsShortArrayOrListWithCache;
use PHPCSUtils\Tokens\Collections;
@@ -194,16 +194,22 @@ public static function getOpenClose(File $phpcsFile, $stackPtr, $isShortList = n
* An array with information on each assignment made, including skipped assignments (empty),
* or an empty array if no assignments are made at all (fatal error in PHP >= 7.0).
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified $stackPtr is not of
- * type T_LIST, T_OPEN_SHORT_ARRAY or
- * T_OPEN_SQUARE_BRACKET.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a T_LIST, T_OPEN_SHORT_ARRAY or
+ * T_OPEN_SQUARE_BRACKET token.
*/
public static function getAssignments(File $phpcsFile, $stackPtr)
{
$openClose = self::getOpenClose($phpcsFile, $stackPtr);
if ($openClose === false) {
// The `getOpenClose()` method does the $stackPtr validation.
- throw new RuntimeException('The Lists::getAssignments() method expects a long/short list token.');
+ $received = $stackPtr;
+ $tokens = $phpcsFile->getTokens();
+ if (\is_int($stackPtr) && isset($tokens[$stackPtr])) {
+ $received = $tokens[$stackPtr]['type'];
+ } elseif (\is_int($stackPtr) === false) {
+ $received = \gettype($stackPtr);
+ }
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'long/short list', $received);
}
if (Cache::isCached($phpcsFile, __METHOD__, $stackPtr) === true) {
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php
index 0d24992..cdb866d 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Namespaces.php
@@ -10,10 +10,13 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
use PHPCSUtils\BackCompat\BCFile;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\RuntimeException;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Tokens\Collections;
use PHPCSUtils\Utils\Conditions;
@@ -44,8 +47,9 @@ final class Namespaces
* reliably determined what the `T_NAMESPACE` token is used for,
* which, in most cases, will mean the code contains a parse/fatal error.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is
- * not a `T_NAMESPACE` token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_NAMESPACE` token.
*/
public static function getType(File $phpcsFile, $stackPtr)
{
@@ -70,8 +74,16 @@ public static function getType(File $phpcsFile, $stackPtr)
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_NAMESPACE) {
- throw new RuntimeException('$stackPtr must be of type T_NAMESPACE');
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if ($tokens[$stackPtr]['code'] !== \T_NAMESPACE) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_NAMESPACE', $tokens[$stackPtr]['type']);
}
$next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
@@ -104,7 +116,7 @@ public static function getType(File $phpcsFile, $stackPtr)
}
if (($tokens[$next]['code'] === \T_NS_SEPARATOR
- || $tokens[$next]['code'] === \T_NAME_FULLY_QUALIFIED) // PHP 8.0 parse error.
+ || $tokens[$next]['code'] === \T_NAME_FULLY_QUALIFIED) // PHP >= 8.0 parse error.
&& ($start !== $stackPtr
|| $phpcsFile->findNext($findAfter, ($stackPtr + 1), null, false, null, true) !== false)
) {
@@ -125,8 +137,9 @@ public static function getType(File $phpcsFile, $stackPtr)
* @return bool `TRUE` if the token passed is the keyword for a namespace declaration.
* `FALSE` if not.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is
- * not a `T_NAMESPACE` token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_NAMESPACE` token.
*/
public static function isDeclaration(File $phpcsFile, $stackPtr)
{
@@ -146,8 +159,9 @@ public static function isDeclaration(File $phpcsFile, $stackPtr)
*
* @return bool `TRUE` if the namespace token passed is used as an operator. `FALSE` if not.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is
- * not a `T_NAMESPACE` token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_NAMESPACE` token.
*/
public static function isOperator(File $phpcsFile, $stackPtr)
{
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php
index 69ec4ef..32305fb 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Numbers.php
@@ -10,8 +10,10 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
/**
* Utility functions for working with integer/float tokens.
@@ -40,7 +42,7 @@ final class Numbers
*
* @var string
*/
- const REGEX_DECIMAL_INT = '`^(?:0|[1-9][0-9]*)$`D';
+ const REGEX_DECIMAL_INT = '`^(?:0|[1-9](?:[0-9_]*[0-9])?)$`D';
/**
* Regex to determine whether the contents of an arbitrary string represents an octal integer.
@@ -49,7 +51,7 @@ final class Numbers
*
* @var string
*/
- const REGEX_OCTAL_INT = '`^0[o]?[0-7]+$`iD';
+ const REGEX_OCTAL_INT = '`^0[o]?[0-7](?:[0-7_]*[0-7])?$`iD';
/**
* Regex to determine whether the contents of an arbitrary string represents a binary integer.
@@ -58,7 +60,7 @@ final class Numbers
*
* @var string
*/
- const REGEX_BINARY_INT = '`^0b[0-1]+$`iD';
+ const REGEX_BINARY_INT = '`^0b[0-1](?:[0-1_]*[0-1])?$`iD';
/**
* Regex to determine whether the contents of an arbitrary string represents a hexidecimal integer.
@@ -67,7 +69,7 @@ final class Numbers
*
* @var string
*/
- const REGEX_HEX_INT = '`^0x[0-9A-F]+$`iD';
+ const REGEX_HEX_INT = '`^0x[0-9A-F](?:[0-9A-F_]*[0-9A-F])?$`iD';
/**
* Regex to determine whether the contents of an arbitrary string represents a float.
@@ -82,16 +84,16 @@ final class Numbers
^(?:
(?:
(?:
- (?P[0-9]+)
+ (?P[0-9](?:[0-9_]*[0-9])?)
|
- (?P([0-9]*\.(?P>LNUM)|(?P>LNUM)\.[0-9]*))
+ (?P((?:[0-9](?:[0-9_]*[0-9])?)*\.(?P>LNUM)|(?P>LNUM)\.(?:[0-9](?:[0-9_]*[0-9])?)*))
)
[e][+-]?(?P>LNUM)
)
|
(?P>DNUM)
|
- (?:0|[1-9][0-9]*)
+ (?:0|[1-9](?:[0-9_]*[0-9])?)
)$
`ixD';
@@ -125,19 +127,24 @@ final class Numbers
* )
* ```
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not of type
- * `T_LNUMBER` or `T_DNUMBER`.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_LNUMBER` or `T_DNUMBER` token.
*/
public static function getCompleteNumber(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false
- || ($tokens[$stackPtr]['code'] !== \T_LNUMBER && $tokens[$stackPtr]['code'] !== \T_DNUMBER)
- ) {
- throw new RuntimeException(
- 'Token type "' . $tokens[$stackPtr]['type'] . '" is not T_LNUMBER or T_DNUMBER'
- );
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if ($tokens[$stackPtr]['code'] !== \T_LNUMBER && $tokens[$stackPtr]['code'] !== \T_DNUMBER) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_LNUMBER or T_DNUMBER', $tokens[$stackPtr]['type']);
}
$content = $tokens[$stackPtr]['content'];
@@ -208,7 +215,7 @@ public static function getDecimalValue($textString)
/**
* Verify whether the contents of an arbitrary string represents a decimal integer.
*
- * Takes PHP 7.4 numeric literal separators in numbers into account.
+ * Takes PHP 7.4 numeric literal separators in numbers into account in the regex.
*
* @since 1.0.0
*
@@ -222,16 +229,13 @@ public static function isDecimalInt($textString)
return false;
}
- // Remove potential PHP 7.4 numeric literal separators.
- $textString = \str_replace('_', '', $textString);
-
return (\preg_match(self::REGEX_DECIMAL_INT, $textString) === 1);
}
/**
* Verify whether the contents of an arbitrary string represents a hexidecimal integer.
*
- * Takes PHP 7.4 numeric literal separators in numbers into account.
+ * Takes PHP 7.4 numeric literal separators in numbers into account in the regex.
*
* @since 1.0.0
*
@@ -245,16 +249,13 @@ public static function isHexidecimalInt($textString)
return false;
}
- // Remove potential PHP 7.4 numeric literal separators.
- $textString = \str_replace('_', '', $textString);
-
return (\preg_match(self::REGEX_HEX_INT, $textString) === 1);
}
/**
* Verify whether the contents of an arbitrary string represents a binary integer.
*
- * Takes PHP 7.4 numeric literal separators in numbers into account.
+ * Takes PHP 7.4 numeric literal separators in numbers into account in the regex.
*
* @since 1.0.0
*
@@ -268,16 +269,13 @@ public static function isBinaryInt($textString)
return false;
}
- // Remove potential PHP 7.4 numeric literal separators.
- $textString = \str_replace('_', '', $textString);
-
return (\preg_match(self::REGEX_BINARY_INT, $textString) === 1);
}
/**
* Verify whether the contents of an arbitrary string represents an octal integer.
*
- * Takes PHP 7.4 numeric literal separators and explicit octal literals in numbers into account.
+ * Takes PHP 7.4 numeric literal separators and explicit octal literals in numbers into account in the regex.
*
* @since 1.0.0
*
@@ -291,16 +289,13 @@ public static function isOctalInt($textString)
return false;
}
- // Remove potential PHP 7.4 numeric literal separators.
- $textString = \str_replace('_', '', $textString);
-
return (\preg_match(self::REGEX_OCTAL_INT, $textString) === 1);
}
/**
* Verify whether the contents of an arbitrary string represents a floating point number.
*
- * Takes PHP 7.4 numeric literal separators in numbers into account.
+ * Takes PHP 7.4 numeric literal separators in numbers into account in the regex.
*
* @since 1.0.0
*
@@ -314,9 +309,6 @@ public static function isFloat($textString)
return false;
}
- // Remove potential PHP 7.4 numeric literal separators.
- $textString = \str_replace('_', '', $textString);
-
return (\preg_match(self::REGEX_FLOAT, $textString) === 1);
}
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php
index ffa346a..3a57926 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ObjectDeclarations.php
@@ -10,10 +10,14 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
+use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Tokens\Collections;
+use PHPCSUtils\Utils\FunctionDeclarations;
use PHPCSUtils\Utils\GetTokensAsString;
/**
@@ -42,6 +46,10 @@ final class ObjectDeclarations
* being extended/interface being implemented.
* Using this version of the utility method, either the complete name (invalid or not) will
* be returned or `null` in case of no name (parse error).
+ * - The PHPCS 4.0 change to no longer accept tokens for anonymous structures (T_CLOSURE/T_ANON_CLASS)
+ * has not been applied to this method (yet). This will change in PHPCSUtils 2.0.
+ * - The PHPCS 4.0 change to normalize the return type to `string` and no longer return `null`
+ * has not been applied to this method (yet). This will change in PHPCSUtils 2.0.
*
* @see \PHP_CodeSniffer\Files\File::getDeclarationName() Original source.
* @see \PHPCSUtils\BackCompat\BCFile::getDeclarationName() Cross-version compatible version of the original.
@@ -57,14 +65,19 @@ final class ObjectDeclarations
* or `NULL` if the passed token doesn't exist, the function or
* class is anonymous or in case of a parse error/live coding.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not of type
- * `T_FUNCTION`, `T_CLASS`, `T_ANON_CLASS`,
- * `T_CLOSURE`, `T_TRAIT`, `T_ENUM` or `T_INTERFACE`.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_FUNCTION`, `T_CLASS`,
+ * `T_ANON_CLASS`, `T_CLOSURE`, `T_TRAIT`, `T_ENUM`
+ * or `T_INTERFACE` token.
*/
public static function getName(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
if (isset($tokens[$stackPtr]) === false
|| ($tokens[$stackPtr]['code'] === \T_ANON_CLASS || $tokens[$stackPtr]['code'] === \T_CLOSURE)
) {
@@ -79,10 +92,8 @@ public static function getName(File $phpcsFile, $stackPtr)
&& $tokenCode !== \T_TRAIT
&& $tokenCode !== \T_ENUM
) {
- throw new RuntimeException(
- 'Token type "' . $tokens[$stackPtr]['type']
- . '" is not T_FUNCTION, T_CLASS, T_INTERFACE, T_TRAIT or T_ENUM'
- );
+ $acceptedTokens = 'T_FUNCTION, T_CLASS, T_INTERFACE, T_TRAIT or T_ENUM';
+ throw UnexpectedTokenType::create(2, '$stackPtr', $acceptedTokens, $tokens[$stackPtr]['type']);
}
if ($tokenCode === \T_FUNCTION
@@ -163,15 +174,24 @@ public static function getName(File $phpcsFile, $stackPtr)
* );
* ```
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * `T_CLASS` token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a T_CLASS token.
*/
public static function getClassProperties(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_CLASS) {
- throw new RuntimeException('$stackPtr must be of type T_CLASS');
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if ($tokens[$stackPtr]['code'] !== \T_CLASS) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_CLASS', $tokens[$stackPtr]['type']);
}
$valid = Collections::classModifierKeywords() + Tokens::$emptyTokens;
@@ -222,7 +242,6 @@ public static function getClassProperties(File $phpcsFile, $stackPtr)
* - Bugs fixed:
* - Handling of PHPCS annotations.
* - Handling of comments.
- * - Handling of the namespace keyword used as operator.
* - Improved handling of parse errors.
* - The returned name will be clean of superfluous whitespace and/or comments.
* - Support for PHP 8.0 tokenization of identifier/namespaced names, cross-version PHP & PHPCS.
@@ -258,7 +277,6 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr)
* - Bugs fixed:
* - Handling of PHPCS annotations.
* - Handling of comments.
- * - Handling of the namespace keyword used as operator.
* - Improved handling of parse errors.
* - The returned name(s) will be clean of superfluous whitespace and/or comments.
* - Support for PHP 8.0 tokenization of identifier/namespaced names, cross-version PHP & PHPCS.
@@ -356,4 +374,265 @@ private static function findNames(File $phpcsFile, $stackPtr, $keyword, array $a
return $names;
}
+
+ /**
+ * Retrieve all constants declared in an OO structure.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found.
+ * @param int $stackPtr The stack position of the OO keyword.
+ *
+ * @return array Array with names of the found constants as keys and the stack pointers
+ * to the T_CONST token for each constant as values.
+ * If no constants are found or a parse error is encountered,
+ * an empty array is returned.
+ *
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not an OO keyword token.
+ */
+ public static function getDeclaredConstants(File $phpcsFile, $stackPtr)
+ {
+ return self::analyzeOOStructure($phpcsFile, $stackPtr)['constants'];
+ }
+
+ /**
+ * Retrieve all cases declared in an enum.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found.
+ * @param int $stackPtr The stack position of the OO keyword.
+ *
+ * @return array Array with names of the found cases as keys and the stack pointers
+ * to the T_ENUM_CASE token for each case as values.
+ * If no cases are found or a parse error is encountered,
+ * an empty array is returned.
+ *
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a T_ENUM token.
+ */
+ public static function getDeclaredEnumCases(File $phpcsFile, $stackPtr)
+ {
+ $tokens = $phpcsFile->getTokens();
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if ($tokens[$stackPtr]['code'] !== \T_ENUM) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_ENUM', $tokens[$stackPtr]['type']);
+ }
+
+ return self::analyzeOOStructure($phpcsFile, $stackPtr)['cases'];
+ }
+
+ /**
+ * Retrieve all properties declared in an OO structure.
+ *
+ * Notes:
+ * - Properties declared via PHP 8.0+ contructor property promotion **will** be included
+ * in the return value.
+ * However, keep in mind that passing the stack pointer of such a property to the
+ * {@see Variables::getMemberProperties()} method is not supported.
+ * - Interfaces and enums cannot contain properties. This method does not take this into
+ * account to allow sniffs to flag this kind of incorrect PHP code.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found.
+ * @param int $stackPtr The stack position of the OO keyword.
+ *
+ * @return array Array with names of the found properties as keys and the stack pointers
+ * to the T_VARIABLE token for each property as values.
+ * If no properties are found or a parse error is encountered,
+ * an empty array is returned.
+ *
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not an OO keyword token.
+ */
+ public static function getDeclaredProperties(File $phpcsFile, $stackPtr)
+ {
+ return self::analyzeOOStructure($phpcsFile, $stackPtr)['properties'];
+ }
+
+ /**
+ * Retrieve all methods declared in an OO structure.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found.
+ * @param int $stackPtr The stack pointer to the OO keyword.
+ *
+ * @return array Array with names of the found methods as keys and the stack pointers
+ * to the T_FUNCTION keyword for each method as values.
+ * If no methods are found or a parse error is encountered,
+ * an empty array is returned.
+ *
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not an OO keyword token.
+ */
+ public static function getDeclaredMethods(File $phpcsFile, $stackPtr)
+ {
+ return self::analyzeOOStructure($phpcsFile, $stackPtr)['methods'];
+ }
+
+ /**
+ * Retrieve all constants, cases, properties and methods in an OO structure.
+ *
+ * @since 1.1.0
+ *
+ * @param \PHP_CodeSniffer\Files\File $phpcsFile The file where this token was found.
+ * @param int $stackPtr The stack position of the OO keyword.
+ *
+ * @return array> Multi-dimensional array with four keys:
+ * - "constants"
+ * - "cases"
+ * - "properties"
+ * - "methods"
+ * Each index holds an associative array with the name of the "thing"
+ * as the key and the stack pointer to the related token as the value.
+ *
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not an OO keyword token.
+ */
+ private static function analyzeOOStructure(File $phpcsFile, $stackPtr)
+ {
+ $tokens = $phpcsFile->getTokens();
+
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if (isset(Tokens::$ooScopeTokens[$tokens[$stackPtr]['code']]) === false) {
+ $acceptedTokens = 'T_CLASS, T_ANON_CLASS, T_INTERFACE, T_TRAIT or T_ENUM';
+ throw UnexpectedTokenType::create(2, '$stackPtr', $acceptedTokens, $tokens[$stackPtr]['type']);
+ }
+
+ // Set defaults.
+ $found = [
+ 'constants' => [],
+ 'cases' => [],
+ 'properties' => [],
+ 'methods' => [],
+ ];
+
+ if (isset($tokens[$stackPtr]['scope_opener'], $tokens[$stackPtr]['scope_closer']) === false) {
+ return $found;
+ }
+
+ if (Cache::isCached($phpcsFile, __METHOD__, $stackPtr) === true) {
+ return Cache::get($phpcsFile, __METHOD__, $stackPtr);
+ }
+
+ for ($i = ($tokens[$stackPtr]['scope_opener'] + 1); $i < $tokens[$stackPtr]['scope_closer']; $i++) {
+ // Skip over potentially large docblocks.
+ if (isset($tokens[$i]['comment_closer']) === true) {
+ $i = $tokens[$i]['comment_closer'];
+ continue;
+ }
+
+ // Skip over attributes.
+ if (isset($tokens[$i]['attribute_closer']) === true) {
+ $i = $tokens[$i]['attribute_closer'];
+ continue;
+ }
+
+ // Skip over trait imports with conflict resolution.
+ if ($tokens[$i]['code'] === \T_USE
+ && isset($tokens[$i]['scope_closer']) === true
+ ) {
+ $i = $tokens[$i]['scope_closer'];
+ continue;
+ }
+
+ // Defensive coding against parse errors.
+ if ($tokens[$i]['code'] === \T_CLOSURE
+ && isset($tokens[$i]['scope_closer']) === true
+ ) {
+ $i = $tokens[$i]['scope_closer'];
+ continue;
+ }
+
+ switch ($tokens[$i]['code']) {
+ case \T_CONST:
+ $assignmentPtr = $phpcsFile->findNext([\T_EQUAL, \T_SEMICOLON, \T_CLOSE_CURLY_BRACKET], ($i + 1));
+ if ($assignmentPtr === false || $tokens[$assignmentPtr]['code'] !== \T_EQUAL) {
+ // Probably a parse error. Ignore.
+ continue 2;
+ }
+
+ $namePtr = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($assignmentPtr - 1), ($i + 1), true);
+ if ($namePtr === false || $tokens[$namePtr]['code'] !== \T_STRING) {
+ // Probably a parse error. Ignore.
+ continue 2;
+ }
+
+ $found['constants'][$tokens[$namePtr]['content']] = $i;
+
+ // Skip to the assignment pointer, no need to double walk.
+ $i = $assignmentPtr;
+ break;
+
+ case \T_ENUM_CASE:
+ $namePtr = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true);
+ if ($namePtr === false || $tokens[$namePtr]['code'] !== \T_STRING) {
+ // Probably a parse error. Ignore.
+ continue 2;
+ }
+
+ $name = $tokens[$namePtr]['content'];
+ $found['cases'][$name] = $i;
+
+ // Skip to the name pointer, no need to double walk.
+ $i = $namePtr;
+ break;
+
+ case \T_VARIABLE:
+ $name = $tokens[$i]['content'];
+ $found['properties'][$name] = $i;
+ break;
+
+ case \T_FUNCTION:
+ $name = self::getName($phpcsFile, $i);
+ if (\is_string($name) && $name !== '') {
+ $found['methods'][$name] = $i;
+
+ if (\strtolower($name) === '__construct') {
+ // Check for constructor property promotion.
+ $parameters = FunctionDeclarations::getParameters($phpcsFile, $i);
+ foreach ($parameters as $param) {
+ if (isset($param['property_visibility'])) {
+ $found['properties'][$param['name']] = $param['token'];
+ }
+ }
+ }
+ }
+
+ if (isset($tokens[$i]['scope_closer']) === true) {
+ // Skip over the contents of the method, including the parameters.
+ $i = $tokens[$i]['scope_closer'];
+ } elseif (isset($tokens[$i]['parenthesis_closer']) === true) {
+ // Skip over the contents of an abstract/interface method, including the parameters.
+ $i = $tokens[$i]['parenthesis_closer'];
+ }
+ break;
+ }
+ }
+
+ Cache::set($phpcsFile, __METHOD__, $stackPtr, $found);
+ return $found;
+ }
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php
index 562440f..7b28511 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Operators.php
@@ -52,8 +52,6 @@ final class Operators
\T_OPEN_SHORT_ARRAY => true,
\T_OPEN_CURLY_BRACKET => true,
\T_COLON => true,
- \T_INLINE_THEN => true,
- \T_INLINE_ELSE => true,
\T_CASE => true,
\T_FN_ARROW => true,
\T_MATCH_ARROW => true,
@@ -206,6 +204,7 @@ public static function isUnaryPlusMinus(File $phpcsFile, $stackPtr)
|| isset(Tokens::$booleanOperators[$tokens[$prev]['code']]) === true
|| isset(Tokens::$assignmentTokens[$tokens[$prev]['code']]) === true
|| isset(Tokens::$castTokens[$tokens[$prev]['code']]) === true
+ || isset(Collections::ternaryOperators()[$tokens[$prev]['code']]) === true
|| isset(self::$extraUnaryIndicators[$tokens[$prev]['code']]) === true
) {
return true;
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php
index 998b64f..651ba41 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Parentheses.php
@@ -17,8 +17,8 @@
* Utility functions for use when examining parenthesis tokens and arbitrary tokens wrapped
* in parentheses.
*
- * In contrast to PHPCS natively, `isset()`, `unset()`, `empty()`, `exit()`, `die()` and `eval()`
- * will be considered parentheses owners by the functions in this class.
+ * In contrast to PHPCS natively (< 4.0), `isset()`, `unset()`, `empty()`, `exit()`, `die()`, `eval()`
+ * and closure `use()` will be considered parentheses owners by the functions in this class.
*
* @since 1.0.0
*/
@@ -29,8 +29,9 @@ final class Parentheses
* Extra tokens which should be considered parentheses owners.
*
* - `T_ISSET`, `T_UNSET`, `T_EMPTY`, `T_EXIT` and `T_EVAL` are not PHPCS native parentheses
- * owners, but are considered such for the purposes of this class.
+ * owners until PHPCS 4.0.0, but are considered such for the purposes of this class.
* Also see {@link https://github.com/squizlabs/PHP_CodeSniffer/issues/3118 PHPCS#3118}.
+ * - `T_USE` when used for a closure use statement also became a parentheses owner in PHPCS 4.0.0.
*
* @since 1.0.0
*
@@ -42,6 +43,7 @@ final class Parentheses
\T_EMPTY => \T_EMPTY,
\T_EXIT => \T_EXIT,
\T_EVAL => \T_EVAL,
+ \T_USE => \T_USE,
];
/**
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php
index 0d65b8e..7dab549 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php
@@ -10,9 +10,12 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\MissingArgumentError;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Tokens\Collections;
use PHPCSUtils\Utils\Arrays;
@@ -53,7 +56,7 @@ final class PassedParameters
* - If passed a `T_ANON_CLASS` stack pointer, it will accept it as a class instantiation.
* - If passed a `T_SELF`, `T_STATIC` or `T_PARENT` stack pointer, it will accept it as a
* class instantiation function call when used like `new self()` (with or without parentheses).
- * When these hierarchiecal keywords are not preceded by the `new` keyword, parentheses
+ * When these hierarchical keywords are not preceded by the `new` keyword, parentheses
* will be required for the token to be accepted.
* - If passed a `T_ARRAY` or `T_OPEN_SHORT_ARRAY` stack pointer, it will detect
* whether the array has values or is empty.
@@ -62,6 +65,9 @@ final class PassedParameters
* a short array opener.
* - If passed a `T_ISSET` or `T_UNSET` stack pointer, it will detect whether those
* language constructs have "parameters".
+ * - If passed a `T_EXIT` stack pointer, it will treat it as a function call and detect whether
+ * it has been passed parameters. When the `T_EXIT` is used as a constant, the return value
+ * will be `false` (no parameters).
*
* @since 1.0.0
*
@@ -75,19 +81,25 @@ final class PassedParameters
*
* @return bool
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the token passed is not one of the
- * accepted types or doesn't exist.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not one of the accepted types.
*/
public static function hasParameters(File $phpcsFile, $stackPtr, $isShortArray = null)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false
- || isset(Collections::parameterPassingTokens()[$tokens[$stackPtr]['code']]) === false
- ) {
- throw new RuntimeException(
- 'The hasParameters() method expects a function call, array, isset or unset token to be passed.'
- );
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ $acceptedTokens = 'function call, array, isset, unset or exit';
+ if (isset(Collections::parameterPassingTokens()[$tokens[$stackPtr]['code']]) === false) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', $acceptedTokens, $tokens[$stackPtr]['type']);
}
// Only accept self/static/parent if preceded by `new` or followed by an open parenthesis.
@@ -97,9 +109,7 @@ public static function hasParameters(File $phpcsFile, $stackPtr, $isShortArray =
if ($tokens[$prev]['code'] !== \T_NEW
&& ($next !== false && $tokens[$next]['code'] !== \T_OPEN_PARENTHESIS)
) {
- throw new RuntimeException(
- 'The hasParameters() method expects a function call, array, isset or unset token to be passed.'
- );
+ throw UnexpectedTokenType::create(2, '$stackPtr', $acceptedTokens, $tokens[$stackPtr]['type']);
}
}
@@ -107,9 +117,7 @@ public static function hasParameters(File $phpcsFile, $stackPtr, $isShortArray =
&& $isShortArray !== true
&& Arrays::isShortArray($phpcsFile, $stackPtr) === false
) {
- throw new RuntimeException(
- 'The hasParameters() method expects a function call, array, isset or unset token to be passed.'
- );
+ throw UnexpectedTokenType::create(2, '$stackPtr', $acceptedTokens, $tokens[$stackPtr]['type']);
}
if ($next === false) {
@@ -126,7 +134,7 @@ public static function hasParameters(File $phpcsFile, $stackPtr, $isShortArray =
return true;
}
- // Deal with function calls, long arrays, isset and unset.
+ // Deal with function calls, long arrays, isset, unset and exit/die.
// Next non-empty token should be the open parenthesis.
if ($tokens[$next]['code'] !== \T_OPEN_PARENTHESIS) {
return false;
@@ -195,8 +203,8 @@ public static function hasParameters(File $phpcsFile, $stackPtr, $isShortArray =
* _The key for named parameters will be the parameter name._
* If no parameters/array items are found, an empty array will be returned.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the token passed is not one of the
- * accepted types or doesn't exist.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not one of the accepted types.
*/
public static function getParameters(File $phpcsFile, $stackPtr, $limit = 0, $isShortArray = null)
{
@@ -385,10 +393,10 @@ public static function getParameters(File $phpcsFile, $stackPtr, $limit = 0, $is
* See {@see PassedParameters::getParameters()} for the format of the
* returned (single-dimensional) array.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the token passed is not one of the
- * accepted types or doesn't exist.
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If a function call parameter is requested and
- * the `$paramName` parameter is not passed.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not one of the accepted types.
+ * @throws \PHPCSUtils\Exceptions\MissingArgumentError If a function call parameter is requested and
+ * the `$paramName` parameter is not passed.
*/
public static function getParameter(File $phpcsFile, $stackPtr, $paramOffset, $paramNames = [])
{
@@ -430,8 +438,8 @@ public static function getParameter(File $phpcsFile, $stackPtr, $paramOffset, $p
*
* @return int
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the token passed is not one of the
- * accepted types or doesn't exist.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not one of the accepted types.
*/
public static function getParameterCount(File $phpcsFile, $stackPtr)
{
@@ -470,10 +478,9 @@ public static function getParameterCount(File $phpcsFile, $stackPtr)
* See {@see PassedParameters::getParameters()} for the format of the
* returned (single-dimensional) array.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the `$paramNames` parameter is not passed
- * and the requested parameter was not passed
- * as a positional parameter in the function call
- * being examined.
+ * @throws \PHPCSUtils\Exceptions\MissingArgumentError If the `$paramNames` parameter is not passed and the
+ * requested parameter was not passed as a positional
+ * parameter in the function call being examined.
*/
public static function getParameterFromStack(array $parameters, $paramOffset, $paramNames)
{
@@ -500,9 +507,7 @@ public static function getParameterFromStack(array $parameters, $paramOffset, $p
}
if (empty($paramNames) === true) {
- throw new RuntimeException(
- 'To allow for support for PHP 8 named parameters, the $paramNames parameter must be passed.'
- );
+ throw MissingArgumentError::create(3, '$paramNames', 'to allow for support for PHP 8 named parameters');
}
return false;
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php
index 76592a5..53bbff1 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php
@@ -10,9 +10,12 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
+use PHPCSUtils\Exceptions\ValueError;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Internal\NoFileCache;
use PHPCSUtils\Tokens\Collections;
@@ -72,10 +75,11 @@ final class TextStrings
*
* @return string The contents of the complete text string.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * valid text string token.
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not the _first_
- * token in a text string.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a valid text string token.
+ * @throws \PHPCSUtils\Exceptions\ValueError If the specified token is not the _first_ token in
+ * a text string.
*/
public static function getCompleteTextString(File $phpcsFile, $stackPtr, $stripQuotes = true)
{
@@ -118,27 +122,34 @@ public static function getCompleteTextString(File $phpcsFile, $stackPtr, $stripQ
*
* @return int Stack pointer to the last token in the text string.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * valid text string token.
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not the _first_
- * token in a text string.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a valid text string token.
+ * @throws \PHPCSUtils\Exceptions\ValueError If the specified token is not the _first_ token in
+ * a text string.
*/
public static function getEndOfCompleteTextString(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- // Must be the start of a text string token.
- if (isset($tokens[$stackPtr], Collections::textStringStartTokens()[$tokens[$stackPtr]['code']]) === false) {
- throw new RuntimeException(
- '$stackPtr must be of type T_START_HEREDOC, T_START_NOWDOC, T_CONSTANT_ENCAPSED_STRING'
- . ' or T_DOUBLE_QUOTED_STRING'
- );
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
}
+ if (isset(Collections::textStringStartTokens()[$tokens[$stackPtr]['code']]) === false) {
+ $acceptedTokens = 'T_START_HEREDOC, T_START_NOWDOC, T_CONSTANT_ENCAPSED_STRING or T_DOUBLE_QUOTED_STRING';
+ throw UnexpectedTokenType::create(2, '$stackPtr', $acceptedTokens, $tokens[$stackPtr]['type']);
+ }
+
+ // Must be the start of a text string token.
if (isset(Tokens::$stringTokens[$tokens[$stackPtr]['code']]) === true) {
$prev = $phpcsFile->findPrevious(\T_WHITESPACE, ($stackPtr - 1), null, true);
if ($tokens[$stackPtr]['code'] === $tokens[$prev]['code']) {
- throw new RuntimeException('$stackPtr must be the start of the text string');
+ throw ValueError::create(2, '$stackPtr', 'must be the start of the text string');
}
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TypeString.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TypeString.php
new file mode 100644
index 0000000..1a5a6b1
--- /dev/null
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TypeString.php
@@ -0,0 +1,403 @@
+
+ */
+ private static $keywordTypes = [
+ 'array' => 'array',
+ 'bool' => 'bool',
+ 'callable' => 'callable',
+ 'false' => 'false',
+ 'float' => 'float',
+ 'int' => 'int',
+ 'iterable' => 'iterable',
+ 'mixed' => 'mixed',
+ 'never' => 'never',
+ 'null' => 'null',
+ 'object' => 'object',
+ 'parent' => 'parent',
+ 'self' => 'self',
+ 'static' => 'static',
+ 'string' => 'string',
+ 'true' => 'true',
+ 'void' => 'void',
+ ];
+
+ /**
+ * Retrieve a list of all PHP native keyword types.
+ *
+ * @since 1.1.0
+ *
+ * @return array Key and value both contain the type name in lowercase.
+ */
+ public static function getKeywordTypes()
+ {
+ return self::$keywordTypes;
+ }
+
+ /**
+ * Check if a singular type is a PHP native keyword based type.
+ *
+ * @since 1.1.0
+ *
+ * @param string $type The singular type.
+ *
+ * @return bool
+ */
+ public static function isKeyword($type)
+ {
+ if (\is_string($type) === false) {
+ return false;
+ }
+
+ $typeLC = \strtolower(\trim($type));
+ return isset(self::$keywordTypes[$typeLC]);
+ }
+
+ /**
+ * Normalize the case for a single type.
+ *
+ * - Types which are recognized PHP "keyword" types will be returned in lowercase.
+ * - Class/Interface/Enum names will be returned in their original case.
+ *
+ * @since 1.1.0
+ *
+ * @param string $type Type to normalize the case for.
+ *
+ * @return string The case-normalized type or an empty string if the input was invalid.
+ */
+ public static function normalizeCase($type)
+ {
+ if (\is_string($type) === false) {
+ return '';
+ }
+
+ if (self::isKeyword($type)) {
+ return \strtolower($type);
+ }
+
+ return $type;
+ }
+
+ /**
+ * Check if a type string represents a plain, singular type.
+ *
+ * Note: Nullable types are not considered plain, singular types for the purposes of this method.
+ *
+ * @since 1.1.0
+ *
+ * @param string $typeString Type string.
+ *
+ * @return bool
+ */
+ public static function isSingular($typeString)
+ {
+ if (\is_string($typeString) === false) {
+ return false;
+ }
+
+ $typeString = \trim($typeString);
+
+ return empty($typeString) === false
+ && \strpos($typeString, '?') === false
+ && \strpos($typeString, '|') === false
+ && \strpos($typeString, '&') === false
+ && \strpos($typeString, '(') === false
+ && \strpos($typeString, ')') === false;
+ }
+
+ /**
+ * Check if a type string represents a nullable type.
+ *
+ * A nullable type in the context of this method is a type which
+ * - starts with the nullable operator and has something after it which is being made nullable;
+ * - or contains `null` as part of a union or DNF type.
+ *
+ * A stand-alone `null` type is not considered a nullable type, but a singular type.
+ *
+ * @since 1.1.0
+ *
+ * @param string $typeString Type string.
+ *
+ * @return bool
+ */
+ public static function isNullable($typeString)
+ {
+ if (\is_string($typeString) === false) {
+ return false;
+ }
+
+ $typeString = \trim($typeString);
+ if (empty($typeString) === true) {
+ return false;
+ }
+
+ // Check for plain nullable type with something which is being made nullable.
+ if (\preg_match('`^\?\s*[^|&()?\s]+`', $typeString) === 1) {
+ return true;
+ }
+
+ // Check for nullable union type.
+ $matched = \preg_match(
+ '`(?^|[^|&(?\s]+\s*\|)\s*null\s*(?\|\s*[^|&)?\s]+|$)`i',
+ $typeString,
+ $matches
+ );
+ return ($matched === 1
+ && (empty($matches['before']) === false || empty($matches['after']) === false));
+ }
+
+ /**
+ * Check if a type string represents a pure union type.
+ *
+ * Note: DNF types are not considered union types for the purpose of this method.
+ *
+ * @since 1.1.0
+ *
+ * @param string $typeString Type string.
+ *
+ * @return bool
+ */
+ public static function isUnion($typeString)
+ {
+ return \is_string($typeString)
+ && \strpos($typeString, '?') === false
+ && \strpos($typeString, '|') !== false
+ && \strpos($typeString, '&') === false
+ && \strpos($typeString, '(') === false
+ && \strpos($typeString, ')') === false
+ // Make sure there is always something before and after each |.
+ && \preg_match('`^[^|&()?\s]+(\s*\|\s*[^|&()?\s]+)+$`', $typeString) === 1;
+ }
+
+ /**
+ * Check if a type string represents a pure intersection type.
+ *
+ * Note: DNF types are not considered intersection types for the purpose of this method.
+ *
+ * @since 1.1.0
+ *
+ * @param string $typeString Type string.
+ *
+ * @return bool
+ */
+ public static function isIntersection($typeString)
+ {
+ return \is_string($typeString)
+ && \strpos($typeString, '?') === false
+ && \strpos($typeString, '|') === false
+ && \strpos($typeString, '&') !== false
+ && \strpos($typeString, '(') === false
+ && \strpos($typeString, ')') === false
+ // Make sure there is always something before and after each &.
+ && \preg_match('`^[^|&()?\s]+(\s*&\s*[^|&()?\s]+)+$`', $typeString) === 1;
+ }
+
+ /**
+ * Check if a type string represents a disjunctive normal form (DNF) type.
+ *
+ * This check for a strict
+ *
+ * @since 1.1.0
+ *
+ * @param string $typeString Type string.
+ *
+ * @return bool
+ */
+ public static function isDNF($typeString)
+ {
+ return \is_string($typeString)
+ && \strpos($typeString, '?') === false
+ && \strpos($typeString, '|') !== false
+ && \strpos($typeString, '&') !== false
+ && \strpos($typeString, '(') !== false
+ && \strpos($typeString, ')') !== false
+ // Now make sure that it is not a definitely invalid format.
+ && \preg_match(self::INVALID_DNF_REGEX, $typeString) !== 1;
+ }
+
+ /**
+ * Split a type string to its individual types and optionally normalize the case of the types.
+ *
+ * @since 1.1.0
+ *
+ * @param string $typeString Type to split.
+ * @param bool $normalize Whether or not to normalize the case of types.
+ * Defaults to true.
+ *
+ * @return array List containing all seen types in the order they were encountered.
+ *
+ * @throws \PHPCSUtils\Exceptions\TypeError If passed $typeString is not a string.
+ */
+ public static function toArray($typeString, $normalize = true)
+ {
+ if (\is_string($typeString) === false) {
+ throw TypeError::create(1, '$typeString', 'string', $typeString);
+ }
+
+ if (\trim($typeString) === '') {
+ return [];
+ }
+
+ $addNull = false;
+ if ($typeString[0] === '?') {
+ $addNull = true;
+ $typeString = \substr($typeString, 1);
+ }
+
+ $typeString = \preg_replace('`\s+`', '', $typeString);
+ $types = \preg_split('`[|&()]+`', $typeString, -1, \PREG_SPLIT_NO_EMPTY);
+
+ // Normalize the types.
+ if ($normalize === true) {
+ $types = \array_map([__CLASS__, 'normalizeCase'], $types);
+ }
+
+ if ($addNull === true) {
+ \array_unshift($types, 'null');
+ }
+
+ return $types;
+ }
+
+ /**
+ * Split a type string to the unique types included and optionally normalize the case of the types.
+ *
+ * @since 1.1.0
+ *
+ * @param string $typeString Type to split.
+ * @param bool $normalize Whether or not to normalize the case of types.
+ * Defaults to true.
+ *
+ * @return array Associative array with the unique types as both the key as well as the value.
+ *
+ * @throws \PHPCSUtils\Exceptions\TypeError If passed $typeString is not a string.
+ */
+ public static function toArrayUnique($typeString, $normalize = true)
+ {
+ $types = self::toArray($typeString, $normalize);
+ return \array_combine($types, $types);
+ }
+
+ /**
+ * Filter a list of types down to only the keyword based types.
+ *
+ * @since 1.1.0
+ *
+ * @param array $types Array of types.
+ * Typically, this is an array as retrieved from the
+ * {@see TypeString::toArray()} method or the
+ * {@see TypeString::toArrayUnique()} method.
+ *
+ * @return array Array with only the PHP native keyword based types.
+ * The result may be an empty array if the input array didn't contain
+ * any keyword based types or if the input was invalid.
+ */
+ public static function filterKeywordTypes(array $types)
+ {
+ return \array_filter($types, [__CLASS__, 'isKeyword']);
+ }
+
+ /**
+ * Filter a list of types down to only the OO name based types.
+ *
+ * @since 1.1.0
+ *
+ * @param array $types Array of types.
+ * Typically, this is an array as retrieved from the
+ * {@see TypeString::toArray()} method or the
+ * {@see TypeString::toArrayUnique()} method.
+ *
+ * @return array Array with only the OO name based types.
+ * The result may be an empty array if the input array didn't contain
+ * any OO name based types or if the input was invalid.
+ */
+ public static function filterOOTypes(array $types)
+ {
+ return \array_filter(
+ $types,
+ static function ($type) {
+ return \is_string($type) === true && self::isKeyword($type) === false;
+ }
+ );
+ }
+}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php
index 6e29f5f..7055fab 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php
@@ -10,9 +10,12 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
+use PHPCSUtils\Exceptions\ValueError;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Utils\Conditions;
use PHPCSUtils\Utils\Parentheses;
@@ -39,23 +42,24 @@ final class UseStatements
* the `T_USE` token is used for. An empty string being returned will
* normally mean the code being examined contains a parse error.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * `T_USE` token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_USE` token.
*/
public static function getType(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false
- || $tokens[$stackPtr]['code'] !== \T_USE
- ) {
- throw new RuntimeException('$stackPtr must be of type T_USE');
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
}
- $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
- if ($next === false) {
- // Live coding or parse error.
- return '';
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if ($tokens[$stackPtr]['code'] !== \T_USE) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_USE', $tokens[$stackPtr]['type']);
}
// More efficient & simpler check for closure use in PHPCS 4.x.
@@ -67,11 +71,18 @@ public static function getType(File $phpcsFile, $stackPtr)
$prev = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), null, true);
if ($prev !== false && $tokens[$prev]['code'] === \T_CLOSE_PARENTHESIS
- && Parentheses::isOwnerIn($phpcsFile, $prev, \T_CLOSURE) === true
+ // T_FUNCTION is included to handle certain parse errors, which are still clearly closure use, correctly.
+ && Parentheses::isOwnerIn($phpcsFile, $prev, [\T_CLOSURE, \T_FUNCTION]) === true
) {
return 'closure';
}
+ $next = $phpcsFile->findNext(Tokens::$emptyTokens, ($stackPtr + 1), null, true);
+ if ($next === false) {
+ // Live coding or parse error.
+ return '';
+ }
+
$lastCondition = Conditions::getLastCondition($phpcsFile, $stackPtr);
if ($lastCondition === false || $tokens[$lastCondition]['code'] === \T_NAMESPACE) {
// Global or scoped namespace and not a closure use statement.
@@ -100,8 +111,9 @@ public static function getType(File $phpcsFile, $stackPtr)
* @return bool `TRUE` if the token passed is a closure use statement.
* `FALSE` if it's not.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * `T_USE` token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_USE` token.
*/
public static function isClosureUse(File $phpcsFile, $stackPtr)
{
@@ -119,8 +131,9 @@ public static function isClosureUse(File $phpcsFile, $stackPtr)
* @return bool `TRUE` if the token passed is an import use statement.
* `FALSE` if it's not.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * `T_USE` token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_USE` token.
*/
public static function isImportUse(File $phpcsFile, $stackPtr)
{
@@ -138,8 +151,9 @@ public static function isImportUse(File $phpcsFile, $stackPtr)
* @return bool `TRUE` if the token passed is a trait use statement.
* `FALSE` if it's not.
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * `T_USE` token.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_USE` token.
*/
public static function isTraitUse(File $phpcsFile, $stackPtr)
{
@@ -183,17 +197,17 @@ public static function isTraitUse(File $phpcsFile, $stackPtr)
* )
* ```
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * `T_USE` token.
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the `T_USE` token is not for an import
- * use statement.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_USE` token.
+ * @throws \PHPCSUtils\Exceptions\ValueError If the `T_USE` token is not for an import use statement.
*/
public static function splitImportUseStatement(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if (self::isImportUse($phpcsFile, $stackPtr) === false) {
- throw new RuntimeException('$stackPtr must be an import use statement');
+ throw ValueError::create(2, '$stackPtr', 'must be the pointer to an import use statement');
}
if (Cache::isCached($phpcsFile, __METHOD__, $stackPtr) === true) {
@@ -375,7 +389,7 @@ public static function splitAndMergeImportUseStatement(File $phpcsFile, $stackPt
try {
$useStatements = self::splitImportUseStatement($phpcsFile, $stackPtr);
$previousUseStatements = self::mergeImportUseStatements($previousUseStatements, $useStatements);
- } catch (RuntimeException $e) {
+ } catch (ValueError $e) {
// Not an import use statement.
}
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php
index a97135f..817134c 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php
@@ -10,9 +10,12 @@
namespace PHPCSUtils\Utils;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\OutOfBoundsStackPtr;
+use PHPCSUtils\Exceptions\TypeError;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
+use PHPCSUtils\Exceptions\ValueError;
use PHPCSUtils\Internal\Cache;
use PHPCSUtils\Tokens\Collections;
use PHPCSUtils\Utils\Scopes;
@@ -77,7 +80,7 @@ final class Variables
* Retrieve the visibility and implementation properties of a class member variable.
*
* Main differences with the PHPCS version:
- * - Removed the parse error warning for properties in interfaces.
+ * - Removed the parse error warning for properties in enums (PHPCS 4.0 makes the same change).
* This will now throw the same _"$stackPtr is not a class member var"_ runtime exception as
* other non-property variables passed to the method.
* - Defensive coding against incorrect calls to this method.
@@ -99,8 +102,12 @@ final class Variables
* array(
* 'scope' => string, // Public, private, or protected.
* 'scope_specified' => boolean, // TRUE if the scope was explicitly specified.
+ * 'set_scope' => string|false, // Scope for asymmetric visibility.
+ * // Either public, private, or protected or
+ * // FALSE if no set scope is specified.
* 'is_static' => boolean, // TRUE if the static keyword was found.
* 'is_readonly' => boolean, // TRUE if the readonly keyword was found.
+ * 'is_final' => boolean, // TRUE if the final keyword was found.
* 'type' => string, // The type of the var (empty if no type specified).
* 'type_token' => integer|false, // The stack pointer to the start of the type
* // or FALSE if there is no type.
@@ -111,21 +118,29 @@ final class Variables
* );
* ```
*
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * `T_VARIABLE` token.
- * @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified position is not a
- * class member variable.
+ * @throws \PHPCSUtils\Exceptions\TypeError If the $stackPtr parameter is not an integer.
+ * @throws \PHPCSUtils\Exceptions\OutOfBoundsStackPtr If the token passed does not exist in the $phpcsFile.
+ * @throws \PHPCSUtils\Exceptions\UnexpectedTokenType If the token passed is not a `T_VARIABLE` token.
+ * @throws \PHPCSUtils\Exceptions\ValueError If the specified position is not a class member variable.
*/
public static function getMemberProperties(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- if (isset($tokens[$stackPtr]) === false || $tokens[$stackPtr]['code'] !== \T_VARIABLE) {
- throw new RuntimeException('$stackPtr must be of type T_VARIABLE');
+ if (\is_int($stackPtr) === false) {
+ throw TypeError::create(2, '$stackPtr', 'integer', $stackPtr);
+ }
+
+ if (isset($tokens[$stackPtr]) === false) {
+ throw OutOfBoundsStackPtr::create(2, '$stackPtr', $stackPtr);
+ }
+
+ if ($tokens[$stackPtr]['code'] !== \T_VARIABLE) {
+ throw UnexpectedTokenType::create(2, '$stackPtr', 'T_VARIABLE', $tokens[$stackPtr]['type']);
}
if (Scopes::isOOProperty($phpcsFile, $stackPtr) === false) {
- throw new RuntimeException('$stackPtr is not a class member var');
+ throw ValueError::create(2, '$stackPtr', 'must be the pointer to a class member var');
}
if (Cache::isCached($phpcsFile, __METHOD__, $stackPtr) === true) {
@@ -136,8 +151,10 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
$scope = 'public';
$scopeSpecified = false;
+ $setScope = false;
$isStatic = false;
$isReadonly = false;
+ $isFinal = false;
$startOfStatement = $phpcsFile->findPrevious(
[
@@ -167,12 +184,33 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
$scope = 'protected';
$scopeSpecified = true;
break;
+ case \T_PUBLIC_SET:
+ $setScope = 'public';
+ if ($scopeSpecified === false) {
+ $scope = 'public';
+ }
+ break;
+ case \T_PROTECTED_SET:
+ $setScope = 'protected';
+ if ($scopeSpecified === false) {
+ $scope = 'public';
+ }
+ break;
+ case \T_PRIVATE_SET:
+ $setScope = 'private';
+ if ($scopeSpecified === false) {
+ $scope = 'public';
+ }
+ break;
case \T_STATIC:
$isStatic = true;
break;
case \T_READONLY:
$isReadonly = true;
break;
+ case \T_FINAL:
+ $isFinal = true;
+ break;
}
}
@@ -212,8 +250,10 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
$returnValue = [
'scope' => $scope,
'scope_specified' => $scopeSpecified,
+ 'set_scope' => $setScope,
'is_static' => $isStatic,
'is_readonly' => $isReadonly,
+ 'is_final' => $isFinal,
'type' => $type,
'type_token' => $typeToken,
'type_end_token' => $typeEndToken,
diff --git a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml
index eefc6db..72cf3b4 100644
--- a/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml
+++ b/vendor/phpcsstandards/phpcsutils/PHPCSUtils/ruleset.xml
@@ -1,4 +1,4 @@
-
+Utility methods for external PHPCS standards.
diff --git a/vendor/phpcsstandards/phpcsutils/README.md b/vendor/phpcsstandards/phpcsutils/README.md
index c971fe4..09d034f 100644
--- a/vendor/phpcsstandards/phpcsutils/README.md
+++ b/vendor/phpcsstandards/phpcsutils/README.md
@@ -2,7 +2,7 @@
-[][phpcsutils-packagist]
+[][phpcsutils-packagist]
[][phpcsutils-releases]
:construction:
[](https://packagist.org/packages/phpcsstandards/phpcsutils#dev-develop)
@@ -13,10 +13,10 @@
[][phpcsutils-tests-gha]
[](https://coveralls.io/github/PHPCSStandards/PHPCSUtils?branch=develop)
-[][phpcsutils-packagist]
-[][phpcsutils-tests-gha]
+[][phpcsutils-packagist]
+[][phpcsutils-tests-gha]
-[](https://github.com/PHPCSStandards/PHPCSUtils/blob/stable/LICENSE)
+[](https://github.com/PHPCSStandards/PHPCSUtils/blob/stable/LICENSE)

@@ -46,7 +46,7 @@ Whether you need to split an `array` into the individual items, are trying to de
Includes improved versions of the PHPCS native utility functions and plenty of new utility functions.
-These functions are compatible with PHPCS 3.10.0 up to PHPCS `master`.
+These functions are compatible with PHPCS 3.13.0 up to PHPCS `4.x`.
### A collection of static properties and methods for often-used token groups
@@ -60,13 +60,13 @@ These classes take most of the heavy lifting away for some frequently occurring
### Test utilities
An abstract `UtilityMethodTestCase` class to support testing of your utility methods written for PHP_CodeSniffer.
-Supports PHPUnit 4.x up to 9.x.
+Supports PHPUnit 4.x up to 11.x.
### Use the latest version of PHP_CodeSniffer native utility functions
Normally to use the latest version of PHP_CodeSniffer native utility functions, you would have to raise the minimum requirements of your external PHPCS standard.
-Now you won't have to anymore. This package allows you to use the latest version of those utility functions in all PHP_CodeSniffer versions from PHPCS 3.10.0 and up.
+Now you won't have to anymore. This package allows you to use the latest version of those utility functions in all PHP_CodeSniffer versions from PHPCS 3.13.0 and up.
### Fully documented
@@ -78,7 +78,7 @@ To see detailed information about all the available abstract sniffs, utility fun
## Minimum Requirements
* PHP 5.4 or higher.
-* [PHP_CodeSniffer] 3.10.0+.
+* [PHP_CodeSniffer] 3.13.0+/4.0.0+.
* Recommended PHP extensions for optimal functionality:
- PCRE with Unicode support (normally enabled by default)
diff --git a/vendor/phpcsstandards/phpcsutils/composer.json b/vendor/phpcsstandards/phpcsutils/composer.json
index 80167bc..7fd8d7b 100644
--- a/vendor/phpcsstandards/phpcsutils/composer.json
+++ b/vendor/phpcsstandards/phpcsutils/composer.json
@@ -2,7 +2,7 @@
"name" : "phpcsstandards/phpcsutils",
"description" : "A suite of utility functions for use with PHP_CodeSniffer",
"type" : "phpcodesniffer-standard",
- "keywords" : [ "phpcs", "phpcbf", "standards", "static analysis", "php_codesniffer", "phpcs3", "tokens", "utility", "phpcodesniffer-standard" ],
+ "keywords" : [ "phpcs", "phpcbf", "standards", "static analysis", "php_codesniffer", "phpcs3", "phpcs4", "tokens", "utility", "phpcodesniffer-standard" ],
"license" : "LGPL-3.0-or-later",
"homepage": "https://phpcsutils.com/",
"authors" : [
@@ -24,15 +24,15 @@
},
"require" : {
"php" : ">=5.4",
- "squizlabs/php_codesniffer" : "^3.10.0 || 4.0.x-dev@dev",
+ "squizlabs/php_codesniffer" : "^3.13.0 || ^4.0",
"dealerdirect/phpcodesniffer-composer-installer" : "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0"
},
"require-dev" : {
"ext-filter": "*",
"phpcsstandards/phpcsdevcs": "^1.1.6",
- "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
"php-parallel-lint/php-console-highlighter": "^1.0",
- "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0"
+ "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
diff --git a/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php b/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php
index 0857fd1..39b47fc 100644
--- a/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php
+++ b/vendor/phpcsstandards/phpcsutils/phpcsutils-autoload.php
@@ -3,7 +3,6 @@
* PHPCSUtils, utility functions and classes for PHP_CodeSniffer sniff developers.
*
* Autoloader for the PHPCSUtils files.
- * Also provides PHPCS cross-version class aliases.
*
* - If an external standard only supports PHPCS >= 3.1.0 and uses the PHPCS
* native unit test framework, this file does not need to be included.
@@ -32,7 +31,7 @@
*/
spl_autoload_register(function ($fqClassName) {
// Only try & load our own classes.
- if (stripos($fqClassName, 'PHPCSUtils') !== 0) {
+ if (stripos($fqClassName, 'PHPCSUtils\\') !== 0) {
return;
}
diff --git a/vendor/squizlabs/php_codesniffer/CHANGELOG.md b/vendor/squizlabs/php_codesniffer/CHANGELOG.md
index dcccd5f..7aadb84 100644
--- a/vendor/squizlabs/php_codesniffer/CHANGELOG.md
+++ b/vendor/squizlabs/php_codesniffer/CHANGELOG.md
@@ -6,6 +6,58 @@ The file documents changes to the PHP_CodeSniffer project.
_Nothing yet._
+## [3.13.1] - 2025-06-12
+
+### Added
+- Added support for PHP 8.4 properties with asymmetric visibility to File::getMemberProperties() through a new `set_scope` array index in the return value. [#1116]
+ - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patches.
+- Added support for PHP 8.4 (constructor promoted) properties with asymmetric visibility to File::getMethodParameters() through new `set_visibility` and `set_visibility_token` array indexes in the return value. [#1116]
+ - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patches.
+- Added support for PHP 8.4 asymmetric visibility modifiers to the following sniffs:
+ - Generic.PHP.LowerCaseKeyword [#1117]
+ - PEAR.NamingConventions.ValidVariableName [#1118]
+ - PSR2.Classes.PropertyDeclaration [#1119]
+ - Squiz.Commenting.BlockComment [#1120]
+ - Squiz.Commenting.DocCommentAlignment [#1120]
+ - Squiz.Commenting.VariableComment [#1120]
+ - Squiz.Functions.FunctionDeclarationArgumentSpacing [#1121]
+ - Squiz.Scope.MemberVarScope [#1122]
+ - Squiz.WhiteSpace.MemberVarSpacing [#1123]
+ - Squiz.WhiteSpace.ScopeKeywordSpacing [#1124]
+ - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patches.
+
+### Changed
+- The PSR2.Classes.PropertyDeclaration will now check that a set-visibility modifier keyword is placed after a potential general visibility keyword. [#1119]
+ - Errors will be reported via a new `AvizKeywordOrder` error code.
+ - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch.
+- The Squiz.Functions.FunctionDeclarationArgumentSpacing will now check spacing after a set-visibility modifier keyword. [#1121]
+ - Errors will be reported via a new `SpacingAfterSetVisbility` error code.
+ - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch.
+- The Squiz.Scope.MemberVarScope will now flag missing "read" visibility, when "write" visibility is set, under a separate error code `AsymReadMissing`. [#1122]
+ - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch.
+- The documentation for the following sniffs has been improved:
+ - PEAR.Classes.ClassDeclaration
+ - Squiz.WhiteSpace.FunctionOpeningBraceSpace
+ - Thanks to [Brian Dunne][@braindawg] and [Rodrigo Primo][@rodrigoprimo] for the patches.
+- Various housekeeping, including improvements to the tests and documentation.
+ - Thanks to [Dan Wallis][@fredden], [Rodrigo Primo][@rodrigoprimo] and [Juliette Reinders Folmer][@jrfnl] for their contributions.
+
+### Other
+- The latest PHP_CodeSniffer XSD file is now available via the following permalink: . [#1094]
+ Older XSD files can be referenced via permalinks based on their minor: `https://schema.phpcodesniffer.com/#.#/phpcs.xsd`.
+
+[#1094]: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/1094
+[#1116]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1116
+[#1117]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1117
+[#1118]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1118
+[#1119]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1119
+[#1120]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1120
+[#1121]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1121
+[#1122]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1122
+[#1123]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1123
+[#1124]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/1124
+
+
## [3.13.0] - 2025-05-11
### Added
@@ -7582,6 +7634,7 @@ Additionally, thanks to [Alexander Turek][@derrabus] for consulting on the repo
-->
[Unreleased]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/master...HEAD
+[3.13.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.13.0...3.13.1
[3.13.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.12.2...3.13.0
[3.12.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.12.1...3.12.2
[3.12.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.12.0...3.12.1
diff --git a/vendor/squizlabs/php_codesniffer/README.md b/vendor/squizlabs/php_codesniffer/README.md
index 9a500ed..eae6436 100644
--- a/vendor/squizlabs/php_codesniffer/README.md
+++ b/vendor/squizlabs/php_codesniffer/README.md
@@ -2,7 +2,7 @@
-[](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases)
+[](https://github.com/PHPCSStandards/PHP_CodeSniffer/releases)
[](https://github.com/PHPCSStandards/PHP_CodeSniffer/actions/workflows/validate.yml)
[][GHA-test]
[](https://coveralls.io/github/PHPCSStandards/PHP_CodeSniffer?branch=master)
diff --git a/vendor/squizlabs/php_codesniffer/src/Config.php b/vendor/squizlabs/php_codesniffer/src/Config.php
index 22c75b7..879e7e2 100644
--- a/vendor/squizlabs/php_codesniffer/src/Config.php
+++ b/vendor/squizlabs/php_codesniffer/src/Config.php
@@ -85,7 +85,7 @@ class Config
*
* @var string
*/
- const VERSION = '3.13.0';
+ const VERSION = '3.13.1';
/**
* Package stability; either stable, beta or alpha.
@@ -1704,11 +1704,6 @@ public static function getAllConfigData()
$configFile = dirname($path).DIRECTORY_SEPARATOR.'CodeSniffer.conf';
} else {
$configFile = dirname(__DIR__).DIRECTORY_SEPARATOR.'CodeSniffer.conf';
- if (is_file($configFile) === false
- && strpos('@data_dir@', '@data_dir') === false
- ) {
- $configFile = '@data_dir@/PHP_CodeSniffer/CodeSniffer.conf';
- }
}
if (is_file($configFile) === false) {
diff --git a/vendor/squizlabs/php_codesniffer/src/Files/File.php b/vendor/squizlabs/php_codesniffer/src/Files/File.php
index e63d09f..fe3b7b1 100644
--- a/vendor/squizlabs/php_codesniffer/src/Files/File.php
+++ b/vendor/squizlabs/php_codesniffer/src/Files/File.php
@@ -1354,6 +1354,10 @@ public function getDeclarationName($stackPtr)
* 'readonly_token' => integer, // The stack pointer to the readonly modifier token.
* // This index will only be set if the property is readonly.
*
+ * ... and if the promoted property uses asymmetric visibility, these additional array indexes will also be available:
+ * 'set_visibility' => string, // The property set-visibility as declared.
+ * 'set_visibility_token' => integer, // The stack pointer to the set-visibility modifier token.
+ *
* @param int $stackPtr The position in the stack of the function token
* to acquire the parameters for.
*
@@ -1406,10 +1410,11 @@ public function getMethodParameters($stackPtr)
$variadicToken = false;
$typeHint = '';
$typeHintToken = false;
- $typeHintEndToken = false;
- $nullableType = false;
- $visibilityToken = null;
- $readonlyToken = null;
+ $typeHintEndToken = false;
+ $nullableType = false;
+ $visibilityToken = null;
+ $setVisibilityToken = null;
+ $readonlyToken = null;
for ($i = $paramStart; $i <= $closer; $i++) {
// Check to see if this token has a parenthesis or bracket opener. If it does
@@ -1541,6 +1546,13 @@ public function getMethodParameters($stackPtr)
$visibilityToken = $i;
}
break;
+ case T_PUBLIC_SET:
+ case T_PROTECTED_SET:
+ case T_PRIVATE_SET:
+ if ($defaultStart === null) {
+ $setVisibilityToken = $i;
+ }
+ break;
case T_READONLY:
if ($defaultStart === null) {
$readonlyToken = $i;
@@ -1575,16 +1587,21 @@ public function getMethodParameters($stackPtr)
$vars[$paramCount]['type_hint_end_token'] = $typeHintEndToken;
$vars[$paramCount]['nullable_type'] = $nullableType;
- if ($visibilityToken !== null || $readonlyToken !== null) {
+ if ($visibilityToken !== null || $setVisibilityToken !== null || $readonlyToken !== null) {
$vars[$paramCount]['property_visibility'] = 'public';
$vars[$paramCount]['visibility_token'] = false;
- $vars[$paramCount]['property_readonly'] = false;
if ($visibilityToken !== null) {
$vars[$paramCount]['property_visibility'] = $this->tokens[$visibilityToken]['content'];
$vars[$paramCount]['visibility_token'] = $visibilityToken;
}
+ if ($setVisibilityToken !== null) {
+ $vars[$paramCount]['set_visibility'] = $this->tokens[$setVisibilityToken]['content'];
+ $vars[$paramCount]['set_visibility_token'] = $setVisibilityToken;
+ }
+
+ $vars[$paramCount]['property_readonly'] = false;
if ($readonlyToken !== null) {
$vars[$paramCount]['property_readonly'] = true;
$vars[$paramCount]['readonly_token'] = $readonlyToken;
@@ -1598,21 +1615,22 @@ public function getMethodParameters($stackPtr)
}
// Reset the vars, as we are about to process the next parameter.
- $currVar = null;
- $paramStart = ($i + 1);
- $defaultStart = null;
- $equalToken = null;
- $hasAttributes = false;
- $passByReference = false;
- $referenceToken = false;
- $variableLength = false;
- $variadicToken = false;
- $typeHint = '';
- $typeHintToken = false;
- $typeHintEndToken = false;
- $nullableType = false;
- $visibilityToken = null;
- $readonlyToken = null;
+ $currVar = null;
+ $paramStart = ($i + 1);
+ $defaultStart = null;
+ $equalToken = null;
+ $hasAttributes = false;
+ $passByReference = false;
+ $referenceToken = false;
+ $variableLength = false;
+ $variadicToken = false;
+ $typeHint = '';
+ $typeHintToken = false;
+ $typeHintEndToken = false;
+ $nullableType = false;
+ $visibilityToken = null;
+ $setVisibilityToken = null;
+ $readonlyToken = null;
$paramCount++;
break;
@@ -1827,6 +1845,9 @@ public function getMethodProperties($stackPtr)
* array(
* 'scope' => string, // Public, private, or protected.
* 'scope_specified' => boolean, // TRUE if the scope was explicitly specified.
+ * 'set_scope' => string|false, // Scope for asymmetric visibility.
+ * // Either public, private, or protected or
+ * // FALSE if no set scope is specified.
* 'is_static' => boolean, // TRUE if the static keyword was found.
* 'is_readonly' => boolean, // TRUE if the readonly keyword was found.
* 'is_final' => boolean, // TRUE if the final keyword was found.
@@ -1896,19 +1917,18 @@ public function getMemberProperties($stackPtr)
}
$valid = [
- T_PUBLIC => T_PUBLIC,
- T_PRIVATE => T_PRIVATE,
- T_PROTECTED => T_PROTECTED,
- T_STATIC => T_STATIC,
- T_VAR => T_VAR,
- T_READONLY => T_READONLY,
- T_FINAL => T_FINAL,
+ T_STATIC => T_STATIC,
+ T_VAR => T_VAR,
+ T_READONLY => T_READONLY,
+ T_FINAL => T_FINAL,
];
+ $valid += Tokens::$scopeModifiers;
$valid += Tokens::$emptyTokens;
$scope = 'public';
$scopeSpecified = false;
+ $setScope = false;
$isStatic = false;
$isReadonly = false;
$isFinal = false;
@@ -1941,6 +1961,15 @@ public function getMemberProperties($stackPtr)
$scope = 'protected';
$scopeSpecified = true;
break;
+ case T_PUBLIC_SET:
+ $setScope = 'public';
+ break;
+ case T_PROTECTED_SET:
+ $setScope = 'protected';
+ break;
+ case T_PRIVATE_SET:
+ $setScope = 'private';
+ break;
case T_STATIC:
$isStatic = true;
break;
@@ -2004,6 +2033,7 @@ public function getMemberProperties($stackPtr)
return [
'scope' => $scope,
'scope_specified' => $scopeSpecified,
+ 'set_scope' => $setScope,
'is_static' => $isStatic,
'is_readonly' => $isReadonly,
'is_final' => $isFinal,
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php
index 7688647..c547fa9 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/PHP/LowerCaseKeywordSniff.php
@@ -33,6 +33,9 @@ public function register()
T_MATCH_DEFAULT => T_MATCH_DEFAULT,
T_PARENT => T_PARENT,
T_SELF => T_SELF,
+ T_PUBLIC_SET => T_PUBLIC_SET,
+ T_PROTECTED_SET => T_PROTECTED_SET,
+ T_PRIVATE_SET => T_PRIVATE_SET,
];
return $targets;
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.1.inc
index f13253d..1e3d9bb 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.1.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/UnusedFunctionParameterUnitTest.1.inc
@@ -140,11 +140,11 @@ function moreParamSecond(LogicException $bar, Exception $foo) {
// phpcs:set Generic.CodeAnalysis.UnusedFunctionParameter ignoreTypeHints[]
class ConstructorPropertyPromotionNoContentInMethod {
- public function __construct(protected int $id) {}
+ public function __construct(protected int $id, private(set) $foo) {}
}
class ConstructorPropertyPromotionWithContentInMethod {
- public function __construct(protected int $id, $toggle = true) {
+ public function __construct(protected int $id, private(set) $foo, $toggle = true) {
if ($toggle === true) {
doSomething();
}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc
index 10d3ed6..c39a8d2 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc
@@ -60,5 +60,17 @@ $c = function() {
FROM fun();
}
+class AsymmetricVisibility {
+ public(set) int $correctPublicSet;
+ protected(set) int $correctProtectedSet;
+ private(set) int $correctPrivateSet;
+
+ PubliC(SeT) int $wrongCasePublic;
+ PROTECTED(set) array $wrongCaseProtected;
+ protected(sEt) int $wrongCaseProtectedSet;
+ Private(set) int $wrongCasePrivate;
+ private(SET) readonly ?string $wrongCasePrivateSet;
+}
+
__HALT_COMPILER(); // An exception due to phar support.
function
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed
index 547f72f..ebb05d1 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.inc.fixed
@@ -60,5 +60,17 @@ $c = function() {
from fun();
}
+class AsymmetricVisibility {
+ public(set) int $correctPublicSet;
+ protected(set) int $correctProtectedSet;
+ private(set) int $correctPrivateSet;
+
+ public(set) int $wrongCasePublic;
+ protected(set) array $wrongCaseProtected;
+ protected(set) int $wrongCaseProtectedSet;
+ private(set) int $wrongCasePrivate;
+ private(set) readonly ?string $wrongCasePrivateSet;
+}
+
__HALT_COMPILER(); // An exception due to phar support.
function
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php
index 31bfad6..90e6be0 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseKeywordUnitTest.php
@@ -55,6 +55,11 @@ public function getErrorList()
57 => 2,
58 => 1,
60 => 1,
+ 68 => 1,
+ 69 => 1,
+ 70 => 1,
+ 71 => 1,
+ 72 => 1,
];
}//end getErrorList()
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc
index fb5b1fd..7474310 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc
@@ -75,7 +75,7 @@ class TypedProperties
}
class ConstructorPropertyPromotionWithTypes {
- public function __construct(protected Float|Int $x, public ?STRING &$y = 'test', private mixed $z) {}
+ public function __construct(protected Float|Int $x, public(set) ?STRING &$y = 'test', private mixed $z) {}
}
class ConstructorPropertyPromotionAndNormalParams {
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed
index 10be06b..4814ea8 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/LowerCaseTypeUnitTest.inc.fixed
@@ -75,7 +75,7 @@ class TypedProperties
}
class ConstructorPropertyPromotionWithTypes {
- public function __construct(protected float|int $x, public ?string &$y = 'test', private mixed $z) {}
+ public function __construct(protected float|int $x, public(set) ?string &$y = 'test', private mixed $z) {}
}
class ConstructorPropertyPromotionAndNormalParams {
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc
index 7d81893..4d0ca8f 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc
@@ -105,3 +105,11 @@ class SkipOverPHP84FinalProperties {
final MyType|false $propA;
private static final null|MyClass $propB;
}
+
+// PHP 8.4 asymmetric visibility
+class WithAsym {
+ private(set) null|true $asym1 = TRUE;
+ public private(set) ?bool $asym2 = false;
+ protected(set) false|string|null $asym3 = null;
+ public protected(set) Type|null|bool $asym4 = true;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed
index 26e20f2..831f116 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.inc.fixed
@@ -105,3 +105,11 @@ class SkipOverPHP84FinalProperties {
final MyType|false $propA;
private static final null|MyClass $propB;
}
+
+// PHP 8.4 asymmetric visibility
+class WithAsym {
+ private(set) null|true $asym1 = TRUE;
+ public private(set) ?bool $asym2 = FALSE;
+ protected(set) false|string|null $asym3 = NULL;
+ public protected(set) Type|null|bool $asym4 = TRUE;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php
index 481c4ab..7738b94 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/UpperCaseConstantUnitTest.php
@@ -31,27 +31,30 @@ final class UpperCaseConstantUnitTest extends AbstractSniffUnitTest
public function getErrorList()
{
return [
- 7 => 1,
- 10 => 1,
- 15 => 1,
- 16 => 1,
- 23 => 1,
- 26 => 1,
- 31 => 1,
- 32 => 1,
- 39 => 1,
- 42 => 1,
- 47 => 1,
- 48 => 1,
- 70 => 1,
- 71 => 1,
- 85 => 1,
- 87 => 1,
- 88 => 1,
- 90 => 2,
- 92 => 2,
- 93 => 1,
- 98 => 2,
+ 7 => 1,
+ 10 => 1,
+ 15 => 1,
+ 16 => 1,
+ 23 => 1,
+ 26 => 1,
+ 31 => 1,
+ 32 => 1,
+ 39 => 1,
+ 42 => 1,
+ 47 => 1,
+ 48 => 1,
+ 70 => 1,
+ 71 => 1,
+ 85 => 1,
+ 87 => 1,
+ 88 => 1,
+ 90 => 2,
+ 92 => 2,
+ 93 => 1,
+ 98 => 2,
+ 112 => 1,
+ 113 => 1,
+ 114 => 1,
];
}//end getErrorList()
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml
index b5d53fd..c6de4fe 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Docs/Classes/ClassDeclarationStandard.xml
@@ -1,7 +1,7 @@
-
+
@@ -12,10 +12,64 @@ class Foo
}
]]>
-
+
{
+class BraceOnSignatureLine {
}
+
+class BlankLineBetween
+
+{
+}
+ ]]>
+
+
+
+
+ {
+}
+ ]]>
+
+
+ public function __construct() {}
+}
+ ]]>
+
+
+
+
+
+
+
+ {
+ }
+}
+
+class NotIndented
+{
+}
+ ]]>
+
+
+ {
+}
+}
+
+class NotIndented
+ {
+ }
]]>
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
index 48674b1..4836380 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/NamingConventions/ValidVariableNameSniff.php
@@ -37,6 +37,10 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
$memberName = ltrim($tokens[$stackPtr]['content'], '$');
$scope = $memberProps['scope'];
$scopeSpecified = $memberProps['scope_specified'];
+ if ($scopeSpecified === false && $memberProps['set_scope'] !== false) {
+ // Implicit `public` visibility for property with asymmetric visibility.
+ $scopeSpecified = true;
+ }
if ($memberProps['scope'] === 'private') {
$isPublic = false;
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc
index 2503f59..f134c16 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/Functions/ValidDefaultValueUnitTest.1.inc
@@ -109,7 +109,7 @@ class OnlyConstructorPropertyPromotion {
class ConstructorPropertyPromotionMixedWithNormalParams {
public function __construct(
- public string $name = '',
+ public(set) string $name = '',
?int $optionalParam = 0,
mixed $requiredParam,
) {}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc
index 3c03da3..e99dda1 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.inc
@@ -99,3 +99,17 @@ $util->setLogger(
private $varName = 'hello';
private $_varName = 'hello';
});
+
+class AsymVisibility {
+ // The read scope is public, but not specified. Enforce the naming conventions anyway.
+ private(set) $asymPublicImplied = 'hello';
+ private(set) $_asymPublicImplied = 'hello';
+
+ // The read scope is private, so these properties should be handled as private properties.
+ private private(set) $asymPrivate = 'hello';
+ private(set) private $_asymPrivate = 'hello';
+
+ // The read scope is public/protected, so these properties should be handled as public properties.
+ public private(set) $asymPublicPrivate = 'hello';
+ private(set) protected $_asymPrivateProtected = 'hello';
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php
index c98af3b..c13fb14 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Tests/NamingConventions/ValidVariableNameUnitTest.php
@@ -31,13 +31,16 @@ final class ValidVariableNameUnitTest extends AbstractSniffUnitTest
public function getErrorList()
{
return [
- 12 => 1,
- 17 => 1,
- 22 => 1,
- 92 => 1,
- 93 => 1,
- 94 => 1,
- 99 => 1,
+ 12 => 1,
+ 17 => 1,
+ 22 => 1,
+ 92 => 1,
+ 93 => 1,
+ 94 => 1,
+ 99 => 1,
+ 106 => 1,
+ 109 => 1,
+ 114 => 1,
];
}//end getErrorList()
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php
index 70828bb..8613f34 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Classes/PropertyDeclarationSniff.php
@@ -114,30 +114,64 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
}//end if
}//end if
- if ($propertyInfo['scope_specified'] === false) {
+ if ($propertyInfo['scope_specified'] === false && $propertyInfo['set_scope'] === false) {
$error = 'Visibility must be declared on property "%s"';
$data = [$tokens[$stackPtr]['content']];
$phpcsFile->addError($error, $stackPtr, 'ScopeMissing', $data);
}
/*
- * Note: per PSR-PER section 4.6, the order should be:
+ * Note: per PSR-PER section 4.6 v 2.1/3.0, the order should be:
* - Inheritance modifier: `abstract` or `final`.
* - Visibility modifier: `public`, `protected`, or `private`.
+ * - Set-visibility modifier: `public(set)`, `protected(set)`, or `private(set)`
* - Scope modifier: `static`.
* - Mutation modifier: `readonly`.
* - Type declaration.
* - Name.
*
- * Ref: https://www.php-fig.org/per/coding-style/#46-modifier-keywords
+ * Ref:
+ * - https://www.php-fig.org/per/coding-style/#46-modifier-keywords
+ * - https://github.com/php-fig/per-coding-style/pull/99
*
* The `static` and `readonly` modifiers are mutually exclusive and cannot be used together.
*
* Based on that, the below modifier keyword order checks are sufficient (for now).
*/
- if ($propertyInfo['scope_specified'] === true && $propertyInfo['is_final'] === true) {
- $scopePtr = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($stackPtr - 1));
+ $hasVisibilityModifier = ($propertyInfo['scope_specified'] === true || $propertyInfo['set_scope'] !== false);
+ $lastVisibilityModifier = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($stackPtr - 1));
+ $firstVisibilityModifier = $lastVisibilityModifier;
+
+ if ($propertyInfo['scope_specified'] === true && $propertyInfo['set_scope'] !== false) {
+ $scopePtr = $phpcsFile->findPrevious([T_PUBLIC, T_PROTECTED, T_PRIVATE], ($stackPtr - 1));
+ $setScopePtr = $phpcsFile->findPrevious([T_PUBLIC_SET, T_PROTECTED_SET, T_PRIVATE_SET], ($stackPtr - 1));
+ if ($scopePtr > $setScopePtr) {
+ $error = 'The "read"-visibility must come before the "write"-visibility';
+ $fix = $phpcsFile->addFixableError($error, $stackPtr, 'AvizKeywordOrder');
+ if ($fix === true) {
+ $phpcsFile->fixer->beginChangeset();
+
+ for ($i = ($scopePtr + 1); $scopePtr < $stackPtr; $i++) {
+ if ($tokens[$i]['code'] !== T_WHITESPACE) {
+ break;
+ }
+
+ $phpcsFile->fixer->replaceToken($i, '');
+ }
+
+ $phpcsFile->fixer->replaceToken($scopePtr, '');
+ $phpcsFile->fixer->addContentBefore($setScopePtr, $tokens[$scopePtr]['content'].' ');
+
+ $phpcsFile->fixer->endChangeset();
+ }
+ }
+
+ $firstVisibilityModifier = min($scopePtr, $setScopePtr);
+ }//end if
+
+ if ($hasVisibilityModifier === true && $propertyInfo['is_final'] === true) {
+ $scopePtr = $firstVisibilityModifier;
$finalPtr = $phpcsFile->findPrevious(T_FINAL, ($stackPtr - 1));
if ($finalPtr > $scopePtr) {
$error = 'The final declaration must come before the visibility declaration';
@@ -161,8 +195,8 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
}
}//end if
- if ($propertyInfo['scope_specified'] === true && $propertyInfo['is_static'] === true) {
- $scopePtr = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($stackPtr - 1));
+ if ($hasVisibilityModifier === true && $propertyInfo['is_static'] === true) {
+ $scopePtr = $lastVisibilityModifier;
$staticPtr = $phpcsFile->findPrevious(T_STATIC, ($stackPtr - 1));
if ($scopePtr > $staticPtr) {
$error = 'The static declaration must come after the visibility declaration';
@@ -170,7 +204,7 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
if ($fix === true) {
$phpcsFile->fixer->beginChangeset();
- for ($i = ($scopePtr + 1); $scopePtr < $stackPtr; $i++) {
+ for ($i = ($staticPtr + 1); $staticPtr < $stackPtr; $i++) {
if ($tokens[$i]['code'] !== T_WHITESPACE) {
break;
}
@@ -178,16 +212,16 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
$phpcsFile->fixer->replaceToken($i, '');
}
- $phpcsFile->fixer->replaceToken($scopePtr, '');
- $phpcsFile->fixer->addContentBefore($staticPtr, $propertyInfo['scope'].' ');
+ $phpcsFile->fixer->replaceToken($staticPtr, '');
+ $phpcsFile->fixer->addContent($scopePtr, ' '.$tokens[$staticPtr]['content']);
$phpcsFile->fixer->endChangeset();
}
}
}//end if
- if ($propertyInfo['scope_specified'] === true && $propertyInfo['is_readonly'] === true) {
- $scopePtr = $phpcsFile->findPrevious(Tokens::$scopeModifiers, ($stackPtr - 1));
+ if ($hasVisibilityModifier === true && $propertyInfo['is_readonly'] === true) {
+ $scopePtr = $lastVisibilityModifier;
$readonlyPtr = $phpcsFile->findPrevious(T_READONLY, ($stackPtr - 1));
if ($scopePtr > $readonlyPtr) {
$error = 'The readonly declaration must come after the visibility declaration';
@@ -195,7 +229,7 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
if ($fix === true) {
$phpcsFile->fixer->beginChangeset();
- for ($i = ($scopePtr + 1); $scopePtr < $stackPtr; $i++) {
+ for ($i = ($readonlyPtr + 1); $readonlyPtr < $stackPtr; $i++) {
if ($tokens[$i]['code'] !== T_WHITESPACE) {
break;
}
@@ -203,8 +237,8 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
$phpcsFile->fixer->replaceToken($i, '');
}
- $phpcsFile->fixer->replaceToken($scopePtr, '');
- $phpcsFile->fixer->addContentBefore($readonlyPtr, $propertyInfo['scope'].' ');
+ $phpcsFile->fixer->replaceToken($readonlyPtr, '');
+ $phpcsFile->fixer->addContent($scopePtr, ' '.$tokens[$readonlyPtr]['content']);
$phpcsFile->fixer->endChangeset();
}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc
index 6aa9ffb..2e1785a 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc
@@ -109,4 +109,20 @@ class AsymmetricVisibility {
protected(set) public int $wrongOrder1;
private(set) protected ?string $wrongOrder2;
+
+ final protected private(set) static bool $correctOrder;
+
+ private(set) static final protected bool $wrongOrder3;
+ private(set) static protected final bool $wrongOrder4;
+ final protected(set) static public bool $wrongOrder5;
+ static public(set) final public bool $wrongOrder6;
+
+ protected private(set) static final bool $wrongOrder7;
+ protected final private(set) static bool $wrongOrder8;
+ static public final protected(set) bool $wrongOrder9;
+ public static public(set) final bool $wrongOrder10;
+
+ private(set) static final bool $wrongOrder11;
+ final static protected(set) bool $wrongOrder12;
+ static public(set) final bool $wrongOrder13;
}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed
index efb6a0d..b398e2f 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.inc.fixed
@@ -37,8 +37,8 @@ class ABC {
private static $propC;
public static $propD;
protected static
- $propE;
- private static /*comment*/ $propF;
+ $propE;
+ private static /*comment*/ $propF;
}
class MyClass
@@ -103,7 +103,23 @@ class AsymmetricVisibility {
protected(set) array $unfixed;
- protected(set) public int $wrongOrder1;
+ public protected(set) int $wrongOrder1;
- private(set) protected ?string $wrongOrder2;
+ protected private(set) ?string $wrongOrder2;
+
+ final protected private(set) static bool $correctOrder;
+
+ final protected private(set) static bool $wrongOrder3;
+ final protected private(set) static bool $wrongOrder4;
+ final public protected(set) static bool $wrongOrder5;
+ final public public(set) static bool $wrongOrder6;
+
+ final protected private(set) static bool $wrongOrder7;
+ final protected private(set) static bool $wrongOrder8;
+ final public protected(set) static bool $wrongOrder9;
+ final public public(set) static bool $wrongOrder10;
+
+ final private(set) static bool $wrongOrder11;
+ final protected(set) static bool $wrongOrder12;
+ final public(set) static bool $wrongOrder13;
}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php
index 70abcec..bce3d9f 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Tests/Classes/PropertyDeclarationUnitTest.php
@@ -61,11 +61,21 @@ public function getErrorList()
95 => 1,
96 => 1,
97 => 2,
- 101 => 2,
+ 101 => 1,
105 => 1,
- 107 => 1,
109 => 1,
111 => 1,
+ 115 => 3,
+ 116 => 3,
+ 117 => 2,
+ 118 => 3,
+ 120 => 1,
+ 121 => 1,
+ 122 => 2,
+ 123 => 2,
+ 125 => 1,
+ 126 => 1,
+ 127 => 2,
];
}//end getErrorList()
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceSpaceStandard.xml b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceSpaceStandard.xml
index 28fa712..c0663c2 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceSpaceStandard.xml
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/WhiteSpace/FunctionOpeningBraceSpaceStandard.xml
@@ -1,24 +1,9 @@
-
+
-
-
- {
-}
- ]]>
-
-
- {
-}
- ]]>
-
-
true,
T_INTERFACE => true,
T_TRAIT => true,
T_ENUM => true,
T_FUNCTION => true,
- T_PUBLIC => true,
- T_PRIVATE => true,
T_FINAL => true,
- T_PROTECTED => true,
T_STATIC => true,
T_ABSTRACT => true,
T_CONST => true,
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php
index 332de56..13099c8 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/DocCommentAlignmentSniff.php
@@ -52,7 +52,7 @@ public function process(File $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
- // We are only interested in function/class/interface doc block comments.
+ // We are only interested in function/class/interface/enum/property/const doc block comments.
$ignore = Tokens::$emptyTokens;
if ($phpcsFile->tokenizerType === 'JS') {
$ignore[] = T_EQUAL;
@@ -61,15 +61,14 @@ public function process(File $phpcsFile, $stackPtr)
}
$nextToken = $phpcsFile->findNext($ignore, ($stackPtr + 1), null, true);
- $ignore = [
+
+ $ignore = Tokens::$scopeModifiers;
+ $ignore += [
T_CLASS => true,
T_INTERFACE => true,
T_ENUM => true,
T_ENUM_CASE => true,
T_FUNCTION => true,
- T_PUBLIC => true,
- T_PRIVATE => true,
- T_PROTECTED => true,
T_STATIC => true,
T_ABSTRACT => true,
T_FINAL => true,
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php
index b992575..afb1be0 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php
@@ -12,6 +12,7 @@
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\AbstractVariableSniff;
use PHP_CodeSniffer\Util\Common;
+use PHP_CodeSniffer\Util\Tokens;
class VariableCommentSniff extends AbstractVariableSniff
{
@@ -28,11 +29,9 @@ class VariableCommentSniff extends AbstractVariableSniff
*/
public function processMemberVar(File $phpcsFile, $stackPtr)
{
- $tokens = $phpcsFile->getTokens();
- $ignore = [
- T_PUBLIC => T_PUBLIC,
- T_PRIVATE => T_PRIVATE,
- T_PROTECTED => T_PROTECTED,
+ $tokens = $phpcsFile->getTokens();
+ $ignore = Tokens::$scopeModifiers;
+ $ignore += [
T_VAR => T_VAR,
T_STATIC => T_STATIC,
T_READONLY => T_READONLY,
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php
index 26fd541..1fd34fc 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Functions/FunctionDeclarationArgumentSpacingSniff.php
@@ -340,6 +340,40 @@ public function processBracket($phpcsFile, $openBracket)
}//end if
}//end if
+ if (isset($param['set_visibility_token']) === true && $param['set_visibility_token'] !== false) {
+ $visibilityToken = $param['set_visibility_token'];
+ $afterVisibilityToken = $phpcsFile->findNext(T_WHITESPACE, ($visibilityToken + 1), $param['token'], true);
+
+ $spacesAfter = 0;
+ if ($afterVisibilityToken !== false
+ && $tokens[$visibilityToken]['line'] !== $tokens[$afterVisibilityToken]['line']
+ ) {
+ $spacesAfter = 'newline';
+ } else if ($tokens[($visibilityToken + 1)]['code'] === T_WHITESPACE) {
+ $spacesAfter = $tokens[($visibilityToken + 1)]['length'];
+ }
+
+ if ($spacesAfter !== 1) {
+ $error = 'Expected 1 space after set-visibility modifier "%s"; %s found';
+ $data = [
+ $tokens[$visibilityToken]['content'],
+ $spacesAfter,
+ ];
+
+ $fix = $phpcsFile->addFixableError($error, $visibilityToken, 'SpacingAfterSetVisbility', $data);
+ if ($fix === true) {
+ $phpcsFile->fixer->beginChangeset();
+ $phpcsFile->fixer->addContent($visibilityToken, ' ');
+
+ for ($i = ($visibilityToken + 1); $tokens[$i]['code'] === T_WHITESPACE; $i++) {
+ $phpcsFile->fixer->replaceToken($i, '');
+ }
+
+ $phpcsFile->fixer->endChangeset();
+ }
+ }//end if
+ }//end if
+
if (isset($param['readonly_token']) === true) {
$readonlyToken = $param['readonly_token'];
$afterReadonlyToken = $phpcsFile->findNext(T_WHITESPACE, ($readonlyToken + 1), $param['token'], true);
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php
index 3d1c83f..912cbdb 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Scope/MemberVarScopeSniff.php
@@ -33,9 +33,15 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
return;
}
- $error = 'Scope modifier not specified for member variable "%s"';
- $data = [$tokens[$stackPtr]['content']];
- $phpcsFile->addError($error, $stackPtr, 'Missing', $data);
+ if ($properties['set_scope'] === false) {
+ $error = 'Scope modifier not specified for member variable "%s"';
+ $data = [$tokens[$stackPtr]['content']];
+ $phpcsFile->addError($error, $stackPtr, 'Missing', $data);
+ } else {
+ $error = 'Read scope modifier not specified for member variable "%s"';
+ $data = [$tokens[$stackPtr]['content']];
+ $phpcsFile->addError($error, $stackPtr, 'AsymReadMissing', $data);
+ }
}//end processMemberVar()
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php
index c559701..56c1fd7 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/MemberVarSpacingSniff.php
@@ -53,7 +53,9 @@ protected function processMemberVar(File $phpcsFile, $stackPtr)
$endOfPreviousStatement = $phpcsFile->findPrevious($stopPoints, ($stackPtr - 1), null, false, null, true);
- $validPrefixes = Tokens::$methodPrefixes;
+ $validPrefixes = Tokens::$scopeModifiers;
+ $validPrefixes[] = T_STATIC;
+ $validPrefixes[] = T_FINAL;
$validPrefixes[] = T_VAR;
$validPrefixes[] = T_READONLY;
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php
index abf05dc..7c3ce11 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/ScopeKeywordSpacingSniff.php
@@ -24,8 +24,9 @@ class ScopeKeywordSpacingSniff implements Sniff
*/
public function register()
{
- $register = Tokens::$methodPrefixes;
- $register[] = T_READONLY;
+ $register = Tokens::$methodPrefixes;
+ $register += Tokens::$scopeModifiers;
+ $register[T_READONLY] = T_READONLY;
return $register;
}//end register()
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc
index db8d43d..0e5d87a 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc
@@ -314,3 +314,20 @@ class FinalProperties {
*/
final int $prop = 1;
}
+
+class AsymVisibility {
+ /**
+ * Comment should be ignored.
+ */
+ public(set) int $prop = 1;
+
+ /**
+ * Comment should be ignored.
+ */
+ protected(set) int $prop = 1;
+
+ /**
+ * Comment should be ignored.
+ */
+ private(set) int $prop = 1;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed
index 69463f9..0935d4a 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/BlockCommentUnitTest.inc.fixed
@@ -316,3 +316,20 @@ class FinalProperties {
*/
final int $prop = 1;
}
+
+class AsymVisibility {
+ /**
+ * Comment should be ignored.
+ */
+ public(set) int $prop = 1;
+
+ /**
+ * Comment should be ignored.
+ */
+ protected(set) int $prop = 1;
+
+ /**
+ * Comment should be ignored.
+ */
+ private(set) int $prop = 1;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc
index af7614e..e8b1356 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc
@@ -114,3 +114,20 @@ final class FinalClassWithFinalProp
*/
final $property = 10;
}
+
+class AsymVisibility {
+ /**
+ * Stars should be aligned.
+ */
+ public(set) int $prop = 1;
+
+ /**
+ * Stars should be aligned.
+ */
+ protected(set) int $prop = 1;
+
+ /**
+ * Stars should be aligned.
+ */
+ private(set) int $prop = 1;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed
index 9f66492..0b8a68e 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.inc.fixed
@@ -114,3 +114,20 @@ final class FinalClassWithFinalProp
*/
final $property = 10;
}
+
+class AsymVisibility {
+ /**
+ * Stars should be aligned.
+ */
+ public(set) int $prop = 1;
+
+ /**
+ * Stars should be aligned.
+ */
+ protected(set) int $prop = 1;
+
+ /**
+ * Stars should be aligned.
+ */
+ private(set) int $prop = 1;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php
index eb9d754..eac7a9e 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/DocCommentAlignmentUnitTest.php
@@ -63,7 +63,12 @@ public function getErrorList($testFile='')
$errors[112] = 1;
$errors[113] = 1;
$errors[114] = 1;
- }
+
+ $errors[120] = 1;
+ $errors[121] = 1;
+ $errors[125] = 1;
+ $errors[126] = 1;
+ }//end if
return $errors;
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc
index b849029..bddb2d1 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc
@@ -469,3 +469,20 @@ class PHP84FinalProperties {
*/
final int $hasDocblock;
}
+
+class AsymVisibility {
+ /**
+ * @var integer
+ */
+ public(set) int $hasDocblockA;
+
+ /**
+ * @var integer
+ */
+ public protected(set) int $hasDocblockB;
+
+ /**
+ * @var integer
+ */
+ private(set) protected int $hasDocblockC;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed
index 0a57d89..2a40e3a 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/VariableCommentUnitTest.inc.fixed
@@ -469,3 +469,20 @@ class PHP84FinalProperties {
*/
final int $hasDocblock;
}
+
+class AsymVisibility {
+ /**
+ * @var integer
+ */
+ public(set) int $hasDocblockA;
+
+ /**
+ * @var integer
+ */
+ public protected(set) int $hasDocblockB;
+
+ /**
+ * @var integer
+ */
+ private(set) protected int $hasDocblockC;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc
index f80a567..af872e7 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc
@@ -210,3 +210,18 @@ class PropertyPromotionSpacingAfterModifier {
string $tooMuchSpaceNewLines,
) {}
}
+
+class AsymVisibilityPropertyPromotionSpacingAfterComma {
+ public function __construct(private(set) string|int $propA, protected(set) bool $correctSpace, public(set) MyClass $tooMuchSpace,public(set) string $noSpace) {}
+}
+
+class AsymVisibilityPropertyPromotionSpacingAfterModifier {
+ public function __construct(
+ private(set)$noSpace,
+ public(set) MyClass $tooMuchSpace,
+ protected(set) public string $tooMuchSpaceX2,
+ private
+ public(set)
+ string $tooMuchSpaceNewLines,
+ ) {}
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc.fixed
index c82e3fb..356b374 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.1.inc.fixed
@@ -184,3 +184,16 @@ class PropertyPromotionSpacingAfterModifier {
readonly public string $tooMuchSpaceNewLines,
) {}
}
+
+class AsymVisibilityPropertyPromotionSpacingAfterComma {
+ public function __construct(private(set) string|int $propA, protected(set) bool $correctSpace, public(set) MyClass $tooMuchSpace, public(set) string $noSpace) {}
+}
+
+class AsymVisibilityPropertyPromotionSpacingAfterModifier {
+ public function __construct(
+ private(set) $noSpace,
+ public(set) MyClass $tooMuchSpace,
+ protected(set) public string $tooMuchSpaceX2,
+ private public(set) string $tooMuchSpaceNewLines,
+ ) {}
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php
index 9dcade3..2bd81ca 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Functions/FunctionDeclarationArgumentSpacingUnitTest.php
@@ -95,6 +95,12 @@ public function getErrorList($testFile='')
207 => 2,
208 => 1,
209 => 1,
+ 215 => 2,
+ 220 => 1,
+ 221 => 1,
+ 222 => 2,
+ 223 => 1,
+ 224 => 1,
];
default:
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc
index 87c3bdf..361cc91 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.inc
@@ -155,3 +155,17 @@ enum SomeEnum
$bar_foo = 3;
}
}
+
+class AsymVisibility {
+ // The read scope is public, but not specified. Enforce the naming conventions anyway.
+ private(set) $asymPublicImplied = 'hello';
+ private(set) $_asymPublicImplied = 'hello';
+
+ // The read scope is private, so these properties should be handled as private properties.
+ private private(set) $asymPrivate = 'hello';
+ private(set) private $_asymPrivate = 'hello';
+
+ // The read scope is public/protected, so these properties should be handled as public properties.
+ public private(set) $asymPublicPrivate = 'hello';
+ private(set) protected $_asymPrivateProtected = 'hello';
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php
index d8d8695..96ae98a 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/NamingConventions/ValidVariableNameUnitTest.php
@@ -68,6 +68,9 @@ public function getErrorList()
146 => 1,
152 => 1,
155 => 1,
+ 162 => 1,
+ 165 => 1,
+ 170 => 1,
];
return $errors;
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc
index 0a1554e..163b65e 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.inc
@@ -74,3 +74,14 @@ interface Base {
class PHP84FinalProperties {
final int $final;
}
+
+class AsymVisibility {
+ // The read scope is public, but not specified. Error should use different error code.
+ public(set) $asymPublic = 'hello';
+ protected(set) $asymProtected = 'hello';
+ private(set) $asymPrivate = 'hello';
+
+ public public(set) $asymPublicPublic = 'hello';
+ protected(set) public $asymPublicProtected = 'hello';
+ protected private(set) $asymProtectedPrivate = 'hello';
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php
index 309d029..1d83126 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Scope/MemberVarScopeUnitTest.php
@@ -40,6 +40,9 @@ public function getErrorList()
66 => 2,
67 => 1,
75 => 1,
+ 80 => 1,
+ 81 => 1,
+ 82 => 1,
];
}//end getErrorList()
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.1.inc
index efb2f2c..75d576d 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.1.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.1.inc
@@ -444,3 +444,18 @@ class MultilineCommentShouldNotBeSplitUp {
*/
public $prop;
}
+
+class AsymVisibility {
+ protected private(set) int $asymProtectedPrivate;
+
+ /**
+ * Docblock
+ */
+ protected(set) final string $asymProtected;
+ #[AnAttribute]
+
+ public(set) string|bool $asymPublic;
+
+
+ private(set) private bool $asymPrivate;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.1.inc.fixed
index e937465..d87c8b7 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.1.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.1.inc.fixed
@@ -431,3 +431,18 @@ class MultilineCommentShouldNotBeSplitUp {
*/
public $prop;
}
+
+class AsymVisibility {
+
+ protected private(set) int $asymProtectedPrivate;
+
+ /**
+ * Docblock
+ */
+ protected(set) final string $asymProtected;
+
+ #[AnAttribute]
+ public(set) string|bool $asymPublic;
+
+ private(set) private bool $asymPrivate;
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php
index 9f43362..63cd763 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/MemberVarSpacingUnitTest.php
@@ -87,6 +87,10 @@ public function getErrorList($testFile='')
427 => 1,
437 => 1,
445 => 1,
+ 449 => 1,
+ 456 => 1,
+ 457 => 1,
+ 460 => 1,
];
default:
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc
index de53edc..e53511f 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc
@@ -192,3 +192,13 @@ class FinalProperties {
final readonly public ?MyType $spacing_correct;
protected final $spacing_incorrect = 'foo';
}
+
+class AsymVisibility {
+ public(set) string $asymPublic = 'hello';
+ public protected(set) final $asymProtected = 'hello';
+ private(set) public string|false $asymPrivate = 'hello';
+
+ public public(set) $asymPublicPublic = 'hello';
+ protected(set) public $asymPublicProtected = 'hello';
+ protected private(set) $asymProtectedPrivate = 'hello';
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed
index 55d1a54..8376b56 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.1.inc.fixed
@@ -185,3 +185,13 @@ class FinalProperties {
final readonly public ?MyType $spacing_correct;
protected final $spacing_incorrect = 'foo';
}
+
+class AsymVisibility {
+ public(set) string $asymPublic = 'hello';
+ public protected(set) final $asymProtected = 'hello';
+ private(set) public string|false $asymPrivate = 'hello';
+
+ public public(set) $asymPublicPublic = 'hello';
+ protected(set) public $asymPublicProtected = 'hello';
+ protected private(set) $asymProtectedPrivate = 'hello';
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php
index 64b82e3..2d20694 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/WhiteSpace/ScopeKeywordSpacingUnitTest.php
@@ -70,6 +70,9 @@ public function getErrorList($testFile='')
187 => 1,
188 => 1,
193 => 2,
+ 197 => 1,
+ 198 => 3,
+ 199 => 2,
];
case 'ScopeKeywordSpacingUnitTest.3.inc':
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc
index 3325e11..f3ea469 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.inc
@@ -129,3 +129,17 @@ enum SomeEnum
$bar_foo = 3;
}
}
+
+class AsymVisibility {
+ // The read scope is public, but not specified. Enforce the naming conventions anyway.
+ private(set) $asymPublicImplied = 'hello';
+ private(set) $_asymPublicImplied = 'hello';
+
+ // The read scope is private, so these properties should be handled as private properties.
+ private private(set) $asymPrivate = 'hello';
+ private(set) private $_asymPrivate = 'hello';
+
+ // The read scope is public/protected, so these properties should be handled as public properties.
+ protected private(set) $asymProtectedPrivate = 'hello';
+ private(set) public $_asymPrivatePublic = 'hello';
+}
diff --git a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php
index c66a2a4..7e62027 100644
--- a/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php
+++ b/vendor/squizlabs/php_codesniffer/src/Standards/Zend/Tests/NamingConventions/ValidVariableNameUnitTest.php
@@ -61,6 +61,10 @@ public function getErrorList()
121 => 1,
126 => 1,
129 => 1,
+ 136 => 1,
+ 139 => 1,
+ 143 => 1,
+ 144 => 1,
];
}//end getErrorList()
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindEndOfStatementTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindEndOfStatementTest.inc
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindEndOfStatementTest.php
similarity index 99%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindEndOfStatementTest.php
index be8f458..ba62360 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindEndOfStatementTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindEndOfStatementTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
use PHP_CodeSniffer\Util\Tokens;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindExtendedClassNameTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindExtendedClassNameTest.inc
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindExtendedClassNameTest.php
similarity index 99%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindExtendedClassNameTest.php
index bb69f25..327f486 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/FindExtendedClassNameTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindExtendedClassNameTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindImplementedInterfaceNamesTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindImplementedInterfaceNamesTest.inc
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindImplementedInterfaceNamesTest.php
similarity index 99%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindImplementedInterfaceNamesTest.php
index c054030..cb2081d 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindImplementedInterfaceNamesTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindImplementedInterfaceNamesTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindStartOfStatementTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindStartOfStatementTest.inc
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindStartOfStatementTest.php
similarity index 99%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindStartOfStatementTest.php
index aa0646c..3506cc1 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/FindStartOfStatementTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/FindStartOfStatementTest.php
@@ -9,7 +9,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
use PHP_CodeSniffer\Util\Tokens;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetClassPropertiesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetClassPropertiesTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetClassPropertiesTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetClassPropertiesTest.inc
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetClassPropertiesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetClassPropertiesTest.php
similarity index 99%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetClassPropertiesTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetClassPropertiesTest.php
index 4841b50..5e3156b 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetClassPropertiesTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetClassPropertiesTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetConditionTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetConditionTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetConditionTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetConditionTest.inc
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetConditionTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetConditionTest.php
similarity index 99%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetConditionTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetConditionTest.php
index 656bd64..9d6eecc 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetConditionTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetConditionTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
use PHP_CodeSniffer\Util\Tokens;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameJSTest.js b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameJSTest.js
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameJSTest.js
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameJSTest.js
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameJSTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameJSTest.php
similarity index 98%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameJSTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameJSTest.php
index af3fe56..5bdb56e 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameJSTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameJSTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError1Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError1Test.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError1Test.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError1Test.inc
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError1Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError1Test.php
similarity index 95%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError1Test.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError1Test.php
index f684ceb..73863ae 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError1Test.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError1Test.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError2Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError2Test.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError2Test.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError2Test.inc
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError2Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError2Test.php
similarity index 95%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError2Test.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError2Test.php
index 6c48349..41b1f37 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameParseError2Test.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameParseError2Test.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameTest.inc
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameTest.php
similarity index 99%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameTest.php
index eb66568..6da1544 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetDeclarationNameTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetDeclarationNameTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMemberPropertiesTest.inc
similarity index 92%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMemberPropertiesTest.inc
index c858826..b5fcea9 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.inc
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMemberPropertiesTest.inc
@@ -375,3 +375,29 @@ class WithFinalProperties {
/* testPHP84FinalComplexTypedProp */
final public (Foo&\Bar)|bool $val9;
}
+
+class AsymVisibility {
+ /* testPHP84AsymPublicSetProperty */
+ public(set) mixed $prop1;
+ /* testPHP84AsymPublicPublicSetProperty */
+ public public(set) (A&B)|null $prop2;
+ /* testPHP84AsymPublicSetPublicProperty */
+ public(set) public bool $prop3;
+
+ /* testPHP84AsymProtectedSetProperty */
+ protected(set) readonly mixed $prop4;
+ /* testPHP84AsymPublicProtectedSetProperty */
+ public protected(set) string $prop5;
+ /* testPHP84AsymProtectedSetPublicProperty */
+ protected(set) public ?float $prop6;
+
+ /* testPHP84AsymPrivateSetProperty */
+ private(set) string|int $prop7;
+ /* testPHP84AsymProtectedPrivateSetProperty */
+ final protected private(set) $prop8;
+ /* testPHP84AsymPrivateSetPublicProperty */
+ private(set) public mixed $prop9;
+
+ /* testPHP84IllegalAsymPublicProtectedSetStaticProperty */
+ public protected(set) static mixed $prop10;
+}
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMemberPropertiesTest.php
similarity index 84%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMemberPropertiesTest.php
index 53cfe5f..3c21891 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMemberPropertiesTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMemberPropertiesTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
@@ -68,6 +68,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -82,6 +83,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -96,6 +98,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -110,6 +113,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -124,6 +128,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -138,6 +143,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -152,6 +158,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -166,6 +173,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -180,6 +188,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -194,6 +203,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -208,6 +218,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -222,6 +233,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -236,6 +248,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -250,6 +263,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -264,6 +278,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -278,6 +293,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -292,6 +308,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -306,6 +323,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -320,6 +338,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -334,6 +353,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -348,6 +368,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -362,6 +383,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -376,6 +398,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -390,6 +413,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -404,6 +428,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -418,6 +443,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -432,6 +458,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -446,6 +473,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -460,6 +488,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -474,6 +503,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -488,6 +518,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -502,6 +533,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -516,6 +548,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -530,6 +563,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -544,6 +578,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -558,6 +593,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -572,6 +608,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -586,6 +623,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -600,6 +638,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -618,6 +657,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -632,6 +672,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -646,6 +687,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -660,6 +702,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -674,6 +717,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -688,6 +732,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -702,6 +747,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -716,6 +762,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -730,6 +777,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -744,6 +792,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -759,6 +808,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -773,6 +823,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -787,6 +838,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -801,6 +853,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -815,6 +868,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -829,6 +883,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -843,6 +898,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -857,6 +913,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -871,6 +928,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -885,6 +943,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -899,6 +958,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -913,6 +973,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -927,6 +988,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -941,6 +1003,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => true,
'is_final' => false,
@@ -955,6 +1018,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => true,
'is_final' => false,
@@ -969,6 +1033,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -983,6 +1048,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -997,6 +1063,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1015,6 +1082,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1029,6 +1097,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1043,6 +1112,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1057,6 +1127,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1072,6 +1143,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1086,6 +1158,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1100,6 +1173,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1114,6 +1188,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -1128,6 +1203,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1142,6 +1218,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -1157,6 +1234,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => false,
@@ -1171,6 +1249,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -1185,6 +1264,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'private',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => false,
@@ -1199,6 +1279,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => false,
@@ -1213,6 +1294,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => true,
@@ -1227,6 +1309,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'protected',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => true,
@@ -1241,6 +1324,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => true,
@@ -1255,6 +1339,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => true,
'is_readonly' => false,
'is_final' => true,
@@ -1269,6 +1354,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => true,
'is_final' => true,
@@ -1283,6 +1369,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => true,
@@ -1297,6 +1384,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => false,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => true,
@@ -1311,6 +1399,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => true,
@@ -1325,6 +1414,7 @@ public static function dataGetMemberProperties()
'expected' => [
'scope' => 'public',
'scope_specified' => true,
+ 'set_scope' => false,
'is_static' => false,
'is_readonly' => false,
'is_final' => true,
@@ -1334,6 +1424,157 @@ public static function dataGetMemberProperties()
'nullable_type' => false,
],
],
+
+ 'php8.4-asym-public-set' => [
+ 'identifier' => '/* testPHP84AsymPublicSetProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => false,
+ 'set_scope' => 'public',
+ 'is_static' => false,
+ 'is_readonly' => false,
+ 'is_final' => false,
+ 'type' => 'mixed',
+ 'type_token' => -2,
+ 'type_end_token' => -2,
+ 'nullable_type' => false,
+ ],
+ ],
+ 'php8.4-asym-public-public-set-dnf-type' => [
+ 'identifier' => '/* testPHP84AsymPublicPublicSetProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => true,
+ 'set_scope' => 'public',
+ 'is_static' => false,
+ 'is_readonly' => false,
+ 'is_final' => false,
+ 'type' => '(A&B)|null',
+ 'type_token' => -8,
+ 'type_end_token' => -2,
+ 'nullable_type' => false,
+ ],
+ ],
+ 'php8.4-asym-public-set-public' => [
+ 'identifier' => '/* testPHP84AsymPublicSetPublicProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => true,
+ 'set_scope' => 'public',
+ 'is_static' => false,
+ 'is_readonly' => false,
+ 'is_final' => false,
+ 'type' => 'bool',
+ 'type_token' => -2,
+ 'type_end_token' => -2,
+ 'nullable_type' => false,
+ ],
+ ],
+ 'php8.4-asym-protected-set-readonly' => [
+ 'identifier' => '/* testPHP84AsymProtectedSetProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => false,
+ 'set_scope' => 'protected',
+ 'is_static' => false,
+ 'is_readonly' => true,
+ 'is_final' => false,
+ 'type' => 'mixed',
+ 'type_token' => -2,
+ 'type_end_token' => -2,
+ 'nullable_type' => false,
+ ],
+ ],
+ 'php8.4-asym-public-protected-set' => [
+ 'identifier' => '/* testPHP84AsymPublicProtectedSetProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => true,
+ 'set_scope' => 'protected',
+ 'is_static' => false,
+ 'is_readonly' => false,
+ 'is_final' => false,
+ 'type' => 'string',
+ 'type_token' => -2,
+ 'type_end_token' => -2,
+ 'nullable_type' => false,
+ ],
+ ],
+ 'php8.4-asym-protected-set-public-nullable-type' => [
+ 'identifier' => '/* testPHP84AsymProtectedSetPublicProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => true,
+ 'set_scope' => 'protected',
+ 'is_static' => false,
+ 'is_readonly' => false,
+ 'is_final' => false,
+ 'type' => '?float',
+ 'type_token' => -2,
+ 'type_end_token' => -2,
+ 'nullable_type' => true,
+ ],
+ ],
+ 'php8.4-asym-private-set-union-type' => [
+ 'identifier' => '/* testPHP84AsymPrivateSetProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => false,
+ 'set_scope' => 'private',
+ 'is_static' => false,
+ 'is_readonly' => false,
+ 'is_final' => false,
+ 'type' => 'string|int',
+ 'type_token' => -4,
+ 'type_end_token' => -2,
+ 'nullable_type' => false,
+ ],
+ ],
+ 'php8.4-asym-final-protected-private-set' => [
+ 'identifier' => '/* testPHP84AsymProtectedPrivateSetProperty */',
+ 'expected' => [
+ 'scope' => 'protected',
+ 'scope_specified' => true,
+ 'set_scope' => 'private',
+ 'is_static' => false,
+ 'is_readonly' => false,
+ 'is_final' => true,
+ 'type' => '',
+ 'type_token' => false,
+ 'type_end_token' => false,
+ 'nullable_type' => false,
+ ],
+ ],
+ 'php8.4-asym-private-set-public' => [
+ 'identifier' => '/* testPHP84AsymPrivateSetPublicProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => true,
+ 'set_scope' => 'private',
+ 'is_static' => false,
+ 'is_readonly' => false,
+ 'is_final' => false,
+ 'type' => 'mixed',
+ 'type_token' => -2,
+ 'type_end_token' => -2,
+ 'nullable_type' => false,
+ ],
+ ],
+ 'php8.4-illegal-asym-public-protected-set-static' => [
+ 'identifier' => '/* testPHP84IllegalAsymPublicProtectedSetStaticProperty */',
+ 'expected' => [
+ 'scope' => 'public',
+ 'scope_specified' => true,
+ 'set_scope' => 'protected',
+ 'is_static' => true,
+ 'is_readonly' => false,
+ 'is_final' => false,
+ 'type' => 'mixed',
+ 'type_token' => -2,
+ 'type_end_token' => -2,
+ 'nullable_type' => false,
+ ],
+ ],
];
}//end dataGetMemberProperties()
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError1Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError1Test.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError1Test.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError1Test.inc
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError1Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError1Test.php
similarity index 95%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError1Test.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError1Test.php
index 528d548..db25407 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError1Test.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError1Test.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError2Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError2Test.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError2Test.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError2Test.inc
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError2Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError2Test.php
similarity index 95%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError2Test.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError2Test.php
index 49cd940..eda050d 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersParseError2Test.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersParseError2Test.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersTest.inc
similarity index 96%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersTest.inc
index a4d8767..3a12ade 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.inc
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersTest.inc
@@ -217,6 +217,17 @@ class ConstructorPropertyPromotionWithOnlyReadOnly {
public function __construct(readonly Foo&Bar $promotedProp, readonly ?bool $promotedToo,) {}
}
+class ConstructorPropertyPromotionWithAsymVisibility {
+ /* testPHP84ConstructorPropertyPromotionWithAsymVisibility */
+ public function __construct(
+ protected(set) string|Book $book,
+ public private(set) ?Publisher $publisher,
+ Private(set) PROTECTED Author $author,
+ readonly public(set) int $pubYear,
+ protected(set) $illegalMissingType,
+ ) {}
+}
+
/* testPHP8ConstructorPropertyPromotionGlobalFunction */
// Intentional fatal error. Property promotion not allowed in non-constructor, but that's not the concern of this method.
function globalFunction(private $x) {}
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersTest.php
similarity index 95%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersTest.php
index 8d04720..e660275 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodParametersTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodParametersTest.php
@@ -9,7 +9,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
@@ -2190,6 +2190,122 @@ public function testPHP81ConstructorPropertyPromotionWithOnlyReadOnly()
}//end testPHP81ConstructorPropertyPromotionWithOnlyReadOnly()
+ /**
+ * Verify recognition of PHP8 constructor with property promotion using PHP 8.4 asymmetric visibility.
+ *
+ * @return void
+ */
+ public function testPHP84ConstructorPropertyPromotionWithAsymVisibility()
+ {
+ // Offsets are relative to the T_FUNCTION token.
+ $expected = [];
+ $expected[0] = [
+ 'token' => 12,
+ 'name' => '$book',
+ 'content' => 'protected(set) string|Book $book',
+ 'has_attributes' => false,
+ 'pass_by_reference' => false,
+ 'reference_token' => false,
+ 'variable_length' => false,
+ 'variadic_token' => false,
+ 'type_hint' => 'string|Book',
+ 'type_hint_token' => 8,
+ 'type_hint_end_token' => 10,
+ 'nullable_type' => false,
+ 'property_visibility' => 'public',
+ 'visibility_token' => false,
+ 'set_visibility' => 'protected(set)',
+ 'set_visibility_token' => 6,
+ 'property_readonly' => false,
+ 'comma_token' => 13,
+ ];
+ $expected[1] = [
+ 'token' => 23,
+ 'name' => '$publisher',
+ 'content' => 'public private(set) ?Publisher $publisher',
+ 'has_attributes' => false,
+ 'pass_by_reference' => false,
+ 'reference_token' => false,
+ 'variable_length' => false,
+ 'variadic_token' => false,
+ 'type_hint' => '?Publisher',
+ 'type_hint_token' => 21,
+ 'type_hint_end_token' => 21,
+ 'nullable_type' => true,
+ 'property_visibility' => 'public',
+ 'visibility_token' => 16,
+ 'set_visibility' => 'private(set)',
+ 'set_visibility_token' => 18,
+ 'property_readonly' => false,
+ 'comma_token' => 24,
+ ];
+ $expected[2] = [
+ 'token' => 33,
+ 'name' => '$author',
+ 'content' => 'Private(set) PROTECTED Author $author',
+ 'has_attributes' => false,
+ 'pass_by_reference' => false,
+ 'reference_token' => false,
+ 'variable_length' => false,
+ 'variadic_token' => false,
+ 'type_hint' => 'Author',
+ 'type_hint_token' => 31,
+ 'type_hint_end_token' => 31,
+ 'nullable_type' => false,
+ 'property_visibility' => 'PROTECTED',
+ 'visibility_token' => 29,
+ 'set_visibility' => 'Private(set)',
+ 'set_visibility_token' => 27,
+ 'property_readonly' => false,
+ 'comma_token' => 34,
+ ];
+ $expected[3] = [
+ 'token' => 43,
+ 'name' => '$pubYear',
+ 'content' => 'readonly public(set) int $pubYear',
+ 'has_attributes' => false,
+ 'pass_by_reference' => false,
+ 'reference_token' => false,
+ 'variable_length' => false,
+ 'variadic_token' => false,
+ 'type_hint' => 'int',
+ 'type_hint_token' => 41,
+ 'type_hint_end_token' => 41,
+ 'nullable_type' => false,
+ 'property_visibility' => 'public',
+ 'visibility_token' => false,
+ 'set_visibility' => 'public(set)',
+ 'set_visibility_token' => 39,
+ 'property_readonly' => true,
+ 'readonly_token' => 37,
+ 'comma_token' => 44,
+ ];
+ $expected[4] = [
+ 'token' => 49,
+ 'name' => '$illegalMissingType',
+ 'content' => 'protected(set) $illegalMissingType',
+ 'has_attributes' => false,
+ 'pass_by_reference' => false,
+ 'reference_token' => false,
+ 'variable_length' => false,
+ 'variadic_token' => false,
+ 'type_hint' => '',
+ 'type_hint_token' => false,
+ 'type_hint_end_token' => false,
+ 'nullable_type' => false,
+ 'property_visibility' => 'public',
+ 'visibility_token' => false,
+ 'set_visibility' => 'protected(set)',
+ 'set_visibility_token' => 47,
+ 'property_readonly' => false,
+ 'comma_token' => 50,
+ ];
+
+ $this->getMethodParametersTestHelper('/* '.__FUNCTION__.' */', $expected);
+
+ }//end testPHP84ConstructorPropertyPromotionWithAsymVisibility()
+
+
/**
* Verify behaviour when a non-constructor function uses PHP 8 property promotion syntax.
*
@@ -3214,6 +3330,10 @@ private function getMethodParametersTestHelper($commentString, $expected, $targe
$expected[$key]['visibility_token'] += $target;
}
+ if (isset($param['set_visibility_token']) === true && is_int($param['set_visibility_token']) === true) {
+ $expected[$key]['set_visibility_token'] += $target;
+ }
+
if (isset($param['readonly_token']) === true) {
$expected[$key]['readonly_token'] += $target;
}
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodPropertiesTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodPropertiesTest.inc
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodPropertiesTest.php
similarity index 99%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodPropertiesTest.php
index fff60b9..2b47ebb 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetMethodPropertiesTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/GetTokensAsStringTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetTokensAsStringTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/GetTokensAsStringTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetTokensAsStringTest.inc
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetTokensAsStringTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetTokensAsStringTest.php
similarity index 99%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetTokensAsStringTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetTokensAsStringTest.php
index 7e79749..1adb946 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/GetTokensAsStringTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/GetTokensAsStringTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/IsReferenceTest.inc
similarity index 100%
rename from vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.inc
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/IsReferenceTest.inc
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/IsReferenceTest.php
similarity index 99%
rename from wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php
rename to vendor/squizlabs/php_codesniffer/tests/Core/Files/File/IsReferenceTest.php
index 5b977de..bd90853 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/squizlabs/php_codesniffer/tests/Core/File/IsReferenceTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Files/File/IsReferenceTest.php
@@ -7,7 +7,7 @@
* @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence
*/
-namespace PHP_CodeSniffer\Tests\Core\File;
+namespace PHP_CodeSniffer\Tests\Core\Files\File;
use PHP_CodeSniffer\Tests\Core\AbstractMethodUnitTest;
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/GitModifiedTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Filters/GitModifiedTest.php
index 4d8f83d..c0b6521 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/GitModifiedTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Filters/GitModifiedTest.php
@@ -9,6 +9,7 @@
namespace PHP_CodeSniffer\Tests\Core\Filters;
+use PHP_CodeSniffer\Config;
use PHP_CodeSniffer\Filters\GitModified;
use PHP_CodeSniffer\Tests\Core\Filters\AbstractFilterTestCase;
use RecursiveArrayIterator;
@@ -219,6 +220,10 @@ public function testExecAlwaysReturnsArray($cmd, $expected)
$this->markTestSkipped('Not a git repository');
}
+ if (Config::getExecutablePath('git') === null) {
+ $this->markTestSkipped('git command not available');
+ }
+
$fakeDI = new RecursiveArrayIterator(self::getFakeFileList());
$filter = new GitModified($fakeDI, '/', self::$config, self::$ruleset);
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/GitStagedTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Filters/GitStagedTest.php
index ce64794..0c936de 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Filters/GitStagedTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Filters/GitStagedTest.php
@@ -9,6 +9,7 @@
namespace PHP_CodeSniffer\Tests\Core\Filters;
+use PHP_CodeSniffer\Config;
use PHP_CodeSniffer\Filters\GitStaged;
use PHP_CodeSniffer\Tests\Core\Filters\AbstractFilterTestCase;
use RecursiveArrayIterator;
@@ -219,6 +220,10 @@ public function testExecAlwaysReturnsArray($cmd, $expected)
$this->markTestSkipped('Not a git repository');
}
+ if (Config::getExecutablePath('git') === null) {
+ $this->markTestSkipped('git command not available');
+ }
+
$fakeDI = new RecursiveArrayIterator(self::getFakeFileList());
$filter = new GitStaged($fakeDI, '/', self::$config, self::$ruleset);
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueAllGoodTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueAllGoodTest.xml
index 6f4e499..f71fd56 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueAllGoodTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueAllGoodTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueConflictTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueConflictTest.xml
index 5e2ddb4..732cfc5 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueConflictTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueConflictTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueNotEnoughLoopsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueNotEnoughLoopsTest.xml
index 25810c0..9072dd7 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueNotEnoughLoopsTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/FixFileReturnValueNotEnoughLoopsTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/Fixtures/TestStandard/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/Fixtures/TestStandard/ruleset.xml
index 345c483..6a202de 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/Fixtures/TestStandard/ruleset.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Fixer/Fixtures/TestStandard/ruleset.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/AllValidDocsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/AllValidDocsTest.xml
index 71a0c7f..3bf637e 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/AllValidDocsTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/AllValidDocsTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/AnchorLinksTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/AnchorLinksTest.xml
index 0e66fab..17fb0ce 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/AnchorLinksTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/AnchorLinksTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/ruleset.xml
index c79ad10..7190872 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/ruleset.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/ruleset.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoDocsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoDocsTest.xml
index 51df839..efb2999 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoDocsTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoDocsTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoValidDocsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoValidDocsTest.xml
index 94dda4e..9f5c9c4 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoValidDocsTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoValidDocsTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/OneDocTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/OneDocTest.xml
index 83ca438..50e64a8 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/OneDocTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/OneDocTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/StructureDocsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/StructureDocsTest.xml
index 45811be..6199e28 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/StructureDocsTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/StructureDocsTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ConstructorNoSniffsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ConstructorNoSniffsTest.xml
index 77ae025..cc61e3c 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ConstructorNoSniffsTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ConstructorNoSniffsTest.xml
@@ -1,5 +1,5 @@
-
+.
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceCaseMismatch1Test.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceCaseMismatch1Test.xml
index 7b22223..e72c4b9 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceCaseMismatch1Test.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceCaseMismatch1Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceHomePathTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceHomePathTest.xml
index 8d39a26..e21f2a6 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceHomePathTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceHomePathTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInternalIgnoreTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInternalIgnoreTest.xml
index 5e4a460..edd9b1e 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInternalIgnoreTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInternalIgnoreTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInternalStandardTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInternalStandardTest.xml
index 0493e25..d01c68c 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInternalStandardTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInternalStandardTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode1Test.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode1Test.xml
index f864f35..a5531bd 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode1Test.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode1Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode2Test.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode2Test.xml
index 49814db..c18ba25 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode2Test.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode2Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode3Test.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode3Test.xml
index 439fe9a..46ac264 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode3Test.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidErrorCode3Test.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidHomePathRefTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidHomePathRefTest.xml
index 801ead6..349449e 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidHomePathRefTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceInvalidHomePathRefTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceMissingFileTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceMissingFileTest.xml
index c7d95e4..18e8c39 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceMissingFileTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceMissingFileTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceTest.xml
index aaa2375..f3147c5 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownCategoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownCategoryTest.xml
index 26f8c84..17ec1a7 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownCategoryTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownCategoryTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownSniffTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownSniffTest.xml
index 8b9b3ad..8cff25e 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownSniffTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownSniffTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownStandardTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownStandardTest.xml
index 8563f86..c8b56b1 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownStandardTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandRulesetReferenceUnknownStandardTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.xml
index f2646da..158805e 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainCustomRulesetTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainCustomRulesetTest.xml
index cbca4fd..77b6c2c 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainCustomRulesetTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainCustomRulesetTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainSingleSniffTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainSingleSniffTest.xml
index 159b7ef..d345779 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainSingleSniffTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainSingleSniffTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/ruleset.xml
index 3dd659b..6e683ff 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/ruleset.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/ruleset.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ExternalA/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ExternalA/ruleset.xml
index a4d929c..90f42fc 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ExternalA/ruleset.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ExternalA/ruleset.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ExternalB/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ExternalB/ruleset.xml
index 2f4447e..9f4115e 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ExternalB/ruleset.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ExternalB/ruleset.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/FakeHomePath/src/MyStandard/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/FakeHomePath/src/MyStandard/ruleset.xml
index a8c9b1a..bc0003a 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/FakeHomePath/src/MyStandard/ruleset.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/FakeHomePath/src/MyStandard/ruleset.xml
@@ -1,4 +1,4 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Internal/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Internal/ruleset.xml
index fefcfcb..ca57053 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Internal/ruleset.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Internal/ruleset.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml
index 3fbfd6d..a8a6f4d 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php
index 1f0780c..59fce1b 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php
@@ -215,6 +215,8 @@ public function testShouldProcessArgCbfonly()
* Verify that in CS mode, phpcs-only directives are respected and phpcbf-only
* directives are ignored.
*
+ * @requires extension bcmath
+ *
* @return void
*/
public function testShouldProcessIniCsonly()
@@ -234,7 +236,8 @@ public function testShouldProcessIniCsonly()
* Verify that in CBF mode, phpcbf-only directives are respected and phpcs-only
* directives are ignored.
*
- * @group CBF
+ * @group CBF
+ * @requires extension bcmath
*
* @return void
*/
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.xml
index 62ea0e6..2a25667 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.xml
@@ -1,5 +1,5 @@
-
+.
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingInlineTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingInlineTest.xml
index 0bdadc7..8f276f8 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingInlineTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingInlineTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.xml
index c69b039..2e89a37 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsMissingInterfaceInvalidTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsMissingInterfaceInvalidTest.xml
index 52b264f..d3886c4 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsMissingInterfaceInvalidTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsMissingInterfaceInvalidTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsMissingInterfaceValidTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsMissingInterfaceValidTest.xml
index 39de8d4..ed5220c 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsMissingInterfaceValidTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsMissingInterfaceValidTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoProcessTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoProcessTest.xml
index d12d435..9f4c78d 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoProcessTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoProcessTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterOrProcessTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterOrProcessTest.xml
index 3f03d1a..c6f4d75 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterOrProcessTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterOrProcessTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterTest.xml
index 699628e..1077bef 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RegisterSniffsRejectsInvalidSniffNoImplementsNoRegisterTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml
index 2978cef..d2cb7c3 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteLinuxTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml
index e92c688..8f22b14 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml
index d95af20..e13f4b7 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest-include.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml
index 6b5c0a9..0cc4044 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml
index 88eaa5e..12a947d 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml
index e8502e7..26d5560 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml
index bfbfaf5..e5f4072 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml
index 67fcca3..4563c9c 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml
index a678c91..c206a06 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategoryTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml
index a7c0501..179cdd4 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForStandardTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml
index c6a14c2..5ff0fd2 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml
index a174261..3646d65 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml
index 75527e2..4b7b666 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml
index 150fc3e..d22ec24 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml
index 973e065..fb80426 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml
index 493adfd..2a8aedd 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml
index 358cb0d..6a16178 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml
index fbc0cb7..9c4ce1b 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml
index 86cc615..c198d68 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml
index 3ae834c..91bef96 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml
@@ -1,5 +1,5 @@
-
+
diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/TimingTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/TimingTest.php
index f5ef115..87c2a64 100644
--- a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/TimingTest.php
+++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/TimingTest.php
@@ -52,8 +52,6 @@ public function testGetDurationWithStartReturnsMilliseconds()
$duration = Timing::getDuration();
$this->assertTrue(is_float($duration));
- $this->assertGreaterThan(1, $duration);
- $this->assertLessThan(15, $duration);
}//end testGetDurationWithStartReturnsMilliseconds()
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/composer.lock b/wordpress/wp-content/plugins/monorepo-plugin/composer.lock
index 5c36f73..ad7cab6 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/composer.lock
+++ b/wordpress/wp-content/plugins/monorepo-plugin/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
- "content-hash": "5235166fb527dd945da834bfdcf7fb23",
+ "content-hash": "7c51e9b23c907624ae55d8ca4b2cc269",
"packages": [],
"packages-dev": [
{
@@ -87,26 +87,26 @@
},
{
"name": "phpcsstandards/phpcsextra",
- "version": "1.3.0",
+ "version": "1.3.1",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
- "reference": "46d08eb86eec622b96c466adec3063adfed280dd"
+ "reference": "8cb1a93708f82778c5fdc46106998c2072565418"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/46d08eb86eec622b96c466adec3063adfed280dd",
- "reference": "46d08eb86eec622b96c466adec3063adfed280dd",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/8cb1a93708f82778c5fdc46106998c2072565418",
+ "reference": "8cb1a93708f82778c5fdc46106998c2072565418",
"shasum": ""
},
"require": {
"php": ">=5.4",
- "phpcsstandards/phpcsutils": "^1.0.9",
+ "phpcsstandards/phpcsutils": "^1.0.12",
"squizlabs/php_codesniffer": "^3.12.1"
},
"require-dev": {
"php-parallel-lint/php-console-highlighter": "^1.0",
- "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
"phpcsstandards/phpcsdevcs": "^1.1.6",
"phpcsstandards/phpcsdevtools": "^1.2.1",
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
@@ -165,33 +165,33 @@
"type": "thanks_dev"
}
],
- "time": "2025-04-20T23:35:32+00:00"
+ "time": "2025-06-08T19:59:14+00:00"
},
{
"name": "phpcsstandards/phpcsutils",
- "version": "1.0.12",
+ "version": "1.1.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
- "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c"
+ "reference": "65355670ac17c34cd235cf9d3ceae1b9252c4dad"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c",
- "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/65355670ac17c34cd235cf9d3ceae1b9252c4dad",
+ "reference": "65355670ac17c34cd235cf9d3ceae1b9252c4dad",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
"php": ">=5.4",
- "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev"
+ "squizlabs/php_codesniffer": "^3.13.0 || ^4.0"
},
"require-dev": {
"ext-filter": "*",
"php-parallel-lint/php-console-highlighter": "^1.0",
- "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
"phpcsstandards/phpcsdevcs": "^1.1.6",
- "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0"
+ "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0"
},
"type": "phpcodesniffer-standard",
"extra": {
@@ -228,6 +228,7 @@
"phpcodesniffer-standard",
"phpcs",
"phpcs3",
+ "phpcs4",
"standards",
"static analysis",
"tokens",
@@ -251,22 +252,26 @@
{
"url": "https://opencollective.com/php_codesniffer",
"type": "open_collective"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/phpcsstandards",
+ "type": "thanks_dev"
}
],
- "time": "2024-05-20T13:34:27+00:00"
+ "time": "2025-06-12T04:32:33+00:00"
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.13.0",
+ "version": "3.13.1",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "65ff2489553b83b4597e89c3b8b721487011d186"
+ "reference": "1b71b4dd7e7ef651ac749cea67e513c0c832f4bd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/65ff2489553b83b4597e89c3b8b721487011d186",
- "reference": "65ff2489553b83b4597e89c3b8b721487011d186",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1b71b4dd7e7ef651ac749cea67e513c0c832f4bd",
+ "reference": "1b71b4dd7e7ef651ac749cea67e513c0c832f4bd",
"shasum": ""
},
"require": {
@@ -337,7 +342,7 @@
"type": "thanks_dev"
}
],
- "time": "2025-05-11T03:36:00+00:00"
+ "time": "2025-06-12T15:04:34+00:00"
},
{
"name": "wp-coding-standards/wpcs",
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/autoload.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/autoload.php
index cb21efb..2750b3e 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/autoload.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/autoload.php
@@ -22,4 +22,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
-return ComposerAutoloaderInit5235166fb527dd945da834bfdcf7fb23::getLoader();
+return ComposerAutoloaderInit7c51e9b23c907624ae55d8ca4b2cc269::getLoader();
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_classmap.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_classmap.php
index b8478a1..3f37dfb 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_classmap.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_classmap.php
@@ -12,22 +12,34 @@
'PHPCSUtils\\BackCompat\\BCTokens' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php',
'PHPCSUtils\\BackCompat\\Helper' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php',
'PHPCSUtils\\Exceptions\\InvalidTokenArray' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php',
+ 'PHPCSUtils\\Exceptions\\LogicException' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/LogicException.php',
+ 'PHPCSUtils\\Exceptions\\MissingArgumentError' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/MissingArgumentError.php',
+ 'PHPCSUtils\\Exceptions\\OutOfBoundsStackPtr' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/OutOfBoundsStackPtr.php',
+ 'PHPCSUtils\\Exceptions\\RuntimeException' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/RuntimeException.php',
'PHPCSUtils\\Exceptions\\TestFileNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php',
'PHPCSUtils\\Exceptions\\TestMarkerNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php',
'PHPCSUtils\\Exceptions\\TestTargetNotFound' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php',
+ 'PHPCSUtils\\Exceptions\\TypeError' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TypeError.php',
+ 'PHPCSUtils\\Exceptions\\UnexpectedTokenType' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/UnexpectedTokenType.php',
+ 'PHPCSUtils\\Exceptions\\ValueError' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/ValueError.php',
'PHPCSUtils\\Fixers\\SpacesFixer' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php',
'PHPCSUtils\\Internal\\Cache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php',
'PHPCSUtils\\Internal\\IsShortArrayOrList' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php',
'PHPCSUtils\\Internal\\IsShortArrayOrListWithCache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php',
'PHPCSUtils\\Internal\\NoFileCache' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php',
'PHPCSUtils\\Internal\\StableCollections' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php',
+ 'PHPCSUtils\\TestUtils\\ConfigDouble' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/ConfigDouble.php',
+ 'PHPCSUtils\\TestUtils\\RulesetDouble' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/RulesetDouble.php',
'PHPCSUtils\\TestUtils\\UtilityMethodTestCase' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php',
'PHPCSUtils\\Tokens\\Collections' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php',
'PHPCSUtils\\Tokens\\TokenHelper' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php',
'PHPCSUtils\\Utils\\Arrays' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php',
'PHPCSUtils\\Utils\\Conditions' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php',
+ 'PHPCSUtils\\Utils\\Constants' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Constants.php',
'PHPCSUtils\\Utils\\Context' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php',
'PHPCSUtils\\Utils\\ControlStructures' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php',
+ 'PHPCSUtils\\Utils\\FileInfo' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FileInfo.php',
+ 'PHPCSUtils\\Utils\\FilePath' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FilePath.php',
'PHPCSUtils\\Utils\\FunctionDeclarations' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php',
'PHPCSUtils\\Utils\\GetTokensAsString' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php',
'PHPCSUtils\\Utils\\Lists' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php',
@@ -42,6 +54,7 @@
'PHPCSUtils\\Utils\\PassedParameters' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php',
'PHPCSUtils\\Utils\\Scopes' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php',
'PHPCSUtils\\Utils\\TextStrings' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php',
+ 'PHPCSUtils\\Utils\\TypeString' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TypeString.php',
'PHPCSUtils\\Utils\\UseStatements' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php',
'PHPCSUtils\\Utils\\Variables' => $vendorDir . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php',
);
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_real.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_real.php
index 4731203..7b00351 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_real.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
-class ComposerAutoloaderInit5235166fb527dd945da834bfdcf7fb23
+class ComposerAutoloaderInit7c51e9b23c907624ae55d8ca4b2cc269
{
private static $loader;
@@ -22,12 +22,12 @@ public static function getLoader()
return self::$loader;
}
- spl_autoload_register(array('ComposerAutoloaderInit5235166fb527dd945da834bfdcf7fb23', 'loadClassLoader'), true, true);
+ spl_autoload_register(array('ComposerAutoloaderInit7c51e9b23c907624ae55d8ca4b2cc269', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__));
- spl_autoload_unregister(array('ComposerAutoloaderInit5235166fb527dd945da834bfdcf7fb23', 'loadClassLoader'));
+ spl_autoload_unregister(array('ComposerAutoloaderInit7c51e9b23c907624ae55d8ca4b2cc269', 'loadClassLoader'));
require __DIR__ . '/autoload_static.php';
- call_user_func(\Composer\Autoload\ComposerStaticInit5235166fb527dd945da834bfdcf7fb23::getInitializer($loader));
+ call_user_func(\Composer\Autoload\ComposerStaticInit7c51e9b23c907624ae55d8ca4b2cc269::getInitializer($loader));
$loader->register(true);
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_static.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_static.php
index d472446..df905a0 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_static.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
namespace Composer\Autoload;
-class ComposerStaticInit5235166fb527dd945da834bfdcf7fb23
+class ComposerStaticInit7c51e9b23c907624ae55d8ca4b2cc269
{
public static $prefixLengthsPsr4 = array (
'P' =>
@@ -35,22 +35,34 @@ class ComposerStaticInit5235166fb527dd945da834bfdcf7fb23
'PHPCSUtils\\BackCompat\\BCTokens' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php',
'PHPCSUtils\\BackCompat\\Helper' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/Helper.php',
'PHPCSUtils\\Exceptions\\InvalidTokenArray' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/InvalidTokenArray.php',
+ 'PHPCSUtils\\Exceptions\\LogicException' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/LogicException.php',
+ 'PHPCSUtils\\Exceptions\\MissingArgumentError' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/MissingArgumentError.php',
+ 'PHPCSUtils\\Exceptions\\OutOfBoundsStackPtr' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/OutOfBoundsStackPtr.php',
+ 'PHPCSUtils\\Exceptions\\RuntimeException' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/RuntimeException.php',
'PHPCSUtils\\Exceptions\\TestFileNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestFileNotFound.php',
'PHPCSUtils\\Exceptions\\TestMarkerNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestMarkerNotFound.php',
'PHPCSUtils\\Exceptions\\TestTargetNotFound' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TestTargetNotFound.php',
+ 'PHPCSUtils\\Exceptions\\TypeError' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/TypeError.php',
+ 'PHPCSUtils\\Exceptions\\UnexpectedTokenType' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/UnexpectedTokenType.php',
+ 'PHPCSUtils\\Exceptions\\ValueError' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Exceptions/ValueError.php',
'PHPCSUtils\\Fixers\\SpacesFixer' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Fixers/SpacesFixer.php',
'PHPCSUtils\\Internal\\Cache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/Cache.php',
'PHPCSUtils\\Internal\\IsShortArrayOrList' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrList.php',
'PHPCSUtils\\Internal\\IsShortArrayOrListWithCache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/IsShortArrayOrListWithCache.php',
'PHPCSUtils\\Internal\\NoFileCache' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/NoFileCache.php',
'PHPCSUtils\\Internal\\StableCollections' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Internal/StableCollections.php',
+ 'PHPCSUtils\\TestUtils\\ConfigDouble' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/ConfigDouble.php',
+ 'PHPCSUtils\\TestUtils\\RulesetDouble' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/RulesetDouble.php',
'PHPCSUtils\\TestUtils\\UtilityMethodTestCase' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/TestUtils/UtilityMethodTestCase.php',
'PHPCSUtils\\Tokens\\Collections' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/Collections.php',
'PHPCSUtils\\Tokens\\TokenHelper' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Tokens/TokenHelper.php',
'PHPCSUtils\\Utils\\Arrays' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Arrays.php',
'PHPCSUtils\\Utils\\Conditions' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Conditions.php',
+ 'PHPCSUtils\\Utils\\Constants' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Constants.php',
'PHPCSUtils\\Utils\\Context' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Context.php',
'PHPCSUtils\\Utils\\ControlStructures' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/ControlStructures.php',
+ 'PHPCSUtils\\Utils\\FileInfo' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FileInfo.php',
+ 'PHPCSUtils\\Utils\\FilePath' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FilePath.php',
'PHPCSUtils\\Utils\\FunctionDeclarations' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/FunctionDeclarations.php',
'PHPCSUtils\\Utils\\GetTokensAsString' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/GetTokensAsString.php',
'PHPCSUtils\\Utils\\Lists' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Lists.php',
@@ -65,6 +77,7 @@ class ComposerStaticInit5235166fb527dd945da834bfdcf7fb23
'PHPCSUtils\\Utils\\PassedParameters' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/PassedParameters.php',
'PHPCSUtils\\Utils\\Scopes' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Scopes.php',
'PHPCSUtils\\Utils\\TextStrings' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TextStrings.php',
+ 'PHPCSUtils\\Utils\\TypeString' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/TypeString.php',
'PHPCSUtils\\Utils\\UseStatements' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/UseStatements.php',
'PHPCSUtils\\Utils\\Variables' => __DIR__ . '/..' . '/phpcsstandards/phpcsutils/PHPCSUtils/Utils/Variables.php',
);
@@ -72,9 +85,9 @@ class ComposerStaticInit5235166fb527dd945da834bfdcf7fb23
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
- $loader->prefixLengthsPsr4 = ComposerStaticInit5235166fb527dd945da834bfdcf7fb23::$prefixLengthsPsr4;
- $loader->prefixDirsPsr4 = ComposerStaticInit5235166fb527dd945da834bfdcf7fb23::$prefixDirsPsr4;
- $loader->classMap = ComposerStaticInit5235166fb527dd945da834bfdcf7fb23::$classMap;
+ $loader->prefixLengthsPsr4 = ComposerStaticInit7c51e9b23c907624ae55d8ca4b2cc269::$prefixLengthsPsr4;
+ $loader->prefixDirsPsr4 = ComposerStaticInit7c51e9b23c907624ae55d8ca4b2cc269::$prefixDirsPsr4;
+ $loader->classMap = ComposerStaticInit7c51e9b23c907624ae55d8ca4b2cc269::$classMap;
}, null, ClassLoader::class);
}
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/installed.json b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/installed.json
index 58091d4..65a65e4 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/installed.json
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/installed.json
@@ -83,32 +83,32 @@
},
{
"name": "phpcsstandards/phpcsextra",
- "version": "1.3.0",
- "version_normalized": "1.3.0.0",
+ "version": "1.3.1",
+ "version_normalized": "1.3.1.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHPCSExtra.git",
- "reference": "46d08eb86eec622b96c466adec3063adfed280dd"
+ "reference": "8cb1a93708f82778c5fdc46106998c2072565418"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/46d08eb86eec622b96c466adec3063adfed280dd",
- "reference": "46d08eb86eec622b96c466adec3063adfed280dd",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHPCSExtra/zipball/8cb1a93708f82778c5fdc46106998c2072565418",
+ "reference": "8cb1a93708f82778c5fdc46106998c2072565418",
"shasum": ""
},
"require": {
"php": ">=5.4",
- "phpcsstandards/phpcsutils": "^1.0.9",
+ "phpcsstandards/phpcsutils": "^1.0.12",
"squizlabs/php_codesniffer": "^3.12.1"
},
"require-dev": {
"php-parallel-lint/php-console-highlighter": "^1.0",
- "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
"phpcsstandards/phpcsdevcs": "^1.1.6",
"phpcsstandards/phpcsdevtools": "^1.2.1",
"phpunit/phpunit": "^4.5 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0"
},
- "time": "2025-04-20T23:35:32+00:00",
+ "time": "2025-06-08T19:59:14+00:00",
"type": "phpcodesniffer-standard",
"extra": {
"branch-alias": {
@@ -168,32 +168,32 @@
},
{
"name": "phpcsstandards/phpcsutils",
- "version": "1.0.12",
- "version_normalized": "1.0.12.0",
+ "version": "1.1.0",
+ "version_normalized": "1.1.0.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHPCSUtils.git",
- "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c"
+ "reference": "65355670ac17c34cd235cf9d3ceae1b9252c4dad"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c",
- "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/65355670ac17c34cd235cf9d3ceae1b9252c4dad",
+ "reference": "65355670ac17c34cd235cf9d3ceae1b9252c4dad",
"shasum": ""
},
"require": {
"dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0",
"php": ">=5.4",
- "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev"
+ "squizlabs/php_codesniffer": "^3.13.0 || ^4.0"
},
"require-dev": {
"ext-filter": "*",
"php-parallel-lint/php-console-highlighter": "^1.0",
- "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
"phpcsstandards/phpcsdevcs": "^1.1.6",
- "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0"
+ "yoast/phpunit-polyfills": "^1.1.0 || ^2.0.0 || ^3.0.0"
},
- "time": "2024-05-20T13:34:27+00:00",
+ "time": "2025-06-12T04:32:33+00:00",
"type": "phpcodesniffer-standard",
"extra": {
"branch-alias": {
@@ -230,6 +230,7 @@
"phpcodesniffer-standard",
"phpcs",
"phpcs3",
+ "phpcs4",
"standards",
"static analysis",
"tokens",
@@ -253,23 +254,27 @@
{
"url": "https://opencollective.com/php_codesniffer",
"type": "open_collective"
+ },
+ {
+ "url": "https://thanks.dev/u/gh/phpcsstandards",
+ "type": "thanks_dev"
}
],
"install-path": "../phpcsstandards/phpcsutils"
},
{
"name": "squizlabs/php_codesniffer",
- "version": "3.13.0",
- "version_normalized": "3.13.0.0",
+ "version": "3.13.1",
+ "version_normalized": "3.13.1.0",
"source": {
"type": "git",
"url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git",
- "reference": "65ff2489553b83b4597e89c3b8b721487011d186"
+ "reference": "1b71b4dd7e7ef651ac749cea67e513c0c832f4bd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/65ff2489553b83b4597e89c3b8b721487011d186",
- "reference": "65ff2489553b83b4597e89c3b8b721487011d186",
+ "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1b71b4dd7e7ef651ac749cea67e513c0c832f4bd",
+ "reference": "1b71b4dd7e7ef651ac749cea67e513c0c832f4bd",
"shasum": ""
},
"require": {
@@ -281,7 +286,7 @@
"require-dev": {
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4"
},
- "time": "2025-05-11T03:36:00+00:00",
+ "time": "2025-06-12T15:04:34+00:00",
"bin": [
"bin/phpcbf",
"bin/phpcs"
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/installed.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/installed.php
index cce6dd5..2ecfa80 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/installed.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/composer/installed.php
@@ -3,7 +3,7 @@
'name' => 'troychaplin/monorepo-plugin',
'pretty_version' => 'dev-main',
'version' => 'dev-main',
- 'reference' => '5b658d0ac8d22c6a6a49c9046f5fdc2994f1b778',
+ 'reference' => '856bfcc3b7fdb00dca5213d1f41a428f4b3db92c',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
@@ -20,27 +20,27 @@
'dev_requirement' => true,
),
'phpcsstandards/phpcsextra' => array(
- 'pretty_version' => '1.3.0',
- 'version' => '1.3.0.0',
- 'reference' => '46d08eb86eec622b96c466adec3063adfed280dd',
+ 'pretty_version' => '1.3.1',
+ 'version' => '1.3.1.0',
+ 'reference' => '8cb1a93708f82778c5fdc46106998c2072565418',
'type' => 'phpcodesniffer-standard',
'install_path' => __DIR__ . '/../phpcsstandards/phpcsextra',
'aliases' => array(),
'dev_requirement' => true,
),
'phpcsstandards/phpcsutils' => array(
- 'pretty_version' => '1.0.12',
- 'version' => '1.0.12.0',
- 'reference' => '87b233b00daf83fb70f40c9a28692be017ea7c6c',
+ 'pretty_version' => '1.1.0',
+ 'version' => '1.1.0.0',
+ 'reference' => '65355670ac17c34cd235cf9d3ceae1b9252c4dad',
'type' => 'phpcodesniffer-standard',
'install_path' => __DIR__ . '/../phpcsstandards/phpcsutils',
'aliases' => array(),
'dev_requirement' => true,
),
'squizlabs/php_codesniffer' => array(
- 'pretty_version' => '3.13.0',
- 'version' => '3.13.0.0',
- 'reference' => '65ff2489553b83b4597e89c3b8b721487011d186',
+ 'pretty_version' => '3.13.1',
+ 'version' => '3.13.1.0',
+ 'reference' => '1b71b4dd7e7ef651ac749cea67e513c0c832f4bd',
'type' => 'library',
'install_path' => __DIR__ . '/../squizlabs/php_codesniffer',
'aliases' => array(),
@@ -49,7 +49,7 @@
'troychaplin/monorepo-plugin' => array(
'pretty_version' => 'dev-main',
'version' => 'dev-main',
- 'reference' => '5b658d0ac8d22c6a6a49c9046f5fdc2994f1b778',
+ 'reference' => '856bfcc3b7fdb00dca5213d1f41a428f4b3db92c',
'type' => 'wordpress-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/CHANGELOG.md b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/CHANGELOG.md
index c1cf762..51f25c1 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/CHANGELOG.md
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/CHANGELOG.md
@@ -15,6 +15,25 @@ This projects adheres to [Keep a CHANGELOG](https://keepachangelog.com/) and use
_Nothing yet._
+## [1.3.1] - 2025-06-08
+
+### Changed
+
+#### Other
+
+* Composer: The minimum `PHPCSUtils` requirement has been updated to `^1.0.12` (was `^1.0.9`). [#346]
+* Various housekeeping.
+
+### Fixed
+
+#### Universal
+
+* `Universal.UseStatements.DisallowMixedGroupUse`: the fixer could get confused when the "base" name for the group name contained a leading backslash, leading to parse errors in the fixed code. [#350]
+
+[#346]: https://github.com/PHPCSStandards/PHPCSExtra/pull/346
+[#350]: https://github.com/PHPCSStandards/PHPCSExtra/pull/350
+
+
## [1.3.0] - 2025-04-21
### Added
@@ -315,13 +334,14 @@ For the full list of features, please see the changelogs of the alpha/rc release
- When using this sniff with tab-based standards, please ensure that the `tab-width` is set and either don't set the `$indent` property or set it to the tab-width (or a multiple thereof).
- The fixer works based on "best guess" and may not always result in the desired indentation. Combine this sniff with the `Generic.WhiteSpace.ScopeIndent` sniff for more precise indentation fixes.
- The behaviour of the sniff is customizable via the following properties:
- - `indent`: the indent used for the codebase.
- - `ignoreAlignmentBefore`: allows for providing a list of token names for which (preceding) precision alignment should be ignored.
- - `ignoreBlankLines`: whether or not potential trailing whitespace on otherwise blank lines should be examined or ignored.
+ + `indent`: the indent used for the codebase.
+ + `ignoreAlignmentBefore`: allows for providing a list of token names for which (preceding) precision alignment should be ignored.
+ + `ignoreBlankLines`: whether or not potential trailing whitespace on otherwise blank lines should be examined or ignored.
### Changed
#### Universal
+
* `Universal.Arrays.DisallowShortArraySyntax`: the sniff will now record metrics about long vs short array usage. [#154]
* `Universal.Arrays.DuplicateArrayKey`: where relevant, the sniff will now make a distinction between keys which will be duplicate in all PHP version and (numeric) keys which will only be a duplicate key in [PHP < 8.0 or PHP >= 8.0][php-rfc-negative_array_index]. [#177], [#178]
If a [`php_version` configuration option][php_version-config] has been passed to PHPCS, it will be respected by the sniff and only report duplicate keys for the configured PHP version.
@@ -335,6 +355,7 @@ For the full list of features, please see the changelogs of the alpha/rc release
* `Universal.UseStatements.NoLeadingBackslash`: the sniff will now also flag and auto-fix leading backslashes in group use statements. [#167]
#### Other
+
* Updated the sniffs for compatibility with PHPCSUtils 1.0.0-alpha4. [#134]
* Updated the sniffs to correctly handle PHP 8.0/8.1/8.2 features whenever relevant.
* Readme: Updated installation instructions for compatibility with Composer 2.2+. [#101]
@@ -349,11 +370,13 @@ For the full list of features, please see the changelogs of the alpha/rc release
The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which potentially could have affected sniffs in this package.
#### NormalizedArrays
+
* `NormalizedArrays.Arrays.ArrayBraceSpacing`: the sniff now allows for trailing comments after the array opener in multi-line arrays. [#118]
* `NormalizedArrays.Arrays.ArrayBraceSpacing`: trailing comments at the end of an array, but before the closer, in multi-line arrays will no longer confuse the sniff. [#135]
* `NormalizedArrays.Arrays.CommaAfterLast`: the fixer will now recognize PHP 7.3+ flexible heredoc/nowdocs and in that case, will add the comma on the same line as the heredoc/nowdoc closer. [#144]
#### Universal
+
* `Universal.Arrays.DisallowShortArraySyntax`: nested short arrays in short lists will now be detected and fixed correctly. [#153]
* `Universal.ControlStructures.DisallowAlternativeSyntax`: the sniff will no longer bow out indiscriminately when the `allowWithInlineHTML` property is set to `true`. [#90], [#161]
* `Universal.ControlStructures.DisallowAlternativeSyntax`: when alternative control structure syntax is allowed in combination with inline HTML (`allowWithInlineHTML` property set to `true`), inline HTML in functions declared within the control structure body will no longer be taken into account for determining whether or not the control structure contains inline HTML. [#160]
@@ -452,19 +475,19 @@ The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which pote
* :wrench: :bar_chart: :books: New `Universal.Operators.StrictComparisons` sniff to enforce the use of strict comparisons. [#48]
Warning: the auto-fixer for this sniff _may_ cause bugs in applications and should be used with care! This is considered a _risky_ fixer.
* :wrench: :bar_chart: :books: New `Universal.OOStructures.AlphabeticExtendsImplements` sniff to verify that the names used in a class "implements" statement or an interface "extends" statement are listed in alphabetic order. [#55]
- * This sniff contains a public `orderby` property to determine the sort order to use for the statement.
+ - This sniff contains a public `orderby` property to determine the sort order to use for the statement.
If all names used are unqualified, the sort order won't make a difference.
However, if one or more of the names are partially or fully qualified, the chosen sort order will determine how the sorting between unqualified, partially and fully qualified names is handled.
The sniff supports two sort order options:
- - _'name'_ : sort by the interface name only (default);
- - _'full'_ : sort by the full name as used in the statement (without leading backslash).
+ + _'name'_ : sort by the interface name only (default);
+ + _'full'_ : sort by the full name as used in the statement (without leading backslash).
In both cases, the sorting will be done using natural sort, case-insensitive.
- * The sniff has modular error codes to allow for selective inclusion/exclusion:
- - `ImplementsWrongOrder` - for "class implements" statements.
- - `ImplementsWrongOrderWithComments` - for "class implements" statements interlaced with comments. These will not be auto-fixed.
- - `ExtendsWrongOrder` - for "interface extends" statements.
- - `ExtendsWrongOrderWithComments` - for "interface extends" statements interlaced with comments. These will not be auto-fixed.
- * When fixing, the existing spacing between the names in an `implements`/`extends` statement will not be maintained.
+ - The sniff has modular error codes to allow for selective inclusion/exclusion:
+ + `ImplementsWrongOrder` - for "class implements" statements.
+ + `ImplementsWrongOrderWithComments` - for "class implements" statements interlaced with comments. These will not be auto-fixed.
+ + `ExtendsWrongOrder` - for "interface extends" statements.
+ + `ExtendsWrongOrderWithComments` - for "interface extends" statements interlaced with comments. These will not be auto-fixed.
+ - When fixing, the existing spacing between the names in an `implements`/`extends` statement will not be maintained.
The fixer will separate each name with a comma and one space.
If alternative formatting is desired, a sniff which will check and fix the formatting should be added to the ruleset.
* :wrench: :bar_chart: :books: New `Universal.UseStatements.LowercaseFunctionConst` sniff to enforce that `function` and `const` keywords when used in an import `use` statement are always lowercase. [#58]
@@ -476,6 +499,7 @@ The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which pote
### Changed
#### Other
+
* The `master` branch has been renamed to `stable`.
* Composer: The version requirements for the [Composer PHPCS plugin] have been widened to allow for version 0.7.0 which supports Composer 2.0.0. [#62]
* Various housekeeping.
@@ -501,17 +525,20 @@ The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which pote
### Added
#### Universal
+
* :wrench: :bar_chart: :books: New `Universal.ControlStructures.DisallowAlternativeSyntax` sniff to disallow using the alternative syntax for control structures. [#23]
- This sniff contains a `allowWithInlineHTML` property to allow alternative syntax when inline HTML is used within the control structure. In all other cases, the use of the alternative syntax will still be disallowed.
- The sniff has modular error codes to allow for making exceptions based on specific control structures and/or specific control structures in combination with inline HTML.
* :bar_chart: `Universal.UseStatements.DisallowUseClass/Function/Const`: new, additional metrics about the import source will be shown in the `info` report. [#25]
#### Other
+
* Readme: installation instructions and sniff list. [#26]
### Changed
#### Universal
+
* `Universal.Arrays.DuplicateArrayKey`: wording of the error message. [#18]
* `Universal.UseStatements.DisallowUseClass/Function/Const`: the error codes have been made more modular. [#25]
Each of these sniffs now has four additional error codes:
@@ -522,12 +549,14 @@ The upgrade to PHPCSUtils 1.0.0-alpha4 took care of a number of bugs, which pote
In all other circumstances, the existing error codes FoundWithAlias and FoundWithoutAlias will continue to be used.
#### Other
+
* Improved formatting of the CLI documentation which can be viewed using `--generator=text`. [#17]
* Various housekeeping.
### Fixed
#### Universal
+
* `Universal.Arrays.DuplicateArrayKey`: improved handling of parse errors. [#34]
* `Universal.ControlStructures.IfElseDeclaration`: the fixer will now respect tab indentation. [#19]
* `Universal.UseStatements.DisallowUseClass/Function/Const`: the determination of whether a import is aliased in now done in a case-insensitive manner. [#25]
@@ -555,6 +584,7 @@ Initial alpha release containing:
This initial alpha release contains the following sniffs:
### NormalizedArrays
+
* :wrench: :bar_chart: :books: `NormalizedArrays.Arrays.ArrayBraceSpacing`: enforce consistent spacing for the open/close braces of array declarations.
The sniff allows for having different settings for:
- Space between the array keyword and the open parenthesis for long arrays via the `keywordSpacing` property.
@@ -576,6 +606,7 @@ This initial alpha release contains the following sniffs:
The valid values are: enforce, forbid or skip to not check the comma after the last array item for a particular type of array.
### Universal
+
* :books: `Universal.Arrays.DuplicateArrayKey`: detects duplicate array keys in array declarations.
* :books: `Universal.Arrays.MixedArrayKeyTypes`: best practice sniff: don't use a mix of integer and numeric keys for array items.
* :books: `Universal.Arrays.MixedKeyedUnkeyedArray`: best practice sniff: don't use a mix of keyed and unkeyed array items.
@@ -596,6 +627,7 @@ This initial alpha release contains the following sniffs:
[php_version-config]: https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options#setting-the-php-version
[Unreleased]: https://github.com/PHPCSStandards/PHPCSExtra/compare/stable...HEAD
+[1.3.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.3.0...1.3.1
[1.3.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.2.1...1.3.0
[1.2.1]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.2.0...1.2.1
[1.2.0]: https://github.com/PHPCSStandards/PHPCSExtra/compare/1.1.2...1.2.0
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml
index c30d745..27a9d54 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Modernize/ruleset.xml
@@ -1,5 +1,5 @@
-
+A collection of sniffs to detect code modernization opportunities.
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml
index 69c54a8..092df23 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/NormalizedArrays/ruleset.xml
@@ -1,5 +1,5 @@
-
+A ruleset for PHP_CodeSniffer to check arrays for normalized format.
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/README.md b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/README.md
index df37064..73c67e3 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/README.md
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/README.md
@@ -1,5 +1,4 @@
-PHPCSExtra
-=====================================================
+# PHPCSExtra
@@ -24,34 +23,31 @@ PHPCSExtra
* [Introduction](#introduction)
* [Minimum Requirements](#minimum-requirements)
* [Installation](#installation)
- + [Composer Project-based Installation](#composer-project-based-installation)
- + [Composer Global Installation](#composer-global-installation)
- + [Updating to a newer version](#updating-to-a-newer-version)
+ - [Composer Project-based Installation](#composer-project-based-installation)
+ - [Composer Global Installation](#composer-global-installation)
+ - [Updating to a newer version](#updating-to-a-newer-version)
* [Features](#features)
* [Sniffs](#sniffs)
- + [Modernize](#modernize)
- + [NormalizedArrays](#normalizedarrays)
- + [Universal](#universal)
+ - [Modernize](#modernize)
+ - [NormalizedArrays](#normalizedarrays)
+ - [Universal](#universal)
* [Contributing](#contributing)
* [License](#license)
-Introduction
--------------------------------------------
+## Introduction
PHPCSExtra is a collection of sniffs and standards for use with [PHP_CodeSniffer][phpcs-gh].
-Minimum Requirements
--------------------------------------------
+## Minimum Requirements
* PHP 5.4 or higher.
* [PHP_CodeSniffer][phpcs-gh] version **3.12.1** or higher.
-* [PHPCSUtils][phpcsutils-gh] version **1.0.9** or higher.
+* [PHPCSUtils][phpcsutils-gh] version **1.0.12** or higher.
-Installation
--------------------------------------------
+## Installation
Installing via Composer is highly recommended.
@@ -93,8 +89,7 @@ composer global update phpcsstandards/phpcsextra --with-dependencies
> (and potential other external PHPCS standards you use), manage the version requirements for these packages.
-Features
--------------------------------------------
+## Features
Once this project is installed, you will see three new rulesets in the list of installed standards when you run `vendor/bin/phpcs -i`: `Modernize`, `NormalizedArrays` and `Universal`.
@@ -105,8 +100,7 @@ Once this project is installed, you will see three new rulesets in the list of i
Instead include individual sniffs from this standard in a custom project/company ruleset to use them.
-Sniffs
--------------------------------------------
+## Sniffs
**Legend**:
* :wrench: = Includes auto-fixer.
@@ -138,13 +132,13 @@ In effect, this means that the sniff will only report on modernizations which ca
Enforce consistent spacing for the open/close braces of array declarations.
The sniff allows for having different settings for:
-- Space between the array keyword and the open parenthesis for long arrays via the `keywordSpacing` property.
+* Space between the array keyword and the open parenthesis for long arrays via the `keywordSpacing` property.
Accepted values: (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces.
-- Spaces on the inside of the braces for empty arrays via the `spacesWhenEmpty` property.
+* Spaces on the inside of the braces for empty arrays via the `spacesWhenEmpty` property.
Accepted values: (string) `newline`, (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces.
-- Spaces on the inside of the braces for single-line arrays via the `spacesSingleLine` property;
+* Spaces on the inside of the braces for single-line arrays via the `spacesSingleLine` property;
Accepted values: (int) number of spaces or `false` to turn this check off. Defaults to `0` spaces.
-- Spaces on the inside of the braces for multi-line arrays via the `spacesMultiLine` property.
+* Spaces on the inside of the braces for multi-line arrays via the `spacesMultiLine` property.
Accepted values: (string) `newline`, (int) number of spaces or `false` to turn this check off. Defaults to `newline`.
Note: if any of the above properties are set to `newline`, it is recommended to also include an array indentation sniff. This sniff will not handle the indentation.
@@ -539,7 +533,7 @@ The behaviour of the sniff is customizable via the following properties:
If this property is not set, the sniff will look to the `--tab-width` CLI value.
If that also isn't set, the default tab-width of `4` will be used.
* `ignoreAlignmentBefore`: allows for providing a list of token names for which (preceding) precision alignment should be ignored.
- Accepted values: (array) token constant names. Defaults to an empty array.
+ Accepted values: (`array`) token constant names. Defaults to an empty array.
Usage example:
```xml
@@ -559,14 +553,15 @@ The behaviour of the sniff is customizable via the following properties:
Accepted values: (bool)`true`|`false`. Defaults to `true`.
-Contributing
--------
+## Contributing
+
Contributions to this project are welcome. Clone the repo, branch off from `develop`, make your changes, commit them and send in a pull request.
If unsure whether the changes you are proposing would be welcome, open an issue first to discuss your proposal.
-License
--------
+
+## License
+
This code is released under the [GNU Lesser General Public License (LGPLv3)](LICENSE).
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php
index 2bb240d..a57d363 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowMixedGroupUseSniff.php
@@ -157,14 +157,18 @@ public function process(File $phpcsFile, $stackPtr)
* Fix it.
*
* This fixer complies with the following (arbitrary) requirements:
- * - It will re-use the original base "group" name, i.e. the part before \{.
- * - It take take aliases into account, but only when something is aliased to a different name.
+ * - It will re-use the original base "group" name, i.e. the part before \{,
+ * though it will remove a potential leading backslash from it.
+ * - It takes aliases into account, but only when something is aliased to a different name.
* Aliases re-using the original name will be removed.
* - The fix will not add a trailing comma after the last group use sub-statement.
* This is a PHP 7.2+ feature.
* If a standard wants to enforce trailing commas, they should use a separate sniff for that.
* - If there is only 1 statement of a certain type, the replacement will be a single
* import use statement, not a group use statement.
+ * - If any of the partial use statements within a group contain leading backslashes,
+ * the sniff will not correct for this. This is a parse error and the fixed version will
+ * still contain a parse error.
*/
$phpcsFile->fixer->beginChangeset();
@@ -187,7 +191,7 @@ public function process(File $phpcsFile, $stackPtr)
$useIndent = \str_repeat(' ', ($tokens[$stackPtr]['column'] - 1));
$insideIndent = $useIndent . \str_repeat(' ', 4);
- $baseGroupName = GetTokensAsString::noEmpties($phpcsFile, ($stackPtr + 1), ($groupStart - 1));
+ $baseGroupName = \ltrim(GetTokensAsString::noEmpties($phpcsFile, ($stackPtr + 1), ($groupStart - 1)), '\\');
foreach ($useStatements as $type => $statements) {
$count = \count($statements);
@@ -201,12 +205,12 @@ public function process(File $phpcsFile, $stackPtr)
}
if ($count === 1) {
- $fqName = \reset($statements);
- $alias = \key($statements);
+ $qualifiedName = \reset($statements);
+ $alias = \key($statements);
- $newStatement = 'use ' . $typeName . $fqName;
+ $newStatement = 'use ' . $typeName . $qualifiedName;
- $unqualifiedName = \ltrim(\substr($fqName, \strrpos($fqName, '\\')), '\\');
+ $unqualifiedName = \ltrim(\substr($qualifiedName, (int) \strrpos($qualifiedName, '\\')), '\\');
if ($unqualifiedName !== $alias) {
$newStatement .= ' as ' . $alias;
}
@@ -220,11 +224,11 @@ public function process(File $phpcsFile, $stackPtr)
// Multiple statements, add a single-type group use statement.
$newStatement = 'use ' . $typeName . $baseGroupName . '{' . $phpcsFile->eolChar;
- foreach ($statements as $alias => $fqName) {
- $partialName = \str_replace($baseGroupName, '', $fqName);
+ foreach ($statements as $alias => $qualifiedName) {
+ $partialName = \str_replace($baseGroupName, '', $qualifiedName);
$newStatement .= $insideIndent . $partialName;
- $unqualifiedName = \ltrim(\substr($partialName, \strrpos($partialName, '\\')), '\\');
+ $unqualifiedName = \ltrim(\substr($partialName, (int) \strrpos($partialName, '\\')), '\\');
if ($unqualifiedName !== $alias) {
$newStatement .= ' as ' . $alias;
}
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php
index 8dcf8dd..5df9317 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseClassSniff.php
@@ -127,7 +127,7 @@ public function process(File $phpcsFile, $stackPtr)
$endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1));
- foreach ($statements['name'] as $alias => $fullName) {
+ foreach ($statements['name'] as $alias => $qualifiedName) {
$reportPtr = $stackPtr;
do {
$reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias);
@@ -163,20 +163,19 @@ public function process(File $phpcsFile, $stackPtr)
$errorCode = 'Found';
$data = [
'',
- $fullName,
+ $qualifiedName,
];
$globalNamespace = false;
$sameNamespace = false;
- if (\strpos($fullName, '\\', 1) === false) {
+ if (\strpos($qualifiedName, '\\') === false) {
$globalNamespace = true;
$errorCode = 'FromGlobalNamespace';
$data[0] = ' from the global namespace';
$phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace');
} elseif ($this->currentNamespace !== ''
- && (\stripos($fullName, $this->currentNamespace . '\\') === 0
- || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0)
+ && \stripos($qualifiedName, $this->currentNamespace . '\\') === 0
) {
$sameNamespace = true;
$errorCode = 'FromSameNamespace';
@@ -188,7 +187,7 @@ public function process(File $phpcsFile, $stackPtr)
}
$hasAlias = false;
- $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1)));
+ $lastLeaf = \strtolower(\substr($qualifiedName, -(\strlen($alias) + 1)));
$aliasLC = \strtolower($alias);
if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) {
$hasAlias = true;
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php
index 44388f6..e66ccc7 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseConstSniff.php
@@ -127,7 +127,7 @@ public function process(File $phpcsFile, $stackPtr)
$endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1));
- foreach ($statements['const'] as $alias => $fullName) {
+ foreach ($statements['const'] as $alias => $qualifiedName) {
$reportPtr = $stackPtr;
do {
$reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias);
@@ -163,20 +163,19 @@ public function process(File $phpcsFile, $stackPtr)
$errorCode = 'Found';
$data = [
'',
- $fullName,
+ $qualifiedName,
];
$globalNamespace = false;
$sameNamespace = false;
- if (\strpos($fullName, '\\', 1) === false) {
+ if (\strpos($qualifiedName, '\\') === false) {
$globalNamespace = true;
$errorCode = 'FromGlobalNamespace';
$data[0] = ' from the global namespace';
$phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace');
} elseif ($this->currentNamespace !== ''
- && (\stripos($fullName, $this->currentNamespace . '\\') === 0
- || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0)
+ && \stripos($qualifiedName, $this->currentNamespace . '\\') === 0
) {
$sameNamespace = true;
$errorCode = 'FromSameNamespace';
@@ -188,7 +187,7 @@ public function process(File $phpcsFile, $stackPtr)
}
$hasAlias = false;
- $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1)));
+ $lastLeaf = \strtolower(\substr($qualifiedName, -(\strlen($alias) + 1)));
$aliasLC = \strtolower($alias);
if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) {
$hasAlias = true;
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php
index 46a39ed..c476352 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/DisallowUseFunctionSniff.php
@@ -127,7 +127,7 @@ public function process(File $phpcsFile, $stackPtr)
$endOfStatement = $phpcsFile->findNext([\T_SEMICOLON, \T_CLOSE_TAG], ($stackPtr + 1));
- foreach ($statements['function'] as $alias => $fullName) {
+ foreach ($statements['function'] as $alias => $qualifiedName) {
$reportPtr = $stackPtr;
do {
$reportPtr = $phpcsFile->findNext(\T_STRING, ($reportPtr + 1), $endOfStatement, false, $alias);
@@ -163,20 +163,19 @@ public function process(File $phpcsFile, $stackPtr)
$errorCode = 'Found';
$data = [
'',
- $fullName,
+ $qualifiedName,
];
$globalNamespace = false;
$sameNamespace = false;
- if (\strpos($fullName, '\\', 1) === false) {
+ if (\strpos($qualifiedName, '\\') === false) {
$globalNamespace = true;
$errorCode = 'FromGlobalNamespace';
$data[0] = ' from the global namespace';
$phpcsFile->recordMetric($reportPtr, self::METRIC_NAME_SRC, 'global namespace');
} elseif ($this->currentNamespace !== ''
- && (\stripos($fullName, $this->currentNamespace . '\\') === 0
- || \stripos($fullName, '\\' . $this->currentNamespace . '\\') === 0)
+ && \stripos($qualifiedName, $this->currentNamespace . '\\') === 0
) {
$sameNamespace = true;
$errorCode = 'FromSameNamespace';
@@ -188,7 +187,7 @@ public function process(File $phpcsFile, $stackPtr)
}
$hasAlias = false;
- $lastLeaf = \strtolower(\substr($fullName, -(\strlen($alias) + 1)));
+ $lastLeaf = \strtolower(\substr($qualifiedName, -(\strlen($alias) + 1)));
$aliasLC = \strtolower($alias);
if ($lastLeaf !== $aliasLC && $lastLeaf !== '\\' . $aliasLC) {
$hasAlias = true;
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php
index 93de596..c5dcec6 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/UseStatements/NoUselessAliasesSniff.php
@@ -92,8 +92,8 @@ public function process(File $phpcsFile, $stackPtr)
// Now check the names in each use statement for useless aliases.
foreach ($useStatements as $type => $statements) {
- foreach ($statements as $alias => $fqName) {
- $unqualifiedName = \ltrim(\substr($fqName, \strrpos($fqName, '\\')), '\\');
+ foreach ($statements as $alias => $qualifiedName) {
+ $unqualifiedName = \ltrim(\substr($qualifiedName, (int) \strrpos($qualifiedName, '\\')), '\\');
$uselessAlias = false;
if ($type === 'const') {
@@ -125,7 +125,7 @@ public function process(File $phpcsFile, $stackPtr)
$error = 'Useless alias "%s" found for import of "%s"';
$code = 'Found';
- $data = [$alias, $fqName];
+ $data = [$alias, $qualifiedName];
// Okay, so this is the one which should be flagged.
$hasComments = $phpcsFile->findNext(Tokens::$commentTokens, ($prev + 1), $aliasPtr);
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
index af68968..89d914b 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/WhiteSpace/PrecisionAlignmentSniff.php
@@ -306,16 +306,7 @@ public function process(File $phpcsFile, $stackPtr)
case \T_END_HEREDOC:
case \T_END_NOWDOC:
- /*
- * PHPCS does not execute tab replacement in heredoc/nowdoc closer
- * tokens prior to PHPCS 3.7.2, so handle this ourselves.
- */
- $content = $tokens[$i]['content'];
- if (\strpos($tokens[$i]['content'], "\t") !== false) {
- $origContent = $content;
- $content = \str_replace("\t", \str_repeat(' ', $this->tabWidth), $content);
- }
-
+ $content = $tokens[$i]['content'];
$closer = \ltrim($content);
$whitespace = \str_replace($closer, '', $content);
$length = \strlen($whitespace);
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml
index 6c591eb..e29238f 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/Universal/ruleset.xml
@@ -1,5 +1,5 @@
-
+A collection of universal sniffs. This standard is not designed to be used to check code. Include individual sniffs from this standard in a custom ruleset instead.
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/composer.json b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/composer.json
index b565df6..9edefc5 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/composer.json
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsextra/composer.json
@@ -23,10 +23,10 @@
"require" : {
"php" : ">=5.4",
"squizlabs/php_codesniffer" : "^3.12.1",
- "phpcsstandards/phpcsutils" : "^1.0.9"
+ "phpcsstandards/phpcsutils" : "^1.0.12"
},
"require-dev" : {
- "php-parallel-lint/php-parallel-lint": "^1.3.2",
+ "php-parallel-lint/php-parallel-lint": "^1.4.0",
"php-parallel-lint/php-console-highlighter": "^1.0",
"phpcsstandards/phpcsdevcs": "^1.1.6",
"phpcsstandards/phpcsdevtools": "^1.2.1",
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist
deleted file mode 100644
index 9ec6fd2..0000000
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/.phpdoc.xml.dist
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
- PHPCSUtils
-
-
-
- build/docs/structure/
-
-
-
-
-
- phpcsutils-autoload.php
- PHPCSUtils
-
-
- PHPCSUtils/Internal/**/*
-
- public
- protected
-
- codeCoverageIgnore
- phpcs
-
-
-
-
-
-
-
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/CHANGELOG.md b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/CHANGELOG.md
index b9f163f..fb1723a 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/CHANGELOG.md
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/CHANGELOG.md
@@ -9,6 +9,176 @@ This projects adheres to [Keep a CHANGELOG](https://keepachangelog.com/) and use
_Nothing yet._
+
+## [1.1.0] - 2025-06-12
+
+### Added
+
+Compatibility with the new PHP_CodeSniffer `4.x` branch in anticipation of the PHP_CodeSniffer 4.0 release. [#674], [#679]
+PHPCSUtils should now be fully compatible with PHP_CodeSniffer 4.0 (again). If you still find an issue, please report it.
+
+#### PHPCS BackCompat
+
+* `BCFile::findExtendedClassName()`: sync with PHPCS 4.0.0 - support for namespace relative names when used as the _extended_ parent class name. [#674]
+* `BCFile::findImplementedInterfaceNames()`: sync with PHPCS 4.0.0 - support for namespace relative names when used in _implemented_ interface names. [#674]
+* `BCFile::getMemberProperties()`: sync with PHPCS 3.12.0 - support for PHP 8.4 final properties. Thanks [@DanielEScherzer]! [#646]
+* `BCFile::getMemberProperties()`: sync with PHPCS 3.13.1 - support for PHP 8.4 asymmetric visibility. [#677]
+* `BCFile::getMemberProperties()`: sync with PHPCS 4.0.0. [#674]
+ - Add support for PHP 8.4 properties in interfaces.
+ - Removed parse error warning.
+* `BCFile::getMethodParameters()`: sync with PHPCS 3.13.1 - support for PHP 8.4 asymmetric visibility. [#677]
+* `BCFile::findStartOfStatement()`: sync with PHPCS 3.12.1 - support for `goto` as a `switch` - `case` terminating statement. [#661]
+* `BCTokens::nameTokens()` as introduced in PHPCS 4.0.0. [#674]
+ The same token array previously already existed in PHPCSUtils as `Collections::nameTokens()`.
+* `BCTokens::functionNameTokens()`: sync with PHPCS 4.0.0 - added the `T_ANON_CLASS` token. [#674]
+* `BCTokens::parenthesisOpeners()`: sync with PHPCS 4.0.0 - added the `T_USE`, `T_ISSET`, `T_UNSET`, `T_EMPTY`, `T_EVAL` and `T_EXIT` tokens. [#674]
+ Note: While `T_USE`, `T_ISSET`, `T_UNSET`, `T_EMPTY`, `T_EVAL` and `T_EXIT` will be included in the return value for this method,
+ the associated parentheses will not have the `'parenthesis_owner'` index set unless PHPCS 4.0.0 is used.
+ Use the [`Parentheses::getOwner()`][`Parentheses`] or the [`Parentheses::hasOwner()`][`Parentheses`] methods if you need to check
+ whether any of these tokens are a parentheses owner. The methods in the `Parentheses` class are PHPCS cross-version compatible.
+
+#### TestUtils
+
+* New [`PHPCSUtils\TestUtils\ConfigDouble`][`ConfigDouble`] class as a lightweight and more stable alternative to directly using the PHPCS native `Config` class in tests. [#550], [#612]
+ Props to [@fredden] for helping me find and fix a bug in this feature before it was released.
+* New [`PHPCSUtils\TestUtils\RulesetDouble`][`RulesetDouble`] class which allows for creating a `Ruleset` object without registering any sniffs. [#674]
+ This allows for the [`PHPCSUtils\TestUtils\UtilityMethodTestCase`][`UtilityMethodTestCase`] class to be cross-version compatible with both PHP_CodeSniffer 3.x as well as 4.x.
+* New [`PHPCSUtils\TestUtils\UtilityMethodTestCase::parseFile()`][`UtilityMethodTestCase`] method to allow for on-demand tokenizing of a (secondary) test case file. [#591], [#610]
+ This method is intended for tests which need to use multiple test case files, like, for example, tests which need to verify that a utility resets a `$fileName` property on seeing another file.
+* New [`PHPCSUtils\TestUtils\UtilityMethodTestCase::testTestMarkersAreUnique()` and `PHPCSUtils\TestUtils\UtilityMethodTestCase::assertTestMarkersAreUnique()`][`UtilityMethodTestCase`] methods which automatically check that code sample files used with this `TestCase` do not contain duplicate test case markers. [#642]
+ If needs be, the test method can be disabled by overloading it (discouraged). If a test uses multiple test case/code sample files, the assertion method can be called directly.
+
+#### Tokens
+
+* New [`Collections::constantTypeTokens()`][`Collections`] method to support PHP 8.3 typed class constants. [#562]
+* New [`Collections::ternaryOperators()`][`Collections`] method. [#549]
+* `T_EXIT` to the `Collections::functionCallTokens()` and `Collections::parameterPassingTokens()` in light of the PHP 8.4 "exit as function" change. [#618]
+* The PHP 8.4 asymmetric visibility tokens have been added to the [`Collections::propertyModifierKeywords()`][`Collections`] method. [#653]
+* `T_INTERFACE` has been added to the [`Collections::ooPropertyScopes()`][`Collections`] method for PHP 8.4 interface properties support. [#674]
+
+#### Utils
+
+* New [`PHPCSUtils\Utils\Constants`][`Constants`] class: Utility functions to examine (class) constants. [#562]
+ Initially available method: `getProperties()` to retrieve an array of information about an OO constant declaration.
+* New [`PHPCSUtils\Utils\FileInfo`][`FileInfo`] class: Utility functions to check characteristics of the file under scan. [#572]
+ Initial set of available methods: `hasByteOrderMark()` and `hasSheBang()`.
+* New [`PHPCSUtils\Utils\FilePath`][`FilePath`] class: Utility functions for handling and comparing file paths. [#593]
+ Initial set of available methods: `getName()` to retrieve the normalized path for the current file, `isStdin()`, `normalizeAbsolutePath()`, `normalizeDirectorySeparators()`, `trailingSlashIt()` and `startsWith()`.
+* New [`PHPCSUtils\Utils\TypeString`][`TypeString`] class: Utility functions for analysing typestrings as retrieved via the various available `getParameters()`/`getProperties()` methods. [#588]
+ Initial set of available methods: `getKeywordTypes()`, `isKeyword()`, `normalizeCase()`, `isSingular()`, `isNullable()`, `isUnion()`, `isIntersection()`, `isDNF()`, `toArray()`, `toArrayUnique()`, `filterKeywordTypes()` and `filterOOTypes()`.
+ Note: The `is*()` methods will not check if the type string provided is valid, as doing so would inhibit what sniffs can flag. The `is*()` methods will only look at the form of the type string to determine if it could be valid for a certain type.
+* New `PHPCSUtils\Utils\ObjectDeclarations::getDeclaredConstants()`, `PHPCSUtils\Utils\ObjectDeclarations::getDeclaredEnumCases()`, `PHPCSUtils\Utils\ObjectDeclarations::getDeclaredProperties()` and `PHPCSUtils\Utils\ObjectDeclarations::getDeclaredMethods()` utility methods. [#592]
+ These methods will each return an array with the name of the constant/case/property/method as the key and the typical stack pointer needed for further processing.
+ The retrieval of this information is highly optimized for performance. If a sniff needs to search for a named constant/enum case/property/method in an OO structure, in most cases, these methods should be the recommended way for finding the declaration, instead of the sniff attempting to do this itself.
+ Mind: the return value of the `getDeclaredProperties()` method includes constructor promoted properties. Passing the stack pointer of constructor promoted properties onto a call to the `Variables::getMemberProperties()` method, however, is currently not supported.
+* `FunctionDeclarations::getParameters()`: support for PHP 8.4 asymmetric visibility. [#677]
+* `Variables::getMemberProperties()`: support for PHP 8.4 final properties. Thanks [@DanielEScherzer]! [#646]
+* `Variables::getMemberProperties()`: support for PHP 8.4 asymmetric visibility. [#677]
+
+### Changed
+
+* The exceptions thrown by PHPCSUtils native utilities have been made more modular and more specific. [#598], [#599], [#600]
+ - Passing a parameter of the wrong type will now result in a `PHPCSUtils\Exceptions\TypeError` being thrown.
+ - Passing a parameter of the correct type, but with an invalid value, like an empty string when only non-empty strings are expected/accepted, will now result in a `PHPCSUtils\Exceptions\ValueError` being thrown.
+ - Passing a (positive) integer stack pointer, which doesn't exist in the token stack of the current file, will now result in a `PHPCSUtils\Exceptions\OutOfBoundsStackPtr` being thrown.
+ - Passing a stack pointer to a token which is not within the range of token types which is accepted by the method, will now result in a `PHPCSUtils\Exceptions\UnexpectedTokenType` being thrown.
+ - Logic errors will now result in a `PHPCSUtils\Exceptions\LogicException` being thrown.
+ This can occur, for instance, when a method takes a `$start` and `$end` parameter and the `$end` pointer is before the `$start` pointer.
+ - Missing, conditionally required, parameters, will now result in a `PHPCSUtils\Exceptions\MissingArgumentError` being thrown.
+ - Generic errors will now result in a `PHPCSUtils\Exceptions\RuntimeException` being thrown.
+ - Previously the PHPCS native `PHP_CodeSniffer\Exceptions\RuntimeException` was used for all these exceptions.
+ Catching the PHPCS native `RuntimeException` will still catch the new exceptions, but it is strongly recommended to be more selective when catching exceptions to prevent accidentally hiding errors in sniffs.
+ - Also note that the PHPCSUtils native utilities now include more and stricter type checking to help surface bugs in sniffs.
+
+#### Abstract Sniffs
+
+* The `AbstractArrayDeclarationSniff::process()` method will no longer hide exceptions about a non-integer or non-existent stack pointer being passed. [#600]
+* The `AbstractArrayDeclarationSniff::processArray()` method will no longer hide exceptions about non-integer or non-existent stack pointers being passed. [#600]
+
+#### PHPCS BackCompat
+
+* `BCFile::getDeclarationName()`: sync with PHPCS 3.12.0 - prevent incorrect result during live coding for unfinished closures. [#644]
+* `BCFile::getDeclarationName()`: sync with PHPCS 4.0.0 - no longer accept the `T_CLOSURE` or `T_ANON_CLASS` tokens. [#674]
+ Passing these will now result in an exception.
+* `BCFile::getDeclarationName()`: sync with PHPCS 4.0.0 - the method will now always return a string. [#674]
+ Previously, the method could return `null` when the name could not be determined. Now it will return an empty string.
+
+#### TestUtils
+
+* The [`PHPCSUtils\TestUtils\UtilityMethodTestCase`][`UtilityMethodTestCase`] is now officially compatible with PHPUnit 11 and will no longer generate any deprecation notices on PHPUnit 11.
+
+#### Utils
+
+* [`Parentheses`]: all methods will now recognize closer `use()` as a parentheses owner. [#674]
+ Note: PHPCS natively does not recognize closure `use` as a parentheses owners until PHP_CodeSniffer 4.0.
+* All methods in the [`PassedParameters`] class will now be able to analyze exit/die when used as a function call. [#618]
+* The `Scopes::isOOProperty()` method now allows for PHP 8.4 properties in interfaces. [#674]
+ - This also adds support for properties in interfaces to the `Variables::getMemberProperties()` method.
+* The `UseStatements::splitAndMergeImportUseStatement()` method will no longer hide exceptions about a non-integer, non-existent or non-`T_USE` stack pointer being passed. [#600]
+
+#### Other
+
+* Dropped support for [PHP_CodeSniffer] < 3.13.0. [#629], [#653]
+ Please ensure you run `composer update phpcsstandards/phpcsutils --with-dependencies` to benefit from this.
+* Various housekeeping, including making the test suite compatible with PHPUnit 11.
+
+### Deprecated
+
+#### TestUtils
+
+* The (internal) `PHPCSUtils\TestUtils\UtilityMethodTestCase::setStaticConfigProperty()` method. [#550]
+ This method has become redundant with the introduction of the `ConfigDouble` class.
+
+### Removed
+
+#### PHPCS BackCompat
+
+* The javascript specific `T_ZSR_EQUAL` token from the `BCTokens::assignmentTokens()` array, as per PHPCS 4.0.0. [#674]
+* The javascript specific `T_OBJECT` token from the `BCTokens::blockOpeners()` array, as per PHPCS 4.0.0. [#674]
+* The javascript specific `T_PROPERTY` and `T_OBJECT` tokens from the `BCTokens::blockOpeners()` array, as per PHPCS 4.0.0. [#674]
+
+### Fixed
+
+#### Abstract Sniffs
+
+* `AbstractArrayDeclarationSniff::getActualArrayKey()`: will now handle FQN `true`/`false`/`null` correctly. [#668]
+
+#### Utils
+
+* `Context::inForeachCondition()` could misidentify the `as` keyword for `foreach` when the iterable expression contained an array declaration in which the `as` keyword was being used. [#617]
+* The `Numbers::is*()` methods could misidentify strings which look like numeric literals with underscores, but are in actual fact invalid as numeric literals, as valid numbers. [#619], [#620]
+* `UseStatements::getType()` will now handle unfinished closure `use` statements (parse errors) more consistently and return `'closure'` for those cases. [#667]
+
+[#549]: https://github.com/PHPCSStandards/PHPCSUtils/pull/549
+[#550]: https://github.com/PHPCSStandards/PHPCSUtils/pull/550
+[#562]: https://github.com/PHPCSStandards/PHPCSUtils/pull/562
+[#572]: https://github.com/PHPCSStandards/PHPCSUtils/pull/572
+[#588]: https://github.com/PHPCSStandards/PHPCSUtils/pull/588
+[#591]: https://github.com/PHPCSStandards/PHPCSUtils/pull/591
+[#592]: https://github.com/PHPCSStandards/PHPCSUtils/pull/592
+[#593]: https://github.com/PHPCSStandards/PHPCSUtils/pull/593
+[#598]: https://github.com/PHPCSStandards/PHPCSUtils/pull/598
+[#599]: https://github.com/PHPCSStandards/PHPCSUtils/pull/599
+[#600]: https://github.com/PHPCSStandards/PHPCSUtils/pull/600
+[#610]: https://github.com/PHPCSStandards/PHPCSUtils/pull/610
+[#612]: https://github.com/PHPCSStandards/PHPCSUtils/pull/612
+[#617]: https://github.com/PHPCSStandards/PHPCSUtils/pull/617
+[#618]: https://github.com/PHPCSStandards/PHPCSUtils/pull/618
+[#619]: https://github.com/PHPCSStandards/PHPCSUtils/issues/619
+[#620]: https://github.com/PHPCSStandards/PHPCSUtils/pull/620
+[#629]: https://github.com/PHPCSStandards/PHPCSUtils/pull/629
+[#642]: https://github.com/PHPCSStandards/PHPCSUtils/pull/642
+[#644]: https://github.com/PHPCSStandards/PHPCSUtils/pull/644
+[#646]: https://github.com/PHPCSStandards/PHPCSUtils/pull/646
+[#653]: https://github.com/PHPCSStandards/PHPCSUtils/pull/653
+[#661]: https://github.com/PHPCSStandards/PHPCSUtils/pull/661
+[#667]: https://github.com/PHPCSStandards/PHPCSUtils/pull/667
+[#668]: https://github.com/PHPCSStandards/PHPCSUtils/pull/668
+[#674]: https://github.com/PHPCSStandards/PHPCSUtils/pull/674
+[#677]: https://github.com/PHPCSStandards/PHPCSUtils/pull/677
+[#679]: https://github.com/PHPCSStandards/PHPCSUtils/pull/679
+
+
## [1.0.12] - 2024-05-20
### Added
@@ -1051,6 +1221,7 @@ This initial alpha release contains the following utility classes:
[Unreleased]: https://github.com/PHPCSStandards/PHPCSUtils/compare/stable...HEAD
+[1.1.0]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.12...1.1.0
[1.0.12]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.11...1.0.12
[1.0.11]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.10...1.0.11
[1.0.10]: https://github.com/PHPCSStandards/PHPCSUtils/compare/1.0.9...1.0.10
@@ -1077,15 +1248,20 @@ This initial alpha release contains the following utility classes:
[`BCTokens`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-BackCompat-BCTokens.html
[`Helper`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-BackCompat-Helper.html
[`SpacesFixer`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Fixers-SpacesFixer.html
+[`ConfigDouble`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-TestUtils-ConfigDouble.html
+[`RulesetDouble`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-TestUtils-RulesetDouble.html
[`UtilityMethodTestCase`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-TestUtils-UtilityMethodTestCase.html
[`Collections`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Tokens-Collections.html
[`TokenHelper`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Tokens-TokenHelper.html
[`Arrays`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Arrays.html
[`Conditions`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Conditions.html
+[`Constants`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Constants.html
[`Context`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Context.html
[`ControlStructures`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-ControlStructures.html
[`FunctionDeclarations`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-FunctionDeclarations.html
[`GetTokensAsString`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-GetTokensAsString.html
+[`FileInfo`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-FileInfo.html
+[`FilePath`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-FilePath.html
[`Lists`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Lists.html
[`MessageHelper`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-MessageHelper.html
[`Namespaces`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Namespaces.html
@@ -1098,9 +1274,11 @@ This initial alpha release contains the following utility classes:
[`PassedParameters`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-PassedParameters.html
[`Scopes`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Scopes.html
[`TextStrings`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-TextStrings.html
+[`TypeString`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-TypeString.html
[`UseStatements`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-UseStatements.html
[`Variables`]: https://phpcsutils.com/phpdoc/classes/PHPCSUtils-Utils-Variables.html
-[@fredden]: https://github.com/fredden
-[@GaryJones]: https://github.com/GaryJones
-[@szepeviktor]: https://github.com/szepeviktor
+[@DanielEScherzer]: https://github.com/DanielEScherzer
+[@fredden]: https://github.com/fredden
+[@GaryJones]: https://github.com/GaryJones
+[@szepeviktor]: https://github.com/szepeviktor
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php
index b79a3fd..1480d25 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/AbstractSniffs/AbstractArrayDeclarationSniff.php
@@ -10,10 +10,11 @@
namespace PHPCSUtils\AbstractSniffs;
-use PHP_CodeSniffer\Exceptions\RuntimeException;
use PHP_CodeSniffer\Files\File;
use PHP_CodeSniffer\Sniffs\Sniff;
use PHP_CodeSniffer\Util\Tokens;
+use PHPCSUtils\Exceptions\LogicException;
+use PHPCSUtils\Exceptions\UnexpectedTokenType;
use PHPCSUtils\Tokens\Collections;
use PHPCSUtils\Utils\Arrays;
use PHPCSUtils\Utils\Numbers;
@@ -118,8 +119,6 @@ abstract class AbstractArrayDeclarationSniff implements Sniff
\T_DNUMBER => \T_DNUMBER,
\T_CONSTANT_ENCAPSED_STRING => \T_CONSTANT_ENCAPSED_STRING,
\T_STRING_CONCAT => \T_STRING_CONCAT,
- \T_INLINE_THEN => \T_INLINE_THEN,
- \T_INLINE_ELSE => \T_INLINE_ELSE,
\T_BOOLEAN_NOT => \T_BOOLEAN_NOT,
];
@@ -143,6 +142,7 @@ final public function __construct()
$this->acceptedTokens += Tokens::$castTokens;
$this->acceptedTokens += Tokens::$bracketTokens;
$this->acceptedTokens += Tokens::$heredocTokens;
+ $this->acceptedTokens += Collections::ternaryOperators();
}
/**
@@ -179,7 +179,7 @@ final public function process(File $phpcsFile, $stackPtr)
{
try {
$this->arrayItems = PassedParameters::getParameters($phpcsFile, $stackPtr);
- } catch (RuntimeException $e) {
+ } catch (UnexpectedTokenType $e) {
// Parse error, short list, real square open bracket or incorrectly tokenized short array token.
return;
}
@@ -246,7 +246,7 @@ public function processArray(File $phpcsFile)
foreach ($this->arrayItems as $itemNr => $arrayItem) {
try {
$arrowPtr = Arrays::getDoubleArrowPtr($phpcsFile, $arrayItem['start'], $arrayItem['end']);
- } catch (RuntimeException $e) {
+ } catch (LogicException $e) {
// Parse error: empty array item. Ignore.
continue;
}
@@ -478,6 +478,37 @@ public function getActualArrayKey(File $phpcsFile, $startPtr, $endPtr)
continue;
}
+ // Handle FQN true/false/null.
+ if ($this->tokens[$i]['code'] === \T_NAME_FULLY_QUALIFIED) {
+ $compareReadyKeyword = \strtolower($this->tokens[$i]['content']);
+ if ($compareReadyKeyword === '\true'
+ || $compareReadyKeyword === '\false'
+ || $compareReadyKeyword === '\null'
+ ) {
+ // FQN true/false/null on PHPCS 4.x. This can be handled.
+ $content .= $this->tokens[$i]['content'];
+ continue;
+ }
+ } elseif ($this->tokens[$i]['code'] === \T_NS_SEPARATOR) {
+ // PHPCS 3.x.
+ $nextNonEmpty = $phpcsFile->findNext(Tokens::$emptyTokens, ($i + 1), null, true);
+ $nextNonEmptyLC = \strtolower($this->tokens[$nextNonEmpty]['content']);
+ if ($nextNonEmpty !== false
+ // PHPCS 3.x with PHP < 8.0.
+ && ($this->tokens[$nextNonEmpty]['code'] === \T_TRUE
+ || $this->tokens[$nextNonEmpty]['code'] === \T_FALSE
+ || $this->tokens[$nextNonEmpty]['code'] === \T_NULL
+ // PHPCS 3.x with PHP >= 8.0 where the namespaced name tokenization has been undone.
+ || ($this->tokens[$nextNonEmpty]['code'] === \T_STRING
+ && ($nextNonEmptyLC === 'true' || $nextNonEmptyLC === 'false' || $nextNonEmptyLC === 'null')))
+ ) {
+ // FQN true/false/null on PHPCS 3.x. This can be handled.
+ $content .= $this->tokens[$nextNonEmpty]['content'];
+ $i = $nextNonEmpty;
+ continue;
+ }
+ }
+
if (isset($this->acceptedTokens[$this->tokens[$i]['code']]) === false) {
// This is not a key we can evaluate. Might be a variable or constant.
return;
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php
index 8c06343..4a78601 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCFile.php
@@ -76,7 +76,8 @@ final class BCFile
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - PHPCS 4.0: The method no longer accepts `T_CLOSURE` and `T_ANON_CLASS` tokens.
+ * - PHPCS 4.0: The method will now always return a string.
*
* @see \PHP_CodeSniffer\Files\File::getDeclarationName() Original source.
* @see \PHPCSUtils\Utils\ObjectDeclarations::getName() PHPCSUtils native improved version.
@@ -88,17 +89,53 @@ final class BCFile
* which declared the class, interface,
* trait, enum or function.
*
- * @return string|null The name of the class, interface, trait, enum, or function;
- * or `NULL` if the function or class is anonymous or
- * in case of a parse error/live coding.
+ * @return string The name of the class, interface, trait, or function or an empty string
+ * if the name could not be determined (live coding).
*
* @throws \PHP_CodeSniffer\Exceptions\RuntimeException If the specified token is not of type
- * `T_FUNCTION`, `T_CLASS`, `T_ANON_CLASS`,
- * `T_CLOSURE`, `T_TRAIT`, `T_ENUM` or `T_INTERFACE`.
+ * `T_FUNCTION`, `T_CLASS`, `T_TRAIT`, `T_ENUM`, or `T_INTERFACE`.
*/
public static function getDeclarationName(File $phpcsFile, $stackPtr)
{
- return $phpcsFile->getDeclarationName($stackPtr);
+ $tokens = $phpcsFile->getTokens();
+
+ $tokenCode = $tokens[$stackPtr]['code'];
+
+ if ($tokenCode !== T_FUNCTION
+ && $tokenCode !== T_CLASS
+ && $tokenCode !== T_INTERFACE
+ && $tokenCode !== T_TRAIT
+ && $tokenCode !== T_ENUM
+ ) {
+ throw new RuntimeException('Token type "' . $tokens[$stackPtr]['type'] . '" is not T_FUNCTION, T_CLASS, T_INTERFACE, T_TRAIT or T_ENUM');
+ }
+
+ if ($tokenCode === T_FUNCTION
+ && strtolower($tokens[$stackPtr]['content']) !== 'function'
+ ) {
+ // This is a function declared without the "function" keyword.
+ // So this token is the function name.
+ return $tokens[$stackPtr]['content'];
+ }
+
+ $stopPoint = $phpcsFile->numTokens;
+ if (isset($tokens[$stackPtr]['parenthesis_opener']) === true) {
+ // For functions, stop searching at the parenthesis opener.
+ $stopPoint = $tokens[$stackPtr]['parenthesis_opener'];
+ } elseif (isset($tokens[$stackPtr]['scope_opener']) === true) {
+ // For OO tokens, stop searching at the open curly.
+ $stopPoint = $tokens[$stackPtr]['scope_opener'];
+ }
+
+ $content = '';
+ for ($i = $stackPtr; $i < $stopPoint; $i++) {
+ if ($tokens[$i]['code'] === T_STRING) {
+ $content = $tokens[$i]['content'];
+ break;
+ }
+ }
+
+ return $content;
}
/**
@@ -148,6 +185,12 @@ public static function getDeclarationName(File $phpcsFile, $stackPtr)
* // This index will only be set if the property is readonly.
* ```
*
+ * ... and if the promoted property uses asymmetric visibility, these additional array indexes will also be available:
+ * ```php
+ * 'set_visibility' => string, // The property set-visibility as declared.
+ * 'set_visibility_token' => integer, // The stack pointer to the set-visibility modifier token.
+ * ```
+ *
* PHPCS cross-version compatible version of the `File::getMethodParameters()` method.
*
* Changelog for the PHPCS native function:
@@ -159,6 +202,7 @@ public static function getDeclarationName(File $phpcsFile, $stackPtr)
*
* @since 1.0.0
* @since 1.0.6 Sync with PHPCS 3.8.0, support for readonly properties without explicit visibility. PHPCS#3801.
+ * @since 1.1.0 Sync with PHPCS 3.13.1, support for asymmetric properties. PHPCS(new)#851
*
* @param \PHP_CodeSniffer\Files\File $phpcsFile The file being scanned.
* @param int $stackPtr The position in the stack of the function token
@@ -205,23 +249,24 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
$closer = $tokens[$opener]['parenthesis_closer'];
- $vars = [];
- $currVar = null;
- $paramStart = ($opener + 1);
- $defaultStart = null;
- $equalToken = null;
- $paramCount = 0;
- $hasAttributes = false;
- $passByReference = false;
- $referenceToken = false;
- $variableLength = false;
- $variadicToken = false;
- $typeHint = '';
- $typeHintToken = false;
- $typeHintEndToken = false;
- $nullableType = false;
- $visibilityToken = null;
- $readonlyToken = null;
+ $vars = [];
+ $currVar = null;
+ $paramStart = ($opener + 1);
+ $defaultStart = null;
+ $equalToken = null;
+ $paramCount = 0;
+ $hasAttributes = false;
+ $passByReference = false;
+ $referenceToken = false;
+ $variableLength = false;
+ $variadicToken = false;
+ $typeHint = '';
+ $typeHintToken = false;
+ $typeHintEndToken = false;
+ $nullableType = false;
+ $visibilityToken = null;
+ $setVisibilityToken = null;
+ $readonlyToken = null;
for ($i = $paramStart; $i <= $closer; $i++) {
// Check to see if this token has a parenthesis or bracket opener. If it does
@@ -355,6 +400,13 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
$visibilityToken = $i;
}
break;
+ case T_PUBLIC_SET:
+ case T_PROTECTED_SET:
+ case T_PRIVATE_SET:
+ if ($defaultStart === null) {
+ $setVisibilityToken = $i;
+ }
+ break;
case T_READONLY:
if ($defaultStart === null) {
$readonlyToken = $i;
@@ -389,16 +441,21 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
$vars[$paramCount]['type_hint_end_token'] = $typeHintEndToken;
$vars[$paramCount]['nullable_type'] = $nullableType;
- if ($visibilityToken !== null || $readonlyToken !== null) {
+ if ($visibilityToken !== null || $setVisibilityToken !== null || $readonlyToken !== null) {
$vars[$paramCount]['property_visibility'] = 'public';
$vars[$paramCount]['visibility_token'] = false;
- $vars[$paramCount]['property_readonly'] = false;
if ($visibilityToken !== null) {
$vars[$paramCount]['property_visibility'] = $tokens[$visibilityToken]['content'];
$vars[$paramCount]['visibility_token'] = $visibilityToken;
}
+ if ($setVisibilityToken !== null) {
+ $vars[$paramCount]['set_visibility'] = $tokens[$setVisibilityToken]['content'];
+ $vars[$paramCount]['set_visibility_token'] = $setVisibilityToken;
+ }
+
+ $vars[$paramCount]['property_readonly'] = false;
if ($readonlyToken !== null) {
$vars[$paramCount]['property_readonly'] = true;
$vars[$paramCount]['readonly_token'] = $readonlyToken;
@@ -412,21 +469,22 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
}
// Reset the vars, as we are about to process the next parameter.
- $currVar = null;
- $paramStart = ($i + 1);
- $defaultStart = null;
- $equalToken = null;
- $hasAttributes = false;
- $passByReference = false;
- $referenceToken = false;
- $variableLength = false;
- $variadicToken = false;
- $typeHint = '';
- $typeHintToken = false;
- $typeHintEndToken = false;
- $nullableType = false;
- $visibilityToken = null;
- $readonlyToken = null;
+ $currVar = null;
+ $paramStart = ($i + 1);
+ $defaultStart = null;
+ $equalToken = null;
+ $hasAttributes = false;
+ $passByReference = false;
+ $referenceToken = false;
+ $variableLength = false;
+ $variadicToken = false;
+ $typeHint = '';
+ $typeHintToken = false;
+ $typeHintEndToken = false;
+ $nullableType = false;
+ $visibilityToken = null;
+ $setVisibilityToken = null;
+ $readonlyToken = null;
++$paramCount;
break;
@@ -466,7 +524,7 @@ public static function getMethodParameters(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::getMethodProperties() Original source.
* @see \PHPCSUtils\Utils\FunctionDeclarations::getProperties() PHPCSUtils native improved version.
@@ -495,8 +553,12 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
* array(
* 'scope' => string, // Public, private, or protected.
* 'scope_specified' => boolean, // TRUE if the scope was explicitly specified.
+ * 'set_scope' => string|false, // Scope for asymmetric visibility.
+ * // Either public, private, or protected or
+ * // FALSE if no set scope is specified.
* 'is_static' => boolean, // TRUE if the static keyword was found.
* 'is_readonly' => boolean, // TRUE if the readonly keyword was found.
+ * 'is_final' => boolean, // TRUE if the final keyword was found.
* 'type' => string, // The type of the var (empty if no type specified).
* 'type_token' => integer|false, // The stack pointer to the start of the type
* // or FALSE if there is no type.
@@ -511,7 +573,8 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - PHPCS 4.0: properties in interfaces (PHP 8.4+) are accepted.
+ * - PHPCS 4.0: will no longer throw a parse error warning.
*
* @see \PHP_CodeSniffer\Files\File::getMemberProperties() Original source.
* @see \PHPCSUtils\Utils\Variables::getMemberProperties() PHPCSUtils native improved version.
@@ -530,7 +593,146 @@ public static function getMethodProperties(File $phpcsFile, $stackPtr)
*/
public static function getMemberProperties(File $phpcsFile, $stackPtr)
{
- return $phpcsFile->getMemberProperties($stackPtr);
+ $tokens = $phpcsFile->getTokens();
+
+ if ($tokens[$stackPtr]['code'] !== T_VARIABLE) {
+ throw new RuntimeException('$stackPtr must be of type T_VARIABLE');
+ }
+
+ $conditions = $tokens[$stackPtr]['conditions'];
+ $conditions = array_keys($conditions);
+ $ptr = array_pop($conditions);
+ if (isset($tokens[$ptr]) === false
+ || isset(Tokens::$ooScopeTokens[$tokens[$ptr]['code']]) === false
+ || $tokens[$ptr]['code'] === T_ENUM
+ ) {
+ throw new RuntimeException('$stackPtr is not a class member var');
+ }
+
+ // Make sure it's not a method parameter.
+ if (empty($tokens[$stackPtr]['nested_parenthesis']) === false) {
+ $parenthesis = array_keys($tokens[$stackPtr]['nested_parenthesis']);
+ $deepestOpen = array_pop($parenthesis);
+ if ($deepestOpen > $ptr
+ && isset($tokens[$deepestOpen]['parenthesis_owner']) === true
+ && $tokens[$tokens[$deepestOpen]['parenthesis_owner']]['code'] === T_FUNCTION
+ ) {
+ throw new RuntimeException('$stackPtr is not a class member var');
+ }
+ }
+
+ $valid = [
+ T_STATIC => T_STATIC,
+ T_VAR => T_VAR,
+ T_READONLY => T_READONLY,
+ T_FINAL => T_FINAL,
+ ];
+
+ $valid += Tokens::$scopeModifiers;
+ $valid += Tokens::$emptyTokens;
+
+ $scope = 'public';
+ $scopeSpecified = false;
+ $setScope = false;
+ $isStatic = false;
+ $isReadonly = false;
+ $isFinal = false;
+
+ $startOfStatement = $phpcsFile->findPrevious(
+ [
+ T_SEMICOLON,
+ T_OPEN_CURLY_BRACKET,
+ T_CLOSE_CURLY_BRACKET,
+ T_ATTRIBUTE_END,
+ ],
+ ($stackPtr - 1)
+ );
+
+ for ($i = ($startOfStatement + 1); $i < $stackPtr; $i++) {
+ if (isset($valid[$tokens[$i]['code']]) === false) {
+ break;
+ }
+
+ switch ($tokens[$i]['code']) {
+ case T_PUBLIC:
+ $scope = 'public';
+ $scopeSpecified = true;
+ break;
+ case T_PRIVATE:
+ $scope = 'private';
+ $scopeSpecified = true;
+ break;
+ case T_PROTECTED:
+ $scope = 'protected';
+ $scopeSpecified = true;
+ break;
+ case T_PUBLIC_SET:
+ $setScope = 'public';
+ break;
+ case T_PROTECTED_SET:
+ $setScope = 'protected';
+ break;
+ case T_PRIVATE_SET:
+ $setScope = 'private';
+ break;
+ case T_STATIC:
+ $isStatic = true;
+ break;
+ case T_READONLY:
+ $isReadonly = true;
+ break;
+ case T_FINAL:
+ $isFinal = true;
+ break;
+ }
+ }
+
+ $type = '';
+ $typeToken = false;
+ $typeEndToken = false;
+ $nullableType = false;
+
+ if ($i < $stackPtr) {
+ // We've found a type.
+ $valid = Collections::propertyTypeTokens();
+
+ for ($i; $i < $stackPtr; $i++) {
+ if ($tokens[$i]['code'] === T_VARIABLE) {
+ // Hit another variable in a group definition.
+ break;
+ }
+
+ if ($tokens[$i]['code'] === T_NULLABLE) {
+ $nullableType = true;
+ }
+
+ if (isset($valid[$tokens[$i]['code']]) === true) {
+ $typeEndToken = $i;
+ if ($typeToken === false) {
+ $typeToken = $i;
+ }
+
+ $type .= $tokens[$i]['content'];
+ }
+ }
+
+ if ($type !== '' && $nullableType === true) {
+ $type = '?' . $type;
+ }
+ }
+
+ return [
+ 'scope' => $scope,
+ 'scope_specified' => $scopeSpecified,
+ 'set_scope' => $setScope,
+ 'is_static' => $isStatic,
+ 'is_readonly' => $isReadonly,
+ 'is_final' => $isFinal,
+ 'type' => $type,
+ 'type_token' => $typeToken,
+ 'type_end_token' => $typeEndToken,
+ 'nullable_type' => $nullableType,
+ ];
}
/**
@@ -549,7 +751,7 @@ public static function getMemberProperties(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 1.3.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::getClassProperties() Original source.
* @see \PHPCSUtils\Utils\ObjectDeclarations::getClassProperties() PHPCSUtils native improved version.
@@ -577,7 +779,7 @@ public static function getClassProperties(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::isReference() Original source.
* @see \PHPCSUtils\Utils\Operators::isReference() PHPCSUtils native improved version.
@@ -603,7 +805,7 @@ public static function isReference(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::getTokensAsString() Original source.
* @see \PHPCSUtils\Utils\GetTokensAsString Related set of functions.
@@ -632,7 +834,7 @@ public static function getTokensAsString(File $phpcsFile, $start, $length, $orig
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 2.1.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::findStartOfStatement() Original source.
*
@@ -656,7 +858,7 @@ public static function findStartOfStatement(File $phpcsFile, $start, $ignore = n
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 2.1.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::findEndOfStatement() Original source.
*
@@ -680,7 +882,7 @@ public static function findEndOfStatement(File $phpcsFile, $start, $ignore = nul
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 0.0.5.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::hasCondition() Original source.
* @see \PHPCSUtils\Utils\Conditions::hasCondition() PHPCSUtils native alternative.
@@ -705,7 +907,7 @@ public static function hasCondition(File $phpcsFile, $stackPtr, $types)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 1.3.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - The upstream method has received no significant updates since PHPCS 3.13.0.
*
* @see \PHP_CodeSniffer\Files\File::getCondition() Original source.
* @see \PHPCSUtils\Utils\Conditions::getCondition() More versatile alternative.
@@ -736,7 +938,7 @@ public static function getCondition(File $phpcsFile, $stackPtr, $type, $first =
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 1.2.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - PHPCS 4.0.0: Handling of the namespace relative parent class using the namespace keyword as operator.
*
* @see \PHP_CodeSniffer\Files\File::findExtendedClassName() Original source.
* @see \PHPCSUtils\Utils\ObjectDeclarations::findExtendedClassName() PHPCSUtils native improved version.
@@ -751,7 +953,42 @@ public static function getCondition(File $phpcsFile, $stackPtr, $type, $first =
*/
public static function findExtendedClassName(File $phpcsFile, $stackPtr)
{
- return $phpcsFile->findExtendedClassName($stackPtr);
+ $tokens = $phpcsFile->getTokens();
+
+ // Check for the existence of the token.
+ if (isset($tokens[$stackPtr]) === false) {
+ return false;
+ }
+
+ if ($tokens[$stackPtr]['code'] !== T_CLASS
+ && $tokens[$stackPtr]['code'] !== T_ANON_CLASS
+ && $tokens[$stackPtr]['code'] !== T_INTERFACE
+ ) {
+ return false;
+ }
+
+ if (isset($tokens[$stackPtr]['scope_opener']) === false) {
+ return false;
+ }
+
+ $classOpenerIndex = $tokens[$stackPtr]['scope_opener'];
+ $extendsIndex = $phpcsFile->findNext(T_EXTENDS, $stackPtr, $classOpenerIndex);
+ if ($extendsIndex === false) {
+ return false;
+ }
+
+ $find = Collections::namespacedNameTokens();
+ $find[] = T_WHITESPACE;
+
+ $end = $phpcsFile->findNext($find, ($extendsIndex + 1), ($classOpenerIndex + 1), true);
+ $name = $phpcsFile->getTokensAsString(($extendsIndex + 1), ($end - $extendsIndex - 1));
+ $name = trim($name);
+
+ if ($name === '') {
+ return false;
+ }
+
+ return $name;
}
/**
@@ -761,7 +998,7 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr)
*
* Changelog for the PHPCS native function:
* - Introduced in PHPCS 2.7.0.
- * - The upstream method has received no significant updates since PHPCS 3.10.0.
+ * - PHPCS 4.0.0: Handling of the namespace relative parent class using the namespace keyword as operator.
*
* @see \PHP_CodeSniffer\Files\File::findImplementedInterfaceNames() Original source.
* @see \PHPCSUtils\Utils\ObjectDeclarations::findImplementedInterfaceNames() PHPCSUtils native improved version.
@@ -776,6 +1013,44 @@ public static function findExtendedClassName(File $phpcsFile, $stackPtr)
*/
public static function findImplementedInterfaceNames(File $phpcsFile, $stackPtr)
{
- return $phpcsFile->findImplementedInterfaceNames($stackPtr);
+ $tokens = $phpcsFile->getTokens();
+
+ // Check for the existence of the token.
+ if (isset($tokens[$stackPtr]) === false) {
+ return false;
+ }
+
+ if ($tokens[$stackPtr]['code'] !== T_CLASS
+ && $tokens[$stackPtr]['code'] !== T_ANON_CLASS
+ && $tokens[$stackPtr]['code'] !== T_ENUM
+ ) {
+ return false;
+ }
+
+ if (isset($tokens[$stackPtr]['scope_closer']) === false) {
+ return false;
+ }
+
+ $classOpenerIndex = $tokens[$stackPtr]['scope_opener'];
+ $implementsIndex = $phpcsFile->findNext(T_IMPLEMENTS, $stackPtr, $classOpenerIndex);
+ if ($implementsIndex === false) {
+ return false;
+ }
+
+ $find = Collections::namespacedNameTokens();
+ $find[] = T_WHITESPACE;
+ $find[] = T_COMMA;
+
+ $end = $phpcsFile->findNext($find, ($implementsIndex + 1), ($classOpenerIndex + 1), true);
+ $name = $phpcsFile->getTokensAsString(($implementsIndex + 1), ($end - $implementsIndex - 1));
+ $name = trim($name);
+
+ if ($name === '') {
+ return false;
+ } else {
+ $names = explode(',', $name);
+ $names = array_map('trim', $names);
+ return $names;
+ }
}
}
diff --git a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php
index 2d6a72f..49b8c15 100644
--- a/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php
+++ b/wordpress/wp-content/plugins/monorepo-plugin/vendor/phpcsstandards/phpcsutils/PHPCSUtils/BackCompat/BCTokens.php
@@ -43,38 +43,36 @@
*
* @since 1.0.0
*
- * @method static array arithmeticTokens() Tokens that represent arithmetic operators.
- * @method static array assignmentTokens() Tokens that represent assignments.
- * @method static array blockOpeners() Tokens that open code blocks.
- * @method static array booleanOperators() Tokens that perform boolean operations.
- * @method static array bracketTokens() Tokens that represent brackets and parenthesis.
- * @method static array castTokens() Tokens that represent type casting.
- * @method static array commentTokens() Tokens that are comments.
- * @method static array comparisonTokens() Tokens that represent comparison operator.
- * @method static array contextSensitiveKeywords() Tokens representing context sensitive keywords in PHP.
- * @method static array emptyTokens() Tokens that don't represent code.
- * @method static array equalityTokens() Tokens that represent equality comparisons.
- * @method static array heredocTokens() Tokens that make up a heredoc string.
- * @method static array includeTokens() Tokens that include files.
- * @method static array magicConstants() Tokens representing PHP magic constants.
- * @method static array methodPrefixes() Tokens that can prefix a method name.
- * @method static array ooScopeTokens() Tokens that open class and object scopes.
- * @method static array operators() Tokens that perform operations.
- * @method static array parenthesisOpeners() Token types that open parenthesis.
- * @method static array phpcsCommentTokens() Tokens that are comments containing PHPCS instructions.
- * @method static array scopeModifiers() Tokens that represent scope modifiers.
- * @method static array scopeOpeners() Tokens that are allowed to open scopes.
- * @method static array stringTokens() Tokens that represent strings.
- * Note that `T_STRING`s are NOT represented in this list as this list
- * is about _text_ strings.
- * @method static array textStringTokens() Tokens that represent text strings.
+ * @method static array arithmeticTokens() Tokens that represent arithmetic operators.
+ * @method static array booleanOperators() Tokens that perform boolean operations.
+ * @method static array bracketTokens() Tokens that represent brackets and parenthesis.
+ * @method static array castTokens() Tokens that represent type casting.
+ * @method static array commentTokens() Tokens that are comments.
+ * @method static array comparisonTokens() Tokens that represent comparison operator.
+ * @method static array contextSensitiveKeywords() Tokens representing context sensitive keywords
+ * in PHP.
+ * @method static array emptyTokens() Tokens that don't represent code.
+ * @method static array equalityTokens() Tokens that represent equality comparisons.
+ * @method static array heredocTokens() Tokens that make up a heredoc string.
+ * @method static array includeTokens() Tokens that include files.
+ * @method static array magicConstants() Tokens representing PHP magic constants.
+ * @method static array methodPrefixes() Tokens that can prefix a method name.
+ * @method static array ooScopeTokens() Tokens that open class and object scopes.
+ * @method static array