From a48f9b996b29df727e3808879da9ec9fa2db5343 Mon Sep 17 00:00:00 2001 From: Chris Reynolds Date: Fri, 17 Jan 2025 10:41:17 -0700 Subject: [PATCH] bump composer deps --- composer.lock | 375 +++++----- vendor/bin/tokenize | 2 +- vendor/composer/installed.json | 393 +++++------ vendor/composer/installed.php | 84 +-- vendor/johnbillion/args/README.md | 2 +- vendor/johnbillion/args/composer.json | 12 +- .../johnbillion/args/src/MetaQuery/Query.php | 2 +- vendor/johnbillion/args/src/WP_Term_Query.php | 7 - vendor/johnbillion/args/src/register_meta.php | 5 + vendor/johnbillion/extended-cpts/README.md | 6 +- .../johnbillion/extended-cpts/composer.json | 14 +- .../extended-cpts/extended-cpts.php | 2 +- .../extended-cpts/src/TaxonomyAdmin.php | 2 +- .../deep-copy/src/DeepCopy/DeepCopy.php | 3 + .../TypeFilter/Date/DatePeriodFilter.php | 42 ++ .../lib/PhpParser/Node/Expr/ArrayItem.php | 8 + .../lib/PhpParser/Node/Expr/ClosureUse.php | 8 + .../lib/PhpParser/Node/Identifier.php | 2 +- .../php-parser/lib/PhpParser/Node/Name.php | 2 +- .../php-parser/lib/PhpParser/Node/Param.php | 13 +- .../lib/PhpParser/Node/PropertyHook.php | 29 +- .../lib/PhpParser/Node/Scalar/DNumber.php | 8 + .../lib/PhpParser/Node/Scalar/Encapsed.php | 8 + .../Node/Scalar/EncapsedStringPart.php | 10 + .../lib/PhpParser/Node/Scalar/LNumber.php | 8 + .../PhpParser/Node/Stmt/DeclareDeclare.php | 10 + .../lib/PhpParser/Node/Stmt/Property.php | 14 + .../PhpParser/Node/Stmt/PropertyProperty.php | 10 + .../lib/PhpParser/Node/Stmt/StaticVar.php | 8 + .../lib/PhpParser/Node/Stmt/UseUse.php | 10 + .../lib/PhpParser/NodeTraverser.php | 245 +++---- .../php-parser/lib/PhpParser/Parser/Php7.php | 2 + .../php-parser/lib/PhpParser/Parser/Php8.php | 8 +- .../lib/PhpParser/ParserAbstract.php | 26 +- .../wpunit-helpers/bin/helpers.sh | 39 +- .../PHPCompatibilityWP/ruleset.xml | 3 +- .../phpcompatibility-wp/README.md | 13 +- .../src/Ast/Type/ArrayShapeNode.php | 2 + .../phpdoc-parser/src/Parser/TypeParser.php | 16 +- vendor/phpunit/phpunit/ChangeLog-9.6.md | 7 + vendor/phpunit/phpunit/composer.json | 2 +- vendor/phpunit/phpunit/composer.lock | 32 +- .../Constraint/Operator/UnaryOperator.php | 1 - .../Framework/Constraint/String/IsJson.php | 1 - .../Traversable/TraversableContains.php | 1 - .../src/Framework/Constraint/Type/IsType.php | 1 - .../phpunit/src/Framework/TestCase.php | 2 +- .../phpunit/src/Runner/Filter/Factory.php | 2 +- vendor/phpunit/phpunit/src/Runner/Version.php | 2 +- .../src/TextUI/XmlConfiguration/Loader.php | 3 +- .../VariableAnalysis/Lib/Helpers.php | 245 +++++-- .../CodeAnalysis/VariableAnalysisSniff.php | 95 +-- .../phpcs-variable-analysis/composer.json | 120 ++-- .../.github/PULL_REQUEST_TEMPLATE.md | 13 + .../AbstractMethodAnnotationSniff.php | 2 +- vendor/squizlabs/php_codesniffer/CHANGELOG.md | 173 ++++- vendor/squizlabs/php_codesniffer/README.md | 10 +- .../squizlabs/php_codesniffer/src/Config.php | 2 +- .../php_codesniffer/src/Files/File.php | 10 +- .../src/Generators/Generator.php | 21 +- .../php_codesniffer/src/Generators/HTML.php | 186 +++-- .../src/Generators/Markdown.php | 52 +- .../php_codesniffer/src/Generators/Text.php | 18 +- .../php_codesniffer/src/Reports/Code.php | 2 +- .../squizlabs/php_codesniffer/src/Runner.php | 22 +- .../Docs/Arrays/ArrayIndentStandard.xml | 107 +++ .../Strings/UnnecessaryHeredocStandard.xml | 39 ++ .../HereNowdocIdentifierSpacingStandard.xml | 23 + .../SpreadOperatorSpacingAfterStandard.xml | 2 +- .../Classes/DuplicateClassNameSniff.php | 96 +-- .../CodeAnalysis/EmptyPHPStatementSniff.php | 187 ++--- ...ExplicitBooleanOperatorPrecedenceSniff.php | 9 +- .../DisallowYodaConditionsSniff.php | 2 +- .../InlineControlStructureSniff.php | 15 - ...ningFunctionBraceKernighanRitchieSniff.php | 33 +- .../Metrics/CyclomaticComplexitySniff.php | 4 +- .../Sniffs/Metrics/NestingLevelSniff.php | 4 +- .../AbstractClassNamePrefixSniff.php | 2 +- .../CamelCapsFunctionNameSniff.php | 9 +- .../ConstructorNameSniff.php | 33 +- .../InterfaceNameSuffixSniff.php | 1 + .../TraitNameSuffixSniff.php | 1 + .../UpperCaseConstantNameSniff.php | 38 +- .../Strings/UnnecessaryHeredocSniff.php | 97 +++ .../WhiteSpace/DisallowTabIndentSniff.php | 1 + .../HereNowdocIdentifierSpacingSniff.php | 69 ++ .../LanguageConstructSpacingSniff.php | 71 +- .../Classes/DuplicateClassNameUnitTest.10.inc | 6 + .../Classes/DuplicateClassNameUnitTest.11.inc | 13 + .../Classes/DuplicateClassNameUnitTest.7.inc | 13 + .../Classes/DuplicateClassNameUnitTest.8.inc | 8 + .../Classes/DuplicateClassNameUnitTest.9.inc | 5 + .../Classes/DuplicateClassNameUnitTest.97.inc | 8 + .../Classes/DuplicateClassNameUnitTest.98.inc | 8 + .../Classes/DuplicateClassNameUnitTest.99.inc | 7 + .../Classes/DuplicateClassNameUnitTest.php | 15 + ...st.inc => EmptyPHPStatementUnitTest.1.inc} | 8 +- ... => EmptyPHPStatementUnitTest.1.inc.fixed} | 4 +- .../EmptyPHPStatementUnitTest.2.inc | 27 + .../EmptyPHPStatementUnitTest.2.inc.fixed | 23 + .../EmptyPHPStatementUnitTest.php | 81 ++- ...js => InlineControlStructureUnitTest.1.js} | 0 ...InlineControlStructureUnitTest.1.js.fixed} | 0 .../InlineControlStructureUnitTest.2.js | 5 + .../InlineControlStructureUnitTest.3.js | 5 + .../InlineControlStructureUnitTest.php | 2 +- .../Generic/Tests/Debug/CSSLintUnitTest.php | 2 + .../Files/LowercasedFilenameUnitTest.php | 45 ++ .../Files/lowercased_filename_unit_test.inc | 1 + ...nctionBraceKernighanRitchieUnitTest.1.inc} | 30 +- ...BraceKernighanRitchieUnitTest.1.inc.fixed} | 32 +- ...unctionBraceKernighanRitchieUnitTest.2.inc | 19 + ...nBraceKernighanRitchieUnitTest.2.inc.fixed | 19 + ...unctionBraceKernighanRitchieUnitTest.3.inc | 7 + ...gFunctionBraceKernighanRitchieUnitTest.php | 96 ++- ...inc => CyclomaticComplexityUnitTest.1.inc} | 32 +- .../CyclomaticComplexityUnitTest.2.inc | 7 + .../CyclomaticComplexityUnitTest.3.inc | 7 + .../Metrics/CyclomaticComplexityUnitTest.php | 42 +- ...nitTest.inc => NestingLevelUnitTest.1.inc} | 38 +- .../Tests/Metrics/NestingLevelUnitTest.2.inc | 7 + .../Tests/Metrics/NestingLevelUnitTest.3.inc | 7 + .../Tests/Metrics/NestingLevelUnitTest.php | 28 +- .../AbstractClassNamePrefixUnitTest.1.inc | 45 ++ .../AbstractClassNamePrefixUnitTest.2.inc | 7 + .../AbstractClassNamePrefixUnitTest.inc | 59 -- .../AbstractClassNamePrefixUnitTest.php | 25 +- ...nc => CamelCapsFunctionNameUnitTest.1.inc} | 19 + .../CamelCapsFunctionNameUnitTest.2.inc | 9 + .../CamelCapsFunctionNameUnitTest.3.inc | 7 + .../CamelCapsFunctionNameUnitTest.php | 100 +-- .../ConstructorNameUnitTest.inc | 33 + .../ConstructorNameUnitTest.php | 17 +- .../InterfaceNameSuffixUnitTest.1.inc | 13 + .../InterfaceNameSuffixUnitTest.2.inc | 7 + .../InterfaceNameSuffixUnitTest.inc | 27 - .../InterfaceNameSuffixUnitTest.php | 14 +- .../TraitNameSuffixUnitTest.1.inc | 11 + .../TraitNameSuffixUnitTest.2.inc | 7 + .../TraitNameSuffixUnitTest.inc | 13 - .../TraitNameSuffixUnitTest.php | 18 +- .../UpperCaseConstantNameUnitTest.1.inc | 91 +++ .../UpperCaseConstantNameUnitTest.2.inc | 7 + .../UpperCaseConstantNameUnitTest.3.inc | 7 + .../UpperCaseConstantNameUnitTest.4.inc | 7 + .../UpperCaseConstantNameUnitTest.5.inc | 9 + .../UpperCaseConstantNameUnitTest.inc | 43 -- .../UpperCaseConstantNameUnitTest.php | 35 +- .../PHP/DisallowShortOpenTagUnitTest.3.inc | 4 + .../PHP/DisallowShortOpenTagUnitTest.4.inc | 6 + .../PHP/DisallowShortOpenTagUnitTest.php | 2 + .../Tests/PHP/LowerCaseKeywordUnitTest.inc | 7 + .../PHP/LowerCaseKeywordUnitTest.inc.fixed | 7 + .../Tests/PHP/LowerCaseKeywordUnitTest.php | 3 + .../Strings/UnnecessaryHeredocUnitTest.1.inc | 108 +++ .../UnnecessaryHeredocUnitTest.1.inc.fixed | 108 +++ .../Strings/UnnecessaryHeredocUnitTest.2.inc | 108 +++ .../UnnecessaryHeredocUnitTest.2.inc.fixed | 108 +++ .../Strings/UnnecessaryHeredocUnitTest.3.inc | 6 + .../Strings/UnnecessaryHeredocUnitTest.php | 74 ++ .../DisallowSpaceIndentUnitTest.1.inc | 7 + .../DisallowSpaceIndentUnitTest.1.inc.fixed | 7 + .../DisallowSpaceIndentUnitTest.2.inc | 7 + .../DisallowSpaceIndentUnitTest.2.inc.fixed | 7 + .../DisallowSpaceIndentUnitTest.php | 1 + .../DisallowTabIndentUnitTest.1.inc | 9 + .../DisallowTabIndentUnitTest.1.inc.fixed | 9 + .../WhiteSpace/DisallowTabIndentUnitTest.php | 76 +- .../HereNowdocIdentifierSpacingUnitTest.inc | 25 + ...eNowdocIdentifierSpacingUnitTest.inc.fixed | 25 + .../HereNowdocIdentifierSpacingUnitTest.php | 58 ++ .../LanguageConstructSpacingUnitTest.1.inc | 9 + ...nguageConstructSpacingUnitTest.1.inc.fixed | 9 + .../LanguageConstructSpacingUnitTest.php | 3 + .../WhiteSpace/ScopeIndentUnitTest.1.inc | 6 + .../ScopeIndentUnitTest.1.inc.fixed | 6 + .../WhiteSpace/ScopeIndentUnitTest.2.inc | 6 + .../ScopeIndentUnitTest.2.inc.fixed | 6 + .../WhiteSpace/ScopeIndentUnitTest.3.inc | 10 +- .../ScopeIndentUnitTest.3.inc.fixed | 10 +- .../Tests/WhiteSpace/ScopeIndentUnitTest.php | 9 +- .../SpreadOperatorSpacingAfterUnitTest.1.inc | 2 + ...adOperatorSpacingAfterUnitTest.1.inc.fixed | 2 + .../SpreadOperatorSpacingAfterUnitTest.php | 1 + .../Squiz/Docs/PHP/HeredocStandard.xml | 32 + .../Sniffs/Arrays/ArrayDeclarationSniff.php | 20 + .../Commenting/PostStatementCommentSniff.php | 8 + .../ForEachLoopDeclarationSniff.php | 2 +- .../Arrays/ArrayDeclarationUnitTest.1.inc | 13 +- .../ArrayDeclarationUnitTest.1.inc.fixed | 10 + .../Arrays/ArrayDeclarationUnitTest.2.inc | 17 + .../ArrayDeclarationUnitTest.2.inc.fixed | 16 + .../Arrays/ArrayDeclarationUnitTest.3.inc | 7 + .../Arrays/ArrayDeclarationUnitTest.4.inc | 8 + .../ArrayDeclarationUnitTest.4.inc.fixed | 8 + .../Tests/Arrays/ArrayDeclarationUnitTest.php | 7 + .../PostStatementCommentUnitTest.inc | 10 + .../PostStatementCommentUnitTest.inc.fixed | 12 + .../PostStatementCommentUnitTest.php | 6 + .../src/Standards/Squiz/ruleset.xml | 10 +- .../php_codesniffer/src/Tokenizers/PHP.php | 219 ++++-- .../src/Tokenizers/Tokenizer.php | 3 +- .../php_codesniffer/src/Util/Common.php | 35 +- .../php_codesniffer/src/Util/Help.php | 1 - .../php_codesniffer/src/Util/Timing.php | 34 +- .../php_codesniffer/src/Util/Tokens.php | 6 +- .../Core/File/FindStartOfStatementTest.php | 54 +- .../tests/Core/Fixer/GenerateDiffTest.php | 1 + .../Core/Generators/AllValidDocsTest.xml | 10 + ...xpectedOutputCodeComparisonBlankLines.html | 88 +++ .../ExpectedOutputCodeComparisonBlankLines.md | 35 + ...ExpectedOutputCodeComparisonBlankLines.txt | 18 + ...pectedOutputCodeComparisonBlockLength.html | 98 +++ ...ExpectedOutputCodeComparisonBlockLength.md | 47 ++ ...xpectedOutputCodeComparisonBlockLength.txt | 23 + .../ExpectedOutputCodeComparisonEncoding.html | 88 +++ .../ExpectedOutputCodeComparisonEncoding.md | 48 ++ .../ExpectedOutputCodeComparisonEncoding.txt | 26 + ...xpectedOutputCodeComparisonLineLength.html | 89 +++ .../ExpectedOutputCodeComparisonLineLength.md | 31 + ...ExpectedOutputCodeComparisonLineLength.txt | 18 + .../ExpectedOutputCodeTitleLineWrapping.html | 118 ++++ .../ExpectedOutputCodeTitleLineWrapping.md | 79 +++ .../ExpectedOutputCodeTitleLineWrapping.txt | 33 + .../ExpectedOutputCodeTitleWhitespace.html | 98 +++ .../ExpectedOutputCodeTitleWhitespace.md | 44 ++ .../ExpectedOutputCodeTitleWhitespace.txt | 20 + .../ExpectedOutputDocumentationTitleCase.html | 78 +++ .../ExpectedOutputDocumentationTitleCase.md | 7 + .../ExpectedOutputDocumentationTitleCase.txt | 7 + ...xpectedOutputDocumentationTitleLength.html | 78 +++ .../ExpectedOutputDocumentationTitleLength.md | 7 + ...ExpectedOutputDocumentationTitleLength.txt | 7 + .../Expectations/ExpectedOutputEmpty.txt | 0 .../Expectations/ExpectedOutputOneDoc.html | 78 +++ .../Expectations/ExpectedOutputOneDoc.md | 7 + .../Expectations/ExpectedOutputOneDoc.txt | 7 + .../ExpectedOutputStandardBlankLines.html | 80 +++ .../ExpectedOutputStandardBlankLines.md | 11 + .../ExpectedOutputStandardBlankLines.txt | 11 + .../ExpectedOutputStandardEncoding.html | 79 +++ .../ExpectedOutputStandardEncoding.md | 8 + .../ExpectedOutputStandardEncoding.txt | 9 + .../ExpectedOutputStandardIndent.html | 81 +++ .../ExpectedOutputStandardIndent.md | 10 + .../ExpectedOutputStandardIndent.txt | 10 + .../ExpectedOutputStandardLineWrapping.html | 80 +++ .../ExpectedOutputStandardLineWrapping.md | 9 + .../ExpectedOutputStandardLineWrapping.txt | 11 + .../ExpectedOutputStructureDocs.html | 191 +++++ .../ExpectedOutputStructureDocs.md | 180 +++++ .../ExpectedOutputStructureDocs.txt | 111 +++ ...dOutputUnsupportedElementAtWrongLevel.html | 77 ++ ...tedOutputUnsupportedElementAtWrongLevel.md | 6 + ...edOutputUnsupportedElementAtWrongLevel.txt | 5 + ...edOutputUnsupportedOneElmAtWrongLevel.html | 78 +++ ...ctedOutputUnsupportedOneElmAtWrongLevel.md | 7 + ...tedOutputUnsupportedOneElmAtWrongLevel.txt | 7 + ...tputUnsupportedSuperfluousCodeElement.html | 88 +++ ...OutputUnsupportedSuperfluousCodeElement.md | 25 + ...utputUnsupportedSuperfluousCodeElement.txt | 13 + ...pectedOutputUnsupportedUnknownElement.html | 77 ++ ...ExpectedOutputUnsupportedUnknownElement.md | 6 + ...xpectedOutputUnsupportedUnknownElement.txt | 5 + .../Core/Generators/Fixtures/HTMLDouble.php | 40 ++ .../Generators/Fixtures/MarkdownDouble.php | 36 + .../Generators/Fixtures/MockGenerator.php | 28 + .../CodeComparisonBlankLinesStandard.xml | 33 + .../CodeComparisonBlockLengthStandard.xml | 35 + .../CodeComparisonEncodingStandard.xml | 42 ++ .../CodeComparisonLineLengthStandard.xml | 25 + .../Content/CodeTitleLineWrappingStandard.xml | 55 ++ .../Content/CodeTitleWhitespaceStandard.xml | 32 + .../DocumentationTitleCaseStandard.xml | 7 + .../DocumentationTitleLengthStandard.xml | 7 + .../Content/StandardBlankLinesStandard.xml | 13 + .../Docs/Content/StandardEncodingStandard.xml | 8 + .../Docs/Content/StandardIndentStandard.xml | 10 + .../Content/StandardLineWrappingStandard.xml | 9 + .../Docs/Structure/NoContentStandard.xml | 2 + .../NoDocumentationElementStandard.xml | 2 + .../OneCodeComparisonNoStandardStandard.xml | 14 + ...OneStandardBlockCodeComparisonStandard.xml | 19 + .../OneStandardBlockNoCodeStandard.xml | 7 + ...tandardBlockTwoCodeComparisonsStandard.xml | 31 + .../TwoStandardBlocksNoCodeStandard.xml | 12 + ...tandardBlocksOneCodeComparisonStandard.xml | 24 + ...dardBlocksThreeCodeComparisonsStandard.xml | 48 ++ .../ElementAtWrongLevelStandard.xml | 8 + .../OneElmAtWrongLevelStandard.xml | 13 + .../SuperfluousCodeElementStandard.xml | 24 + .../Unsupported/UnknownElementStandard.xml | 7 + .../Content/CodeComparisonBlankLinesSniff.php | 12 + .../CodeComparisonBlockLengthSniff.php | 12 + .../Content/CodeComparisonEncodingSniff.php | 12 + .../Content/CodeComparisonLineLengthSniff.php | 12 + .../Content/CodeTitleLineWrappingSniff.php | 12 + .../Content/CodeTitleWhitespaceSniff.php | 12 + .../Content/DocumentationTitleCaseSniff.php | 12 + .../Content/DocumentationTitleLengthSniff.php | 12 + .../Content/StandardBlankLinesSniff.php | 12 + .../Sniffs/Content/StandardEncodingSniff.php | 12 + .../Sniffs/Content/StandardIndentSniff.php | 12 + .../Content/StandardLineWrappingSniff.php | 12 + .../StandardWithDocs/Sniffs/DummySniff.php | 25 + .../Structure/DocumentationMissingSniff.php | 12 + .../Sniffs/Structure/NoContentSniff.php | 12 + .../Structure/NoDocumentationElementSniff.php | 12 + .../OneCodeComparisonNoStandardSniff.php | 12 + .../OneStandardBlockCodeComparisonSniff.php | 12 + .../Structure/OneStandardBlockNoCodeSniff.php | 12 + ...neStandardBlockTwoCodeComparisonsSniff.php | 12 + .../TwoStandardBlocksNoCodeSniff.php | 12 + ...woStandardBlocksOneCodeComparisonSniff.php | 12 + ...tandardBlocksThreeCodeComparisonsSniff.php | 12 + .../Unsupported/ElementAtWrongLevelSniff.php | 12 + .../Unsupported/OneElmAtWrongLevelSniff.php | 12 + .../SuperfluousCodeElementSniff.php | 12 + .../Unsupported/UnknownElementSniff.php | 12 + .../Fixtures/StandardWithDocs/ruleset.xml | 4 + .../tests/Core/Generators/GeneratorTest.php | 245 +++++++ .../tests/Core/Generators/HTMLTest.php | 292 ++++++++ .../tests/Core/Generators/MarkdownTest.php | 290 ++++++++ .../tests/Core/Generators/NoDocsTest.xml | 8 + .../tests/Core/Generators/NoValidDocsTest.xml | 8 + .../tests/Core/Generators/OneDocTest.xml | 8 + .../Core/Generators/StructureDocsTest.xml | 10 + .../tests/Core/Generators/TextTest.php | 197 ++++++ .../Core/Ruleset/AbstractRulesetTestCase.php | 115 +++ .../Core/Ruleset/ExpandSniffDirectoryTest.php | 78 +++ .../Core/Ruleset/ExpandSniffDirectoryTest.xml | 8 + .../tests/Core/Ruleset/ExplainTest.php | 31 +- .../.hidden/HiddenDirShouldBeIgnoredSniff.php | 15 + .../src/MyStandard/AbstractSniff.php | 12 + .../src/MyStandard/DummySniff.php | 25 + .../.hidden/HiddenDirShouldBeIgnoredSniff.php | 15 + .../src/MyStandard/Sniffs/AbstractSniff.php | 12 + .../Sniffs/CategoryA/.HiddenFileSniff.php | 12 + .../CategoryA/.hidden/DoNotFindMeSniff.txt | 0 .../.hidden/HiddenDirShouldBeIgnoredSniff.php | 15 + .../Sniffs/CategoryA/DoNotFindMeSniff.txt | 12 + .../Sniffs/CategoryA/FindMeSniff.php | 12 + .../CategoryA/IncorrectFileExtensionSniff.inc | 12 + .../Sniffs/CategoryA/MissingSniffSuffix.php | 12 + .../IncorrectLevelShouldStillBeFoundSniff.php | 12 + .../Sniffs/CategoryB/AnotherAbstractSniff.php | 12 + .../Sniffs/CategoryB/FindMeSniff.php | 12 + .../IncorrectFileExtensionSniff.php3 | 12 + .../IncorrectLevelShouldStillBeFoundSniff.php | 12 + .../MyStandard/Utils/NotInSniffsDirSniff.php | 12 + .../Utils/SubDir/NotInSniffsDirSniff.php | 12 + .../.hiddenAbove/src/MyStandard/ruleset.xml | 4 + .../Fixtures/InvalidNoSniffsDir/Sniffs | 0 .../Fixtures/InvalidNoSniffsDir/ruleset.xml | 4 + .../ProcessRulesetAutoloadLoadAlways.1.php | 8 + .../ProcessRulesetAutoloadLoadAlways.2.php | 8 + .../ProcessRulesetAutoloadLoadAlways.3.php | 8 + .../ProcessRulesetAutoloadLoadAlways.4.php | 8 + .../ProcessRulesetAutoloadLoadPhpcbfOnly.php | 8 + .../ProcessRulesetAutoloadLoadPhpcsOnly.php | 8 + .../Fixtures/PropertyTypeHandlingInline.inc | 26 + .../Deprecated/WithLongReplacementSniff.php | 2 +- ...eplacementContainingLinuxNewlinesSniff.php | 2 +- ...WithReplacementContainingNewlinesSniff.php | 2 +- .../Deprecated/WithReplacementSniff.php | 2 +- .../Deprecated/WithoutReplacementSniff.php | 2 +- .../EmptyDeprecationVersionSniff.php | 2 +- .../EmptyRemovalVersionSniff.php | 2 +- .../InvalidDeprecationMessageSniff.php | 2 +- .../InvalidDeprecationVersionSniff.php | 2 +- .../InvalidRemovalVersionSniff.php | 2 +- .../SetProperty/AllowedAsDeclaredSniff.php | 2 +- .../AllowedViaMagicMethodSniff.php | 2 +- .../SetProperty/AllowedViaStdClassSniff.php | 2 +- .../NotAllowedViaAttributeSniff.php | 2 +- .../SetProperty/PropertyTypeHandlingSniff.php | 125 ++++ .../Ruleset/Fixtures/TestStandard/ruleset.xml | 4 + .../tests/Core/Ruleset/Fixtures/ruleset.xml | 4 - .../Core/Ruleset/GetIgnorePatternsTest.php | 111 +++ .../Core/Ruleset/GetIgnorePatternsTest.xml | 19 + .../Core/Ruleset/GetIncludePatternsTest.php | 108 +++ .../Core/Ruleset/GetIncludePatternsTest.xml | 15 + .../Ruleset/ProcessRuleInvalidTypeTest.php | 43 ++ .../Ruleset/ProcessRuleInvalidTypeTest.xml | 9 + .../ProcessRuleShouldProcessElementTest.php | 660 ++++++++++++++++++ .../ProcessRuleShouldProcessElementTest.xml | 100 +++ ...ssRulesetAutoExpandSniffsDirectoryTest.xml | 8 + ...ProcessRulesetAutoloadFileNotFoundTest.xml | 8 + .../Ruleset/ProcessRulesetAutoloadTest.php | 164 +++++ .../Ruleset/ProcessRulesetAutoloadTest.xml | 37 + ...ocessRulesetBrokenRulesetEmptyFileTest.xml | 0 ...cessRulesetBrokenRulesetMultiErrorTest.xml | 10 + ...essRulesetBrokenRulesetSingleErrorTest.xml | 2 + .../ProcessRulesetBrokenRulesetTest.php | 92 +++ .../ProcessRulesetExcludeSniffGroupTest.xml | 11 + .../ProcessRulesetInvalidNoSniffsDirTest.xml | 10 + .../Core/Ruleset/ProcessRulesetMiscTest.xml | 25 + ...ProcessRulesetShouldProcessElementTest.php | 388 ++++++++++ ...ProcessRulesetShouldProcessElementTest.xml | 54 ++ .../tests/Core/Ruleset/ProcessRulesetTest.php | 263 +++++++ .../PropertyTypeHandlingInlineTest.xml | 6 + .../Core/Ruleset/PropertyTypeHandlingTest.php | 234 +++++++ .../Core/Ruleset/PropertyTypeHandlingTest.xml | 44 ++ .../RuleInclusionAbsoluteWindowsTest.php | 12 +- .../tests/Core/Ruleset/RuleInclusionTest.php | 63 +- .../tests/Core/Ruleset/RuleInclusionTest.xml | 9 + .../SetPropertyAllowedAsDeclaredTest.xml | 4 +- .../SetPropertyAllowedViaMagicMethodTest.xml | 4 +- .../SetPropertyAllowedViaStdClassTest.xml | 4 +- ...PropertyToMultipleSniffsInCategoryTest.xml | 2 +- ...nInvalidPropertyWhenSetForCategoryTest.xml | 2 +- ...nInvalidPropertyWhenSetForStandardTest.xml | 2 +- .../SetPropertyNotAllowedViaAttributeTest.xml | 4 +- ...opertyThrowsErrorOnInvalidPropertyTest.xml | 2 +- .../Core/Ruleset/SetSniffPropertyTest.php | 73 +- ...eprecationsEmptyDeprecationVersionTest.xml | 6 +- ...iffDeprecationsEmptyRemovalVersionTest.xml | 6 +- ...recationsInvalidDeprecationMessageTest.xml | 6 +- ...recationsInvalidDeprecationVersionTest.xml | 6 +- ...fDeprecationsInvalidRemovalVersionTest.xml | 6 +- .../ShowSniffDeprecationsOrderTest.xml | 8 +- .../ShowSniffDeprecationsReportWidthTest.xml | 6 +- .../Ruleset/ShowSniffDeprecationsTest.php | 128 ++-- .../Ruleset/ShowSniffDeprecationsTest.xml | 8 +- .../AbstractTokenizerTestCase.php | 2 +- .../Comment/CommentTestCase.php | 4 +- .../Comment/LiveCoding1Test.inc | 0 .../Comment/LiveCoding1Test.php | 2 +- .../Comment/LiveCoding2Test.inc | 0 .../Comment/LiveCoding2Test.php | 2 +- .../Comment/LiveCoding3Test.inc | 0 .../Comment/LiveCoding3Test.php | 2 +- .../Comment/LiveCoding4Test.inc | 0 .../Comment/LiveCoding4Test.php | 2 +- .../Comment/MultiLineDocBlockTest.inc | 0 .../Comment/MultiLineDocBlockTest.php | 2 +- .../PhpcsAnnotationsInDocBlockTest.inc | 0 .../PhpcsAnnotationsInDocBlockTest.php | 2 +- .../Comment/SingleLineDocBlockTest.inc | 0 .../Comment/SingleLineDocBlockTest.php | 2 +- .../PHP/AnonClassParenthesisOwnerTest.inc | 0 .../PHP/AnonClassParenthesisOwnerTest.php | 4 +- .../PHP/ArrayKeywordTest.inc | 0 .../PHP/ArrayKeywordTest.php | 4 +- .../PHP/AttributesTest.inc | 0 .../PHP/AttributesTest.php | 4 +- .../PHP/BackfillEnumTest.inc | 0 .../PHP/BackfillEnumTest.php | 4 +- .../PHP/BackfillExplicitOctalNotationTest.inc | 0 .../PHP/BackfillExplicitOctalNotationTest.php | 4 +- .../PHP/BackfillFnTokenTest.inc | 0 .../PHP/BackfillFnTokenTest.php | 6 +- .../PHP/BackfillMatchTokenTest.inc | 0 .../PHP/BackfillMatchTokenTest.php | 4 +- .../PHP/BackfillNumericSeparatorTest.inc | 0 .../PHP/BackfillNumericSeparatorTest.php | 4 +- .../PHP/BackfillReadonlyTest.inc | 0 .../PHP/BackfillReadonlyTest.php | 4 +- .../PHP/BitwiseOrTest.inc | 0 .../PHP/BitwiseOrTest.php | 4 +- .../PHP/ContextSensitiveKeywordsTest.inc | 0 .../PHP/ContextSensitiveKeywordsTest.php | 4 +- .../PHP/DNFTypesParseError1Test.inc | 0 .../PHP/DNFTypesParseError1Test.php | 4 +- .../PHP/DNFTypesParseError2Test.inc | 0 .../PHP/DNFTypesParseError2Test.php | 4 +- .../PHP/DNFTypesTest.inc | 31 + .../PHP/DNFTypesTest.php | 35 +- .../PHP/DefaultKeywordTest.inc | 0 .../PHP/DefaultKeywordTest.php | 4 +- .../PHP/DoubleArrowTest.inc | 0 .../PHP/DoubleArrowTest.php | 4 +- .../PHP/DoubleQuotedStringTest.inc | 0 .../PHP/DoubleQuotedStringTest.php | 4 +- .../PHP/EnumCaseTest.inc | 0 .../PHP/EnumCaseTest.php | 4 +- .../PHP/FinallyTest.inc | 0 .../PHP/FinallyTest.php | 4 +- .../PHP/GotoLabelTest.inc | 0 .../PHP/GotoLabelTest.php | 4 +- .../PHP/HeredocNowdocTest.inc | 0 .../PHP/HeredocNowdocTest.php | 4 +- .../PHP/HeredocParseErrorTest.inc | 0 .../PHP/HeredocParseErrorTest.php | 4 +- .../PHP/HeredocStringTest.inc | 0 .../PHP/HeredocStringTest.php | 4 +- .../PHP/NamedFunctionCallArgumentsTest.inc | 0 .../PHP/NamedFunctionCallArgumentsTest.php | 4 +- .../PHP/NullsafeObjectOperatorTest.inc | 0 .../PHP/NullsafeObjectOperatorTest.php | 4 +- .../PHP/OtherContextSensitiveKeywordsTest.inc | 0 .../PHP/OtherContextSensitiveKeywordsTest.php | 4 +- .../PHP/ResolveSimpleTokenTest.inc | 0 .../PHP/ResolveSimpleTokenTest.php | 4 +- .../PHP/ShortArrayTest.inc | 0 .../PHP/ShortArrayTest.php | 4 +- .../PHP/StableCommentWhitespaceTest.inc | 0 .../PHP/StableCommentWhitespaceTest.php | 4 +- .../PHP/StableCommentWhitespaceWinTest.inc | 0 .../PHP/StableCommentWhitespaceWinTest.php | 4 +- .../PHP/TypeIntersectionTest.inc | 0 .../PHP/TypeIntersectionTest.php | 4 +- .../PHP/TypedConstantsTest.inc | 0 .../PHP/TypedConstantsTest.php | 4 +- .../PHP/UndoNamespacedNameSingleTokenTest.inc | 0 .../PHP/UndoNamespacedNameSingleTokenTest.php | 4 +- .../tests/Core/Tokenizers/PHP/YieldTest.inc | 77 ++ .../tests/Core/Tokenizers/PHP/YieldTest.php | 448 ++++++++++++ ...reateParenthesisNestingMapDNFTypesTest.inc | 0 ...reateParenthesisNestingMapDNFTypesTest.php | 5 +- ...atePositionMapHeredocNowdocCloserTest.inc} | 0 ...atePositionMapHeredocNowdocCloserTest.php} | 9 +- ...atePositionMapHeredocNowdocOpenerTest.inc} | 0 ...atePositionMapHeredocNowdocOpenerTest.php} | 9 +- .../CreatePositionMapTabWidth0Test.php | 107 +++ .../CreatePositionMapYieldFromTest.inc | 15 + .../CreatePositionMapYieldFromTest.php | 100 +++ .../CreateTokenMapArrayParenthesesTest.inc | 0 .../CreateTokenMapArrayParenthesesTest.php | 4 +- ...curseScopeMapCaseKeywordConditionsTest.inc | 0 ...curseScopeMapCaseKeywordConditionsTest.php | 4 +- ...seScopeMapDefaultKeywordConditionsTest.inc | 0 ...seScopeMapDefaultKeywordConditionsTest.php | 4 +- ...urseScopeMapWithNamespaceOperatorTest.inc} | 0 ...urseScopeMapWithNamespaceOperatorTest.php} | 6 +- .../Tokenizer/ReplaceTabsInTokenMiscTest.php | 124 ++++ .../ReplaceTabsInTokenTabWidth1Test.php | 111 +++ .../ReplaceTabsInTokenTabWidth2Test.php | 111 +++ .../ReplaceTabsInTokenTabWidth4Test.php | 111 +++ .../ReplaceTabsInTokenTabWidth5Test.php | 111 +++ .../Tokenizer/ReplaceTabsInTokenTest.inc | 46 ++ .../Tokenizer/ReplaceTabsInTokenTestCase.php | 274 ++++++++ .../Core/Util/Common/EscapeshellcmdTest.php | 91 +++ .../Core/Util/Common/GetSniffCodeTest.php | 200 ++++++ .../Core/Util/Common/PrepareForOutputTest.php | 113 +++ .../tests/Core/Util/Help/HelpTest.php | 52 +- .../Timing/GetHumanReadableDurationTest.php | 114 +++ .../tests/Core/Util/Timing/TimingTest.php | 123 ++++ .../Tokens/GetHighestWeightedTokenTest.php | 162 +++++ .../tests/Core/Util/Tokens/TokenNameTest.php | 81 +++ .../php_codesniffer/tests/bootstrap.php | 21 +- vendor/yoast/phpunit-polyfills/CHANGELOG.md | 55 +- vendor/yoast/phpunit-polyfills/README.md | 245 ++++--- vendor/yoast/phpunit-polyfills/composer.json | 6 +- .../phpunitpolyfills-autoload.php | 27 +- .../InvalidComparisonMethodException.php | 2 + .../src/Helpers/ComparatorValidator.php | 4 +- .../src/Helpers/ResourceHelper.php | 2 + .../AssertArrayWithListKeys_Empty.php | 2 + .../src/Polyfills/AssertClosedResource.php | 2 + .../Polyfills/AssertClosedResource_Empty.php | 2 + .../src/Polyfills/AssertContainsOnly.php | 472 +++++++++++++ .../Polyfills/AssertContainsOnly_Empty.php | 10 + .../Polyfills/AssertEqualsSpecializations.php | 2 + .../AssertEqualsSpecializations_Empty.php | 2 + .../AssertFileEqualsSpecializations.php | 2 + .../AssertFileEqualsSpecializations_Empty.php | 2 + .../src/Polyfills/AssertIsType.php | 2 + .../src/Polyfills/AssertIsType_Empty.php | 2 + .../src/Polyfills/AssertObjectEquals.php | 2 + .../Polyfills/AssertObjectEquals_Empty.php | 2 + .../src/Polyfills/AssertObjectNotEquals.php | 2 + .../Polyfills/AssertObjectNotEquals_Empty.php | 2 + .../src/Polyfills/AssertObjectProperty.php | 2 + .../Polyfills/AssertObjectProperty_Empty.php | 2 + .../src/Polyfills/AssertStringContains.php | 2 + .../Polyfills/AssertStringContains_Empty.php | 2 + .../src/Polyfills/AssertionRenames.php | 2 + .../src/Polyfills/AssertionRenames_Empty.php | 2 + .../src/Polyfills/EqualToSpecializations.php | 9 +- .../EqualToSpecializations_Empty.php | 2 + .../ExpectExceptionMessageMatches.php | 2 + .../ExpectExceptionMessageMatches_Empty.php | 2 + .../src/Polyfills/ExpectUserDeprecation.php | 2 + .../Polyfills/ExpectUserDeprecation_Empty.php | 2 + .../src/TestCases/TestCasePHPUnitGte8.php | 8 + .../src/TestCases/TestCasePHPUnitLte7.php | 8 + .../src/TestCases/XTestCase.php | 4 + ...tListenerDefaultImplementationPHPUnit6.php | 2 + ...stenerDefaultImplementationPHPUnitGte7.php | 2 + .../TestListenerSnakeCaseMethods.php | 4 + 581 files changed, 15748 insertions(+), 2054 deletions(-) create mode 100644 vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php create mode 100644 vendor/spryker/code-sniffer/.github/PULL_REQUEST_TEMPLATE.md create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Arrays/ArrayIndentStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/Strings/UnnecessaryHeredocStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Docs/WhiteSpace/HereNowdocIdentifierSpacingStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/Strings/UnnecessaryHeredocSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/WhiteSpace/HereNowdocIdentifierSpacingSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.10.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.11.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.7.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.8.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.9.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.97.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.98.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Classes/DuplicateClassNameUnitTest.99.inc rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/{EmptyPHPStatementUnitTest.inc => EmptyPHPStatementUnitTest.1.inc} (89%) rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/{EmptyPHPStatementUnitTest.inc.fixed => EmptyPHPStatementUnitTest.1.inc.fixed} (95%) create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.2.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/CodeAnalysis/EmptyPHPStatementUnitTest.2.inc.fixed rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/{InlineControlStructureUnitTest.js => InlineControlStructureUnitTest.1.js} (100%) rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/{InlineControlStructureUnitTest.js.fixed => InlineControlStructureUnitTest.1.js.fixed} (100%) create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.2.js create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/ControlStructures/InlineControlStructureUnitTest.3.js create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Files/lowercased_filename_unit_test.inc rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/{OpeningFunctionBraceKernighanRitchieUnitTest.inc => OpeningFunctionBraceKernighanRitchieUnitTest.1.inc} (88%) rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/{OpeningFunctionBraceKernighanRitchieUnitTest.inc.fixed => OpeningFunctionBraceKernighanRitchieUnitTest.1.inc.fixed} (88%) create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.2.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.2.inc.fixed create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Functions/OpeningFunctionBraceKernighanRitchieUnitTest.3.inc rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/{CyclomaticComplexityUnitTest.inc => CyclomaticComplexityUnitTest.1.inc} (95%) create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.2.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/CyclomaticComplexityUnitTest.3.inc rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/{NestingLevelUnitTest.inc => NestingLevelUnitTest.1.inc} (68%) create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.2.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Metrics/NestingLevelUnitTest.3.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.1.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.2.inc delete mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/AbstractClassNamePrefixUnitTest.inc rename vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/{CamelCapsFunctionNameUnitTest.inc => CamelCapsFunctionNameUnitTest.1.inc} (86%) create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.2.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/CamelCapsFunctionNameUnitTest.3.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.1.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.2.inc delete mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/InterfaceNameSuffixUnitTest.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.1.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.2.inc delete mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/TraitNameSuffixUnitTest.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.1.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.2.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.3.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.4.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.5.inc delete mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/NamingConventions/UpperCaseConstantNameUnitTest.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/PHP/DisallowShortOpenTagUnitTest.4.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryHeredocUnitTest.1.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryHeredocUnitTest.1.inc.fixed create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryHeredocUnitTest.2.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryHeredocUnitTest.2.inc.fixed create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryHeredocUnitTest.3.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Strings/UnnecessaryHeredocUnitTest.php create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/HereNowdocIdentifierSpacingUnitTest.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/HereNowdocIdentifierSpacingUnitTest.inc.fixed create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/WhiteSpace/HereNowdocIdentifierSpacingUnitTest.php create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Docs/PHP/HeredocStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.3.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.4.inc create mode 100644 vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Arrays/ArrayDeclarationUnitTest.4.inc.fixed create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/AllValidDocsTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonBlankLines.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonBlankLines.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonBlankLines.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonBlockLength.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonBlockLength.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonBlockLength.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonEncoding.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonEncoding.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonEncoding.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonLineLength.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonLineLength.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeComparisonLineLength.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleLineWrapping.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputCodeTitleWhitespace.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputDocumentationTitleCase.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputDocumentationTitleCase.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputDocumentationTitleCase.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputDocumentationTitleLength.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputDocumentationTitleLength.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputDocumentationTitleLength.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputEmpty.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputOneDoc.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputOneDoc.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputOneDoc.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardBlankLines.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardEncoding.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardIndent.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardLineWrapping.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardLineWrapping.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStandardLineWrapping.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStructureDocs.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStructureDocs.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputStructureDocs.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedElementAtWrongLevel.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedElementAtWrongLevel.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedElementAtWrongLevel.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedUnknownElement.html create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedUnknownElement.md create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Expectations/ExpectedOutputUnsupportedUnknownElement.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/HTMLDouble.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/MarkdownDouble.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/MockGenerator.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonBlankLinesStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonBlockLengthStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonEncodingStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonLineLengthStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleLineWrappingStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleWhitespaceStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleCaseStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleLengthStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardBlankLinesStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardEncodingStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardIndentStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardLineWrappingStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/NoContentStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/NoDocumentationElementStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneCodeComparisonNoStandardStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockCodeComparisonStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockNoCodeStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockTwoCodeComparisonsStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksNoCodeStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksOneCodeComparisonStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksThreeCodeComparisonsStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/ElementAtWrongLevelStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/OneElmAtWrongLevelStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/SuperfluousCodeElementStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/UnknownElementStandard.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeComparisonBlankLinesSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeComparisonBlockLengthSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeComparisonEncodingSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeComparisonLineLengthSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeTitleLineWrappingSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeTitleWhitespaceSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/DocumentationTitleCaseSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/DocumentationTitleLengthSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/StandardBlankLinesSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/StandardEncodingSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/StandardIndentSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/StandardLineWrappingSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/DummySniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/DocumentationMissingSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/NoContentSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/NoDocumentationElementSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/OneCodeComparisonNoStandardSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/OneStandardBlockCodeComparisonSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/OneStandardBlockNoCodeSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/OneStandardBlockTwoCodeComparisonsSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/TwoStandardBlocksNoCodeSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/TwoStandardBlocksOneCodeComparisonSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Structure/TwoStandardBlocksThreeCodeComparisonsSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Unsupported/ElementAtWrongLevelSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Unsupported/OneElmAtWrongLevelSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Unsupported/SuperfluousCodeElementSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Unsupported/UnknownElementSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/ruleset.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/GeneratorTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/HTMLTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/MarkdownTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoDocsTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoValidDocsTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/OneDocTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/StructureDocsTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Generators/TextTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/AbstractRulesetTestCase.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/.hidden/HiddenDirShouldBeIgnoredSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/AbstractSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/DummySniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/.hidden/HiddenDirShouldBeIgnoredSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/AbstractSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryA/.HiddenFileSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryA/.hidden/DoNotFindMeSniff.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryA/.hidden/HiddenDirShouldBeIgnoredSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryA/DoNotFindMeSniff.txt create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryA/FindMeSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryA/IncorrectFileExtensionSniff.inc create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryA/MissingSniffSuffix.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryA/Subdir/IncorrectLevelShouldStillBeFoundSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryB/AnotherAbstractSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryB/FindMeSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/CategoryB/IncorrectFileExtensionSniff.php3 create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Sniffs/IncorrectLevelShouldStillBeFoundSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Utils/NotInSniffsDirSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/Utils/SubDir/NotInSniffsDirSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/ruleset.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/InvalidNoSniffsDir/Sniffs create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/InvalidNoSniffsDir/ruleset.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.1.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.2.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.3.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.4.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadPhpcbfOnly.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadPhpcsOnly.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/PropertyTypeHandlingInline.inc rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/Deprecated/WithLongReplacementSniff.php (96%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/Deprecated/WithReplacementContainingLinuxNewlinesSniff.php (95%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/Deprecated/WithReplacementContainingNewlinesSniff.php (95%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/Deprecated/WithReplacementSniff.php (93%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/Deprecated/WithoutReplacementSniff.php (93%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/DeprecatedInvalid/EmptyDeprecationVersionSniff.php (92%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/DeprecatedInvalid/EmptyRemovalVersionSniff.php (92%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/DeprecatedInvalid/InvalidDeprecationMessageSniff.php (92%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/DeprecatedInvalid/InvalidDeprecationVersionSniff.php (92%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/DeprecatedInvalid/InvalidRemovalVersionSniff.php (92%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/SetProperty/AllowedAsDeclaredSniff.php (89%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/SetProperty/AllowedViaMagicMethodSniff.php (92%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/SetProperty/AllowedViaStdClassSniff.php (88%) rename vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/{ => TestStandard}/Sniffs/SetProperty/NotAllowedViaAttributeSniff.php (89%) create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/PropertyTypeHandlingSniff.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/ruleset.xml delete mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ruleset.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIgnorePatternsTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIgnorePatternsTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIncludePatternsTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIncludePatternsTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleInvalidTypeTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleInvalidTypeTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoExpandSniffsDirectoryTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadFileNotFoundTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetEmptyFileTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetMultiErrorTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetSingleErrorTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetExcludeSniffGroupTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetInvalidNoSniffsDirTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetMiscTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingInlineTest.xml create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.xml rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/AbstractTokenizerTestCase.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/CommentTestCase.php (97%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/LiveCoding1Test.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/LiveCoding1Test.php (97%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/LiveCoding2Test.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/LiveCoding2Test.php (97%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/LiveCoding3Test.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/LiveCoding3Test.php (96%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/LiveCoding4Test.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/LiveCoding4Test.php (97%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/MultiLineDocBlockTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/MultiLineDocBlockTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/PhpcsAnnotationsInDocBlockTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/PhpcsAnnotationsInDocBlockTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/SingleLineDocBlockTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Comment/SingleLineDocBlockTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/AnonClassParenthesisOwnerTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/AnonClassParenthesisOwnerTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/ArrayKeywordTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/ArrayKeywordTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/AttributesTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/AttributesTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillEnumTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillEnumTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillExplicitOctalNotationTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillExplicitOctalNotationTest.php (97%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillFnTokenTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillFnTokenTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillMatchTokenTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillMatchTokenTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillNumericSeparatorTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillNumericSeparatorTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillReadonlyTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BackfillReadonlyTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BitwiseOrTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/BitwiseOrTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/ContextSensitiveKeywordsTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/ContextSensitiveKeywordsTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DNFTypesParseError1Test.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DNFTypesParseError1Test.php (95%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DNFTypesParseError2Test.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DNFTypesParseError2Test.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DNFTypesTest.inc (90%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DNFTypesTest.php (92%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DefaultKeywordTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DefaultKeywordTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DoubleArrowTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DoubleArrowTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DoubleQuotedStringTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/DoubleQuotedStringTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/EnumCaseTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/EnumCaseTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/FinallyTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/FinallyTest.php (96%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/GotoLabelTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/GotoLabelTest.php (97%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/HeredocNowdocTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/HeredocNowdocTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/HeredocParseErrorTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/HeredocParseErrorTest.php (90%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/HeredocStringTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/HeredocStringTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/NamedFunctionCallArgumentsTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/NamedFunctionCallArgumentsTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/NullsafeObjectOperatorTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/NullsafeObjectOperatorTest.php (97%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/OtherContextSensitiveKeywordsTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/OtherContextSensitiveKeywordsTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/ResolveSimpleTokenTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/ResolveSimpleTokenTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/ShortArrayTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/ShortArrayTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/StableCommentWhitespaceTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/StableCommentWhitespaceTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/StableCommentWhitespaceWinTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/StableCommentWhitespaceWinTest.php (96%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/TypeIntersectionTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/TypeIntersectionTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/TypedConstantsTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/TypedConstantsTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/UndoNamespacedNameSingleTokenTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/PHP/UndoNamespacedNameSingleTokenTest.php (99%) create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/YieldTest.inc create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/YieldTest.php rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer/Tokenizer/HeredocNowdocCloserTest.inc => Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocCloserTest.inc} (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer/Tokenizer/HeredocNowdocCloserTest.php => Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocCloserTest.php} (93%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer/Tokenizer/HeredocNowdocOpenerTest.inc => Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocOpenerTest.inc} (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer/Tokenizer/HeredocNowdocOpenerTest.php => Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocOpenerTest.php} (93%) create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapTabWidth0Test.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapYieldFromTest.inc create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapYieldFromTest.php rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Tokenizer/CreateTokenMapArrayParenthesesTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Tokenizer/CreateTokenMapArrayParenthesesTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php (98%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.inc (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer => Tokenizers}/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php (99%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc => Tokenizers/Tokenizer/RecurseScopeMapWithNamespaceOperatorTest.inc} (100%) rename vendor/squizlabs/php_codesniffer/tests/Core/{Tokenizer/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php => Tokenizers/Tokenizer/RecurseScopeMapWithNamespaceOperatorTest.php} (95%) create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenMiscTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth1Test.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth2Test.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth4Test.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth5Test.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTest.inc create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTestCase.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/EscapeshellcmdTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/GetSniffCodeTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/PrepareForOutputTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/GetHumanReadableDurationTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/TimingTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php create mode 100644 vendor/squizlabs/php_codesniffer/tests/Core/Util/Tokens/TokenNameTest.php create mode 100644 vendor/yoast/phpunit-polyfills/src/Polyfills/AssertContainsOnly.php create mode 100644 vendor/yoast/phpunit-polyfills/src/Polyfills/AssertContainsOnly_Empty.php diff --git a/composer.lock b/composer.lock index 686e5876..05369bcf 100644 --- a/composer.lock +++ b/composer.lock @@ -119,282 +119,282 @@ }, { "name": "johnbillion/args", - "version": "2.1.0", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/johnbillion/args.git", - "reference": "464f53c1eff41eaa7e7aec9d5e03a2c8cfb2b783" + "reference": "ef9b110c4379ded08300c5484e4fa67455697c5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnbillion/args/zipball/464f53c1eff41eaa7e7aec9d5e03a2c8cfb2b783", - "reference": "464f53c1eff41eaa7e7aec9d5e03a2c8cfb2b783", + "url": "https://api.github.com/repos/johnbillion/args/zipball/ef9b110c4379ded08300c5484e4fa67455697c5b", + "reference": "ef9b110c4379ded08300c5484e4fa67455697c5b", "shasum": "" }, "require": { "php": ">=8.0" }, "require-dev": { - "ergebnis/json-printer": "^3.2", - "ergebnis/phpstan-rules": "^1.0", + "ergebnis/json-printer": "3.7.0", + "ergebnis/phpstan-rules": "1.0.0", "humanmade/coding-standards": "1.2.1", "johnbillion/falsey-assertequals-detector": "^3", "phpdocumentor/reflection": "~4.0 || ~5.0", - "phpstan/phpstan": "1.12.5", - "phpstan/phpstan-phpunit": "1.4.0", + "phpstan/phpstan": "1.12.12", + "phpstan/phpstan-phpunit": "1.4.1", "phpstan/phpstan-strict-rules": "1.6.1", "phpunit/phpunit": "^9.0", - "roots/wordpress-core-installer": "^1.0.0", - "roots/wordpress-full": "6.6", + "roots/wordpress-core-installer": "1.100.0", + "roots/wordpress-full": "6.7", "szepeviktor/phpstan-wordpress": "1.3.5" }, "type": "library", "extra": { "args-shapes": [ { - "function": "\\get_categories()", + "file": "vendor/wordpress/wordpress/wp-includes/category.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/category.php" + "function": "\\get_categories()" }, { - "function": "\\get_comments()", + "file": "vendor/wordpress/wordpress/wp-includes/comment.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/comment.php" + "function": "\\get_comments()" }, { - "function": "\\get_posts()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\get_posts()" }, { - "function": "\\get_tags()", + "file": "vendor/wordpress/wordpress/wp-includes/category.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/category.php" + "function": "\\get_tags()" }, { - "function": "\\get_terms()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\get_terms()" }, { - "function": "\\get_users()", + "file": "vendor/wordpress/wordpress/wp-includes/user.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/user.php" + "function": "\\get_users()" }, { - "function": "\\paginate_links()", + "file": "vendor/wordpress/wordpress/wp-includes/general-template.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/general-template.php" + "function": "\\paginate_links()" }, { - "function": "\\register_block_type()", + "file": "vendor/wordpress/wordpress/wp-includes/blocks.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/blocks.php" + "function": "\\register_block_type()" }, { - "function": "\\register_meta()", + "file": "vendor/wordpress/wordpress/wp-includes/meta.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/meta.php" + "function": "\\register_meta()" }, { - "function": "\\register_post_meta()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\register_post_meta()" }, { - "function": "\\register_post_status()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\register_post_status()" }, { - "function": "\\register_post_type()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\register_post_type()" }, { - "function": "\\register_rest_field()", + "file": "vendor/wordpress/wordpress/wp-includes/rest-api.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/rest-api.php" + "function": "\\register_rest_field()" }, { - "function": "\\register_setting()", + "file": "vendor/wordpress/wordpress/wp-includes/option.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/option.php" + "function": "\\register_setting()" }, { - "function": "\\register_taxonomy()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\register_taxonomy()" }, { - "function": "\\register_term_meta()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\register_term_meta()" }, { - "function": "\\wp_count_terms()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\wp_count_terms()" }, { - "function": "\\wp_die()", + "file": "vendor/wordpress/wordpress/wp-includes/functions.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/functions.php" + "function": "\\wp_die()" }, { - "function": "\\wp_dropdown_categories()", + "file": "vendor/wordpress/wordpress/wp-includes/category-template.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/category-template.php" + "function": "\\wp_dropdown_categories()" }, { - "function": "\\wp_dropdown_languages()", + "file": "vendor/wordpress/wordpress/wp-includes/l10n.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/l10n.php" + "function": "\\wp_dropdown_languages()" }, { - "function": "\\wp_generate_tag_cloud()", + "file": "vendor/wordpress/wordpress/wp-includes/category-template.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/category-template.php" + "function": "\\wp_generate_tag_cloud()" }, { - "function": "\\wp_get_nav_menus()", + "file": "vendor/wordpress/wordpress/wp-includes/nav-menu.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/nav-menu.php" + "function": "\\wp_get_nav_menus()" }, { - "function": "\\wp_get_object_terms()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\wp_get_object_terms()" }, { - "function": "\\wp_insert_post()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "postarr", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\wp_insert_post()" }, { - "function": "\\wp_insert_term()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\wp_insert_term()" }, { - "function": "\\wp_insert_user()", + "file": "vendor/wordpress/wordpress/wp-includes/user.php", "param": "userdata", - "file": "vendor/wordpress/wordpress/wp-includes/user.php" + "function": "\\wp_insert_user()" }, { - "function": "\\wp_nav_menu()", + "file": "vendor/wordpress/wordpress/wp-includes/nav-menu-template.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/nav-menu-template.php" + "function": "\\wp_nav_menu()" }, { - "function": "\\wp_remote_get()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_remote_get()" }, { - "function": "\\wp_remote_head()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_remote_head()" }, { - "function": "\\wp_remote_post()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_remote_post()" }, { - "function": "\\wp_remote_request()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_remote_request()" }, { - "function": "\\wp_safe_remote_get()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_safe_remote_get()" }, { - "function": "\\wp_safe_remote_head()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_safe_remote_head()" }, { - "function": "\\wp_safe_remote_post()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_safe_remote_post()" }, { - "function": "\\wp_safe_remote_request()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_safe_remote_request()" }, { - "function": "\\wp_update_post()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "postarr", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\wp_update_post()" }, { - "function": "\\wp_update_term()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\wp_update_term()" }, { - "function": "\\wp_update_user()", + "file": "vendor/wordpress/wordpress/wp-includes/user.php", "param": "userdata", - "file": "vendor/wordpress/wordpress/wp-includes/user.php" + "function": "\\wp_update_user()" }, { - "method": "\\WP_Block_Type::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-block-type.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-block-type.php" + "method": "\\WP_Block_Type::__construct()" }, { - "method": "\\WP_Comment_Query::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-comment-query.php", "param": "query", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-comment-query.php" + "method": "\\WP_Comment_Query::__construct()" }, { - "method": "\\WP_Customize_Control::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-control.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-control.php" + "method": "\\WP_Customize_Control::__construct()" }, { - "method": "\\WP_Customize_Manager::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-manager.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-manager.php" + "method": "\\WP_Customize_Manager::__construct()" }, { - "method": "\\WP_Customize_Panel::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-panel.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-panel.php" + "method": "\\WP_Customize_Panel::__construct()" }, { - "method": "\\WP_Customize_Section::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-section.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-section.php" + "method": "\\WP_Customize_Section::__construct()" }, { - "method": "\\WP_Customize_Setting::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-setting.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-setting.php" + "method": "\\WP_Customize_Setting::__construct()" }, { - "method": "\\WP_Http::request()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-http.php" + "method": "\\WP_Http::request()" }, { - "method": "\\WP_Query::parse_query()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-query.php", "param": "query", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-query.php" + "method": "\\WP_Query::parse_query()" }, { - "method": "\\WP_Term_Query::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-term-query.php", "param": "query", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-term-query.php" + "method": "\\WP_Term_Query::__construct()" }, { - "method": "\\WP_User_Query::prepare_query()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-user-query.php", "param": "query", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-user-query.php" + "method": "\\WP_User_Query::prepare_query()" } ], "wordpress-install-dir": "vendor/wordpress/wordpress" @@ -417,7 +417,7 @@ "description": "I don't want to get into an argument about this.", "support": { "issues": "https://github.com/johnbillion/args/issues", - "source": "https://github.com/johnbillion/args/tree/2.1.0" + "source": "https://github.com/johnbillion/args/tree/2.2.1" }, "funding": [ { @@ -425,20 +425,20 @@ "type": "github" } ], - "time": "2024-10-05T15:23:39+00:00" + "time": "2024-11-30T23:22:24+00:00" }, { "name": "johnbillion/extended-cpts", - "version": "5.0.9", + "version": "5.0.11", "source": { "type": "git", "url": "https://github.com/johnbillion/extended-cpts.git", - "reference": "98e974fd972205b419d658a18afa5f22350f477d" + "reference": "57f2e74155a12e7a37d07250e6739dbab5a732b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnbillion/extended-cpts/zipball/98e974fd972205b419d658a18afa5f22350f477d", - "reference": "98e974fd972205b419d658a18afa5f22350f477d", + "url": "https://api.github.com/repos/johnbillion/extended-cpts/zipball/57f2e74155a12e7a37d07250e6739dbab5a732b3", + "reference": "57f2e74155a12e7a37d07250e6739dbab5a732b3", "shasum": "" }, "require": { @@ -450,14 +450,14 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "johnbillion/falsey-assertequals-detector": "*", "johnbillion/plugin-infrastructure": "dev-trunk", - "johnbillion/wp-compat": "0.1.0", - "lucatume/wp-browser": ">=3.0.21 <3.5", - "phpcompatibility/phpcompatibility-wp": "^2", - "phpstan/phpstan": "1.12.2", - "phpstan/phpstan-phpunit": "1.4.0", - "roots/wordpress-core-installer": "^1.0.0", + "johnbillion/wp-compat": "0.3.1", + "lucatume/wp-browser": "3.2.3", + "phpcompatibility/phpcompatibility-wp": "2.1.5", + "phpstan/phpstan": "1.12.12", + "phpstan/phpstan-phpunit": "1.4.1", + "roots/wordpress-core-installer": "1.100.0", "roots/wordpress-full": "*", - "szepeviktor/phpstan-wordpress": "1.1.6", + "szepeviktor/phpstan-wordpress": "1.3.5", "wp-coding-standards/wpcs": "2.3.0" }, "type": "library", @@ -487,15 +487,9 @@ "homepage": "https://github.com/johnbillion/extended-cpts/", "support": { "issues": "https://github.com/johnbillion/extended-cpts/issues", - "source": "https://github.com/johnbillion/extended-cpts/tree/5.0.9" + "source": "https://github.com/johnbillion/extended-cpts/tree/5.0.11" }, - "funding": [ - { - "url": "https://github.com/johnbillion", - "type": "github" - } - ], - "time": "2024-09-29T16:07:18+00:00" + "time": "2024-11-30T23:16:17+00:00" } ], "packages-dev": [ @@ -759,16 +753,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -807,7 +801,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -815,20 +809,20 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", - "version": "v5.3.1", + "version": "v5.4.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -871,9 +865,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, - "time": "2024-10-08T18:51:32+00:00" + "time": "2024-12-30T11:07:19+00:00" }, { "name": "pantheon-systems/pantheon-wp-coding-standards", @@ -919,16 +913,16 @@ }, { "name": "pantheon-systems/wpunit-helpers", - "version": "v2.0.1", + "version": "v2.0.2", "source": { "type": "git", "url": "https://github.com/pantheon-systems/wpunit-helpers.git", - "reference": "4663809a3dd9bffdd98169afcb6c31e8f6aab91c" + "reference": "8e767a2d59abc16b4fc5bedc12e0adbb87554044" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pantheon-systems/wpunit-helpers/zipball/4663809a3dd9bffdd98169afcb6c31e8f6aab91c", - "reference": "4663809a3dd9bffdd98169afcb6c31e8f6aab91c", + "url": "https://api.github.com/repos/pantheon-systems/wpunit-helpers/zipball/8e767a2d59abc16b4fc5bedc12e0adbb87554044", + "reference": "8e767a2d59abc16b4fc5bedc12e0adbb87554044", "shasum": "" }, "require": { @@ -959,9 +953,9 @@ "description": "Unified scripts for installing and running automated WP Unit Tests.", "support": { "issues": "https://github.com/pantheon-systems/wpunit-helpers/issues", - "source": "https://github.com/pantheon-systems/wpunit-helpers/tree/v2.0.1" + "source": "https://github.com/pantheon-systems/wpunit-helpers/tree/v2.0.2" }, - "time": "2024-08-28T17:02:11+00:00" + "time": "2025-01-06T18:07:41+00:00" }, { "name": "phar-io/manifest", @@ -1217,16 +1211,16 @@ }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.5", + "version": "2.1.6", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" + "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/80ccb1a7640995edf1b87a4409fa584cd5869469", + "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469", "shasum": "" }, "require": { @@ -1283,7 +1277,7 @@ "type": "open_collective" } ], - "time": "2024-04-24T21:37:59+00:00" + "time": "2025-01-16T22:34:19+00:00" }, { "name": "phpcsstandards/phpcsextra", @@ -1453,16 +1447,16 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.32.0", + "version": "1.33.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4" + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6ca22b154efdd9e3c68c56f5d94670920a1c19a4", - "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { @@ -1494,9 +1488,9 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.32.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, - "time": "2024-09-26T07:23:32+00:00" + "time": "2024-10-13T11:25:22+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1819,16 +1813,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.21", + "version": "9.6.22", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -1839,7 +1833,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -1902,7 +1896,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -1918,7 +1912,7 @@ "type": "tidelift" } ], - "time": "2024-09-19T10:50:18+00:00" + "time": "2024-12-05T13:48:26+00:00" }, { "name": "sebastian/cli-parser", @@ -2885,16 +2879,16 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.19", + "version": "v2.11.22", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" + "reference": "ffb6f16c6033ec61ed84446b479a31d6529f0eb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ffb6f16c6033ec61ed84446b479a31d6529f0eb7", + "reference": "ffb6f16c6033ec61ed84446b479a31d6529f0eb7", "shasum": "" }, "require": { @@ -2905,9 +2899,8 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", "phpcsstandards/phpcsdevcs": "^1.1", "phpstan/phpstan": "^1.7", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0" }, "type": "phpcodesniffer-standard", "autoload": { @@ -2939,7 +2932,7 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2024-06-26T20:08:34+00:00" + "time": "2025-01-06T17:54:24+00:00" }, { "name": "slevomat/coding-standard", @@ -3008,16 +3001,16 @@ }, { "name": "spryker/code-sniffer", - "version": "0.17.25", + "version": "0.17.26", "source": { "type": "git", "url": "https://github.com/spryker/code-sniffer.git", - "reference": "4d26c642e56be892f1fcebc227e9a7b4ddb25f06" + "reference": "be31dad00da0af2417a775b1d545c87cb058f2e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/code-sniffer/zipball/4d26c642e56be892f1fcebc227e9a7b4ddb25f06", - "reference": "4d26c642e56be892f1fcebc227e9a7b4ddb25f06", + "url": "https://api.github.com/repos/spryker/code-sniffer/zipball/be31dad00da0af2417a775b1d545c87cb058f2e8", + "reference": "be31dad00da0af2417a775b1d545c87cb058f2e8", "shasum": "" }, "require": { @@ -3062,20 +3055,20 @@ "issues": "https://github.com/spryker/code-sniffer/issues", "source": "https://github.com/spryker/code-sniffer" }, - "time": "2024-09-20T09:34:15+00:00" + "time": "2025-01-03T17:43:12+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.3", + "version": "3.11.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" + "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1368f4a58c3c52114b86b1abe8f4098869cb0079", + "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079", "shasum": "" }, "require": { @@ -3142,7 +3135,7 @@ "type": "open_collective" } ], - "time": "2024-09-18T10:38:58+00:00" + "time": "2024-12-11T16:04:26+00:00" }, { "name": "theseer/tokenizer", @@ -3262,16 +3255,16 @@ }, { "name": "yoast/phpunit-polyfills", - "version": "3.0.0", + "version": "3.1.1", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "19e6d5fb8aad31f731f774f9646a10c64a8843d2" + "reference": "e6381c62c4df51677b657fbac79b79dfce7acdab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/19e6d5fb8aad31f731f774f9646a10c64a8843d2", - "reference": "19e6d5fb8aad31f731f774f9646a10c64a8843d2", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/e6381c62c4df51677b657fbac79b79dfce7acdab", + "reference": "e6381c62c4df51677b657fbac79b79dfce7acdab", "shasum": "" }, "require": { @@ -3321,15 +3314,15 @@ "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2024-09-07T00:24:25+00:00" + "time": "2025-01-12T08:41:37+00:00" } ], "aliases": [], "minimum-stability": "dev", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, - "platform": [], - "platform-dev": [], + "platform": {}, + "platform-dev": {}, "plugin-api-version": "2.6.0" } diff --git a/vendor/bin/tokenize b/vendor/bin/tokenize index 5a7da0cc..5e53259a 100755 --- a/vendor/bin/tokenize +++ b/vendor/bin/tokenize @@ -34,4 +34,4 @@ if [ -n "$bashSource" ]; then fi fi -"${dir}/tokenize" "$@" +exec "${dir}/tokenize" "$@" diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 60e3124a..9c8e1bab 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -386,284 +386,284 @@ }, { "name": "johnbillion/args", - "version": "2.1.0", - "version_normalized": "2.1.0.0", + "version": "2.2.1", + "version_normalized": "2.2.1.0", "source": { "type": "git", "url": "https://github.com/johnbillion/args.git", - "reference": "464f53c1eff41eaa7e7aec9d5e03a2c8cfb2b783" + "reference": "ef9b110c4379ded08300c5484e4fa67455697c5b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnbillion/args/zipball/464f53c1eff41eaa7e7aec9d5e03a2c8cfb2b783", - "reference": "464f53c1eff41eaa7e7aec9d5e03a2c8cfb2b783", + "url": "https://api.github.com/repos/johnbillion/args/zipball/ef9b110c4379ded08300c5484e4fa67455697c5b", + "reference": "ef9b110c4379ded08300c5484e4fa67455697c5b", "shasum": "" }, "require": { "php": ">=8.0" }, "require-dev": { - "ergebnis/json-printer": "^3.2", - "ergebnis/phpstan-rules": "^1.0", + "ergebnis/json-printer": "3.7.0", + "ergebnis/phpstan-rules": "1.0.0", "humanmade/coding-standards": "1.2.1", "johnbillion/falsey-assertequals-detector": "^3", "phpdocumentor/reflection": "~4.0 || ~5.0", - "phpstan/phpstan": "1.12.5", - "phpstan/phpstan-phpunit": "1.4.0", + "phpstan/phpstan": "1.12.12", + "phpstan/phpstan-phpunit": "1.4.1", "phpstan/phpstan-strict-rules": "1.6.1", "phpunit/phpunit": "^9.0", - "roots/wordpress-core-installer": "^1.0.0", - "roots/wordpress-full": "6.6", + "roots/wordpress-core-installer": "1.100.0", + "roots/wordpress-full": "6.7", "szepeviktor/phpstan-wordpress": "1.3.5" }, - "time": "2024-10-05T15:23:39+00:00", + "time": "2024-11-30T23:22:24+00:00", "type": "library", "extra": { "args-shapes": [ { - "function": "\\get_categories()", + "file": "vendor/wordpress/wordpress/wp-includes/category.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/category.php" + "function": "\\get_categories()" }, { - "function": "\\get_comments()", + "file": "vendor/wordpress/wordpress/wp-includes/comment.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/comment.php" + "function": "\\get_comments()" }, { - "function": "\\get_posts()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\get_posts()" }, { - "function": "\\get_tags()", + "file": "vendor/wordpress/wordpress/wp-includes/category.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/category.php" + "function": "\\get_tags()" }, { - "function": "\\get_terms()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\get_terms()" }, { - "function": "\\get_users()", + "file": "vendor/wordpress/wordpress/wp-includes/user.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/user.php" + "function": "\\get_users()" }, { - "function": "\\paginate_links()", + "file": "vendor/wordpress/wordpress/wp-includes/general-template.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/general-template.php" + "function": "\\paginate_links()" }, { - "function": "\\register_block_type()", + "file": "vendor/wordpress/wordpress/wp-includes/blocks.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/blocks.php" + "function": "\\register_block_type()" }, { - "function": "\\register_meta()", + "file": "vendor/wordpress/wordpress/wp-includes/meta.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/meta.php" + "function": "\\register_meta()" }, { - "function": "\\register_post_meta()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\register_post_meta()" }, { - "function": "\\register_post_status()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\register_post_status()" }, { - "function": "\\register_post_type()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\register_post_type()" }, { - "function": "\\register_rest_field()", + "file": "vendor/wordpress/wordpress/wp-includes/rest-api.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/rest-api.php" + "function": "\\register_rest_field()" }, { - "function": "\\register_setting()", + "file": "vendor/wordpress/wordpress/wp-includes/option.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/option.php" + "function": "\\register_setting()" }, { - "function": "\\register_taxonomy()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\register_taxonomy()" }, { - "function": "\\register_term_meta()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\register_term_meta()" }, { - "function": "\\wp_count_terms()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\wp_count_terms()" }, { - "function": "\\wp_die()", + "file": "vendor/wordpress/wordpress/wp-includes/functions.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/functions.php" + "function": "\\wp_die()" }, { - "function": "\\wp_dropdown_categories()", + "file": "vendor/wordpress/wordpress/wp-includes/category-template.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/category-template.php" + "function": "\\wp_dropdown_categories()" }, { - "function": "\\wp_dropdown_languages()", + "file": "vendor/wordpress/wordpress/wp-includes/l10n.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/l10n.php" + "function": "\\wp_dropdown_languages()" }, { - "function": "\\wp_generate_tag_cloud()", + "file": "vendor/wordpress/wordpress/wp-includes/category-template.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/category-template.php" + "function": "\\wp_generate_tag_cloud()" }, { - "function": "\\wp_get_nav_menus()", + "file": "vendor/wordpress/wordpress/wp-includes/nav-menu.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/nav-menu.php" + "function": "\\wp_get_nav_menus()" }, { - "function": "\\wp_get_object_terms()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\wp_get_object_terms()" }, { - "function": "\\wp_insert_post()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "postarr", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\wp_insert_post()" }, { - "function": "\\wp_insert_term()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\wp_insert_term()" }, { - "function": "\\wp_insert_user()", + "file": "vendor/wordpress/wordpress/wp-includes/user.php", "param": "userdata", - "file": "vendor/wordpress/wordpress/wp-includes/user.php" + "function": "\\wp_insert_user()" }, { - "function": "\\wp_nav_menu()", + "file": "vendor/wordpress/wordpress/wp-includes/nav-menu-template.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/nav-menu-template.php" + "function": "\\wp_nav_menu()" }, { - "function": "\\wp_remote_get()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_remote_get()" }, { - "function": "\\wp_remote_head()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_remote_head()" }, { - "function": "\\wp_remote_post()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_remote_post()" }, { - "function": "\\wp_remote_request()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_remote_request()" }, { - "function": "\\wp_safe_remote_get()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_safe_remote_get()" }, { - "function": "\\wp_safe_remote_head()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_safe_remote_head()" }, { - "function": "\\wp_safe_remote_post()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_safe_remote_post()" }, { - "function": "\\wp_safe_remote_request()", + "file": "vendor/wordpress/wordpress/wp-includes/http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/http.php" + "function": "\\wp_safe_remote_request()" }, { - "function": "\\wp_update_post()", + "file": "vendor/wordpress/wordpress/wp-includes/post.php", "param": "postarr", - "file": "vendor/wordpress/wordpress/wp-includes/post.php" + "function": "\\wp_update_post()" }, { - "function": "\\wp_update_term()", + "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/taxonomy.php" + "function": "\\wp_update_term()" }, { - "function": "\\wp_update_user()", + "file": "vendor/wordpress/wordpress/wp-includes/user.php", "param": "userdata", - "file": "vendor/wordpress/wordpress/wp-includes/user.php" + "function": "\\wp_update_user()" }, { - "method": "\\WP_Block_Type::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-block-type.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-block-type.php" + "method": "\\WP_Block_Type::__construct()" }, { - "method": "\\WP_Comment_Query::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-comment-query.php", "param": "query", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-comment-query.php" + "method": "\\WP_Comment_Query::__construct()" }, { - "method": "\\WP_Customize_Control::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-control.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-control.php" + "method": "\\WP_Customize_Control::__construct()" }, { - "method": "\\WP_Customize_Manager::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-manager.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-manager.php" + "method": "\\WP_Customize_Manager::__construct()" }, { - "method": "\\WP_Customize_Panel::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-panel.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-panel.php" + "method": "\\WP_Customize_Panel::__construct()" }, { - "method": "\\WP_Customize_Section::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-section.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-section.php" + "method": "\\WP_Customize_Section::__construct()" }, { - "method": "\\WP_Customize_Setting::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-setting.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-customize-setting.php" + "method": "\\WP_Customize_Setting::__construct()" }, { - "method": "\\WP_Http::request()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-http.php", "param": "args", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-http.php" + "method": "\\WP_Http::request()" }, { - "method": "\\WP_Query::parse_query()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-query.php", "param": "query", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-query.php" + "method": "\\WP_Query::parse_query()" }, { - "method": "\\WP_Term_Query::__construct()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-term-query.php", "param": "query", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-term-query.php" + "method": "\\WP_Term_Query::__construct()" }, { - "method": "\\WP_User_Query::prepare_query()", + "file": "vendor/wordpress/wordpress/wp-includes/class-wp-user-query.php", "param": "query", - "file": "vendor/wordpress/wordpress/wp-includes/class-wp-user-query.php" + "method": "\\WP_User_Query::prepare_query()" } ], "wordpress-install-dir": "vendor/wordpress/wordpress" @@ -687,7 +687,7 @@ "description": "I don't want to get into an argument about this.", "support": { "issues": "https://github.com/johnbillion/args/issues", - "source": "https://github.com/johnbillion/args/tree/2.1.0" + "source": "https://github.com/johnbillion/args/tree/2.2.1" }, "funding": [ { @@ -699,17 +699,17 @@ }, { "name": "johnbillion/extended-cpts", - "version": "5.0.9", - "version_normalized": "5.0.9.0", + "version": "5.0.11", + "version_normalized": "5.0.11.0", "source": { "type": "git", "url": "https://github.com/johnbillion/extended-cpts.git", - "reference": "98e974fd972205b419d658a18afa5f22350f477d" + "reference": "57f2e74155a12e7a37d07250e6739dbab5a732b3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnbillion/extended-cpts/zipball/98e974fd972205b419d658a18afa5f22350f477d", - "reference": "98e974fd972205b419d658a18afa5f22350f477d", + "url": "https://api.github.com/repos/johnbillion/extended-cpts/zipball/57f2e74155a12e7a37d07250e6739dbab5a732b3", + "reference": "57f2e74155a12e7a37d07250e6739dbab5a732b3", "shasum": "" }, "require": { @@ -721,17 +721,17 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "johnbillion/falsey-assertequals-detector": "*", "johnbillion/plugin-infrastructure": "dev-trunk", - "johnbillion/wp-compat": "0.1.0", - "lucatume/wp-browser": ">=3.0.21 <3.5", - "phpcompatibility/phpcompatibility-wp": "^2", - "phpstan/phpstan": "1.12.2", - "phpstan/phpstan-phpunit": "1.4.0", - "roots/wordpress-core-installer": "^1.0.0", + "johnbillion/wp-compat": "0.3.1", + "lucatume/wp-browser": "3.2.3", + "phpcompatibility/phpcompatibility-wp": "2.1.5", + "phpstan/phpstan": "1.12.12", + "phpstan/phpstan-phpunit": "1.4.1", + "roots/wordpress-core-installer": "1.100.0", "roots/wordpress-full": "*", - "szepeviktor/phpstan-wordpress": "1.1.6", + "szepeviktor/phpstan-wordpress": "1.3.5", "wp-coding-standards/wpcs": "2.3.0" }, - "time": "2024-09-29T16:07:18+00:00", + "time": "2024-11-30T23:16:17+00:00", "type": "library", "extra": { "wordpress-install-dir": "vendor/wordpress/wordpress" @@ -760,29 +760,23 @@ "homepage": "https://github.com/johnbillion/extended-cpts/", "support": { "issues": "https://github.com/johnbillion/extended-cpts/issues", - "source": "https://github.com/johnbillion/extended-cpts/tree/5.0.9" + "source": "https://github.com/johnbillion/extended-cpts/tree/5.0.11" }, - "funding": [ - { - "url": "https://github.com/johnbillion", - "type": "github" - } - ], "install-path": "../johnbillion/extended-cpts" }, { "name": "myclabs/deep-copy", - "version": "1.12.0", - "version_normalized": "1.12.0.0", + "version": "1.12.1", + "version_normalized": "1.12.1.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -798,7 +792,7 @@ "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, - "time": "2024-06-12T14:39:25+00:00", + "time": "2024-11-08T17:47:46+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -823,7 +817,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -835,17 +829,17 @@ }, { "name": "nikic/php-parser", - "version": "v5.3.1", - "version_normalized": "5.3.1.0", + "version": "v5.4.0", + "version_normalized": "5.4.0.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b" + "reference": "447a020a1f875a434d62f2a401f53b82a396e494" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/8eea230464783aa9671db8eea6f8c6ac5285794b", - "reference": "8eea230464783aa9671db8eea6f8c6ac5285794b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/447a020a1f875a434d62f2a401f53b82a396e494", + "reference": "447a020a1f875a434d62f2a401f53b82a396e494", "shasum": "" }, "require": { @@ -858,7 +852,7 @@ "ircmaxell/php-yacc": "^0.0.7", "phpunit/phpunit": "^9.0" }, - "time": "2024-10-08T18:51:32+00:00", + "time": "2024-12-30T11:07:19+00:00", "bin": [ "bin/php-parse" ], @@ -890,7 +884,7 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v5.3.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v5.4.0" }, "install-path": "../nikic/php-parser" }, @@ -941,17 +935,17 @@ }, { "name": "pantheon-systems/wpunit-helpers", - "version": "v2.0.1", - "version_normalized": "2.0.1.0", + "version": "v2.0.2", + "version_normalized": "2.0.2.0", "source": { "type": "git", "url": "https://github.com/pantheon-systems/wpunit-helpers.git", - "reference": "4663809a3dd9bffdd98169afcb6c31e8f6aab91c" + "reference": "8e767a2d59abc16b4fc5bedc12e0adbb87554044" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pantheon-systems/wpunit-helpers/zipball/4663809a3dd9bffdd98169afcb6c31e8f6aab91c", - "reference": "4663809a3dd9bffdd98169afcb6c31e8f6aab91c", + "url": "https://api.github.com/repos/pantheon-systems/wpunit-helpers/zipball/8e767a2d59abc16b4fc5bedc12e0adbb87554044", + "reference": "8e767a2d59abc16b4fc5bedc12e0adbb87554044", "shasum": "" }, "require": { @@ -960,7 +954,7 @@ "require-dev": { "squizlabs/php_codesniffer": "^3.7" }, - "time": "2024-08-28T17:02:11+00:00", + "time": "2025-01-06T18:07:41+00:00", "type": "composer-plugin", "extra": { "class": "Pantheon\\WPUnitHelpers\\Plugin" @@ -984,7 +978,7 @@ "description": "Unified scripts for installing and running automated WP Unit Tests.", "support": { "issues": "https://github.com/pantheon-systems/wpunit-helpers/issues", - "source": "https://github.com/pantheon-systems/wpunit-helpers/tree/v2.0.1" + "source": "https://github.com/pantheon-systems/wpunit-helpers/tree/v2.0.2" }, "install-path": "../pantheon-systems/wpunit-helpers" }, @@ -1250,17 +1244,17 @@ }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.5", - "version_normalized": "2.1.5.0", + "version": "2.1.6", + "version_normalized": "2.1.6.0", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" + "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", - "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/80ccb1a7640995edf1b87a4409fa584cd5869469", + "reference": "80ccb1a7640995edf1b87a4409fa584cd5869469", "shasum": "" }, "require": { @@ -1274,7 +1268,7 @@ "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, - "time": "2024-04-24T21:37:59+00:00", + "time": "2025-01-16T22:34:19+00:00", "type": "phpcodesniffer-standard", "installation-source": "dist", "notification-url": "https://packagist.org/downloads/", @@ -1495,17 +1489,17 @@ }, { "name": "phpstan/phpdoc-parser", - "version": "1.32.0", - "version_normalized": "1.32.0.0", + "version": "1.33.0", + "version_normalized": "1.33.0.0", "source": { "type": "git", "url": "https://github.com/phpstan/phpdoc-parser.git", - "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4" + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/6ca22b154efdd9e3c68c56f5d94670920a1c19a4", - "reference": "6ca22b154efdd9e3c68c56f5d94670920a1c19a4", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/82a311fd3690fb2bf7b64d5c98f912b3dd746140", + "reference": "82a311fd3690fb2bf7b64d5c98f912b3dd746140", "shasum": "" }, "require": { @@ -1522,7 +1516,7 @@ "phpunit/phpunit": "^9.5", "symfony/process": "^5.2" }, - "time": "2024-09-26T07:23:32+00:00", + "time": "2024-10-13T11:25:22+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1539,7 +1533,7 @@ "description": "PHPDoc parser with support for nullable, intersection and generic types", "support": { "issues": "https://github.com/phpstan/phpdoc-parser/issues", - "source": "https://github.com/phpstan/phpdoc-parser/tree/1.32.0" + "source": "https://github.com/phpstan/phpdoc-parser/tree/1.33.0" }, "install-path": "../phpstan/phpdoc-parser" }, @@ -1879,17 +1873,17 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.21", - "version_normalized": "9.6.21.0", + "version": "9.6.22", + "version_normalized": "9.6.22.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa" + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", - "reference": "de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/f80235cb4d3caa59ae09be3adf1ded27521d1a9c", + "reference": "f80235cb4d3caa59ae09be3adf1ded27521d1a9c", "shasum": "" }, "require": { @@ -1900,7 +1894,7 @@ "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=7.3", @@ -1925,7 +1919,7 @@ "ext-soap": "To be able to generate mocks based on WSDL files", "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" }, - "time": "2024-09-19T10:50:18+00:00", + "time": "2024-12-05T13:48:26+00:00", "bin": [ "phpunit" ], @@ -1965,7 +1959,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.21" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.22" }, "funding": [ { @@ -2996,17 +2990,17 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.19", - "version_normalized": "2.11.19.0", + "version": "v2.11.22", + "version_normalized": "2.11.22.0", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" + "reference": "ffb6f16c6033ec61ed84446b479a31d6529f0eb7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", - "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/ffb6f16c6033ec61ed84446b479a31d6529f0eb7", + "reference": "ffb6f16c6033ec61ed84446b479a31d6529f0eb7", "shasum": "" }, "require": { @@ -3017,11 +3011,10 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", "phpcsstandards/phpcsdevcs": "^1.1", "phpstan/phpstan": "^1.7", - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0" }, - "time": "2024-06-26T20:08:34+00:00", + "time": "2025-01-06T17:54:24+00:00", "type": "phpcodesniffer-standard", "installation-source": "dist", "autoload": { @@ -3125,17 +3118,17 @@ }, { "name": "spryker/code-sniffer", - "version": "0.17.25", - "version_normalized": "0.17.25.0", + "version": "0.17.26", + "version_normalized": "0.17.26.0", "source": { "type": "git", "url": "https://github.com/spryker/code-sniffer.git", - "reference": "4d26c642e56be892f1fcebc227e9a7b4ddb25f06" + "reference": "be31dad00da0af2417a775b1d545c87cb058f2e8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spryker/code-sniffer/zipball/4d26c642e56be892f1fcebc227e9a7b4ddb25f06", - "reference": "4d26c642e56be892f1fcebc227e9a7b4ddb25f06", + "url": "https://api.github.com/repos/spryker/code-sniffer/zipball/be31dad00da0af2417a775b1d545c87cb058f2e8", + "reference": "be31dad00da0af2417a775b1d545c87cb058f2e8", "shasum": "" }, "require": { @@ -3147,7 +3140,7 @@ "phpstan/phpstan": "^1.0.0", "phpunit/phpunit": "^9.5" }, - "time": "2024-09-20T09:34:15+00:00", + "time": "2025-01-03T17:43:12+00:00", "bin": [ "bin/tokenize" ], @@ -3186,17 +3179,17 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.10.3", - "version_normalized": "3.10.3.0", + "version": "3.11.2", + "version_normalized": "3.11.2.0", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c" + "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/62d32998e820bddc40f99f8251958aed187a5c9c", - "reference": "62d32998e820bddc40f99f8251958aed187a5c9c", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/1368f4a58c3c52114b86b1abe8f4098869cb0079", + "reference": "1368f4a58c3c52114b86b1abe8f4098869cb0079", "shasum": "" }, "require": { @@ -3208,7 +3201,7 @@ "require-dev": { "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, - "time": "2024-09-18T10:38:58+00:00", + "time": "2024-12-11T16:04:26+00:00", "bin": [ "bin/phpcbf", "bin/phpcs" @@ -3391,17 +3384,17 @@ }, { "name": "yoast/phpunit-polyfills", - "version": "3.0.0", - "version_normalized": "3.0.0.0", + "version": "3.1.1", + "version_normalized": "3.1.1.0", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "19e6d5fb8aad31f731f774f9646a10c64a8843d2" + "reference": "e6381c62c4df51677b657fbac79b79dfce7acdab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/19e6d5fb8aad31f731f774f9646a10c64a8843d2", - "reference": "19e6d5fb8aad31f731f774f9646a10c64a8843d2", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/e6381c62c4df51677b657fbac79b79dfce7acdab", + "reference": "e6381c62c4df51677b657fbac79b79dfce7acdab", "shasum": "" }, "require": { @@ -3413,7 +3406,7 @@ "php-parallel-lint/php-parallel-lint": "^1.4.0", "yoast/yoastcs": "^3.1.0" }, - "time": "2024-09-07T00:24:25+00:00", + "time": "2025-01-12T08:41:37+00:00", "type": "library", "extra": { "branch-alias": { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index a2d6ec5a..3cd71233 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'jazzsequence/games-collector', - 'pretty_version' => 'dev-main', - 'version' => 'dev-main', - 'reference' => '0dd5d612c2011e2ce8a248ca927488078970e1e5', + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'reference' => 'bd1bbe8049cd6db81d2a4ace66bc6edcd81360b7', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -65,45 +65,45 @@ 'dev_requirement' => false, ), 'jazzsequence/games-collector' => array( - 'pretty_version' => 'dev-main', - 'version' => 'dev-main', - 'reference' => '0dd5d612c2011e2ce8a248ca927488078970e1e5', + 'pretty_version' => 'dev-develop', + 'version' => 'dev-develop', + 'reference' => 'bd1bbe8049cd6db81d2a4ace66bc6edcd81360b7', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), 'dev_requirement' => false, ), 'johnbillion/args' => array( - 'pretty_version' => '2.1.0', - 'version' => '2.1.0.0', - 'reference' => '464f53c1eff41eaa7e7aec9d5e03a2c8cfb2b783', + 'pretty_version' => '2.2.1', + 'version' => '2.2.1.0', + 'reference' => 'ef9b110c4379ded08300c5484e4fa67455697c5b', 'type' => 'library', 'install_path' => __DIR__ . '/../johnbillion/args', 'aliases' => array(), 'dev_requirement' => false, ), 'johnbillion/extended-cpts' => array( - 'pretty_version' => '5.0.9', - 'version' => '5.0.9.0', - 'reference' => '98e974fd972205b419d658a18afa5f22350f477d', + 'pretty_version' => '5.0.11', + 'version' => '5.0.11.0', + 'reference' => '57f2e74155a12e7a37d07250e6739dbab5a732b3', 'type' => 'library', 'install_path' => __DIR__ . '/../johnbillion/extended-cpts', 'aliases' => array(), 'dev_requirement' => false, ), 'myclabs/deep-copy' => array( - 'pretty_version' => '1.12.0', - 'version' => '1.12.0.0', - 'reference' => '3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c', + 'pretty_version' => '1.12.1', + 'version' => '1.12.1.0', + 'reference' => '123267b2c49fbf30d78a7b2d333f6be754b94845', 'type' => 'library', 'install_path' => __DIR__ . '/../myclabs/deep-copy', 'aliases' => array(), 'dev_requirement' => true, ), 'nikic/php-parser' => array( - 'pretty_version' => 'v5.3.1', - 'version' => '5.3.1.0', - 'reference' => '8eea230464783aa9671db8eea6f8c6ac5285794b', + 'pretty_version' => 'v5.4.0', + 'version' => '5.4.0.0', + 'reference' => '447a020a1f875a434d62f2a401f53b82a396e494', 'type' => 'library', 'install_path' => __DIR__ . '/../nikic/php-parser', 'aliases' => array(), @@ -119,9 +119,9 @@ 'dev_requirement' => true, ), 'pantheon-systems/wpunit-helpers' => array( - 'pretty_version' => 'v2.0.1', - 'version' => '2.0.1.0', - 'reference' => '4663809a3dd9bffdd98169afcb6c31e8f6aab91c', + 'pretty_version' => 'v2.0.2', + 'version' => '2.0.2.0', + 'reference' => '8e767a2d59abc16b4fc5bedc12e0adbb87554044', 'type' => 'composer-plugin', 'install_path' => __DIR__ . '/../pantheon-systems/wpunit-helpers', 'aliases' => array(), @@ -164,9 +164,9 @@ 'dev_requirement' => true, ), 'phpcompatibility/phpcompatibility-wp' => array( - 'pretty_version' => '2.1.5', - 'version' => '2.1.5.0', - 'reference' => '01c1ff2704a58e46f0cb1ca9d06aee07b3589082', + 'pretty_version' => '2.1.6', + 'version' => '2.1.6.0', + 'reference' => '80ccb1a7640995edf1b87a4409fa584cd5869469', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../phpcompatibility/phpcompatibility-wp', 'aliases' => array(), @@ -191,9 +191,9 @@ 'dev_requirement' => true, ), 'phpstan/phpdoc-parser' => array( - 'pretty_version' => '1.32.0', - 'version' => '1.32.0.0', - 'reference' => '6ca22b154efdd9e3c68c56f5d94670920a1c19a4', + 'pretty_version' => '1.33.0', + 'version' => '1.33.0.0', + 'reference' => '82a311fd3690fb2bf7b64d5c98f912b3dd746140', 'type' => 'library', 'install_path' => __DIR__ . '/../phpstan/phpdoc-parser', 'aliases' => array(), @@ -245,9 +245,9 @@ 'dev_requirement' => true, ), 'phpunit/phpunit' => array( - 'pretty_version' => '9.6.21', - 'version' => '9.6.21.0', - 'reference' => 'de6abf3b6f8dd955fac3caad3af7a9504e8c2ffa', + 'pretty_version' => '9.6.22', + 'version' => '9.6.22.0', + 'reference' => 'f80235cb4d3caa59ae09be3adf1ded27521d1a9c', 'type' => 'library', 'install_path' => __DIR__ . '/../phpunit/phpunit', 'aliases' => array(), @@ -398,9 +398,9 @@ 'dev_requirement' => true, ), 'sirbrillig/phpcs-variable-analysis' => array( - 'pretty_version' => 'v2.11.19', - 'version' => '2.11.19.0', - 'reference' => 'bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1', + 'pretty_version' => 'v2.11.22', + 'version' => '2.11.22.0', + 'reference' => 'ffb6f16c6033ec61ed84446b479a31d6529f0eb7', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../sirbrillig/phpcs-variable-analysis', 'aliases' => array(), @@ -416,18 +416,18 @@ 'dev_requirement' => true, ), 'spryker/code-sniffer' => array( - 'pretty_version' => '0.17.25', - 'version' => '0.17.25.0', - 'reference' => '4d26c642e56be892f1fcebc227e9a7b4ddb25f06', + 'pretty_version' => '0.17.26', + 'version' => '0.17.26.0', + 'reference' => 'be31dad00da0af2417a775b1d545c87cb058f2e8', 'type' => 'phpcodesniffer-standard', 'install_path' => __DIR__ . '/../spryker/code-sniffer', 'aliases' => array(), 'dev_requirement' => true, ), 'squizlabs/php_codesniffer' => array( - 'pretty_version' => '3.10.3', - 'version' => '3.10.3.0', - 'reference' => '62d32998e820bddc40f99f8251958aed187a5c9c', + 'pretty_version' => '3.11.2', + 'version' => '3.11.2.0', + 'reference' => '1368f4a58c3c52114b86b1abe8f4098869cb0079', 'type' => 'library', 'install_path' => __DIR__ . '/../squizlabs/php_codesniffer', 'aliases' => array(), @@ -452,9 +452,9 @@ 'dev_requirement' => true, ), 'yoast/phpunit-polyfills' => array( - 'pretty_version' => '3.0.0', - 'version' => '3.0.0.0', - 'reference' => '19e6d5fb8aad31f731f774f9646a10c64a8843d2', + 'pretty_version' => '3.1.1', + 'version' => '3.1.1.0', + 'reference' => 'e6381c62c4df51677b657fbac79b79dfce7acdab', 'type' => 'library', 'install_path' => __DIR__ . '/../yoast/phpunit-polyfills', 'aliases' => array(), diff --git a/vendor/johnbillion/args/README.md b/vendor/johnbillion/args/README.md index f147ebf9..3713ec6e 100644 --- a/vendor/johnbillion/args/README.md +++ b/vendor/johnbillion/args/README.md @@ -18,7 +18,7 @@ This library provides well-documented classes which represent many of the associ ## Current status -Last updated for WordPress 6.6. +Last updated for WordPress 6.7. ## Requirements diff --git a/vendor/johnbillion/args/composer.json b/vendor/johnbillion/args/composer.json index 2d2b7578..0d1d1345 100644 --- a/vendor/johnbillion/args/composer.json +++ b/vendor/johnbillion/args/composer.json @@ -299,17 +299,17 @@ "wordpress-install-dir": "vendor/wordpress/wordpress" }, "require-dev": { - "ergebnis/json-printer": "^3.2", - "ergebnis/phpstan-rules": "^1.0", + "ergebnis/json-printer": "3.7.0", + "ergebnis/phpstan-rules": "1.0.0", "humanmade/coding-standards": "1.2.1", "johnbillion/falsey-assertequals-detector": "^3", "phpdocumentor/reflection": "~4.0 || ~5.0", - "phpstan/phpstan": "1.12.5", - "phpstan/phpstan-phpunit": "1.4.0", + "phpstan/phpstan": "1.12.12", + "phpstan/phpstan-phpunit": "1.4.1", "phpstan/phpstan-strict-rules": "1.6.1", "phpunit/phpunit": "^9.0", - "roots/wordpress-core-installer": "^1.0.0", - "roots/wordpress-full": "6.6", + "roots/wordpress-core-installer": "1.100.0", + "roots/wordpress-full": "6.7", "szepeviktor/phpstan-wordpress": "1.3.5" }, "funding": [ diff --git a/vendor/johnbillion/args/src/MetaQuery/Query.php b/vendor/johnbillion/args/src/MetaQuery/Query.php index 039ffdb8..583989ba 100644 --- a/vendor/johnbillion/args/src/MetaQuery/Query.php +++ b/vendor/johnbillion/args/src/MetaQuery/Query.php @@ -44,7 +44,7 @@ final public static function fromArray( array $clauses ) : self { return $class; } - final public function addClause( Clause $clause, string $key = null ) : void { + final public function addClause( Clause $clause, ?string $key = null ) : void { if ( null !== $key ) { $this->clauses[ $key ] = $clause; } else { diff --git a/vendor/johnbillion/args/src/WP_Term_Query.php b/vendor/johnbillion/args/src/WP_Term_Query.php index 4f33c256..8937df4c 100644 --- a/vendor/johnbillion/args/src/WP_Term_Query.php +++ b/vendor/johnbillion/args/src/WP_Term_Query.php @@ -139,13 +139,6 @@ class WP_Term_Query extends Shared\Base implements MetaQuery\WithArgs { */ public string $fields; - /** - * Whether to return a term count. If true, will take precedence over `$fields`. - * - * Default false. - */ - public bool $count; - /** * Name or array of names to return term(s) for. * diff --git a/vendor/johnbillion/args/src/register_meta.php b/vendor/johnbillion/args/src/register_meta.php index f0cfc2a1..71d4c30e 100644 --- a/vendor/johnbillion/args/src/register_meta.php +++ b/vendor/johnbillion/args/src/register_meta.php @@ -40,6 +40,11 @@ class register_meta extends Shared\Base { */ public string $description; + /** + * A human-readable label of the data attached to this meta key. + */ + public string $label; + /** * Whether the meta key has one value per object, or an array of values per object. */ diff --git a/vendor/johnbillion/extended-cpts/README.md b/vendor/johnbillion/extended-cpts/README.md index e45e691d..31c74257 100644 --- a/vendor/johnbillion/extended-cpts/README.md +++ b/vendor/johnbillion/extended-cpts/README.md @@ -60,9 +60,9 @@ Not your first time here? See [Recent Changes for Developers](https://github.com ## Minimum Requirements ## * **PHP:** 7.4 - - Tested up to PHP 8.3 -* **WordPress:** 5.7 - - Tested up to WP 6.6 + - Tested up to PHP 8.4 +* **WordPress:** 5.8 + - Tested up to WP 6.7 ## Installation ## diff --git a/vendor/johnbillion/extended-cpts/composer.json b/vendor/johnbillion/extended-cpts/composer.json index cbc32265..6959d2b9 100644 --- a/vendor/johnbillion/extended-cpts/composer.json +++ b/vendor/johnbillion/extended-cpts/composer.json @@ -18,14 +18,14 @@ "dealerdirect/phpcodesniffer-composer-installer": "^0.7", "johnbillion/falsey-assertequals-detector": "*", "johnbillion/plugin-infrastructure": "dev-trunk", - "johnbillion/wp-compat": "0.1.0", - "lucatume/wp-browser": ">=3.0.21 <3.5", - "phpcompatibility/phpcompatibility-wp": "^2", - "phpstan/phpstan": "1.12.2", - "phpstan/phpstan-phpunit": "1.4.0", - "roots/wordpress-core-installer": "^1.0.0", + "johnbillion/wp-compat": "0.3.1", + "lucatume/wp-browser": "3.2.3", + "phpcompatibility/phpcompatibility-wp": "2.1.5", + "phpstan/phpstan": "1.12.12", + "phpstan/phpstan-phpunit": "1.4.1", + "roots/wordpress-core-installer": "1.100.0", "roots/wordpress-full": "*", - "szepeviktor/phpstan-wordpress": "1.1.6", + "szepeviktor/phpstan-wordpress": "1.3.5", "wp-coding-standards/wpcs": "2.3.0" }, "autoload": { diff --git a/vendor/johnbillion/extended-cpts/extended-cpts.php b/vendor/johnbillion/extended-cpts/extended-cpts.php index 03f27fa6..a7304fb0 100755 --- a/vendor/johnbillion/extended-cpts/extended-cpts.php +++ b/vendor/johnbillion/extended-cpts/extended-cpts.php @@ -9,7 +9,7 @@ * @link https://github.com/johnbillion/extended-cpts * @copyright 2012-2024 John Blackbourn * @license GPL v2 or later - * @version 5.0.9 + * @version 5.0.11 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/vendor/johnbillion/extended-cpts/src/TaxonomyAdmin.php b/vendor/johnbillion/extended-cpts/src/TaxonomyAdmin.php index f15471cf..8ca450df 100644 --- a/vendor/johnbillion/extended-cpts/src/TaxonomyAdmin.php +++ b/vendor/johnbillion/extended-cpts/src/TaxonomyAdmin.php @@ -418,7 +418,7 @@ public function meta_box_simple( WP_Post $post, array $meta_box ): void { * @param bool $show_none Optional. Whether to include a 'none' item in the term list. Default false. * @param string $type Optional. The taxonomy list type (checklist or dropdown). Default 'checklist'. */ - protected function do_meta_box( WP_Post $post, \Walker $walker = null, bool $show_none = false, string $type = 'checklist' ): void { + protected function do_meta_box( WP_Post $post, ?\Walker $walker = null, bool $show_none = false, string $type = 'checklist' ): void { $taxonomy = $this->taxo->taxonomy; /** @var WP_Taxonomy */ $tax = get_taxonomy( $taxonomy ); diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php index 084858ee..f739d922 100644 --- a/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php +++ b/vendor/myclabs/deep-copy/src/DeepCopy/DeepCopy.php @@ -4,6 +4,7 @@ use ArrayObject; use DateInterval; +use DatePeriod; use DateTimeInterface; use DateTimeZone; use DeepCopy\Exception\CloneException; @@ -12,6 +13,7 @@ use DeepCopy\Matcher\Matcher; use DeepCopy\Reflection\ReflectionHelper; use DeepCopy\TypeFilter\Date\DateIntervalFilter; +use DeepCopy\TypeFilter\Date\DatePeriodFilter; use DeepCopy\TypeFilter\Spl\ArrayObjectFilter; use DeepCopy\TypeFilter\Spl\SplDoublyLinkedListFilter; use DeepCopy\TypeFilter\TypeFilter; @@ -64,6 +66,7 @@ public function __construct($useCloneMethod = false) $this->addTypeFilter(new ArrayObjectFilter($this), new TypeMatcher(ArrayObject::class)); $this->addTypeFilter(new DateIntervalFilter(), new TypeMatcher(DateInterval::class)); + $this->addTypeFilter(new DatePeriodFilter(), new TypeMatcher(DatePeriod::class)); $this->addTypeFilter(new SplDoublyLinkedListFilter($this), new TypeMatcher(SplDoublyLinkedList::class)); } diff --git a/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php new file mode 100644 index 00000000..6bd2f7e5 --- /dev/null +++ b/vendor/myclabs/deep-copy/src/DeepCopy/TypeFilter/Date/DatePeriodFilter.php @@ -0,0 +1,42 @@ += 80200 && $element->include_end_date) { + $options |= DatePeriod::INCLUDE_END_DATE; + } + if (!$element->include_start_date) { + $options |= DatePeriod::EXCLUDE_START_DATE; + } + + if ($element->getEndDate()) { + return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $element->getEndDate(), $options); + } + + if (PHP_VERSION_ID >= 70217) { + $recurrences = $element->getRecurrences(); + } else { + $recurrences = $element->recurrences - $element->include_start_date; + } + + return new DatePeriod($element->getStartDate(), $element->getDateInterval(), $recurrences, $options); + } +} diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php index 490ac937..be9d0708 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Expr/ArrayItem.php @@ -1,3 +1,11 @@ flags !== 0; + return $this->flags !== 0 || $this->hooks !== []; } public function isPublic(): bool { - return (bool) ($this->flags & Modifiers::PUBLIC); + $public = (bool) ($this->flags & Modifiers::PUBLIC); + if ($public) { + return true; + } + + if ($this->hooks === []) { + return false; + } + + return ($this->flags & Modifiers::VISIBILITY_MASK) === 0; } public function isProtected(): bool { diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php b/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php index a8cde850..349b9cef 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/PropertyHook.php @@ -2,6 +2,11 @@ namespace PhpParser\Node; +use PhpParser\Modifiers; +use PhpParser\Node\Expr\Assign; +use PhpParser\Node\Expr\PropertyFetch; +use PhpParser\Node\Expr\Variable; +use PhpParser\Node\Stmt\Expression; use PhpParser\Node\Stmt\Return_; use PhpParser\NodeAbstract; @@ -30,6 +35,7 @@ class PropertyHook extends NodeAbstract implements FunctionLike { * params?: Param[], * attrGroups?: AttributeGroup[], * } $subNodes Array of the following optional subnodes: + * 'flags => 0 : Flags * 'byRef' => false : Whether hook returns by reference * 'params' => array(): Parameters * 'attrGroups' => array(): PHP attribute groups @@ -57,9 +63,30 @@ public function getReturnType() { return null; } + /** + * Whether the property hook is final. + */ + public function isFinal(): bool { + return (bool) ($this->flags & Modifiers::FINAL); + } + public function getStmts(): ?array { if ($this->body instanceof Expr) { - return [new Return_($this->body)]; + $name = $this->name->toLowerString(); + if ($name === 'get') { + return [new Return_($this->body)]; + } + if ($name === 'set') { + if (!$this->hasAttribute('propertyName')) { + throw new \LogicException( + 'Can only use getStmts() on a "set" hook if the "propertyName" attribute is set'); + } + + $propName = $this->getAttribute('propertyName'); + $prop = new PropertyFetch(new Variable('this'), (string) $propName); + return [new Expression(new Assign($prop, $this->body))]; + } + throw new \LogicException('Unknown property hook "' . $name . '"'); } return $this->body; } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php index ad3937a5..aaafc5fe 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Scalar/DNumber.php @@ -1,3 +1,11 @@ flags & Modifiers::READONLY); } + /** + * Whether the property is abstract. + */ + public function isAbstract(): bool { + return (bool) ($this->flags & Modifiers::ABSTRACT); + } + + /** + * Whether the property is final. + */ + public function isFinal(): bool { + return (bool) ($this->flags & Modifiers::FINAL); + } + /** * Whether the property has explicit public(set) visibility. */ diff --git a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php index 4a21a880..fe7c9973 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Node/Stmt/PropertyProperty.php @@ -1,3 +1,13 @@ stopTraversal) { break; } - } elseif ($subNode instanceof Node) { - $traverseChildren = true; - $visitorIndex = -1; - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->enterNode($subNode); - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($subNode, $return); - $subNode = $node->$name = $return; - } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { - $traverseChildren = false; - break; - } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { - $node->$name = null; - continue 2; - } else { - throw new \LogicException( - 'enterNode() returned invalid value of type ' . gettype($return) - ); - } - } - } - if ($traverseChildren) { - $this->traverseNode($subNode); - if ($this->stopTraversal) { + continue; + } + + if (!$subNode instanceof Node) { + continue; + } + + $traverseChildren = true; + $visitorIndex = -1; + + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->enterNode($subNode); + if (null !== $return) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($subNode, $return); + $subNode = $node->$name = $return; + } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { + $traverseChildren = false; + } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { + $traverseChildren = false; break; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { + $this->stopTraversal = true; + break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + $node->$name = null; + continue 2; + } else { + throw new \LogicException( + 'enterNode() returned invalid value of type ' . gettype($return) + ); } } + } + + if ($traverseChildren) { + $this->traverseNode($subNode); + if ($this->stopTraversal) { + break; + } + } + + for (; $visitorIndex >= 0; --$visitorIndex) { + $visitor = $this->visitors[$visitorIndex]; + $return = $visitor->leaveNode($subNode); - for (; $visitorIndex >= 0; --$visitorIndex) { - $visitor = $this->visitors[$visitorIndex]; - $return = $visitor->leaveNode($subNode); - - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($subNode, $return); - $subNode = $node->$name = $return; - } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { - $node->$name = null; - break; - } elseif (\is_array($return)) { - throw new \LogicException( - 'leaveNode() may only return an array ' . - 'if the parent structure is an array' - ); - } else { - throw new \LogicException( - 'leaveNode() returned invalid value of type ' . gettype($return) - ); - } + if (null !== $return) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($subNode, $return); + $subNode = $node->$name = $return; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { + $this->stopTraversal = true; + break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + $node->$name = null; + break; + } elseif (\is_array($return)) { + throw new \LogicException( + 'leaveNode() may only return an array ' . + 'if the parent structure is an array' + ); + } else { + throw new \LogicException( + 'leaveNode() returned invalid value of type ' . gettype($return) + ); } } } @@ -176,77 +182,80 @@ protected function traverseArray(array $nodes): array { $doNodes = []; foreach ($nodes as $i => $node) { - if ($node instanceof Node) { - $traverseChildren = true; - $visitorIndex = -1; - - foreach ($this->visitors as $visitorIndex => $visitor) { - $return = $visitor->enterNode($node); - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($node, $return); - $nodes[$i] = $node = $return; - } elseif (\is_array($return)) { - $doNodes[] = [$i, $return]; - continue 2; - } elseif (NodeVisitor::REMOVE_NODE === $return) { - $doNodes[] = [$i, []]; - continue 2; - } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { - $traverseChildren = false; - } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { - $traverseChildren = false; - break; - } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { - throw new \LogicException( - 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); - } else { - throw new \LogicException( - 'enterNode() returned invalid value of type ' . gettype($return) - ); - } - } + if (!$node instanceof Node) { + if (\is_array($node)) { + throw new \LogicException('Invalid node structure: Contains nested arrays'); } + continue; + } + + $traverseChildren = true; + $visitorIndex = -1; - if ($traverseChildren) { - $this->traverseNode($node); - if ($this->stopTraversal) { + foreach ($this->visitors as $visitorIndex => $visitor) { + $return = $visitor->enterNode($node); + if (null !== $return) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($node, $return); + $nodes[$i] = $node = $return; + } elseif (\is_array($return)) { + $doNodes[] = [$i, $return]; + continue 2; + } elseif (NodeVisitor::REMOVE_NODE === $return) { + $doNodes[] = [$i, []]; + continue 2; + } elseif (NodeVisitor::DONT_TRAVERSE_CHILDREN === $return) { + $traverseChildren = false; + } elseif (NodeVisitor::DONT_TRAVERSE_CURRENT_AND_CHILDREN === $return) { + $traverseChildren = false; break; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { + $this->stopTraversal = true; + break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + throw new \LogicException( + 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); + } else { + throw new \LogicException( + 'enterNode() returned invalid value of type ' . gettype($return) + ); } } + } - for (; $visitorIndex >= 0; --$visitorIndex) { - $visitor = $this->visitors[$visitorIndex]; - $return = $visitor->leaveNode($node); - - if (null !== $return) { - if ($return instanceof Node) { - $this->ensureReplacementReasonable($node, $return); - $nodes[$i] = $node = $return; - } elseif (\is_array($return)) { - $doNodes[] = [$i, $return]; - break; - } elseif (NodeVisitor::REMOVE_NODE === $return) { - $doNodes[] = [$i, []]; - break; - } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { - $this->stopTraversal = true; - break 2; - } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { - throw new \LogicException( - 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); - } else { - throw new \LogicException( - 'leaveNode() returned invalid value of type ' . gettype($return) - ); - } + if ($traverseChildren) { + $this->traverseNode($node); + if ($this->stopTraversal) { + break; + } + } + + for (; $visitorIndex >= 0; --$visitorIndex) { + $visitor = $this->visitors[$visitorIndex]; + $return = $visitor->leaveNode($node); + + if (null !== $return) { + if ($return instanceof Node) { + $this->ensureReplacementReasonable($node, $return); + $nodes[$i] = $node = $return; + } elseif (\is_array($return)) { + $doNodes[] = [$i, $return]; + break; + } elseif (NodeVisitor::REMOVE_NODE === $return) { + $doNodes[] = [$i, []]; + break; + } elseif (NodeVisitor::STOP_TRAVERSAL === $return) { + $this->stopTraversal = true; + break 2; + } elseif (NodeVisitor::REPLACE_WITH_NULL === $return) { + throw new \LogicException( + 'REPLACE_WITH_NULL can not be used if the parent structure is an array'); + } else { + throw new \LogicException( + 'leaveNode() returned invalid value of type ' . gettype($return) + ); } } - } elseif (\is_array($node)) { - throw new \LogicException('Invalid node structure: Contains nested arrays'); } } diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php index 2ab16954..b9097820 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php7.php @@ -1844,10 +1844,12 @@ protected function initReduceCallbacks(): void { 290 => static function ($self, $stackPos) { $self->semValue = new Node\Param($self->semStack[$stackPos-(7-6)], null, $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-4)], $self->semStack[$stackPos-(7-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-7)]); $self->checkParam($self->semValue); + $self->addPropertyNameToHooks($self->semValue); }, 291 => static function ($self, $stackPos) { $self->semValue = new Node\Param($self->semStack[$stackPos-(9-6)], $self->semStack[$stackPos-(9-8)], $self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-4)], $self->semStack[$stackPos-(9-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(9-2)], $self->semStack[$stackPos-(9-1)], $self->semStack[$stackPos-(9-9)]); $self->checkParam($self->semValue); + $self->addPropertyNameToHooks($self->semValue); }, 292 => static function ($self, $stackPos) { $self->semValue = new Node\Param(new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])), null, $self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-4)], $self->semStack[$stackPos-(6-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-1)]); diff --git a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php index e1aa4b1f..3addf944 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php +++ b/vendor/nikic/php-parser/lib/PhpParser/Parser/Php8.php @@ -1839,10 +1839,12 @@ protected function initReduceCallbacks(): void { 290 => static function ($self, $stackPos) { $self->semValue = new Node\Param($self->semStack[$stackPos-(7-6)], null, $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-4)], $self->semStack[$stackPos-(7-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-7)]); $self->checkParam($self->semValue); + $self->addPropertyNameToHooks($self->semValue); }, 291 => static function ($self, $stackPos) { $self->semValue = new Node\Param($self->semStack[$stackPos-(9-6)], $self->semStack[$stackPos-(9-8)], $self->semStack[$stackPos-(9-3)], $self->semStack[$stackPos-(9-4)], $self->semStack[$stackPos-(9-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(9-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(9-2)], $self->semStack[$stackPos-(9-1)], $self->semStack[$stackPos-(9-9)]); $self->checkParam($self->semValue); + $self->addPropertyNameToHooks($self->semValue); }, 292 => static function ($self, $stackPos) { $self->semValue = new Node\Param(new Expr\Error($self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos])), null, $self->semStack[$stackPos-(6-3)], $self->semStack[$stackPos-(6-4)], $self->semStack[$stackPos-(6-5)], $self->getAttributes($self->tokenStartStack[$stackPos-(6-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(6-2)], $self->semStack[$stackPos-(6-1)]); @@ -1993,7 +1995,9 @@ protected function initReduceCallbacks(): void { }, 348 => static function ($self, $stackPos) { $self->semValue = new Stmt\Property($self->semStack[$stackPos-(7-2)], $self->semStack[$stackPos-(7-4)], $self->getAttributes($self->tokenStartStack[$stackPos-(7-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(7-3)], $self->semStack[$stackPos-(7-1)], $self->semStack[$stackPos-(7-6)]); - $self->checkPropertyHookList($self->semStack[$stackPos-(7-6)], $stackPos-(7-5)); + $self->checkPropertyHooksForMultiProperty($self->semValue, $stackPos-(7-5)); + $self->checkEmptyPropertyHookList($self->semStack[$stackPos-(7-6)], $stackPos-(7-5)); + $self->addPropertyNameToHooks($self->semValue); }, 349 => static function ($self, $stackPos) { $self->semValue = new Stmt\ClassConst($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-2)], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos]), $self->semStack[$stackPos-(5-1)]); @@ -2122,7 +2126,7 @@ protected function initReduceCallbacks(): void { $self->semValue = []; }, 394 => static function ($self, $stackPos) { - $self->semValue = $self->semStack[$stackPos-(3-2)]; $self->checkPropertyHookList($self->semStack[$stackPos-(3-2)], $stackPos-(3-1)); + $self->semValue = $self->semStack[$stackPos-(3-2)]; $self->checkEmptyPropertyHookList($self->semStack[$stackPos-(3-2)], $stackPos-(3-1)); }, 395 => static function ($self, $stackPos) { $self->semValue = new Node\PropertyHook($self->semStack[$stackPos-(5-4)], $self->semStack[$stackPos-(5-5)], ['flags' => $self->semStack[$stackPos-(5-2)], 'byRef' => $self->semStack[$stackPos-(5-3)], 'params' => [], 'attrGroups' => $self->semStack[$stackPos-(5-1)]], $self->getAttributes($self->tokenStartStack[$stackPos-(5-1)], $self->tokenEndStack[$stackPos])); diff --git a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php index 3d1e4eed..667f21f5 100644 --- a/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php +++ b/vendor/nikic/php-parser/lib/PhpParser/ParserAbstract.php @@ -32,6 +32,7 @@ use PhpParser\Node\Stmt\Property; use PhpParser\Node\Stmt\TryCatch; use PhpParser\Node\UseItem; +use PhpParser\Node\VarLikeIdentifier; use PhpParser\NodeVisitor\CommentAnnotatingVisitor; abstract class ParserAbstract implements Parser { @@ -411,8 +412,6 @@ protected function doParse(): ?array { $rule = $state - $this->numNonLeafStates; } } - - throw new \RuntimeException('Reached end of parser loop'); } protected function emitError(Error $error): void { @@ -1160,8 +1159,15 @@ protected function checkUseUse(UseItem $node, int $namePos): void { } } + protected function checkPropertyHooksForMultiProperty(Property $property, int $hookPos): void { + if (count($property->props) > 1) { + $this->emitError(new Error( + 'Cannot use hooks when declaring multiple properties', $this->getAttributesAt($hookPos))); + } + } + /** @param PropertyHook[] $hooks */ - protected function checkPropertyHookList(array $hooks, int $hookPos): void { + protected function checkEmptyPropertyHookList(array $hooks, int $hookPos): void { if (empty($hooks)) { $this->emitError(new Error( 'Property hook list cannot be empty', $this->getAttributesAt($hookPos))); @@ -1196,6 +1202,20 @@ protected function checkPropertyHookModifiers(int $a, int $b, int $modifierPos): } } + /** + * @param Property|Param $node + */ + protected function addPropertyNameToHooks(Node $node): void { + if ($node instanceof Property) { + $name = $node->props[0]->name->toString(); + } else { + $name = $node->var->name; + } + foreach ($node->hooks as $hook) { + $hook->setAttribute('propertyName', $name); + } + } + /** @param array $args */ private function isSimpleExit(array $args): bool { if (\count($args) === 0) { diff --git a/vendor/pantheon-systems/wpunit-helpers/bin/helpers.sh b/vendor/pantheon-systems/wpunit-helpers/bin/helpers.sh index 8064c980..4b5fab86 100755 --- a/vendor/pantheon-systems/wpunit-helpers/bin/helpers.sh +++ b/vendor/pantheon-systems/wpunit-helpers/bin/helpers.sh @@ -2,14 +2,32 @@ # Arbitrary download function that uses wget or curl depending on what's available. download() { - if which curl &> /dev/null; then - curl -s "$1" > "$2"; - elif which wget &> /dev/null; then - wget -nv -O "$2" "$1" - else - echo "Missing curl or wget" >&2 - exit 1 - fi + if which curl &> /dev/null; then + curl -s "$1" > "$2"; + elif which wget &> /dev/null; then + wget -nv -O "$2" "$1" + else + echo "Missing curl or wget" >&2 + exit 1 + fi +} + +# Function to ensure svn is installed +ensure_svn_installed() { + if ! which svn &> /dev/null; then + echo "svn is not installed. Installing..." + if which apt-get &> /dev/null; then + sudo apt-get update + sudo apt-get install -y subversion + elif which yum &> /dev/null; then + sudo yum install -y subversion + elif which brew &> /dev/null; then + brew install subversion + else + echo "Package manager not found. Please install svn manually." + exit 1 + fi + fi } # Download WordPress with wp-cli. Always forces the download of files to overwrite existing ones. @@ -195,6 +213,9 @@ install_test_suite() { local ioption='-i' fi + # Ensure svn is installed + ensure_svn_installed + # set up testing suite if it doesn't yet exist if [ ! -d "$WP_TESTS_DIR" ]; then # set up testing suite @@ -263,4 +284,4 @@ cleanup() { # Remove the files rm -f "$WP_VERSION_JSON" fi -} +} \ No newline at end of file diff --git a/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml b/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml index 7f797a19..7947f6fa 100644 --- a/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml +++ b/vendor/phpcompatibility/phpcompatibility-wp/PHPCompatibilityWP/ruleset.xml @@ -6,8 +6,9 @@ The WordPress minimum PHP requirement was 5.2.4 up to WP 5.1. As of WP 5.2, the new minimum PHP requirement is PHP 5.6.20. As of WP 6.3, the new minimum PHP requirement is PHP 7.0.0. + As of WP 6.6, the new minimum PHP requirement is PHP 7.2.24. Add the following in your project PHP_CodeSniffer ruleset to enforce this: - + This directive is not included in this ruleset as individual projects may use a different (higher) minimum PHP version. diff --git a/vendor/phpcompatibility/phpcompatibility-wp/README.md b/vendor/phpcompatibility/phpcompatibility-wp/README.md index 6890031e..22ace587 100644 --- a/vendor/phpcompatibility/phpcompatibility-wp/README.md +++ b/vendor/phpcompatibility/phpcompatibility-wp/README.md @@ -1,7 +1,7 @@ -[![Latest Stable Version](https://poser.pugx.org/phpcompatibility/phpcompatibility-wp/v/stable.png)](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp) -[![Latest Unstable Version](https://poser.pugx.org/phpcompatibility/phpcompatibility-wp/v/unstable.png)](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp) -[![License](https://poser.pugx.org/phpcompatibility/phpcompatibility-wp/license.png)](https://github.com/PHPCompatibility/PHPCompatibilityWP/blob/master/LICENSE) -[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilityWP/workflows/CI/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilityWP/actions) +[![Latest Stable Version](https://img.shields.io/packagist/v/phpcompatibility/phpcompatibility-wp?label=stable)](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp) +[![Latest Unstable Version](https://img.shields.io/badge/unstable-dev--develop-e68718.svg?maxAge=2419200)](https://packagist.org/packages/phpcompatibility/phpcompatibility-wp) +[![License](https://img.shields.io/github/license/PHPCompatibility/PHPCompatibilityWP?color=00a7a7)](https://github.com/PHPCompatibility/PHPCompatibilityWP/blob/master/LICENSE) +[![Build Status](https://github.com/PHPCompatibility/PHPCompatibilityWP/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/PHPCompatibility/PHPCompatibilityWP/actions/workflows/ci.yml) # PHPCompatibilityWP @@ -85,6 +85,11 @@ All code within the PHPCompatibility organisation is released under the GNU Less ## Changelog +### 2.1.6 - 2025-01-16 + +- README: Fixed some broken badges. +- General housekeeping and documentation updates. Including a contribution by [@johnbillion]. + ### 2.1.5 - 2024-04-25 - Ruleset: Updated for compatibility with WordPress 6.5. Thanks [@swissspidy] diff --git a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php index 1f4ed4a9..73d162de 100644 --- a/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php +++ b/vendor/phpstan/phpdoc-parser/src/Ast/Type/ArrayShapeNode.php @@ -10,6 +10,8 @@ class ArrayShapeNode implements TypeNode public const KIND_ARRAY = 'array'; public const KIND_LIST = 'list'; + public const KIND_NON_EMPTY_ARRAY = 'non-empty-array'; + public const KIND_NON_EMPTY_LIST = 'non-empty-list'; use NodeAttributes; diff --git a/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php b/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php index 2be28398..982eba7d 100644 --- a/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php +++ b/vendor/phpstan/phpdoc-parser/src/Parser/TypeParser.php @@ -180,7 +180,13 @@ private function parseAtomic(TokenIterator $tokens): Ast\Type\TypeNode } elseif ($tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_SQUARE_BRACKET)) { $type = $this->tryParseArrayOrOffsetAccess($tokens, $type); - } elseif (in_array($type->name, ['array', 'list', 'object'], true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { + } elseif (in_array($type->name, [ + Ast\Type\ArrayShapeNode::KIND_ARRAY, + Ast\Type\ArrayShapeNode::KIND_LIST, + Ast\Type\ArrayShapeNode::KIND_NON_EMPTY_ARRAY, + Ast\Type\ArrayShapeNode::KIND_NON_EMPTY_LIST, + 'object', + ], true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { if ($type->name === 'object') { $type = $this->parseObjectShape($tokens); } else { @@ -690,7 +696,13 @@ private function parseCallableReturnType(TokenIterator $tokens): Ast\Type\TypeNo $startIndex )); - } elseif (in_array($type->name, ['array', 'list', 'object'], true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { + } elseif (in_array($type->name, [ + Ast\Type\ArrayShapeNode::KIND_ARRAY, + Ast\Type\ArrayShapeNode::KIND_LIST, + Ast\Type\ArrayShapeNode::KIND_NON_EMPTY_ARRAY, + Ast\Type\ArrayShapeNode::KIND_NON_EMPTY_LIST, + 'object', + ], true) && $tokens->isCurrentTokenType(Lexer::TOKEN_OPEN_CURLY_BRACKET) && !$tokens->isPrecededByHorizontalWhitespace()) { if ($type->name === 'object') { $type = $this->parseObjectShape($tokens); } else { diff --git a/vendor/phpunit/phpunit/ChangeLog-9.6.md b/vendor/phpunit/phpunit/ChangeLog-9.6.md index e6c6bc03..b8ce54eb 100644 --- a/vendor/phpunit/phpunit/ChangeLog-9.6.md +++ b/vendor/phpunit/phpunit/ChangeLog-9.6.md @@ -2,6 +2,12 @@ All notable changes of the PHPUnit 9.6 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles. +## [9.6.22] - 2024-12-05 + +### Fixed + +* [#6071](https://github.com/sebastianbergmann/phpunit/issues/6071): PHP Archives (PHARs) of PHPUnit 8.5 and PHPUnit 9.6 bundle outdated versions of Prophecy + ## [9.6.21] - 2024-09-19 ### Changed @@ -156,6 +162,7 @@ All notable changes of the PHPUnit 9.6 release series are documented in this fil * [#5064](https://github.com/sebastianbergmann/phpunit/issues/5064): Deprecate `PHPUnit\Framework\TestCase::getMockClass()` * [#5132](https://github.com/sebastianbergmann/phpunit/issues/5132): Deprecate `Test` suffix for abstract test case classes +[9.6.22]: https://github.com/sebastianbergmann/phpunit/compare/9.6.21...9.6.22 [9.6.21]: https://github.com/sebastianbergmann/phpunit/compare/9.6.20...9.6.21 [9.6.20]: https://github.com/sebastianbergmann/phpunit/compare/9.6.19...9.6.20 [9.6.19]: https://github.com/sebastianbergmann/phpunit/compare/9.6.18...9.6.19 diff --git a/vendor/phpunit/phpunit/composer.json b/vendor/phpunit/phpunit/composer.json index e64534e0..fbee5d8b 100644 --- a/vendor/phpunit/phpunit/composer.json +++ b/vendor/phpunit/phpunit/composer.json @@ -30,7 +30,7 @@ "ext-xml": "*", "ext-xmlwriter": "*", "doctrine/instantiator": "^1.5.0 || ^2", - "myclabs/deep-copy": "^1.12.0", + "myclabs/deep-copy": "^1.12.1", "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "phpunit/php-code-coverage": "^9.2.32", diff --git a/vendor/phpunit/phpunit/composer.lock b/vendor/phpunit/phpunit/composer.lock index 134a4150..08fedc14 100644 --- a/vendor/phpunit/phpunit/composer.lock +++ b/vendor/phpunit/phpunit/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": "c42c85dc63b776e13d9454ad6ff3ddc9", + "content-hash": "c2c8f2f519c0a987a4a2c8d3ffd9b3ce", "packages": [ { "name": "doctrine/instantiator", @@ -78,16 +78,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.12.0", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", - "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/123267b2c49fbf30d78a7b2d333f6be754b94845", + "reference": "123267b2c49fbf30d78a7b2d333f6be754b94845", "shasum": "" }, "require": { @@ -126,7 +126,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.1" }, "funding": [ { @@ -134,20 +134,20 @@ "type": "tidelift" } ], - "time": "2024-06-12T14:39:25+00:00" + "time": "2024-11-08T17:47:46+00:00" }, { "name": "nikic/php-parser", - "version": "v4.19.1", + "version": "v4.19.4", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", - "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/715f4d25e225bc47b293a8b997fe6ce99bf987d2", + "reference": "715f4d25e225bc47b293a8b997fe6ce99bf987d2", "shasum": "" }, "require": { @@ -156,7 +156,7 @@ }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", - "phpunit/phpunit": "^6.5 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^7.0 || ^8.0 || ^9.0" }, "bin": [ "bin/php-parse" @@ -188,9 +188,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.4" }, - "time": "2024-03-17T08:10:35+00:00" + "time": "2024-09-29T15:01:53+00:00" }, { "name": "phar-io/manifest", @@ -1646,7 +1646,7 @@ "packages-dev": [], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": {}, "prefer-stable": true, "prefer-lowest": false, "platform": { @@ -1658,7 +1658,7 @@ "ext-xml": "*", "ext-xmlwriter": "*" }, - "platform-dev": [], + "platform-dev": {}, "platform-overrides": { "php": "7.3.0" }, diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php index 9a69a474..f8c24a52 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Operator/UnaryOperator.php @@ -10,7 +10,6 @@ namespace PHPUnit\Framework\Constraint; use function count; - use SebastianBergmann\RecursionContext\InvalidArgumentException; /** diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php b/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php index 08aeaaf9..bdf36332 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/String/IsJson.php @@ -10,7 +10,6 @@ namespace PHPUnit\Framework\Constraint; use function json_decode; - use function json_last_error; use function sprintf; use SebastianBergmann\RecursionContext\InvalidArgumentException; diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php index 829aab41..0f934396 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Traversable/TraversableContains.php @@ -10,7 +10,6 @@ namespace PHPUnit\Framework\Constraint; use function is_array; - use function sprintf; use SebastianBergmann\RecursionContext\InvalidArgumentException; diff --git a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php index 5a968a30..285b74a7 100644 --- a/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php +++ b/vendor/phpunit/phpunit/src/Framework/Constraint/Type/IsType.php @@ -10,7 +10,6 @@ namespace PHPUnit\Framework\Constraint; use function gettype; - use function is_array; use function is_bool; use function is_callable; diff --git a/vendor/phpunit/phpunit/src/Framework/TestCase.php b/vendor/phpunit/phpunit/src/Framework/TestCase.php index 28b5b245..30dd5b95 100644 --- a/vendor/phpunit/phpunit/src/Framework/TestCase.php +++ b/vendor/phpunit/phpunit/src/Framework/TestCase.php @@ -599,7 +599,7 @@ public function expectOutputString(string $expectedString): void } /** - * @psalm-param class-string<\Throwable> $exception + * @psalm-param class-string $exception */ public function expectException(string $exception): void { diff --git a/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php b/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php index b7d83b9f..4880470e 100644 --- a/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php +++ b/vendor/phpunit/phpunit/src/Runner/Filter/Factory.php @@ -24,7 +24,7 @@ final class Factory { /** - * @psalm-var array + * @psalm-var array */ private $filters = []; diff --git a/vendor/phpunit/phpunit/src/Runner/Version.php b/vendor/phpunit/phpunit/src/Runner/Version.php index f7b94b5d..0e8638cb 100644 --- a/vendor/phpunit/phpunit/src/Runner/Version.php +++ b/vendor/phpunit/phpunit/src/Runner/Version.php @@ -44,7 +44,7 @@ public static function id(): string } if (self::$version === '') { - self::$version = (new VersionId('9.6.21', dirname(__DIR__, 2)))->getVersion(); + self::$version = (new VersionId('9.6.22', dirname(__DIR__, 2)))->getVersion(); assert(!empty(self::$version)); } diff --git a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php index 7a7786b6..fa677212 100644 --- a/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php +++ b/vendor/phpunit/phpunit/src/TextUI/XmlConfiguration/Loader.php @@ -50,6 +50,7 @@ use PHPUnit\TextUI\XmlConfiguration\Logging\TestDox\Xml as TestDoxXml; use PHPUnit\TextUI\XmlConfiguration\Logging\Text; use PHPUnit\TextUI\XmlConfiguration\TestSuite as TestSuiteConfiguration; +use PHPUnit\TextUI\XmlConfigurationTest; use PHPUnit\Util\TestDox\CliTestDoxPrinter; use PHPUnit\Util\VersionComparisonOperator; use PHPUnit\Util\Xml; @@ -702,7 +703,7 @@ private function legacyCodeCoverage(string $filename, DOMXPath $xpath, DOMDocume * If $value is 'false' or 'true', this returns the value that $value represents. * Otherwise, returns $default, which may be a string in rare cases. * - * @see \PHPUnit\TextUI\XmlConfigurationTest::testPHPConfigurationIsReadCorrectly + * @see XmlConfigurationTest::testPHPConfigurationIsReadCorrectly * * @param bool|string $default * diff --git a/vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/Helpers.php b/vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/Helpers.php index e08a296f..ae06129c 100644 --- a/vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/Helpers.php +++ b/vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Lib/Helpers.php @@ -4,6 +4,7 @@ use PHP_CodeSniffer\Files\File; use VariableAnalysis\Lib\ScopeInfo; +use VariableAnalysis\Lib\Constants; use VariableAnalysis\Lib\ForLoopInfo; use VariableAnalysis\Lib\EnumInfo; use VariableAnalysis\Lib\ScopeType; @@ -427,22 +428,88 @@ public static function findVariableScope(File $phpcsFile, $stackPtr, $varName = $token = $tokens[$stackPtr]; $varName = isset($varName) ? $varName : self::normalizeVarName($token['content']); - $arrowFunctionIndex = self::getContainingArrowFunctionIndex($phpcsFile, $stackPtr); - $isTokenInsideArrowFunctionBody = is_int($arrowFunctionIndex); - if ($isTokenInsideArrowFunctionBody) { - // Get the list of variables defined by the arrow function - // If this matches any of them, the scope is the arrow function, - // otherwise, it uses the enclosing scope. - if ($arrowFunctionIndex) { - $variableNames = self::getVariablesDefinedByArrowFunction($phpcsFile, $arrowFunctionIndex); - self::debug('findVariableScope: looking for', $varName, 'in arrow function variables', $variableNames); - if (in_array($varName, $variableNames, true)) { - return $arrowFunctionIndex; + $enclosingScopeIndex = self::findVariableScopeExceptArrowFunctions($phpcsFile, $stackPtr); + + if (!is_null($enclosingScopeIndex)) { + $arrowFunctionIndex = self::getContainingArrowFunctionIndex($phpcsFile, $stackPtr, $enclosingScopeIndex); + $isTokenInsideArrowFunctionBody = is_int($arrowFunctionIndex); + if ($isTokenInsideArrowFunctionBody) { + // Get the list of variables defined by the arrow function + // If this matches any of them, the scope is the arrow function, + // otherwise, it uses the enclosing scope. + if ($arrowFunctionIndex) { + $variableNames = self::getVariablesDefinedByArrowFunction($phpcsFile, $arrowFunctionIndex); + self::debug('findVariableScope: looking for', $varName, 'in arrow function variables', $variableNames); + if (in_array($varName, $variableNames, true)) { + return $arrowFunctionIndex; + } } } } - return self::findVariableScopeExceptArrowFunctions($phpcsFile, $stackPtr); + return $enclosingScopeIndex; + } + + /** + * Return the variable names and positions of each variable targetted by a `compact()` call. + * + * @param File $phpcsFile + * @param int $stackPtr + * @param array> $arguments The stack pointers of each argument; see findFunctionCallArguments + * + * @return array each variable's firstRead position and its name; other VariableInfo properties are not set! + */ + public static function getVariablesInsideCompact(File $phpcsFile, $stackPtr, $arguments) + { + $tokens = $phpcsFile->getTokens(); + $variablePositionsAndNames = []; + + foreach ($arguments as $argumentPtrs) { + $argumentPtrs = array_values(array_filter($argumentPtrs, function ($argumentPtr) use ($tokens) { + return isset(Tokens::$emptyTokens[$tokens[$argumentPtr]['code']]) === false; + })); + if (empty($argumentPtrs)) { + continue; + } + if (!isset($tokens[$argumentPtrs[0]])) { + continue; + } + $argumentFirstToken = $tokens[$argumentPtrs[0]]; + if ($argumentFirstToken['code'] === T_ARRAY) { + // It's an array argument, recurse. + $arrayArguments = self::findFunctionCallArguments($phpcsFile, $argumentPtrs[0]); + $variablePositionsAndNames = array_merge($variablePositionsAndNames, self::getVariablesInsideCompact($phpcsFile, $stackPtr, $arrayArguments)); + continue; + } + if (count($argumentPtrs) > 1) { + // Complex argument, we can't handle it, ignore. + continue; + } + if ($argumentFirstToken['code'] === T_CONSTANT_ENCAPSED_STRING) { + // Single-quoted string literal, ie compact('whatever'). + // Substr is to strip the enclosing single-quotes. + $varName = substr($argumentFirstToken['content'], 1, -1); + $variable = new VariableInfo($varName); + $variable->firstRead = $argumentPtrs[0]; + $variablePositionsAndNames[] = $variable; + continue; + } + if ($argumentFirstToken['code'] === T_DOUBLE_QUOTED_STRING) { + // Double-quoted string literal. + $regexp = Constants::getDoubleQuotedVarRegexp(); + if (! empty($regexp) && preg_match($regexp, $argumentFirstToken['content'])) { + // Bail if the string needs variable expansion, that's runtime stuff. + continue; + } + // Substr is to strip the enclosing double-quotes. + $varName = substr($argumentFirstToken['content'], 1, -1); + $variable = new VariableInfo($varName); + $variable->firstRead = $argumentPtrs[0]; + $variablePositionsAndNames[] = $variable; + continue; + } + } + return $variablePositionsAndNames; } /** @@ -572,12 +639,13 @@ public static function isTokenInsideArrowFunctionDefinition(File $phpcsFile, $st /** * @param File $phpcsFile * @param int $stackPtr + * @param int $enclosingScopeIndex * * @return ?int */ - public static function getContainingArrowFunctionIndex(File $phpcsFile, $stackPtr) + public static function getContainingArrowFunctionIndex(File $phpcsFile, $stackPtr, $enclosingScopeIndex) { - $arrowFunctionIndex = self::getPreviousArrowFunctionIndex($phpcsFile, $stackPtr); + $arrowFunctionIndex = self::getPreviousArrowFunctionIndex($phpcsFile, $stackPtr, $enclosingScopeIndex); if (! is_int($arrowFunctionIndex)) { return null; } @@ -585,24 +653,41 @@ public static function getContainingArrowFunctionIndex(File $phpcsFile, $stackPt if (! $arrowFunctionInfo) { return null; } - $arrowFunctionScopeStart = $arrowFunctionInfo['scope_opener']; - $arrowFunctionScopeEnd = $arrowFunctionInfo['scope_closer']; - if ($stackPtr > $arrowFunctionScopeStart && $stackPtr < $arrowFunctionScopeEnd) { + + // We found the closest arrow function before this token. If the token is + // within the scope of that arrow function, then return it. + if ($stackPtr > $arrowFunctionInfo['scope_opener'] && $stackPtr < $arrowFunctionInfo['scope_closer']) { return $arrowFunctionIndex; } + + // If the token is after the scope of the closest arrow function, we may + // still be inside the scope of a nested arrow function, so we need to + // search further back until we are certain there are no more arrow + // functions. + if ($stackPtr > $arrowFunctionInfo['scope_closer']) { + return self::getContainingArrowFunctionIndex($phpcsFile, $arrowFunctionIndex, $enclosingScopeIndex); + } + return null; } /** + * Move back from the stackPtr to the start of the enclosing scope until we + * find a 'fn' token that starts an arrow function, returning the index of + * that token. Returns null if there are no arrow functions before stackPtr. + * + * Note that this does not guarantee that stackPtr is inside the arrow + * function scope we find! + * * @param File $phpcsFile * @param int $stackPtr + * @param int $enclosingScopeIndex * * @return ?int */ - private static function getPreviousArrowFunctionIndex(File $phpcsFile, $stackPtr) + private static function getPreviousArrowFunctionIndex(File $phpcsFile, $stackPtr, $enclosingScopeIndex) { $tokens = $phpcsFile->getTokens(); - $enclosingScopeIndex = self::findVariableScopeExceptArrowFunctions($phpcsFile, $stackPtr); for ($index = $stackPtr - 1; $index > $enclosingScopeIndex; $index--) { $token = $tokens[$index]; if ($token['content'] === 'fn' && self::isArrowFunction($phpcsFile, $index)) { @@ -646,6 +731,15 @@ public static function isArrowFunction(File $phpcsFile, $stackPtr) } /** + * Find the opening and closing scope positions for an arrow function if the + * given position is the start of the arrow function (the `fn` keyword + * token). + * + * Returns null if the passed token is not an arrow function keyword. + * + * If the token is an arrow function keyword, the scope opener is returned as + * the provided position. + * * @param File $phpcsFile * @param int $stackPtr * @@ -1535,6 +1629,7 @@ public static function getForLoopForIncrementVariable($stackPtr, $forLoops) */ public static function isConstructorPromotion(File $phpcsFile, $stackPtr) { + // If we are not in a function's parameters, this is not promotion. $functionIndex = self::getFunctionIndexForFunctionParameter($phpcsFile, $stackPtr); if (! $functionIndex) { return false; @@ -1542,55 +1637,97 @@ public static function isConstructorPromotion(File $phpcsFile, $stackPtr) $tokens = $phpcsFile->getTokens(); - // If the previous token is a visibility keyword, this is constructor - // promotion. eg: `public $foobar`. - $prevIndex = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($stackPtr - 1), $functionIndex, true); - if (! is_int($prevIndex)) { + // Move backwards from the token, ignoring whitespace, typehints, and the + // 'readonly' keyword, and return true if the previous token is a + // visibility keyword (eg: `public`). + for ($i = $stackPtr - 1; $i > $functionIndex; $i--) { + if (in_array($tokens[$i]['code'], Tokens::$scopeModifiers, true)) { + return true; + } + if (in_array($tokens[$i]['code'], Tokens::$emptyTokens, true)) { + continue; + } + if ($tokens[$i]['content'] === 'readonly') { + continue; + } + if (self::isTokenPartOfTypehint($phpcsFile, $i)) { + continue; + } return false; } - $prevToken = $tokens[$prevIndex]; - if (in_array($prevToken['code'], Tokens::$scopeModifiers, true)) { + return false; + } + + /** + * Return false if the token is definitely not part of a typehint + * + * @param File $phpcsFile + * @param int $stackPtr + * + * @return bool + */ + private static function isTokenPossiblyPartOfTypehint(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + $token = $tokens[$stackPtr]; + if ($token['code'] === 'PHPCS_T_NULLABLE') { + return true; + } + if ($token['code'] === T_NS_SEPARATOR) { return true; } - - // If the previous token is not a visibility keyword, but the one before it - // is, the previous token was probably a typehint and this is constructor - // promotion. eg: `public boolean $foobar`. - $prev2Index = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prevIndex - 1), $functionIndex, true); - if (! is_int($prev2Index)) { - return false; + if ($token['code'] === T_STRING) { + return true; } - $prev2Token = $tokens[$prev2Index]; - // If the token that might be a visibility keyword is a nullable typehint, - // ignore it and move back one token further eg: `public ?boolean $foobar`. - if ($prev2Token['code'] === 'PHPCS_T_NULLABLE') { - $prev2Index = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev2Index - 1), $functionIndex, true); - if (! is_int($prev2Index)) { - return false; - } + if ($token['code'] === T_TRUE) { + return true; } - $prev2Token = $tokens[$prev2Index]; - if (in_array($prev2Token['code'], Tokens::$scopeModifiers, true)) { + if ($token['code'] === T_FALSE) { return true; } - - // If the previous token is not a visibility keyword, but the one two - // before it is, and one of the tokens is `readonly`, the previous token - // was probably a typehint and this is constructor promotion. eg: `public - // readonly boolean $foobar`. - $prev3Index = $phpcsFile->findPrevious(Tokens::$emptyTokens, ($prev2Index - 1), $functionIndex, true); - if (! is_int($prev3Index)) { - return false; + if ($token['code'] === T_NULL) { + return true; } - $prev3Token = $tokens[$prev3Index]; - $wasPreviousReadonly = $prevToken['content'] === 'readonly' || $prev2Token['content'] === 'readonly'; - if (in_array($prev3Token['code'], Tokens::$scopeModifiers, true) && $wasPreviousReadonly) { + if ($token['content'] === '|') { + return true; + } + if (in_array($token['code'], Tokens::$emptyTokens)) { return true; } - return false; } + /** + * Return true if the token is inside a typehint + * + * @param File $phpcsFile + * @param int $stackPtr + * + * @return bool + */ + public static function isTokenPartOfTypehint(File $phpcsFile, $stackPtr) + { + $tokens = $phpcsFile->getTokens(); + + if (! self::isTokenPossiblyPartOfTypehint($phpcsFile, $stackPtr)) { + return false; + } + + // Examine every following token, ignoring everything that might be part of + // a typehint. If we find a variable at the end, this is part of a + // typehint. + $i = $stackPtr; + while (true) { + $i += 1; + if (! isset($tokens[$i])) { + return false; + } + if (! self::isTokenPossiblyPartOfTypehint($phpcsFile, $i)) { + return ($tokens[$i]['code'] === T_VARIABLE); + } + } + } + /** * Return true if the token is inside an abstract class. * diff --git a/vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php b/vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php index a08f7b17..5eaea940 100644 --- a/vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php +++ b/vendor/sirbrillig/phpcs-variable-analysis/VariableAnalysis/Sniffs/CodeAnalysis/VariableAnalysisSniff.php @@ -864,29 +864,7 @@ protected function processVariableAsUseImportDefinition(File $phpcsFile, $stackP */ protected function processVariableAsClassProperty(File $phpcsFile, $stackPtr) { - $propertyDeclarationKeywords = [ - T_PUBLIC, - T_PRIVATE, - T_PROTECTED, - T_VAR, - ]; - $stopAtPtr = $stackPtr - 2; - $visibilityPtr = $phpcsFile->findPrevious($propertyDeclarationKeywords, $stackPtr - 1, $stopAtPtr > 0 ? $stopAtPtr : 0); - if ($visibilityPtr) { - return true; - } - $staticPtr = $phpcsFile->findPrevious(T_STATIC, $stackPtr - 1, $stopAtPtr > 0 ? $stopAtPtr : 0); - if (! $staticPtr) { - return false; - } - $stopAtPtr = $staticPtr - 2; - $visibilityPtr = $phpcsFile->findPrevious($propertyDeclarationKeywords, $staticPtr - 1, $stopAtPtr > 0 ? $stopAtPtr : 0); - if ($visibilityPtr) { - return true; - } - // it's legal to use `static` to define properties as well as to - // define variables, so make sure we are not in a function before - // assuming it's a property. + // Make sure we are not in a class method before assuming it's a property. $tokens = $phpcsFile->getTokens(); /** @var array{conditions?: (int|string)[], content?: string}|null */ @@ -1891,61 +1869,6 @@ protected function processVariableInString(File $phpcsFile, $stackPtr) } } - /** - * @param File $phpcsFile - * @param int $stackPtr - * @param array> $arguments The stack pointers of each argument - * @param int $currScope - * - * @return void - */ - protected function processCompactArguments(File $phpcsFile, $stackPtr, $arguments, $currScope) - { - $tokens = $phpcsFile->getTokens(); - - foreach ($arguments as $argumentPtrs) { - $argumentPtrs = array_values(array_filter($argumentPtrs, function ($argumentPtr) use ($tokens) { - return isset(Tokens::$emptyTokens[$tokens[$argumentPtr]['code']]) === false; - })); - if (empty($argumentPtrs)) { - continue; - } - if (!isset($tokens[$argumentPtrs[0]])) { - continue; - } - $argumentFirstToken = $tokens[$argumentPtrs[0]]; - if ($argumentFirstToken['code'] === T_ARRAY) { - // It's an array argument, recurse. - $arrayArguments = Helpers::findFunctionCallArguments($phpcsFile, $argumentPtrs[0]); - $this->processCompactArguments($phpcsFile, $stackPtr, $arrayArguments, $currScope); - continue; - } - if (count($argumentPtrs) > 1) { - // Complex argument, we can't handle it, ignore. - continue; - } - if ($argumentFirstToken['code'] === T_CONSTANT_ENCAPSED_STRING) { - // Single-quoted string literal, ie compact('whatever'). - // Substr is to strip the enclosing single-quotes. - $varName = substr($argumentFirstToken['content'], 1, -1); - $this->markVariableReadAndWarnIfUndefined($phpcsFile, $varName, $argumentPtrs[0], $currScope); - continue; - } - if ($argumentFirstToken['code'] === T_DOUBLE_QUOTED_STRING) { - // Double-quoted string literal. - $regexp = Constants::getDoubleQuotedVarRegexp(); - if (! empty($regexp) && preg_match($regexp, $argumentFirstToken['content'])) { - // Bail if the string needs variable expansion, that's runtime stuff. - continue; - } - // Substr is to strip the enclosing double-quotes. - $varName = substr($argumentFirstToken['content'], 1, -1); - $this->markVariableReadAndWarnIfUndefined($phpcsFile, $varName, $argumentPtrs[0], $currScope); - continue; - } - } - } - /** * Called to process variables named in a call to compact(). * @@ -1956,13 +1879,17 @@ protected function processCompactArguments(File $phpcsFile, $stackPtr, $argument */ protected function processCompact(File $phpcsFile, $stackPtr) { - $currScope = Helpers::findVariableScope($phpcsFile, $stackPtr); - if ($currScope === null) { - return; - } - + Helpers::debug("processCompact at {$stackPtr}"); $arguments = Helpers::findFunctionCallArguments($phpcsFile, $stackPtr); - $this->processCompactArguments($phpcsFile, $stackPtr, $arguments, $currScope); + $variables = Helpers::getVariablesInsideCompact($phpcsFile, $stackPtr, $arguments); + foreach ($variables as $variable) { + $currScope = Helpers::findVariableScope($phpcsFile, $stackPtr, $variable->name); + if ($currScope === null) { + continue; + } + $variablePosition = $variable->firstRead ? $variable->firstRead : $stackPtr; + $this->markVariableReadAndWarnIfUndefined($phpcsFile, $variable->name, $variablePosition, $currScope); + } } /** diff --git a/vendor/sirbrillig/phpcs-variable-analysis/composer.json b/vendor/sirbrillig/phpcs-variable-analysis/composer.json index 54c7563f..b11fae43 100644 --- a/vendor/sirbrillig/phpcs-variable-analysis/composer.json +++ b/vendor/sirbrillig/phpcs-variable-analysis/composer.json @@ -1,61 +1,63 @@ { - "name": "sirbrillig/phpcs-variable-analysis", - "description": "A PHPCS sniff to detect problems with variables.", - "type": "phpcodesniffer-standard", - "keywords" : [ "phpcs", "static analysis" ], - "license": "BSD-2-Clause", - "authors": [ - { - "name": "Sam Graham", - "email": "php-codesniffer-variableanalysis@illusori.co.uk" - }, - { - "name": "Payton Swick", - "email": "payton@foolord.com" - } - ], - "support" : { - "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", - "wiki" : "https://github.com/sirbrillig/phpcs-variable-analysis/wiki", - "source": "https://github.com/sirbrillig/phpcs-variable-analysis" - }, - "config": { - "sort-order": true, - "allow-plugins": { - "dealerdirect/phpcodesniffer-composer-installer": true - } - }, - "autoload": { - "psr-4": { - "VariableAnalysis\\": "VariableAnalysis/" - } - }, - "autoload-dev": { - "psr-4": { - "VariableAnalysis\\Tests\\": "Tests/" - } - }, - "minimum-stability": "dev", - "prefer-stable": true, - "scripts": { - "test": "./vendor/bin/phpunit --no-coverage", - "coverage": "./vendor/bin/phpunit", - "lint": "./vendor/bin/phpcs", - "fix": "./vendor/bin/phpcbf", - "phpstan": "./vendor/bin/phpstan analyse", - "psalm": "./vendor/bin/psalm --no-cache", - "static-analysis": "composer phpstan && composer psalm" - }, - "require" : { - "php" : ">=5.4.0", - "squizlabs/php_codesniffer": "^3.5.6" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0", - "sirbrillig/phpcs-import-detection": "^1.1", - "phpcsstandards/phpcsdevcs": "^1.1", - "phpstan/phpstan": "^1.7", - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", - "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0@beta" - } + "name": "sirbrillig/phpcs-variable-analysis", + "description": "A PHPCS sniff to detect problems with variables.", + "type": "phpcodesniffer-standard", + "keywords": ["phpcs", "static analysis"], + "license": "BSD-2-Clause", + "authors": [ + { + "name": "Sam Graham", + "email": "php-codesniffer-variableanalysis@illusori.co.uk" + }, + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "support": { + "issues": "https://github.com/sirbrillig/phpcs-variable-analysis/issues", + "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki", + "source": "https://github.com/sirbrillig/phpcs-variable-analysis" + }, + "config": { + "sort-order": true, + "allow-plugins": { + "dealerdirect/phpcodesniffer-composer-installer": true + }, + "lock": false + }, + "autoload": { + "psr-4": { + "VariableAnalysis\\": "VariableAnalysis/" + } + }, + "autoload-dev": { + "psr-4": { + "VariableAnalysis\\Tests\\": "Tests/" + } + }, + "minimum-stability": "dev", + "prefer-stable": true, + "scripts": { + "test": "./vendor/bin/phpunit --no-coverage", + "coverage": "./vendor/bin/phpunit", + "test-lte9": "./vendor/bin/phpunit -c phpunitlte9.xml.dist --no-coverage", + "coverage-lte9": "./vendor/bin/phpunit -c phpunitlte9.xml.dist", + "lint": "./vendor/bin/phpcs", + "fix": "./vendor/bin/phpcbf", + "phpstan": "./vendor/bin/phpstan analyse", + "psalm": "./vendor/bin/psalm --no-cache", + "static-analysis": "composer phpstan && composer psalm" + }, + "require": { + "php": ">=5.4.0", + "squizlabs/php_codesniffer": "^3.5.6" + }, + "require-dev": { + "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.5 || ^7.0 || ^8.0 || ^9.0 || ^10.5.32 || ^11.3.3", + "phpcsstandards/phpcsdevcs": "^1.1", + "phpstan/phpstan": "^1.7", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || ^1.0", + "vimeo/psalm": "^0.2 || ^0.3 || ^1.1 || ^4.24 || ^5.0" + } } diff --git a/vendor/spryker/code-sniffer/.github/PULL_REQUEST_TEMPLATE.md b/vendor/spryker/code-sniffer/.github/PULL_REQUEST_TEMPLATE.md new file mode 100644 index 00000000..5467ac4b --- /dev/null +++ b/vendor/spryker/code-sniffer/.github/PULL_REQUEST_TEMPLATE.md @@ -0,0 +1,13 @@ +## PR Description +Add a meaningful description here that will let us know what you want to fix with this PR or what functionality you want to add. + +## Steps before you submit a PR +- Please add tests for the code you add if it's possible. +- Please check out our contribution guide: https://docs.spryker.com/docs/dg/dev/code-contribution-guide.html +- Add a `contribution-license-agreement.txt` file with the following content: +`I hereby agree to Spryker\'s Contribution License Agreement in https://github.com/spryker/code-sniffer/blob/HASH_OF_COMMIT_YOU_ARE_BASING_YOUR_BRANCH_FROM_MASTER_BRANCH/CONTRIBUTING.md.` + +This is a mandatory step to make sure you are aware of the license agreement and agree to it. `HASH_OF_COMMIT_YOU_ARE_BASING_YOUR_BRANCH_FROM_MASTER_BRANCH` is a hash of the commit you are basing your branch from the master branch. You can take it from commits list of master branch before you submit a PR. + +## Checklist +- [x] I agree with the Code Contribution License Agreement in CONTRIBUTING.md diff --git a/vendor/spryker/code-sniffer/Spryker/Sniffs/AbstractSniffs/AbstractMethodAnnotationSniff.php b/vendor/spryker/code-sniffer/Spryker/Sniffs/AbstractSniffs/AbstractMethodAnnotationSniff.php index 3965c51e..929de21e 100644 --- a/vendor/spryker/code-sniffer/Spryker/Sniffs/AbstractSniffs/AbstractMethodAnnotationSniff.php +++ b/vendor/spryker/code-sniffer/Spryker/Sniffs/AbstractSniffs/AbstractMethodAnnotationSniff.php @@ -30,7 +30,7 @@ abstract class AbstractMethodAnnotationSniff extends AbstractClassDetectionSpryk /** * @var string */ - public $namespaces = 'Pyz,SprykerEco,SprykerMiddleware,SprykerSdk,Spryker'; + public $namespaces = 'Pyz,SprykerEco,SprykerMiddleware,SprykerSdk,Spryker,SprykerFeature'; /** * @var bool diff --git a/vendor/squizlabs/php_codesniffer/CHANGELOG.md b/vendor/squizlabs/php_codesniffer/CHANGELOG.md index 777e59b7..4f055159 100644 --- a/vendor/squizlabs/php_codesniffer/CHANGELOG.md +++ b/vendor/squizlabs/php_codesniffer/CHANGELOG.md @@ -6,6 +6,167 @@ The file documents changes to the PHP_CodeSniffer project. _Nothing yet._ +## [3.11.2] - 2024-12-11 + +### Changed +- Generators/HTML + Markdown: the output will now be empty (no page header/footer) when there are no docs to display. [#687] + - This is in line with the Text Generator which already didn't produce output if there are no docs. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Generators/HTML: only display a Table of Contents when there is more than one sniff with documentation. [#697] + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Generators/HTML: improved handling of line breaks in `` blocks. [#723] + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Generators/Markdown: improved compatibility with the variety of available markdown parsers. [#722] + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Generators/Markdown: improved handling of line breaks in `` blocks. [#737] + - This prevents additional paragraphs from being displayed as code blocks. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Generic.NamingConventions.UpperCaseConstantName: the exact token containing the non-uppercase constant name will now be identified with more accuracy. [#665] + - Thanks to [Rodrigo Primo][@rodrigoprimo] for the patch. +- Generic.Functions.OpeningFunctionBraceKernighanRitchie: minor improvement to the error message wording. [#736] + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Various housekeeping, including improvements to the tests and documentation. + - Thanks to [Rodrigo Primo][@rodrigoprimo] and [Juliette Reinders Folmer][@jrfnl] for their contributions. + +### Fixed +- Fixed bug [#527] : Squiz.Arrays.ArrayDeclaration: short lists within a foreach condition should be ignored. + - Thanks to [Rodrigo Primo][@rodrigoprimo] for the patch. +- Fixed bug [#665] : Generic.NamingConventions.UpperCaseConstantName: false positives and false negatives when code uses unconventional spacing and comments when calling `define()`. + - Thanks to [Rodrigo Primo][@rodrigoprimo] for the patch. +- Fixed bug [#665] : Generic.NamingConventions.UpperCaseConstantName: false positive when a constant named `DEFINE` is encountered. + - Thanks to [Rodrigo Primo][@rodrigoprimo] for the patch. +- Fixed bug [#665] : Generic.NamingConventions.UpperCaseConstantName: false positive for attribute class called `define`. + - Thanks to [Rodrigo Primo][@rodrigoprimo] for the patch. +- Fixed bug [#665] : Generic.NamingConventions.UpperCaseConstantName: false positive when handling the instantiation of a class named `define`. + - Thanks to [Rodrigo Primo][@rodrigoprimo] for the patch. +- Fixed bug [#688] : Generators/Markdown could leave error_reporting in an incorrect state. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Fixed bug [#698] : Generators/Markdown : link in the documentation footer would not parse as a link. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Fixed bug [#738] : Generators/Text: stray blank lines after code sample titles. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Fixed bug [#739] : Generators/HTML + Markdown: multi-space whitespace within a code sample title was folded into a single space. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. + +[#527]: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/527 +[#665]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/665 +[#687]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/687 +[#688]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/688 +[#697]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/697 +[#698]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/698 +[#722]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/722 +[#723]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/723 +[#736]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/736 +[#737]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/737 +[#738]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/738 +[#739]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/739 + +## [3.11.1] - 2024-11-16 + +### Changed +- Output from the `--generator=...` feature will respect the OS-expected EOL char in more places. [#671] + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Various housekeeping, including improvements to the tests and documentation. + - Thanks to [Bartosz Dziewoński][@MatmaRex] and [Juliette Reinders Folmer][@jrfnl] for their contributions. + +### Fixed +- Fixed bug [#674] : Generic.WhiteSpace.HereNowdocIdentifierSpacing broken XML documentation + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Fixed bug [#675] : InvalidArgumentException when a ruleset includes a sniff by file name and the included sniff does not comply with the PHPCS naming conventions. + - Notwithstanding this fix, it is strongly recommended to ensure custom sniff classes comply with the PHPCS naming conventions. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. + +[#671]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/671 +[#674]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/674 +[#675]: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/675 + +## [3.11.0] - 2024-11-12 + +### Added +- Runtime support for PHP 8.4. All known PHP 8.4 deprecation notices have been fixed. + - Syntax support for new PHP 8.4 features will follow in a future release. + - If you find any PHP 8.4 deprecation notices which were missed, please report them. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patches. +- Tokenizer support for PHP 8.3 "yield from" expressions with a comment between the keywords. [#529], [#647] + - Sniffs explicitly handling T_YIELD_FROM tokens may need updating. The PR description contains example code for use by sniff developers. + - Additionally, the following sniff has been updated to support "yield from" expressions with comments: + - Generic.WhiteSpace.LanguageConstructSpacing + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- New `Generic.WhiteSpace.HereNowdocIdentifierSpacing` sniff. [#586], [#637] + - Forbid whitespace between the `<<<` and the identifier string in heredoc/nowdoc start tokens. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- New `Generic.Strings.UnnecessaryHeredoc` sniff. [#633] + - Warns about heredocs without interpolation or expressions in the body text and can auto-fix these to nowdocs. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Documentation for the following sniffs: + - Generic.Arrays.ArrayIndent + - Squiz.PHP.Heredoc + - Thanks to [Rodrigo Primo][@rodrigoprimo] and [Juliette Reinders Folmer][@jrfnl] for the patches. + +### Changed +- The Common::getSniffCode() method will now throw an InvalidArgumentException exception if an invalid `$sniffClass` is passed. [#524], [#625] + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Documentation generated using the `--generator=...` feature will now always be presented in natural order based on the sniff name(s). [#668] + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Minor improvements to the display of runtime information. [#658] + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. +- Squiz.Commenting.PostStatementComment: trailing annotations in PHP files will now be reported under a separate, non-auto-fixable error code `AnnotationFound`. [#560], [#627] + - This prevents (tooling related) annotations from taking on a different meaning when moved by the fixer. + - The separate error code also allows for selectively excluding it to prevent the sniff from triggering on trailing annotations, while still forbidding other trailing comments. + - Thanks to [Rodrigo Primo][@rodrigoprimo] for the patch. +- Squiz.ControlStructures.ForEachLoopDeclaration: the `SpacingAfterOpen` error code has been replaced by the `SpaceAfterOpen` error code. The latter is a pre-existing code. The former appears to have been a typo. [#582] + - Thanks to [Dan Wallis][@fredden] for the patch. +- The following sniff(s) have received efficiency improvements: + - Generic.Classes.DuplicateClassName + - Generic.NamingConventions.ConstructorName + - Thanks to [Rodrigo Primo][@rodrigoprimo] and [Juliette Reinders Folmer][@jrfnl] for the patches. +- Various housekeeping, including improvements to the tests and documentation. + - Thanks to [Rodrigo Primo][@rodrigoprimo] and [Juliette Reinders Folmer][@jrfnl] for their contributions. + +### Fixed +- Fixed bug [#3808][sq-3808] : Generic.WhiteSpace.ScopeIndent would throw false positive for tab indented multi-token yield from expression. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#630] : The tokenizer could inadvertently transform "normal" parentheses to DNF parentheses, when a function call was preceded by a switch-case / alternative syntax control structure colon. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#645] : On PHP 5.4, if yield was used as the declaration name for a function declared to return by reference, the function name would incorrectly be tokenized as T_YIELD instead of T_STRING. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#647] : Tokenizer not applying tab replacement in single token "yield from" keywords. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#647] : Generic.WhiteSpace.DisallowSpaceIndent did not flag space indentation in multi-line yield from. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#647] : Generic.WhiteSpace.DisallowTabIndent did not flag tabs inside yield from. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#652] : Generic.NamingConventions.ConstructorName: false positives for PHP-4 style calls to PHP-4 style parent constructor when a method with the same name as the parent class was called on another class. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#652] : Generic.NamingConventions.ConstructorName: false negatives for PHP-4 style calls to parent constructor for function calls with whitespace and comments in unconventional places. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#653] : Generic.Classes.DuplicateClassName : the sniff did not skip namespace keywords used as operators, which could lead to false positives. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#653] : Generic.Classes.DuplicateClassName : sniff going into an infinite loop during live coding. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#653] : Generic.Classes.DuplicateClassName : false positives/negatives when a namespace declaration contained whitespace or comments in unconventional places. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch +- Fixed bug [#653] : Generic.Classes.DuplicateClassName : namespace for a file going in/out of PHP was not remembered/applied correctly. + - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch + +[sq-3808]: https://github.com/squizlabs/PHP_CodeSniffer/issues/3808 +[#524]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/524 +[#529]: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/529 +[#560]: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/560 +[#582]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/582 +[#586]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/586 +[#625]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/625 +[#627]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/627 +[#630]: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/630 +[#633]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/633 +[#637]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/637 +[#645]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/645 +[#647]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/647 +[#652]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/652 +[#653]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/653 +[#658]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/658 +[#668]: https://github.com/PHPCSStandards/PHP_CodeSniffer/pull/668 + ## [3.10.3] - 2024-09-18 ### Changed @@ -48,7 +209,7 @@ _Nothing yet._ [#608]: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/608 [ghcli]: https://cli.github.com/ -[ghattest]: https://docs.github.com/en/actions/security-guides/using-artifact-attestations-to-establish-provenance-for-builds +[ghattest]: https://docs.github.com/en/actions/security-for-github-actions/using-artifact-attestations/using-artifact-attestations-to-establish-provenance-for-builds ## [3.10.2] - 2024-07-22 @@ -231,7 +392,7 @@ _Nothing yet._ - Squiz.WhiteSpace.MemberVarSpacing - Squiz.WhiteSpace.ScopeClosingBrace - Squiz.WhiteSpace.SuperfluousWhitespace - - Thanks to [Jay McPartland][@jonmcp] and [Rodrigo Primo][@rodrigoprimo] for the patches. + - Thanks to [Jay McPartland][@jaymcp] and [Rodrigo Primo][@rodrigoprimo] for the patches. ### Changed - The following sniffs have received performance related improvements: @@ -244,7 +405,7 @@ _Nothing yet._ - External standards with sniff tests using the PHP_CodeSniffer native test framework will also benefit from these changes. - Thanks to [Juliette Reinders Folmer][@jrfnl] for the patch. - Various housekeeping, including improvements to the tests and documentation. - - Thanks to [Jay McPartland][@jonmcp], [João Pedro Oliveira][@jpoliveira08], [Rodrigo Primo][@rodrigoprimo] and [Juliette Reinders Folmer][@jrfnl] for their contributions. + - Thanks to [Jay McPartland][@jaymcp], [João Pedro Oliveira][@jpoliveira08], [Rodrigo Primo][@rodrigoprimo] and [Juliette Reinders Folmer][@jrfnl] for their contributions. ### Fixed - Fixed bug [#289] : Squiz.WhiteSpace.OperatorSpacing and PSR12.Operators.OperatorSpacing : improved fixer conflict protection by more strenuously avoiding handling operators in declare statements. @@ -7046,6 +7207,9 @@ Additionally, thanks to [Alexander Turek][@derrabus] for consulting on the repo --> [Unreleased]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/master...HEAD +[3.11.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.11.1...3.11.2 +[3.11.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.11.0...3.11.1 +[3.11.0]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.10.3...3.11.0 [3.10.3]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.10.2...3.10.3 [3.10.2]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.10.1...3.10.2 [3.10.1]: https://github.com/PHPCSStandards/PHP_CodeSniffer/compare/3.10.0...3.10.1 @@ -7242,6 +7406,7 @@ Additionally, thanks to [Alexander Turek][@derrabus] for consulting on the repo [@ivuorinen]: https://github.com/ivuorinen [@jasonmccreary]: https://github.com/jasonmccreary [@javer]: https://github.com/javer +[@jaymcp]: https://github.com/jaymcp [@JDGrimes]: https://github.com/JDGrimes [@jedgell]: https://github.com/jedgell [@jeffslofish]: https://github.com/jeffslofish @@ -7252,7 +7417,6 @@ Additionally, thanks to [Alexander Turek][@derrabus] for consulting on the repo [@johanderuijter]: https://github.com/johanderuijter [@johnmaguire]: https://github.com/johnmaguire [@johnpbloch]: https://github.com/johnpbloch -[@jonmcp]: https://github.com/jonmcp [@JorisDebonnet]: https://github.com/JorisDebonnet [@josephzidell]: https://github.com/josephzidell [@joshdavis11]: https://github.com/joshdavis11 @@ -7282,6 +7446,7 @@ Additionally, thanks to [Alexander Turek][@derrabus] for consulting on the repo [@maryo]: https://github.com/maryo [@MasterOdin]: https://github.com/MasterOdin [@mathroc]: https://github.com/mathroc +[@MatmaRex]: https://github.com/MatmaRex [@maxgalbu]: https://github.com/maxgalbu [@mcuelenaere]: https://github.com/mcuelenaere [@mhujer]: https://github.com/mhujer diff --git a/vendor/squizlabs/php_codesniffer/README.md b/vendor/squizlabs/php_codesniffer/README.md index 6c7c073b..9a500edd 100644 --- a/vendor/squizlabs/php_codesniffer/README.md +++ b/vendor/squizlabs/php_codesniffer/README.md @@ -2,14 +2,14 @@ '.PHP_EOL; + echo ' '.PHP_EOL; + echo ''.PHP_EOL; + } + + /** + * Print the _real_ footer of the HTML page. + * + * @return void + */ + public function printRealFooter() + { + parent::printFooter(); + } +} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/MarkdownDouble.php b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/MarkdownDouble.php new file mode 100644 index 00000000..ed2a5d8f --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/MarkdownDouble.php @@ -0,0 +1,36 @@ +getTitle($doc), PHP_EOL; + } +} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonBlankLinesStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonBlankLinesStandard.xml new file mode 100644 index 00000000..bcaf82bb --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonBlankLinesStandard.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonBlockLengthStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonBlockLengthStandard.xml new file mode 100644 index 00000000..c479a7fd --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonBlockLengthStandard.xml @@ -0,0 +1,35 @@ + + + + + + + $one = 10; + ]]> + + + $a = 10; + ]]> + + + + + echo $foo; + ]]> + + + print $foo; + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonEncodingStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonEncodingStandard.xml new file mode 100644 index 00000000..c366553f --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonEncodingStandard.xml @@ -0,0 +1,42 @@ + + + + + + + $f; +$g = $h <= $i; +$j = $k >= $l; +$m = $n <=> $o; + ]]> + + + + +// The above PHP tag is specifically testing +// handling of that in generated HTML doc. + +// Now let's also check the handling of +// comparison operators in code samples +// in combination with "em" tags. +$a = $b < $c; +$d = $e > $f; +$g = $h <= $i; +$j = $k >= $l; +$m = $n <=> $o; + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonLineLengthStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonLineLengthStandard.xml new file mode 100644 index 00000000..b4431ea8 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeComparisonLineLengthStandard.xml @@ -0,0 +1,25 @@ + + + + + + + Countable, Serializable +{ +} + ]]> + + + foobar($param1, $param2) {} +} + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleLineWrappingStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleLineWrappingStandard.xml new file mode 100644 index 00000000..b773f7a8 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleLineWrappingStandard.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleWhitespaceStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleWhitespaceStandard.xml new file mode 100644 index 00000000..28297202 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/CodeTitleWhitespaceStandard.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleCaseStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleCaseStandard.xml new file mode 100644 index 00000000..a4078e3d --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleCaseStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleLengthStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleLengthStandard.xml new file mode 100644 index 00000000..24489276 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/DocumentationTitleLengthStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardBlankLinesStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardBlankLinesStandard.xml new file mode 100644 index 00000000..10c47bf4 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardBlankLinesStandard.xml @@ -0,0 +1,13 @@ + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardEncodingStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardEncodingStandard.xml new file mode 100644 index 00000000..3e34c3f9 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardEncodingStandard.xml @@ -0,0 +1,8 @@ + + + tags in standard descriptions is allowed and their handling should be safeguarded. + Other tags, like link, bold, are not allowed and will be encoded for display when the HTML or Markdown report is used. + ]]> + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardIndentStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardIndentStandard.xml new file mode 100644 index 00000000..b2ec6c5e --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardIndentStandard.xml @@ -0,0 +1,10 @@ + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardLineWrappingStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardLineWrappingStandard.xml new file mode 100644 index 00000000..66bbb962 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Content/StandardLineWrappingStandard.xml @@ -0,0 +1,9 @@ + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/NoContentStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/NoContentStandard.xml new file mode 100644 index 00000000..83afee8e --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/NoContentStandard.xml @@ -0,0 +1,2 @@ + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/NoDocumentationElementStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/NoDocumentationElementStandard.xml new file mode 100644 index 00000000..ca8290f1 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/NoDocumentationElementStandard.xml @@ -0,0 +1,2 @@ + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneCodeComparisonNoStandardStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneCodeComparisonNoStandardStandard.xml new file mode 100644 index 00000000..c2af9098 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneCodeComparisonNoStandardStandard.xml @@ -0,0 +1,14 @@ + + + + class Code {} + ]]> + + + class Comparison {} + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockCodeComparisonStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockCodeComparisonStandard.xml new file mode 100644 index 00000000..c3ce35cd --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockCodeComparisonStandard.xml @@ -0,0 +1,19 @@ + + + + + + + class Code {} + ]]> + + + class Comparison {} + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockNoCodeStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockNoCodeStandard.xml new file mode 100644 index 00000000..fc014949 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockNoCodeStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockTwoCodeComparisonsStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockTwoCodeComparisonsStandard.xml new file mode 100644 index 00000000..19559e67 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/OneStandardBlockTwoCodeComparisonsStandard.xml @@ -0,0 +1,31 @@ + + + + + + + class Code {} + ]]> + + + class Comparison {} + ]]> + + + + + $one = 10; + ]]> + + + $a = 10; + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksNoCodeStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksNoCodeStandard.xml new file mode 100644 index 00000000..f5f621ec --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksNoCodeStandard.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksOneCodeComparisonStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksOneCodeComparisonStandard.xml new file mode 100644 index 00000000..a5b3a321 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksOneCodeComparisonStandard.xml @@ -0,0 +1,24 @@ + + + + + + + Code {} + ]]> + + + Comparison {} + ]]> + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksThreeCodeComparisonsStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksThreeCodeComparisonsStandard.xml new file mode 100644 index 00000000..540ac7ea --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Structure/TwoStandardBlocksThreeCodeComparisonsStandard.xml @@ -0,0 +1,48 @@ + + + + + + + class Code {} + ]]> + + + class Comparison {} + ]]> + + + + + + + + $one = 10; + ]]> + + + $a = 10; + ]]> + + + + + echo $foo; + ]]> + + + print $foo; + ]]> + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/ElementAtWrongLevelStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/ElementAtWrongLevelStandard.xml new file mode 100644 index 00000000..68519dd2 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/ElementAtWrongLevelStandard.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/OneElmAtWrongLevelStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/OneElmAtWrongLevelStandard.xml new file mode 100644 index 00000000..6c1dd164 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/OneElmAtWrongLevelStandard.xml @@ -0,0 +1,13 @@ + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/SuperfluousCodeElementStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/SuperfluousCodeElementStandard.xml new file mode 100644 index 00000000..333786a3 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/SuperfluousCodeElementStandard.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/UnknownElementStandard.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/UnknownElementStandard.xml new file mode 100644 index 00000000..c9ec3227 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Docs/Unsupported/UnknownElementStandard.xml @@ -0,0 +1,7 @@ + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeComparisonBlankLinesSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeComparisonBlankLinesSniff.php new file mode 100644 index 00000000..1e56bf9c --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/Fixtures/StandardWithDocs/Sniffs/Content/CodeComparisonBlankLinesSniff.php @@ -0,0 +1,12 @@ + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/GeneratorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/GeneratorTest.php new file mode 100644 index 00000000..441c4998 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/GeneratorTest.php @@ -0,0 +1,245 @@ + $expected The expected list of found docs. + * + * @dataProvider dataConstructor + * + * @return void + */ + public function testConstructor($standard, array $expected) + { + // Set up the ruleset. + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $generator = new MockGenerator($ruleset); + $this->assertSame($expected, $generator->docFiles); + + }//end testConstructor() + + + /** + * Data provider. + * + * @return array>> + */ + public static function dataConstructor() + { + $pathToDocsInFixture = __DIR__.DIRECTORY_SEPARATOR.'Fixtures'; + $pathToDocsInFixture .= DIRECTORY_SEPARATOR.'StandardWithDocs'; + $pathToDocsInFixture .= DIRECTORY_SEPARATOR.'Docs'.DIRECTORY_SEPARATOR; + + return [ + 'Standard without docs' => [ + 'standard' => __DIR__.'/NoDocsTest.xml', + 'expected' => [], + ], + 'Standard with an invalid doc file' => [ + 'standard' => __DIR__.'/NoValidDocsTest.xml', + 'expected' => [ + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'NoDocumentationElementStandard.xml', + ], + ], + 'Standard with one doc file' => [ + 'standard' => __DIR__.'/OneDocTest.xml', + 'expected' => [ + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'OneStandardBlockNoCodeStandard.xml', + ], + ], + 'Standard with multiple doc files' => [ + 'standard' => __DIR__.'/StructureDocsTest.xml', + 'expected' => [ + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'NoContentStandard.xml', + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'OneCodeComparisonNoStandardStandard.xml', + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'OneStandardBlockCodeComparisonStandard.xml', + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'OneStandardBlockNoCodeStandard.xml', + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'OneStandardBlockTwoCodeComparisonsStandard.xml', + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'TwoStandardBlocksNoCodeStandard.xml', + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'TwoStandardBlocksOneCodeComparisonStandard.xml', + $pathToDocsInFixture.'Structure'.DIRECTORY_SEPARATOR.'TwoStandardBlocksThreeCodeComparisonsStandard.xml', + ], + ], + ]; + + }//end dataConstructor() + + + /** + * Verify that an XML doc which isn't valid documentation yields an Exception to warn devs. + * + * This should not be hidden via defensive coding! + * + * @return void + */ + public function testGeneratingInvalidDocsResultsInException() + { + // Set up the ruleset. + $standard = __DIR__.'/NoValidDocsTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + if (PHP_VERSION_ID >= 80000) { + $exception = 'TypeError'; + $message = 'processSniff(): Argument #1 ($doc) must be of type DOMNode, null given'; + } else if (PHP_VERSION_ID >= 70000) { + $exception = 'TypeError'; + $message = 'processSniff() must be an instance of DOMNode, null given'; + } else { + $exception = 'PHPUnit_Framework_Error'; + $message = 'processSniff() must be an instance of DOMNode, null given'; + } + + if (method_exists($this, 'expectExceptionMessage') === true) { + // PHPUnit 5.2.0+. + $this->expectException($exception); + $this->expectExceptionMessage($message); + } else { + // Ancient PHPUnit. + $this->setExpectedException($exception, $message); + } + + $generator = new MockGenerator($ruleset); + $generator->generate(); + + }//end testGeneratingInvalidDocsResultsInException() + + + /** + * Verify the wiring for the generate() function. + * + * @param string $standard The standard to use for the test. + * @param string $expected The expected function output. + * + * @dataProvider dataGeneratingDocs + * + * @return void + */ + public function testGeneratingDocs($standard, $expected) + { + // Set up the ruleset. + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $this->expectOutputString($expected); + + $generator = new MockGenerator($ruleset); + $generator->generate(); + + }//end testGeneratingDocs() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataGeneratingDocs() + { + $multidocExpected = []; + $multidocExpected[] = 'No Content'; + $multidocExpected[] = 'Code Comparison Only, Missing Standard Block'; + $multidocExpected[] = 'One Standard Block, Code Comparison'; + $multidocExpected[] = 'One Standard Block, No Code'; + $multidocExpected[] = 'One Standard Block, Two Code Comparisons'; + $multidocExpected[] = 'Two Standard Blocks, No Code'; + $multidocExpected[] = 'Two Standard Blocks, One Code Comparison'; + $multidocExpected[] = 'Two Standard Blocks, Three Code Comparisons'; + $multidocExpected = implode(PHP_EOL, $multidocExpected).PHP_EOL; + + return [ + 'Standard without docs' => [ + 'standard' => __DIR__.'/NoDocsTest.xml', + 'expected' => '', + ], + 'Standard with one doc file' => [ + 'standard' => __DIR__.'/OneDocTest.xml', + 'expected' => 'One Standard Block, No Code'.PHP_EOL, + ], + 'Standard with multiple doc files' => [ + 'standard' => __DIR__.'/StructureDocsTest.xml', + 'expected' => $multidocExpected, + ], + ]; + + }//end dataGeneratingDocs() + + + /** + * Test that the documentation for each standard passed on the command-line is shown separately. + * + * @covers \PHP_CodeSniffer\Runner::runPHPCS + * + * @return void + */ + public function testGeneratorWillShowEachStandardSeparately() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $standard = __DIR__.'/OneDocTest.xml'; + $_SERVER['argv'] = [ + 'phpcs', + '--generator=Text', + "--standard=$standard,PSR1", + '--report-width=80', + ]; + + $regex = '`^ + \R* # Optional blank line at the start. + (?: + (?P-+\R) # Line with dashes. + \|[ ]GENERATORTEST[ ]CODING[ ]STANDARD:[ ][^\|]+\|\R # Doc title line with prefix expected for first standard. + (?P>delimiter) # Line with dashes. + .+?\R{2} # Standard description. + ) # Only expect this group once. + (?: + (?P>delimiter) # Line with dashes. + \|[ ]PSR1[ ]CODING[ ]STANDARD:[ ][^\|]+\|\R # Doc title line with prefix expected for second standard. + (?P>delimiter) # Line with dashes. + .+?\R+ # Standard description. + (?: + -+[ ]CODE[ ]COMPARISON[ ]-+\R # Code Comparison starter line with dashes. + (?:.+?(?P>delimiter)\R){2} # Arbitrary text followed by a delimiter line. + )* # Code comparison is optional and can exist multiple times. + \R+ + ){3,} # This complete group should occur at least three times. + `sx'; + + $this->expectOutputRegex($regex); + + $runner = new Runner(); + $runner->runPHPCS(); + + }//end testGeneratorWillShowEachStandardSeparately() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/HTMLTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/HTMLTest.php new file mode 100644 index 00000000..9cec58e7 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/HTMLTest.php @@ -0,0 +1,292 @@ +assertNotFalse($expected, 'Output expectation file could not be found'); + + // Make the test OS independent. + $expected = str_replace("\n", PHP_EOL, $expected); + $this->expectOutputString($expected); + + $generator = new HTMLDouble($ruleset); + $generator->generate(); + + }//end testDocs() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataDocs() + { + return [ + 'Standard without docs' => [ + 'standard' => __DIR__.'/NoDocsTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', + ], + 'Standard with one doc file' => [ + 'standard' => __DIR__.'/OneDocTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputOneDoc.html', + ], + 'Standard with multiple doc files' => [ + 'standard' => __DIR__.'/StructureDocsTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStructureDocs.html', + ], + ]; + + }//end dataDocs() + + + /** + * Test the generated docs for the handling of specific parts of the documentation. + * + * @param string $sniffs The specific fixture sniffs to verify the docs for. + * @param string $pathToExpected Path to a file containing the expected function output. + * + * @dataProvider dataDocSpecifics + * + * @return void + */ + public function testDocSpecifics($sniffs, $pathToExpected) + { + // Set up the ruleset. + $standard = __DIR__.'/AllValidDocsTest.xml'; + $config = new ConfigDouble(["--standard=$standard", "--sniffs=$sniffs"]); + $ruleset = new Ruleset($config); + + // In tests, the `--sniffs` setting doesn't work out of the box. + $sniffParts = explode('.', $sniffs); + $sniffFile = __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.$sniffParts[0].DIRECTORY_SEPARATOR; + $sniffFile .= 'Sniffs'.DIRECTORY_SEPARATOR.$sniffParts[1].DIRECTORY_SEPARATOR.$sniffParts[2].'Sniff.php'; + + $sniffParts = array_map('strtolower', $sniffParts); + $sniffName = $sniffParts[0].'\sniffs\\'.$sniffParts[1].'\\'.$sniffParts[2].'sniff'; + $restrictions = [$sniffName => true]; + $ruleset->registerSniffs([$sniffFile], $restrictions, []); + + $expected = file_get_contents($pathToExpected); + $this->assertNotFalse($expected, 'Output expectation file could not be found'); + + // Make the test OS independent. + $expected = str_replace("\n", PHP_EOL, $expected); + $this->expectOutputString($expected); + + $generator = new HTMLDouble($ruleset); + $generator->generate(); + + }//end testDocSpecifics() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataDocSpecifics() + { + return [ + 'Documentation title: case' => [ + 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleCase', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleCase.html', + ], + 'Documentation title: length' => [ + 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleLength.html', + ], + 'Standard Element: blank line handling' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardBlankLines', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardBlankLines.html', + ], + 'Standard Element: encoding of special characters' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardEncoding', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardEncoding.html', + ], + 'Standard Element: indent handling' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardIndent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardIndent.html', + ], + 'Standard Element: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.html', + ], + 'Code Title: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.html', + ], + 'Code Title: whitespace handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.html', + ], + 'Code Comparison: blank line handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlankLines', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlankLines.html', + ], + 'Code Comparison: different block lengths' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlockLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlockLength.html', + ], + 'Code Comparison: encoding of special characters' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonEncoding', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonEncoding.html', + ], + 'Code Comparison: line length handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonLineLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonLineLength.html', + ], + 'Unsupported: element at the wrong level' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.ElementAtWrongLevel', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedElementAtWrongLevel.html', + ], + 'Unsupported: one correct elm, one at wrong level' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.OneElmAtWrongLevel', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.html', + ], + 'Unsupported: superfluous code element' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.SuperfluousCodeElement', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.html', + ], + 'Unsupported: unknown element' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.UnknownElement', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedUnknownElement.html', + ], + ]; + + }//end dataDocSpecifics() + + + /** + * Test the generated footer. + * + * @return void + */ + public function testFooter() + { + // Set up the ruleset. + $standard = __DIR__.'/OneDocTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $regex = '`^
'; + $regex .= 'Documentation generated on [A-Z][a-z]{2}, [0-9]{2} [A-Z][a-z]{2} 20[0-9]{2} [0-2][0-9](?::[0-5][0-9]){2} [+-][0-9]{4}'; + $regex .= ' by PHP_CodeSniffer [3-9]\.[0-9]+.[0-9]+'; + $regex .= '
\R \R\R$`'; + $this->expectOutputRegex($regex); + + $generator = new HTMLDouble($ruleset); + $generator->printRealFooter(); + + }//end testFooter() + + + /** + * Safeguard that the footer logic doesn't permanently change the error level. + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * + * @return void + */ + public function testFooterResetsErrorReportingToOriginalSetting() + { + $expected = error_reporting(); + + // Set up the ruleset. + $standard = __DIR__.'/OneDocTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + // We know there will be output, but we're not interested in the output for this test. + ob_start(); + $generator = new HTMLDouble($ruleset); + $generator->printRealFooter(); + ob_end_clean(); + + $this->assertSame($expected, error_reporting()); + + }//end testFooterResetsErrorReportingToOriginalSetting() + + + /** + * Safeguard that users won't see a PHP warning about the timezone not being set when calling date(). + * + * The warning we don't want to see is: + * "date(): It is not safe to rely on the system's timezone settings. You are *required* to use + * the date.timezone setting or the date_default_timezone_set() function. In case you used any of + * those methods and you are still getting this warning, you most likely misspelled the timezone + * identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select + * your timezone." + * + * JRF: Based on my tests, the warning only occurs on PHP < 7.0, but never a bad thing to safeguard this + * on a wider range of PHP versions. + * + * Note: as of PHP 8.2, PHP no longer accepts an empty string as timezone and will use `UTC` instead, + * so the warning on calling date() in the code itself would not display anyway. + * + * @requires PHP < 8.2 + * + * @doesNotPerformAssertions + * + * @return void + */ + public function testFooterDoesntThrowWarningOnMissingTimezone() + { + $originalIni = @ini_set('date.timezone', ''); + + // Set up the ruleset. + $standard = __DIR__.'/OneDocTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + // We know there will be output, but we're not interested in the output for this test. + ob_start(); + $generator = new HTMLDouble($ruleset); + $generator->printRealFooter(); + ob_end_clean(); + + // Reset the timezone to its original state. + ini_set('date.timezone', $originalIni); + + }//end testFooterDoesntThrowWarningOnMissingTimezone() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/MarkdownTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/MarkdownTest.php new file mode 100644 index 00000000..54f60d07 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/MarkdownTest.php @@ -0,0 +1,290 @@ +assertNotFalse($expected, 'Output expectation file could not be found'); + + // Make the test OS independent. + $expected = str_replace("\n", PHP_EOL, $expected); + $this->expectOutputString($expected); + + $generator = new MarkdownDouble($ruleset); + $generator->generate(); + + }//end testDocs() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataDocs() + { + return [ + 'Standard without docs' => [ + 'standard' => __DIR__.'/NoDocsTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', + ], + 'Standard with one doc file' => [ + 'standard' => __DIR__.'/OneDocTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputOneDoc.md', + ], + 'Standard with multiple doc files' => [ + 'standard' => __DIR__.'/StructureDocsTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStructureDocs.md', + ], + ]; + + }//end dataDocs() + + + /** + * Test the generated docs for the handling of specific parts of the documentation. + * + * @param string $sniffs The specific fixture sniffs to verify the docs for. + * @param string $pathToExpected Path to a file containing the expected function output. + * + * @dataProvider dataDocSpecifics + * + * @return void + */ + public function testDocSpecifics($sniffs, $pathToExpected) + { + // Set up the ruleset. + $standard = __DIR__.'/AllValidDocsTest.xml'; + $config = new ConfigDouble(["--standard=$standard", "--sniffs=$sniffs"]); + $ruleset = new Ruleset($config); + + // In tests, the `--sniffs` setting doesn't work out of the box. + $sniffParts = explode('.', $sniffs); + $sniffFile = __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.$sniffParts[0].DIRECTORY_SEPARATOR; + $sniffFile .= 'Sniffs'.DIRECTORY_SEPARATOR.$sniffParts[1].DIRECTORY_SEPARATOR.$sniffParts[2].'Sniff.php'; + + $sniffParts = array_map('strtolower', $sniffParts); + $sniffName = $sniffParts[0].'\sniffs\\'.$sniffParts[1].'\\'.$sniffParts[2].'sniff'; + $restrictions = [$sniffName => true]; + $ruleset->registerSniffs([$sniffFile], $restrictions, []); + + $expected = file_get_contents($pathToExpected); + $this->assertNotFalse($expected, 'Output expectation file could not be found'); + + // Make the test OS independent. + $expected = str_replace("\n", PHP_EOL, $expected); + $this->expectOutputString($expected); + + $generator = new MarkdownDouble($ruleset); + $generator->generate(); + + }//end testDocSpecifics() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataDocSpecifics() + { + return [ + 'Documentation title: case' => [ + 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleCase', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleCase.md', + ], + 'Documentation title: length' => [ + 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleLength.md', + ], + 'Standard Element: blank line handling' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardBlankLines', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardBlankLines.md', + ], + 'Standard Element: encoding of special characters' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardEncoding', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardEncoding.md', + ], + 'Standard Element: indent handling' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardIndent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardIndent.md', + ], + 'Standard Element: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.md', + ], + 'Code Title: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.md', + ], + 'Code Title: whitespace handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.md', + ], + 'Code Comparison: blank line handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlankLines', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlankLines.md', + ], + 'Code Comparison: different block lengths' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlockLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlockLength.md', + ], + 'Code Comparison: encoding of special characters' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonEncoding', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonEncoding.md', + ], + 'Code Comparison: line length handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonLineLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonLineLength.md', + ], + 'Unsupported: element at the wrong level' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.ElementAtWrongLevel', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedElementAtWrongLevel.md', + ], + 'Unsupported: one correct elm, one at wrong level' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.OneElmAtWrongLevel', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.md', + ], + 'Unsupported: superfluous code element' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.SuperfluousCodeElement', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.md', + ], + 'Unsupported: unknown element' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.UnknownElement', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedUnknownElement.md', + ], + ]; + + }//end dataDocSpecifics() + + + /** + * Test the generated footer. + * + * @return void + */ + public function testFooter() + { + // Set up the ruleset. + $standard = __DIR__.'/OneDocTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $regex = '`^\RDocumentation generated on [A-Z][a-z]{2}, [0-9]{2} [A-Z][a-z]{2} 20[0-9]{2} [0-2][0-9](?::[0-5][0-9]){2} [+-][0-9]{4}'; + $regex .= ' by \[PHP_CodeSniffer [3-9]\.[0-9]+.[0-9]+\]\(https://github\.com/PHPCSStandards/PHP_CodeSniffer\)\R$`'; + $this->expectOutputRegex($regex); + + $generator = new MarkdownDouble($ruleset); + $generator->printRealFooter(); + + }//end testFooter() + + + /** + * Safeguard that the footer logic doesn't permanently change the error level. + * + * @runInSeparateProcess + * @preserveGlobalState disabled + * + * @return void + */ + public function testFooterResetsErrorReportingToOriginalSetting() + { + $expected = error_reporting(); + + // Set up the ruleset. + $standard = __DIR__.'/OneDocTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + // We know there will be output, but we're not interested in the output for this test. + ob_start(); + $generator = new MarkdownDouble($ruleset); + $generator->printRealFooter(); + ob_end_clean(); + + $this->assertSame($expected, error_reporting()); + + }//end testFooterResetsErrorReportingToOriginalSetting() + + + /** + * Safeguard that users won't see a PHP warning about the timezone not being set when calling date(). + * + * The warning we don't want to see is: + * "date(): It is not safe to rely on the system's timezone settings. You are *required* to use + * the date.timezone setting or the date_default_timezone_set() function. In case you used any of + * those methods and you are still getting this warning, you most likely misspelled the timezone + * identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select + * your timezone." + * + * JRF: Based on my tests, the warning only occurs on PHP < 7.0, but never a bad thing to safeguard this + * on a wider range of PHP versions. + * + * Note: as of PHP 8.2, PHP no longer accepts an empty string as timezone and will use `UTC` instead, + * so the warning on calling date() in the code itself would not display anyway. + * + * @requires PHP < 8.2 + * + * @doesNotPerformAssertions + * + * @return void + */ + public function testFooterDoesntThrowWarningOnMissingTimezone() + { + $originalIni = @ini_set('date.timezone', ''); + + // Set up the ruleset. + $standard = __DIR__.'/OneDocTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + // We know there will be output, but we're not interested in the output for this test. + ob_start(); + $generator = new MarkdownDouble($ruleset); + $generator->printRealFooter(); + ob_end_clean(); + + // Reset the timezone to its original state. + ini_set('date.timezone', $originalIni); + + }//end testFooterDoesntThrowWarningOnMissingTimezone() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoDocsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoDocsTest.xml new file mode 100644 index 00000000..51df8395 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoDocsTest.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoValidDocsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoValidDocsTest.xml new file mode 100644 index 00000000..94dda4e7 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/NoValidDocsTest.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/OneDocTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/OneDocTest.xml new file mode 100644 index 00000000..83ca4384 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/OneDocTest.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/StructureDocsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/StructureDocsTest.xml new file mode 100644 index 00000000..45811bee --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/StructureDocsTest.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Generators/TextTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/TextTest.php new file mode 100644 index 00000000..b0c5f280 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Generators/TextTest.php @@ -0,0 +1,197 @@ +assertNotFalse($expected, 'Output expectation file could not be found'); + + // Make the test OS independent. + $expected = str_replace("\n", PHP_EOL, $expected); + $this->expectOutputString($expected); + + $generator = new Text($ruleset); + $generator->generate(); + + }//end testDocs() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataDocs() + { + return [ + 'Standard without docs' => [ + 'standard' => __DIR__.'/NoDocsTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputEmpty.txt', + ], + 'Standard with one doc file' => [ + 'standard' => __DIR__.'/OneDocTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputOneDoc.txt', + ], + 'Standard with multiple doc files' => [ + 'standard' => __DIR__.'/StructureDocsTest.xml', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStructureDocs.txt', + ], + ]; + + }//end dataDocs() + + + /** + * Test the generated docs for the handling of specific parts of the documentation. + * + * @param string $sniffs The specific fixture sniffs to verify the docs for. + * @param string $pathToExpected Path to a file containing the expected function output. + * + * @dataProvider dataDocSpecifics + * + * @return void + */ + public function testDocSpecifics($sniffs, $pathToExpected) + { + // Set up the ruleset. + $standard = __DIR__.'/AllValidDocsTest.xml'; + $config = new ConfigDouble(["--standard=$standard", "--sniffs=$sniffs"]); + $ruleset = new Ruleset($config); + + // In tests, the `--sniffs` setting doesn't work out of the box. + $sniffParts = explode('.', $sniffs); + $sniffFile = __DIR__.DIRECTORY_SEPARATOR.'Fixtures'.DIRECTORY_SEPARATOR.$sniffParts[0].DIRECTORY_SEPARATOR; + $sniffFile .= 'Sniffs'.DIRECTORY_SEPARATOR.$sniffParts[1].DIRECTORY_SEPARATOR.$sniffParts[2].'Sniff.php'; + + $sniffParts = array_map('strtolower', $sniffParts); + $sniffName = $sniffParts[0].'\sniffs\\'.$sniffParts[1].'\\'.$sniffParts[2].'sniff'; + $restrictions = [$sniffName => true]; + $ruleset->registerSniffs([$sniffFile], $restrictions, []); + + $expected = file_get_contents($pathToExpected); + $this->assertNotFalse($expected, 'Output expectation file could not be found'); + + // Make the test OS independent. + $expected = str_replace("\n", PHP_EOL, $expected); + $this->expectOutputString($expected); + + $generator = new Text($ruleset); + $generator->generate(); + + }//end testDocSpecifics() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataDocSpecifics() + { + return [ + 'Documentation title: case' => [ + 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleCase', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleCase.txt', + ], + 'Documentation title: length' => [ + 'sniffs' => 'StandardWithDocs.Content.DocumentationTitleLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputDocumentationTitleLength.txt', + ], + 'Standard Element: blank line handling' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardBlankLines', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardBlankLines.txt', + ], + 'Standard Element: encoding of special characters' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardEncoding', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardEncoding.txt', + ], + 'Standard Element: indent handling' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardIndent', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardIndent.txt', + ], + 'Standard Element: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.StandardLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputStandardLineWrapping.txt', + ], + 'Code Title: line wrapping' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleLineWrapping', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleLineWrapping.txt', + ], + 'Code Title: whitespace handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeTitleWhitespace', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeTitleWhitespace.txt', + ], + 'Code Comparison: blank line handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlankLines', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlankLines.txt', + ], + 'Code Comparison: different block lengths' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonBlockLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonBlockLength.txt', + ], + 'Code Comparison: encoding of special characters' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonEncoding', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonEncoding.txt', + ], + 'Code Comparison: line length handling' => [ + 'sniffs' => 'StandardWithDocs.Content.CodeComparisonLineLength', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputCodeComparisonLineLength.txt', + ], + 'Unsupported: element at the wrong level' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.ElementAtWrongLevel', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedElementAtWrongLevel.txt', + ], + 'Unsupported: one correct elm, one at wrong level' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.OneElmAtWrongLevel', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedOneElmAtWrongLevel.txt', + ], + 'Unsupported: superfluous code element' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.SuperfluousCodeElement', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedSuperfluousCodeElement.txt', + ], + 'Unsupported: unknown element' => [ + 'sniffs' => 'StandardWithDocs.Unsupported.UnknownElement', + 'pathToExpected' => __DIR__.'/Expectations/ExpectedOutputUnsupportedUnknownElement.txt', + ], + ]; + + }//end dataDocSpecifics() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/AbstractRulesetTestCase.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/AbstractRulesetTestCase.php new file mode 100644 index 00000000..41c63944 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/AbstractRulesetTestCase.php @@ -0,0 +1,115 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHPUnit\Framework\TestCase; + +abstract class AbstractRulesetTestCase extends TestCase +{ + + /** + * The fully qualified name of the PHPCS runtime exception class. + * + * @var string + */ + const RUNTIME_EXCEPTION = 'PHP_CodeSniffer\Exceptions\RuntimeException'; + + + /** + * Asserts that an object has a specified property in a PHPUnit cross-version compatible manner. + * + * @param string $propertyName The name of the property. + * @param object $object The object on which to check whether the property exists. + * @param string $message Optional failure message to display. + * + * @return void + */ + protected function assertXObjectHasProperty($propertyName, $object, $message='') + { + if (method_exists($this, 'assertObjectHasProperty') === true) { + $this->assertObjectHasProperty($propertyName, $object, $message); + } else { + // PHPUnit < 9.6.11. + $this->assertObjectHasAttribute($propertyName, $object, $message); + } + + }//end assertXObjectHasProperty() + + + /** + * Asserts that an object does not have a specified property + * in a PHPUnit cross-version compatible manner. + * + * @param string $propertyName The name of the property. + * @param object $object The object on which to check whether the property exists. + * @param string $message Optional failure message to display. + * + * @return void + */ + protected function assertXObjectNotHasProperty($propertyName, $object, $message='') + { + if (method_exists($this, 'assertObjectNotHasProperty') === true) { + $this->assertObjectNotHasProperty($propertyName, $object, $message); + } else { + // PHPUnit < 9.6.11. + $this->assertObjectNotHasAttribute($propertyName, $object, $message); + } + + }//end assertXObjectNotHasProperty() + + + /** + * Helper method to tell PHPUnit to expect a PHPCS RuntimeException with a certain message + * in a PHPUnit cross-version compatible manner. + * + * @param string $message The expected exception message. + * + * @return void + */ + protected function expectRuntimeExceptionMessage($message) + { + if (method_exists($this, 'expectException') === true) { + // PHPUnit 5+. + $this->expectException(self::RUNTIME_EXCEPTION); + $this->expectExceptionMessage($message); + } else { + // PHPUnit 4. + $this->setExpectedException(self::RUNTIME_EXCEPTION, $message); + } + + }//end expectRuntimeExceptionMessage() + + + /** + * Helper method to tell PHPUnit to expect a PHPCS RuntimeException which matches a regex patten + * in a PHPUnit cross-version compatible manner. + * + * @param string $regex The regex which should match. + * + * @return void + */ + protected function expectRuntimeExceptionRegex($regex) + { + if (method_exists($this, 'expectExceptionMessageMatches') === true) { + $this->expectException(self::RUNTIME_EXCEPTION); + $this->expectExceptionMessageMatches($regex); + } else if (method_exists($this, 'expectExceptionMessageRegExp') === true) { + // PHPUnit < 8.4.0. + $this->expectException(self::RUNTIME_EXCEPTION); + $this->expectExceptionMessageRegExp($regex); + } else { + // PHPUnit < 5.2.0. + $this->setExpectedExceptionRegExp(self::RUNTIME_EXCEPTION, $regex); + } + + }//end expectRuntimeExceptionRegex() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.php new file mode 100644 index 00000000..8f7f4f93 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.php @@ -0,0 +1,78 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHPUnit\Framework\TestCase; + +/** + * Test the Ruleset::expandSniffDirectory() method. + * + * @covers \PHP_CodeSniffer\Ruleset::expandSniffDirectory + */ +final class ExpandSniffDirectoryTest extends TestCase +{ + + + /** + * Test finding sniff files based on a given directory. + * + * This test verifies that: + * - Hidden (sub)directories are ignored, but the given directory is allowed to be within a hidden directory. + * - Hidden files are ignored. + * - Files without a "php" extension are ignored. + * - Files without a "Sniff" suffix in the file name are ignored. + * + * Note: the "[Another]AbstractSniff" files will be found and included in the return value + * from `Ruleset::expandSniffDirectory()`. + * Those are filtered out later in the `Ruleset::registerSniffs()` method. + * + * @return void + */ + public function testExpandSniffDirectory() + { + // Set up the ruleset. + $standard = __DIR__.'/ExpandSniffDirectoryTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $expectedPathToRuleset = __DIR__.'/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/ruleset.xml'; + $expectedPathToRuleset = realpath($expectedPathToRuleset); + $this->assertNotFalse($expectedPathToRuleset, 'Ruleset file could not be found'); + $this->assertContains($expectedPathToRuleset, $ruleset->paths, 'Ruleset file not included in the "seen ruleset paths"'); + + /* + * Take note: the expectation includes some "undesirables" related to the convoluted directory structure + * in the "standard" used as a test fixture. + * + * That is okay as (for now) non-standard directory layouts are supported. + * + * This test is not about the standard directory layout. + */ + + $expectedSniffCodes = [ + '.Sniffs.IncorrectLevelShouldStillBeFound' => 'MyStandard\\Sniffs\\IncorrectLevelShouldStillBeFoundSniff', + 'MyStandard.CategoryA.FindMe' => 'MyStandard\\Sniffs\\CategoryA\\FindMeSniff', + 'MyStandard.CategoryB.FindMe' => 'MyStandard\\Sniffs\\CategoryB\\FindMeSniff', + 'Sniffs.SubDir.IncorrectLevelShouldStillBeFound' => 'MyStandard\\Sniffs\\CategoryA\\SubDir\\IncorrectLevelShouldStillBeFoundSniff', + ]; + + // Sort the value to make the tests stable as different OSes will read directories + // in a different order and the order is not relevant for these tests. Just the values. + $actual = $ruleset->sniffCodes; + ksort($actual); + + $this->assertSame($expectedSniffCodes, $actual, 'Registered sniffs do not match expectation'); + + }//end testExpandSniffDirectory() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.xml new file mode 100644 index 00000000..f2646da0 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExpandSniffDirectoryTest.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainTest.php index 5438c65c..48866cc3 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ExplainTest.php @@ -185,19 +185,20 @@ public function testExplainWithDeprecatedSniffs() $ruleset = new Ruleset($config); $expected = PHP_EOL; - $expected .= 'The SniffDeprecationTest standard contains 9 sniffs'.PHP_EOL.PHP_EOL; - - $expected .= 'Fixtures (9 sniffs)'.PHP_EOL; - $expected .= '-------------------'.PHP_EOL; - $expected .= ' Fixtures.Deprecated.WithLongReplacement *'.PHP_EOL; - $expected .= ' Fixtures.Deprecated.WithoutReplacement *'.PHP_EOL; - $expected .= ' Fixtures.Deprecated.WithReplacement *'.PHP_EOL; - $expected .= ' Fixtures.Deprecated.WithReplacementContainingLinuxNewlines *'.PHP_EOL; - $expected .= ' Fixtures.Deprecated.WithReplacementContainingNewlines *'.PHP_EOL; - $expected .= ' Fixtures.SetProperty.AllowedAsDeclared'.PHP_EOL; - $expected .= ' Fixtures.SetProperty.AllowedViaMagicMethod'.PHP_EOL; - $expected .= ' Fixtures.SetProperty.AllowedViaStdClass'.PHP_EOL; - $expected .= ' Fixtures.SetProperty.NotAllowedViaAttribute'.PHP_EOL.PHP_EOL; + $expected .= 'The ShowSniffDeprecationsTest standard contains 10 sniffs'.PHP_EOL.PHP_EOL; + + $expected .= 'TestStandard (10 sniffs)'.PHP_EOL; + $expected .= '------------------------'.PHP_EOL; + $expected .= ' TestStandard.Deprecated.WithLongReplacement *'.PHP_EOL; + $expected .= ' TestStandard.Deprecated.WithoutReplacement *'.PHP_EOL; + $expected .= ' TestStandard.Deprecated.WithReplacement *'.PHP_EOL; + $expected .= ' TestStandard.Deprecated.WithReplacementContainingLinuxNewlines *'.PHP_EOL; + $expected .= ' TestStandard.Deprecated.WithReplacementContainingNewlines *'.PHP_EOL; + $expected .= ' TestStandard.SetProperty.AllowedAsDeclared'.PHP_EOL; + $expected .= ' TestStandard.SetProperty.AllowedViaMagicMethod'.PHP_EOL; + $expected .= ' TestStandard.SetProperty.AllowedViaStdClass'.PHP_EOL; + $expected .= ' TestStandard.SetProperty.NotAllowedViaAttribute'.PHP_EOL; + $expected .= ' TestStandard.SetProperty.PropertyTypeHandling'.PHP_EOL.PHP_EOL; $expected .= '* Sniffs marked with an asterix are deprecated.'.PHP_EOL; @@ -217,6 +218,10 @@ public function testExplainWithDeprecatedSniffs() */ public function testExplainWillExplainEachStandardSeparately() { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + $standard = __DIR__.'/ExplainSingleSniffTest.xml'; $_SERVER['argv'] = [ 'phpcs', diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/.hidden/HiddenDirShouldBeIgnoredSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/.hidden/HiddenDirShouldBeIgnoredSniff.php new file mode 100644 index 00000000..3ee64dbb --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/DirectoryExpansion/.hiddenAbove/src/MyStandard/.hidden/HiddenDirShouldBeIgnoredSniff.php @@ -0,0 +1,15 @@ + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/InvalidNoSniffsDir/Sniffs b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/InvalidNoSniffsDir/Sniffs new file mode 100644 index 00000000..e69de29b diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/InvalidNoSniffsDir/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/InvalidNoSniffsDir/ruleset.xml new file mode 100644 index 00000000..b85e7486 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/InvalidNoSniffsDir/ruleset.xml @@ -0,0 +1,4 @@ + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.1.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.1.php new file mode 100644 index 00000000..2b1fadaf --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.1.php @@ -0,0 +1,8 @@ +string,10=>10,float=>1.5,null=>null,true=>true,false=>false + +// phpcs:set TestStandard.SetProperty.PropertyTypeHandling expectsOldSchoolArrayWithOnlyValues[] string, 10, 1.5, null, true, false +// phpcs:set TestStandard.SetProperty.PropertyTypeHandling expectsOldSchoolArrayWithKeysAndValues[] string=>string,10=>10,float=>1.5,null=>null,true=>true,false=>false + +echo 'hello!'; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithLongReplacementSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithLongReplacementSniff.php similarity index 96% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithLongReplacementSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithLongReplacementSniff.php index 40c23113..659d89ee 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithLongReplacementSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithLongReplacementSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\Deprecated; +namespace Fixtures\TestStandard\Sniffs\Deprecated; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementContainingLinuxNewlinesSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementContainingLinuxNewlinesSniff.php similarity index 95% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementContainingLinuxNewlinesSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementContainingLinuxNewlinesSniff.php index 0363927d..d870cbf7 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementContainingLinuxNewlinesSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementContainingLinuxNewlinesSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\Deprecated; +namespace Fixtures\TestStandard\Sniffs\Deprecated; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementContainingNewlinesSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementContainingNewlinesSniff.php similarity index 95% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementContainingNewlinesSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementContainingNewlinesSniff.php index e9e76c8c..2516d7cd 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementContainingNewlinesSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementContainingNewlinesSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\Deprecated; +namespace Fixtures\TestStandard\Sniffs\Deprecated; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementSniff.php similarity index 93% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementSniff.php index a6339828..19534486 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithReplacementSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithReplacementSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\Deprecated; +namespace Fixtures\TestStandard\Sniffs\Deprecated; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithoutReplacementSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithoutReplacementSniff.php similarity index 93% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithoutReplacementSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithoutReplacementSniff.php index d6d38871..888e08fd 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/Deprecated/WithoutReplacementSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/Deprecated/WithoutReplacementSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\Deprecated; +namespace Fixtures\TestStandard\Sniffs\Deprecated; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/EmptyDeprecationVersionSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/EmptyDeprecationVersionSniff.php similarity index 92% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/EmptyDeprecationVersionSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/EmptyDeprecationVersionSniff.php index 8d3dcd42..4e26b7b7 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/EmptyDeprecationVersionSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/EmptyDeprecationVersionSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\DeprecatedInvalid; +namespace Fixtures\TestStandard\Sniffs\DeprecatedInvalid; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/EmptyRemovalVersionSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/EmptyRemovalVersionSniff.php similarity index 92% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/EmptyRemovalVersionSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/EmptyRemovalVersionSniff.php index 828b1692..cdf15c30 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/EmptyRemovalVersionSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/EmptyRemovalVersionSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\DeprecatedInvalid; +namespace Fixtures\TestStandard\Sniffs\DeprecatedInvalid; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidDeprecationMessageSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidDeprecationMessageSniff.php similarity index 92% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidDeprecationMessageSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidDeprecationMessageSniff.php index a6819825..368bd414 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidDeprecationMessageSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidDeprecationMessageSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\DeprecatedInvalid; +namespace Fixtures\TestStandard\Sniffs\DeprecatedInvalid; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidDeprecationVersionSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidDeprecationVersionSniff.php similarity index 92% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidDeprecationVersionSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidDeprecationVersionSniff.php index d51aa876..b8218ad5 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidDeprecationVersionSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidDeprecationVersionSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\DeprecatedInvalid; +namespace Fixtures\TestStandard\Sniffs\DeprecatedInvalid; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidRemovalVersionSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidRemovalVersionSniff.php similarity index 92% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidRemovalVersionSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidRemovalVersionSniff.php index a10997bb..1177e733 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/DeprecatedInvalid/InvalidRemovalVersionSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/DeprecatedInvalid/InvalidRemovalVersionSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SniffDeprecationTest */ -namespace Fixtures\Sniffs\DeprecatedInvalid; +namespace Fixtures\TestStandard\Sniffs\DeprecatedInvalid; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\DeprecatedSniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedAsDeclaredSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedAsDeclaredSniff.php similarity index 89% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedAsDeclaredSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedAsDeclaredSniff.php index c26160b2..a8f0364c 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedAsDeclaredSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedAsDeclaredSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SetSniffPropertyTest */ -namespace Fixtures\Sniffs\SetProperty; +namespace Fixtures\TestStandard\Sniffs\SetProperty; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedViaMagicMethodSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedViaMagicMethodSniff.php similarity index 92% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedViaMagicMethodSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedViaMagicMethodSniff.php index 04097bb9..98eb22c5 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedViaMagicMethodSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedViaMagicMethodSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SetSniffPropertyTest */ -namespace Fixtures\Sniffs\SetProperty; +namespace Fixtures\TestStandard\Sniffs\SetProperty; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedViaStdClassSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedViaStdClassSniff.php similarity index 88% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedViaStdClassSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedViaStdClassSniff.php index 30418729..0f58b2e0 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/AllowedViaStdClassSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/AllowedViaStdClassSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SetSniffPropertyTest */ -namespace Fixtures\Sniffs\SetProperty; +namespace Fixtures\TestStandard\Sniffs\SetProperty; use PHP_CodeSniffer\Files\File; use PHP_CodeSniffer\Sniffs\Sniff; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/NotAllowedViaAttributeSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/NotAllowedViaAttributeSniff.php similarity index 89% rename from vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/NotAllowedViaAttributeSniff.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/NotAllowedViaAttributeSniff.php index e895a87a..bb523558 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/Sniffs/SetProperty/NotAllowedViaAttributeSniff.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/NotAllowedViaAttributeSniff.php @@ -5,7 +5,7 @@ * @see \PHP_CodeSniffer\Tests\Core\Ruleset\SetSniffPropertyTest */ -namespace Fixtures\Sniffs\SetProperty; +namespace Fixtures\TestStandard\Sniffs\SetProperty; use AllowDynamicProperties; use PHP_CodeSniffer\Files\File; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/PropertyTypeHandlingSniff.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/PropertyTypeHandlingSniff.php new file mode 100644 index 00000000..be4c2147 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/Sniffs/SetProperty/PropertyTypeHandlingSniff.php @@ -0,0 +1,125 @@ + + */ + public $expectsArrayWithOnlyValues; + + /** + * Used to verify that array properties with keys get parsed to a proper array. + * + * @var array + */ + public $expectsArrayWithKeysAndValues; + + /** + * Used to verify that array properties passed as a string get parsed to a proper array. + * + * @var array + */ + public $expectsOldSchoolArrayWithOnlyValues; + + /** + * Used to verify that array properties passed as a string with keys get parsed to a proper array. + * + * @var array + */ + public $expectsOldSchoolArrayWithKeysAndValues; + + public function register() + { + return [T_ECHO]; + } + + public function process(File $phpcsFile, $stackPtr) + { + // Do something. + } +} diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/ruleset.xml new file mode 100644 index 00000000..345c4837 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/TestStandard/ruleset.xml @@ -0,0 +1,4 @@ + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ruleset.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ruleset.xml deleted file mode 100644 index 11a899ad..00000000 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/Fixtures/ruleset.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIgnorePatternsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIgnorePatternsTest.php new file mode 100644 index 00000000..ae6b8bea --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIgnorePatternsTest.php @@ -0,0 +1,111 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHPUnit\Framework\TestCase; + +/** + * Test the Ruleset::getIgnorePatterns() method. + * + * @covers \PHP_CodeSniffer\Ruleset::getIgnorePatterns + */ +final class GetIgnorePatternsTest extends TestCase +{ + + /** + * The Ruleset object. + * + * @var \PHP_CodeSniffer\Ruleset + */ + private static $ruleset; + + + /** + * Initialize the config and ruleset objects for this test. + * + * @beforeClass + * + * @return void + */ + public static function initializeConfigAndRuleset() + { + // Set up the ruleset. + $standard = __DIR__."/GetIgnorePatternsTest.xml"; + $config = new ConfigDouble(["--standard=$standard"]); + self::$ruleset = new Ruleset($config); + + }//end initializeConfigAndRuleset() + + + /** + * Test retrieving ignore patterns. + * + * @param string|null $listener The listener to get patterns for or null for all patterns. + * @param array> $expected The expected function output. + * + * @dataProvider dataGetIgnorePatterns + * + * @return void + */ + public function testGetIgnorePatterns($listener, $expected) + { + $this->assertSame($expected, self::$ruleset->getIgnorePatterns($listener)); + + }//end testGetIgnorePatterns() + + + /** + * Data provider. + * + * @see self::testGetIgnorePatterns() + * + * @return array>|null>> + */ + public static function dataGetIgnorePatterns() + { + return [ + 'All ignore patterns' => [ + 'listener' => null, + 'expected' => [ + 'PSR1.Classes.ClassDeclaration' => [ + './src/*/file.php' => 'absolute', + './bin/' => 'relative', + ], + 'Generic.Formatting.SpaceAfterCast' => [ + './src/*/test\\.php$' => 'absolute', + ], + './tests/' => 'absolute', + './vendor/*' => 'absolute', + '*/node-modules/*' => 'relative', + ], + ], + 'Ignore patterns for PSR1.Classes.ClassDeclaration' => [ + 'listener' => 'PSR1.Classes.ClassDeclaration', + 'expected' => [ + './src/*/file.php' => 'absolute', + './bin/' => 'relative', + ], + ], + 'Ignore patterns for Generic.Formatting.SpaceAfterCast' => [ + 'listener' => 'Generic.Formatting.SpaceAfterCast', + 'expected' => ['./src/*/test\\.php$' => 'absolute'], + ], + 'Ignore patterns for sniff without ignore patterns' => [ + 'listener' => 'PSR1.Files.SideEffects', + 'expected' => [], + ], + ]; + + }//end dataGetIgnorePatterns() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIgnorePatternsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIgnorePatternsTest.xml new file mode 100644 index 00000000..7fcfdc23 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIgnorePatternsTest.xml @@ -0,0 +1,19 @@ + + + + ./tests/ + ./vendor/* + */node-modules/* + + + + + ./src/*/file.php + ./bin/ + + + + ./src/*/test\.php$ + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIncludePatternsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIncludePatternsTest.php new file mode 100644 index 00000000..a38401b6 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIncludePatternsTest.php @@ -0,0 +1,108 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHPUnit\Framework\TestCase; + +/** + * Test the Ruleset::getIncludePatterns() method. + * + * @covers \PHP_CodeSniffer\Ruleset::getIncludePatterns + */ +final class GetIncludePatternsTest extends TestCase +{ + + /** + * The Ruleset object. + * + * @var \PHP_CodeSniffer\Ruleset + */ + private static $ruleset; + + + /** + * Initialize the config and ruleset objects for this test. + * + * @beforeClass + * + * @return void + */ + public static function initializeConfigAndRuleset() + { + // Set up the ruleset. + $standard = __DIR__."/GetIncludePatternsTest.xml"; + $config = new ConfigDouble(["--standard=$standard"]); + self::$ruleset = new Ruleset($config); + + }//end initializeConfigAndRuleset() + + + /** + * Test retrieving include patterns. + * + * @param string|null $listener The listener to get patterns for or null for all patterns. + * @param array> $expected The expected function output. + * + * @dataProvider dataGetIncludePatterns + * + * @return void + */ + public function testGetIncludePatterns($listener, $expected) + { + $this->assertSame($expected, self::$ruleset->getIncludePatterns($listener)); + + }//end testGetIncludePatterns() + + + /** + * Data provider. + * + * @see self::testGetIncludePatterns() + * + * @return array>|null>> + */ + public static function dataGetIncludePatterns() + { + return [ + 'All include patterns' => [ + 'listener' => null, + 'expected' => [ + 'PSR1.Classes.ClassDeclaration' => [ + './src/*/file.php' => 'absolute', + './bin/' => 'relative', + ], + 'Generic.Formatting.SpaceAfterCast' => [ + './src/*/test\\.php$' => 'absolute', + ], + ], + ], + 'Include patterns for PSR1.Classes.ClassDeclaration' => [ + 'listener' => 'PSR1.Classes.ClassDeclaration', + 'expected' => [ + './src/*/file.php' => 'absolute', + './bin/' => 'relative', + ], + ], + 'Include patterns for Generic.Formatting.SpaceAfterCast' => [ + 'listener' => 'Generic.Formatting.SpaceAfterCast', + 'expected' => ['./src/*/test\\.php$' => 'absolute'], + ], + 'Include patterns for sniff without include patterns' => [ + 'listener' => 'PSR1.Files.SideEffects', + 'expected' => [], + ], + ]; + + }//end dataGetIncludePatterns() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIncludePatternsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIncludePatternsTest.xml new file mode 100644 index 00000000..c24f93f5 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/GetIncludePatternsTest.xml @@ -0,0 +1,15 @@ + + + + + + + ./src/*/file.php + ./bin/ + + + + ./src/*/test\.php$ + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleInvalidTypeTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleInvalidTypeTest.php new file mode 100644 index 00000000..08a2e6b8 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleInvalidTypeTest.php @@ -0,0 +1,43 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; + +/** + * Test handling of invalid type elements. + * + * @covers \PHP_CodeSniffer\Ruleset::processRule + */ +final class ProcessRuleInvalidTypeTest extends AbstractRulesetTestCase +{ + + + /** + * Test displaying an informative error message when an invalid type is given. + * + * @return void + */ + public function testInvalidTypeHandling() + { + $standard = __DIR__.'/ProcessRuleInvalidTypeTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + + $message = 'Message type "notice" is invalid; must be "error" or "warning"'; + $this->expectRuntimeExceptionMessage($message); + + new Ruleset($config); + + }//end testInvalidTypeHandling() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleInvalidTypeTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleInvalidTypeTest.xml new file mode 100644 index 00000000..63c2aaf3 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleInvalidTypeTest.xml @@ -0,0 +1,9 @@ + + + + + + notice + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.php new file mode 100644 index 00000000..7de34c12 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.php @@ -0,0 +1,660 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; + +/** + * Test handling of `phpc(cs|cbf)-only` instructions at rule level. + * + * @covers \PHP_CodeSniffer\Ruleset::processRule + * @covers \PHP_CodeSniffer\Ruleset::shouldProcessElement + */ +final class ProcessRuleShouldProcessElementTest extends AbstractRulesetTestCase +{ + + /** + * The Ruleset object. + * + * @var \PHP_CodeSniffer\Ruleset + */ + private static $ruleset; + + + /** + * Initialize the config and ruleset objects for this test. + * + * @before + * + * @return void + */ + protected function initializeConfigAndRuleset() + { + if (isset(self::$ruleset) === false) { + // Set up the ruleset. + $standard = __DIR__.'/ProcessRuleShouldProcessElementTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + self::$ruleset = new Ruleset($config); + } + + }//end initializeConfigAndRuleset() + + + /** + * Verify that in CS mode, phpcs-only directives are set and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessSeverityCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $key = 'severity'; + + // Verify that the non-selective severity directive IS applied. + $sniffCode = 'PSR1.Files.SideEffects'; + $this->assertRulesetPropertySame(3, $sniffCode, $key); + + // Verify that the CS-only severity directive IS applied. + $sniffCode = 'Generic.Metrics.CyclomaticComplexity'; + $this->assertRulesetPropertySame(2, $sniffCode, $key); + + // Verify that the CBF-only severity directive is NOT applied. + $sniffCode = 'PSR2.Namespaces.NamespaceDeclaration'; + $this->assertNotHasRulesetDirective($sniffCode, $key); + + }//end testShouldProcessSeverityCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are set and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessSeverityCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $key = 'severity'; + + // Verify that the non-selective severity directive IS applied. + $sniffCode = 'PSR1.Files.SideEffects'; + $this->assertRulesetPropertySame(3, $sniffCode, $key); + + // Verify that the CS-only severity directive is NOT applied. + $sniffCode = 'Generic.Metrics.CyclomaticComplexity'; + $this->assertNotHasRulesetDirective($sniffCode, $key); + + // Verify that the CBF-only severity directive IS applied. + $sniffCode = 'PSR2.Namespaces.NamespaceDeclaration'; + $this->assertRulesetPropertySame(4, $sniffCode, $key); + + }//end testShouldProcessSeverityCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are set and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessTypeCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $key = 'type'; + + // Verify that the non-selective type directive IS applied. + $sniffCode = 'PSR1.Files.SideEffects'; + $this->assertRulesetPropertySame('warning', $sniffCode, $key); + + // Verify that the CS-only type directive IS applied. + $sniffCode = 'Generic.Metrics.CyclomaticComplexity'; + $this->assertRulesetPropertySame('warning', $sniffCode, $key); + + // Verify that the CBF-only type directive is NOT applied. + $sniffCode = 'PSR2.Namespaces.NamespaceDeclaration'; + $this->assertNotHasRulesetDirective($sniffCode, $key); + + }//end testShouldProcessTypeCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are set and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessTypeCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $key = 'type'; + + // Verify that the non-selective type directive IS applied. + $sniffCode = 'PSR1.Files.SideEffects'; + $this->assertRulesetPropertySame('warning', $sniffCode, $key); + + // Verify that the CS-only type directive is NOT applied. + $sniffCode = 'Generic.Metrics.CyclomaticComplexity'; + $this->assertNotHasRulesetDirective($sniffCode, $key); + + // Verify that the CBF-only type directive IS applied. + $sniffCode = 'PSR2.Namespaces.NamespaceDeclaration'; + $this->assertRulesetPropertySame('error', $sniffCode, $key); + + }//end testShouldProcessTypeCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are set and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessMessageCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $key = 'message'; + + // Verify that the non-selective message directive IS applied. + $sniffCode = 'PSR1.Files.SideEffects'; + $this->assertRulesetPropertySame('A different warning message', $sniffCode, $key); + + // Verify that the CS-only message directive IS applied. + $sniffCode = 'Generic.Metrics.CyclomaticComplexity'; + $this->assertRulesetPropertySame('A different warning but only for phpcs', $sniffCode, $key); + + // Verify that the CBF-only message directive is NOT applied. + $sniffCode = 'PSR2.Namespaces.NamespaceDeclaration'; + $this->assertNotHasRulesetDirective($sniffCode, $key); + + }//end testShouldProcessMessageCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are set and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessMessageCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $key = 'message'; + + // Verify that the non-selective message directive IS applied. + $sniffCode = 'PSR1.Files.SideEffects'; + $this->assertRulesetPropertySame('A different warning message', $sniffCode, $key); + + // Verify that the CS-only message directive is NOT applied. + $sniffCode = 'Generic.Metrics.CyclomaticComplexity'; + $this->assertNotHasRulesetDirective($sniffCode, $key); + + // Verify that the CBF-only message directive IS applied. + $sniffCode = 'PSR2.Namespaces.NamespaceDeclaration'; + $this->assertRulesetPropertySame('A different warning but only for phpcbf', $sniffCode, $key); + + }//end testShouldProcessMessageCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are set and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessIncludePatternCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $includedKey = './vendor/'; + + // Verify that the non-selective include-pattern directive IS applied. + $sniffCode = 'PSR1.Methods.CamelCapsMethodName'; + $this->assertArrayHasKey($sniffCode, self::$ruleset->includePatterns, "Sniff $sniffCode not registered"); + $this->assertArrayHasKey($includedKey, self::$ruleset->includePatterns[$sniffCode], "Include pattern for sniff $sniffCode not registered"); + + // Verify that the CS-only include-pattern directive IS applied. + $sniffCode = 'Generic.Files.LineLength'; + $this->assertArrayHasKey($sniffCode, self::$ruleset->includePatterns, "Sniff $sniffCode not registered"); + $this->assertArrayHasKey($includedKey, self::$ruleset->includePatterns[$sniffCode], "Include pattern for sniff $sniffCode not registered"); + + // Verify that the CBF-only include-pattern directive is NOT applied. + $sniffCode = 'PSR2.Files.ClosingTag'; + $this->assertArrayNotHasKey($sniffCode, self::$ruleset->includePatterns, "Sniff $sniffCode was registered"); + + }//end testShouldProcessIncludePatternCsonly() + + + /** + * Verify that in CS mode, phpcbf-only directives are set and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessIncludePatternCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $includedKey = './vendor/'; + + // Verify that the non-selective include-pattern directive IS applied. + $sniffCode = 'PSR1.Methods.CamelCapsMethodName'; + $this->assertArrayHasKey($sniffCode, self::$ruleset->includePatterns, "Sniff $sniffCode not registered"); + $this->assertArrayHasKey($includedKey, self::$ruleset->includePatterns[$sniffCode], "Include pattern for sniff $sniffCode not registered"); + + // Verify that the CS-only include-pattern directive is NOT applied. + $sniffCode = 'Generic.Files.LineLength'; + $this->assertArrayNotHasKey($sniffCode, self::$ruleset->includePatterns, "Sniff $sniffCode was registered"); + + // Verify that the CBF-only include-pattern directive is IS applied. + $sniffCode = 'PSR2.Files.ClosingTag'; + $this->assertArrayHasKey($sniffCode, self::$ruleset->includePatterns, "Sniff $sniffCode not registered"); + $this->assertArrayHasKey($includedKey, self::$ruleset->includePatterns[$sniffCode], "Include pattern for sniff $sniffCode not registered"); + + }//end testShouldProcessIncludePatternCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are set and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessExcludePatternCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $excludedKey = './tests/'; + + // Verify that the non-selective exclude-pattern directive IS applied. + $sniffCode = 'PSR1.Classes.ClassDeclaration'; + $this->assertArrayHasKey($sniffCode, self::$ruleset->ignorePatterns, "Sniff $sniffCode not registered"); + $this->assertArrayHasKey($excludedKey, self::$ruleset->ignorePatterns[$sniffCode], "Ignore pattern for sniff $sniffCode not registered"); + + // Verify that the CS-only exclude-pattern directive IS applied. + $sniffCode = 'Generic.Formatting.SpaceAfterCast'; + $this->assertArrayHasKey($sniffCode, self::$ruleset->ignorePatterns, "Sniff $sniffCode not registered"); + $this->assertArrayHasKey($excludedKey, self::$ruleset->ignorePatterns[$sniffCode], "Ignore pattern for sniff $sniffCode not registered"); + + // Verify that the CBF-only exclude-pattern directive is NOT applied. + $sniffCode = 'PSR2.Methods.FunctionClosingBrace'; + $this->assertArrayNotHasKey($sniffCode, self::$ruleset->ignorePatterns, "Sniff $sniffCode was registered"); + + }//end testShouldProcessExcludePatternCsonly() + + + /** + * Verify that in CS mode, phpcbf-only directives are set and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessExcludePatternCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $excludedKey = './tests/'; + + // Verify that the non-selective exclude-pattern directive IS applied. + $sniffCode = 'PSR1.Classes.ClassDeclaration'; + $this->assertArrayHasKey($sniffCode, self::$ruleset->ignorePatterns, "Sniff $sniffCode not registered"); + $this->assertArrayHasKey($excludedKey, self::$ruleset->ignorePatterns[$sniffCode], "Ignore pattern for sniff $sniffCode not registered"); + + // Verify that the CS-only exclude-pattern directive is NOT applied. + $sniffCode = 'Generic.Formatting.SpaceAfterCast'; + $this->assertArrayNotHasKey($sniffCode, self::$ruleset->ignorePatterns, "Sniff $sniffCode was registered"); + + // Verify that the CBF-only exclude-pattern directive is IS applied. + $sniffCode = 'PSR2.Methods.FunctionClosingBrace'; + $this->assertArrayHasKey($sniffCode, self::$ruleset->ignorePatterns, "Sniff $sniffCode not registered"); + $this->assertArrayHasKey($excludedKey, self::$ruleset->ignorePatterns[$sniffCode], "Ignore pattern for sniff $sniffCode not registered"); + + }//end testShouldProcessExcludePatternCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are set and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessPropertiesCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $csSniffClass = 'PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff'; + $cbfSniffClass = 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff'; + + $propertyName = 'indent'; + $propertyDefault = 4; + $propertyChanged = '2'; + + // Verify that the CS-only property directive IS applied. + $this->assertArrayHasKey($csSniffClass, self::$ruleset->sniffs, "Sniff $csSniffClass not registered"); + $this->assertXObjectHasProperty($propertyName, self::$ruleset->sniffs[$csSniffClass]); + + $actualValue = self::$ruleset->sniffs[$csSniffClass]->$propertyName; + $this->assertSame($propertyChanged, $actualValue, 'cs-only property change directive not applied'); + + // Verify that the CBF-only property directive is NOT applied. + $this->assertArrayHasKey($cbfSniffClass, self::$ruleset->sniffs, "Sniff $cbfSniffClass not registered"); + $this->assertXObjectHasProperty($propertyName, self::$ruleset->sniffs[$cbfSniffClass]); + + $actualValue = self::$ruleset->sniffs[$cbfSniffClass]->$propertyName; + $this->assertSame($propertyDefault, $actualValue, 'cbf-only property change directive was applied'); + + }//end testShouldProcessPropertiesCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are set and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessPropertiesCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $csSniffClass = 'PHP_CodeSniffer\Standards\Generic\Sniffs\Arrays\ArrayIndentSniff'; + $cbfSniffClass = 'PHP_CodeSniffer\Standards\PSR2\Sniffs\Classes\ClassDeclarationSniff'; + + $propertyName = 'indent'; + $propertyDefault = 4; + $propertyChanged = '2'; + + // Verify that the CS-only property directive is NOT applied. + $this->assertArrayHasKey($csSniffClass, self::$ruleset->sniffs, "Sniff $csSniffClass not registered"); + $this->assertXObjectHasProperty($propertyName, self::$ruleset->sniffs[$csSniffClass]); + + $actualValue = self::$ruleset->sniffs[$csSniffClass]->$propertyName; + $this->assertSame($propertyDefault, $actualValue, 'cs-only property change directive was applied'); + + // Verify that the CBF-only property directive IS applied. + $this->assertArrayHasKey($cbfSniffClass, self::$ruleset->sniffs, "Sniff $cbfSniffClass not registered"); + $this->assertXObjectHasProperty($propertyName, self::$ruleset->sniffs[$cbfSniffClass]); + + $actualValue = self::$ruleset->sniffs[$cbfSniffClass]->$propertyName; + $this->assertSame($propertyChanged, $actualValue, 'cbf-only property change directive not applied'); + + }//end testShouldProcessPropertiesCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are set and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessPropertyCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + // Verify the sniff is registed. + $sniffClass = 'PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff'; + $this->assertArrayHasKey($sniffClass, self::$ruleset->sniffs, "Sniff $sniffClass not registered"); + + $sniffObject = self::$ruleset->sniffs[$sniffClass]; + + // Verify that the non-selective property directive IS applied. + $propertyName = 'exact'; + $expected = true; + + $this->assertXObjectHasProperty($propertyName, $sniffObject); + $this->assertSame($expected, $sniffObject->$propertyName, 'Non-selective property change directive not applied'); + + // Verify that the CS-only property directive IS applied. + $propertyName = 'indent'; + $expected = '2'; + + $this->assertXObjectHasProperty($propertyName, $sniffObject); + $this->assertSame($expected, $sniffObject->$propertyName, 'cs-only property change directive not applied'); + + // Verify that the CBF-only property directive is NOT applied. + $propertyName = 'tabIndent'; + $expectedDefault = false; + + $this->assertXObjectHasProperty($propertyName, $sniffObject); + $this->assertSame($expectedDefault, $sniffObject->$propertyName, 'cbf-only property change directive was applied'); + + }//end testShouldProcessPropertyCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are set and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessPropertyCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + // Verify the sniff is registed. + $sniffClass = 'PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff'; + $this->assertArrayHasKey($sniffClass, self::$ruleset->sniffs, "Sniff $sniffClass not registered"); + + $sniffObject = self::$ruleset->sniffs[$sniffClass]; + + // Verify that the non-selective property directive IS applied. + $propertyName = 'exact'; + $expected = true; + + $this->assertXObjectHasProperty($propertyName, $sniffObject); + $this->assertSame($expected, $sniffObject->$propertyName, 'Non-selective property change directive not applied'); + + // Verify that the CS-only property directive is NOT applied. + $propertyName = 'indent'; + $expectedDefault = 4; + + $this->assertXObjectHasProperty($propertyName, $sniffObject); + $this->assertSame($expectedDefault, $sniffObject->$propertyName, 'cs-only property change directive was applied'); + + // Verify that the CBF-only property directive IS applied. + $propertyName = 'tabIndent'; + $expected = true; + + $this->assertXObjectHasProperty($propertyName, $sniffObject); + $this->assertSame($expected, $sniffObject->$propertyName, 'cbf-only property change directive not applied'); + + }//end testShouldProcessPropertyCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are set and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessElementCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $expected = [ + // Non-selective element directive. + 'T_COMMENT', + // Phpcs-only element directive. + 'T_CLASS', + // Non-selective element directive via `extend`. + 'T_BACKTICK', + // Phpcs-only element directive via `extend`. + 'T_INTERFACE', + ]; + + $this->verifyShouldProcessElement($expected); + + }//end testShouldProcessElementCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are set and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessElementCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $expected = [ + // Non-selective element directive. + 'T_COMMENT', + // Phpcbf-only element directive. + 'T_ENUM', + // Non-selective element directive via `extend`. + 'T_BACKTICK', + // Phpcbf-only element directive via `extend`. + 'T_TRAIT', + ]; + + $this->verifyShouldProcessElement($expected); + + }//end testShouldProcessElementCbfonly() + + + /** + * Verify that directives are set correctly. + * + * @param array $expected Expected sniff property value. + * + * @return void + */ + private function verifyShouldProcessElement($expected) + { + // Verify the sniff is registed. + $sniffClass = 'PHP_CodeSniffer\Standards\Generic\Sniffs\WhiteSpace\ScopeIndentSniff'; + $this->assertArrayHasKey($sniffClass, self::$ruleset->sniffs, "Sniff $sniffClass not registered"); + + // Verify the target property exists. + $sniffObject = self::$ruleset->sniffs[$sniffClass]; + $propertyName = 'ignoreIndentationTokens'; + + $this->assertXObjectHasProperty($propertyName, $sniffObject); + + // Verify the value. + $actualValue = $sniffObject->$propertyName; + $this->assertSame($expected, $actualValue, 'Selective element directives not applied correctly'); + + }//end verifyShouldProcessElement() + + + /** + * Custom assertion to verify that a Ruleset `$ruleset` property has a certain directive set for a certain sniff code. + * + * @param string $sniffCode Sniff code. + * @param string $key Array key. + * + * @return void + */ + private function assertHasRulesetDirective($sniffCode, $key) + { + $this->assertArrayHasKey($sniffCode, self::$ruleset->ruleset, "Sniff $sniffCode not registered"); + $this->assertTrue(is_array(self::$ruleset->ruleset[$sniffCode]), "Sniff $sniffCode is not an array"); + $this->assertArrayHasKey($key, self::$ruleset->ruleset[$sniffCode], "Directive $key not registered for sniff $sniffCode"); + + }//end assertHasRulesetDirective() + + + /** + * Custom assertion to verify that a Ruleset `$ruleset` property does NOT have a certain directive set for a certain sniff code. + * + * @param string $sniffCode Sniff code. + * @param string $key Array key. + * + * @return void + */ + private function assertNotHasRulesetDirective($sniffCode, $key) + { + if (isset(self::$ruleset->ruleset[$sniffCode]) === true + && is_array(self::$ruleset->ruleset[$sniffCode]) === true + && isset(self::$ruleset->ruleset[$sniffCode][$key]) === true + ) { + $this->fail("Directive $key is registered for sniff $sniffCode"); + } + + }//end assertNotHasRulesetDirective() + + + /** + * Custom assertion to verify that the value of a certain directive for a certain sniff code on the ruleset is correct. + * + * @param mixed $expected Expected value. + * @param string $sniffCode Sniff code. + * @param string $key Array key. + * + * @return void + */ + private function assertRulesetPropertySame($expected, $sniffCode, $key) + { + $this->assertHasRulesetDirective($sniffCode, $key); + + $actual = self::$ruleset->ruleset[$sniffCode][$key]; + $this->assertSame($expected, $actual, "Value for $key on sniff $sniffCode does not meet expectations"); + + }//end assertRulesetPropertySame() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml new file mode 100644 index 00000000..73a81161 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRuleShouldProcessElementTest.xml @@ -0,0 +1,100 @@ + + + + + + 3 + warning + A different warning message + + + + ./vendor/ + + + + ./tests/ + + + + + + + 2 + warning + A different warning but only for phpcs + + + + ./vendor/ + + + + ./tests/ + + + + + + + + + + + 4 + error + A different warning but only for phpcbf + + + + ./vendor/ + + + + ./tests/ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoExpandSniffsDirectoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoExpandSniffsDirectoryTest.xml new file mode 100644 index 00000000..69688086 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoExpandSniffsDirectoryTest.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadFileNotFoundTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadFileNotFoundTest.xml new file mode 100644 index 00000000..196baa6c --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadFileNotFoundTest.xml @@ -0,0 +1,8 @@ + + + + ./tests/Core/Ruleset/Fixtures/ThisFileDoesNotExist.php + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadTest.php new file mode 100644 index 00000000..a6a0dd4a --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadTest.php @@ -0,0 +1,164 @@ + instructions. + * + * @author Juliette Reinders Folmer + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; + +/** + * Test handling of instructions. + * + * Note: these tests need to run in separate processes as otherwise we cannot + * reliably determine whether or not the correct files were loaded as the + * underlying code uses `include_once`. + * + * @runTestsInSeparateProcesses + * @preserveGlobalState disabled + * + * @covers \PHP_CodeSniffer\Ruleset::processRuleset + */ +final class ProcessRulesetAutoloadTest extends AbstractRulesetTestCase +{ + + + /** + * Verify that in CS mode, phpcs-only directives are respected and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessAutoloadCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $originallyIncludes = get_included_files(); + + // Set up the ruleset. + $standard = __DIR__.'/ProcessRulesetAutoloadTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + new Ruleset($config); + + $finalIncludes = get_included_files(); + $diff = array_diff($finalIncludes, $originallyIncludes); + + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadAlways.1.php'), + $diff, + 'ProcessRulesetAutoloadLoadAlways.1.php autoload file was not loaded' + ); + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadAlways.2.php'), + $diff, + 'ProcessRulesetAutoloadLoadAlways.2.php autoload file was not loaded' + ); + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadAlways.3.php'), + $diff, + 'ProcessRulesetAutoloadLoadAlways.3.php autoload file was not loaded' + ); + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadAlways.4.php'), + $diff, + 'ProcessRulesetAutoloadLoadAlways.4.php autoload file was not loaded' + ); + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadPhpcsOnly.php'), + $diff, + 'ProcessRulesetAutoloadLoadPhpcsOnly.php autoload file was not loaded' + ); + $this->assertNotContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadPhpcbfOnly.php'), + $diff, + 'ProcessRulesetAutoloadLoadPhpcbfOnly.php autoload file was loaded, while it shouldn\'t have been' + ); + + }//end testShouldProcessAutoloadCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are respected and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessAutoloadCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $originallyIncludes = get_included_files(); + + // Set up the ruleset. + $standard = __DIR__.'/ProcessRulesetAutoloadTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + new Ruleset($config); + + $finalIncludes = get_included_files(); + $diff = array_diff($finalIncludes, $originallyIncludes); + + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadAlways.1.php'), + $diff, + 'ProcessRulesetAutoloadLoadAlways.1.php autoload file was not loaded' + ); + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadAlways.2.php'), + $diff, + 'ProcessRulesetAutoloadLoadAlways.2.php autoload file was not loaded' + ); + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadAlways.3.php'), + $diff, + 'ProcessRulesetAutoloadLoadAlways.3.php autoload file was not loaded' + ); + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadAlways.4.php'), + $diff, + 'ProcessRulesetAutoloadLoadAlways.4.php autoload file was not loaded' + ); + $this->assertNotContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadPhpcsOnly.php'), + $diff, + 'ProcessRulesetAutoloadLoadPhpcsOnly.php autoload file was loaded, while it shouldn\'t have been' + ); + $this->assertContains( + __DIR__.str_replace('/', DIRECTORY_SEPARATOR, '/Fixtures/ProcessRulesetAutoloadLoadPhpcbfOnly.php'), + $diff, + 'ProcessRulesetAutoloadLoadPhpcbfOnly.php autoload file was not loaded' + ); + + }//end testShouldProcessAutoloadCbfonly() + + + /** + * Test an exception is thrown when the directive points to a file which doesn't exist. + * + * @return void + */ + public function testFileNotFoundException() + { + $exceptionMsg = 'The specified autoload file "./tests/Core/Ruleset/Fixtures/ThisFileDoesNotExist.php" does not exist'; + $this->expectRuntimeExceptionMessage($exceptionMsg); + + // Set up the ruleset. + $standard = __DIR__.'/ProcessRulesetAutoloadFileNotFoundTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + new Ruleset($config); + + }//end testFileNotFoundException() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadTest.xml new file mode 100644 index 00000000..450de650 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetAutoloadTest.xml @@ -0,0 +1,37 @@ + + + + . + + + + ./Fixtures/ProcessRulesetAutoloadLoadAlways.1.php + Fixtures/ProcessRulesetAutoloadLoadAlways.2.php + + + ./tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.3.php + tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadAlways.4.php + + + ./tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadPhpcsOnly.php + + + ./tests/Core/Ruleset/Fixtures/ProcessRulesetAutoloadLoadPhpcbfOnly.php + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetEmptyFileTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetEmptyFileTest.xml new file mode 100644 index 00000000..e69de29b diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetMultiErrorTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetMultiErrorTest.xml new file mode 100644 index 00000000..64294b9b --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetMultiErrorTest.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetSingleErrorTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetSingleErrorTest.xml new file mode 100644 index 00000000..e9c5bd7e --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetSingleErrorTest.xml @@ -0,0 +1,2 @@ + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php new file mode 100644 index 00000000..95f67c21 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetBrokenRulesetTest.php @@ -0,0 +1,92 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; + +/** + * Test handling of broken ruleset files. + * + * Note: these tests need to run in separate processes as otherwise they run into + * some weirdness with the libxml_get_errors()/libxml_clear_errors() functions + * (duplicate error messages). + * + * @runTestsInSeparateProcesses + * @preserveGlobalState disabled + * + * @covers \PHP_CodeSniffer\Ruleset::processRuleset + */ +final class ProcessRulesetBrokenRulesetTest extends AbstractRulesetTestCase +{ + + + /** + * Test displaying an informative error message when an empty XML ruleset file is encountered. + * + * @return void + */ + public function testBrokenRulesetEmptyFile() + { + $standard = __DIR__.'/ProcessRulesetBrokenRulesetEmptyFileTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + + $regex = '`^Ruleset \S+ProcessRulesetBrokenRulesetEmptyFileTest\.xml is not valid\R$`'; + $this->expectRuntimeExceptionRegex($regex); + + new Ruleset($config); + + }//end testBrokenRulesetEmptyFile() + + + /** + * Test displaying an informative error message for a broken XML ruleset with a single XML error. + * + * @return void + */ + public function testBrokenRulesetSingleError() + { + $standard = __DIR__.'/ProcessRulesetBrokenRulesetSingleErrorTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + + $regex = '`^Ruleset \S+ProcessRulesetBrokenRulesetSingleErrorTest\.xml is not valid\R'; + $regex .= '- On line 3, column 1: Premature end of data in tag ruleset line 2\R$`'; + + $this->expectRuntimeExceptionRegex($regex); + + new Ruleset($config); + + }//end testBrokenRulesetSingleError() + + + /** + * Test displaying an informative error message for a broken XML ruleset with multiple XML errors. + * + * @return void + */ + public function testBrokenRulesetMultiError() + { + $standard = __DIR__.'/ProcessRulesetBrokenRulesetMultiErrorTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + + $regex = '`^Ruleset \S+ProcessRulesetBrokenRulesetMultiErrorTest\.xml is not valid\R'; + $regex .= '- On line 8, column 12: Opening and ending tag mismatch: property line 7 and rule\R'; + $regex .= '- On line 10, column 11: Opening and ending tag mismatch: properties line 5 and ruleset\R'; + $regex .= '- On line 11, column 1: Premature end of data in tag rule line 4\R$`'; + + $this->expectRuntimeExceptionRegex($regex); + + new Ruleset($config); + + }//end testBrokenRulesetMultiError() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetExcludeSniffGroupTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetExcludeSniffGroupTest.xml new file mode 100644 index 00000000..a83347ce --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetExcludeSniffGroupTest.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetInvalidNoSniffsDirTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetInvalidNoSniffsDirTest.xml new file mode 100644 index 00000000..daa07f2e --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetInvalidNoSniffsDirTest.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetMiscTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetMiscTest.xml new file mode 100644 index 00000000..56bf6898 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetMiscTest.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php new file mode 100644 index 00000000..cd04ae78 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.php @@ -0,0 +1,388 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Config; +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHPUnit\Framework\TestCase; + +/** + * Test handling of `phpc(cs|cbf)-only` instructions at ruleset level. + * + * @covers \PHP_CodeSniffer\Ruleset::processRuleset + * @covers \PHP_CodeSniffer\Ruleset::shouldProcessElement + */ +final class ProcessRulesetShouldProcessElementTest extends TestCase +{ + + /** + * Cache to store the original ini values for ini settings being changed in these tests. + * + * @var array + */ + private static $originalIniValues = [ + 'bcmath.scale' => null, + 'docref_root' => null, + 'user_agent' => null, + ]; + + /** + * The Config object. + * + * @var \PHP_CodeSniffer\Tests\ConfigDouble + */ + private static $config; + + /** + * The Ruleset object. + * + * @var \PHP_CodeSniffer\Ruleset + */ + private static $ruleset; + + + /** + * Store the original ini values to allow for restoring them after the tests. + * + * @beforeClass + * + * @return void + */ + public static function saveOriginalIniValues() + { + foreach (self::$originalIniValues as $name => $null) { + $value = ini_get($name); + if ($value !== false) { + self::$originalIniValues[$name] = $value; + } + } + + }//end saveOriginalIniValues() + + + /** + * Initialize the config and ruleset objects for this test only once (but do allow recording code coverage). + * + * @before + * + * @return void + */ + protected function initializeConfigAndRuleset() + { + if (isset(self::$ruleset) === false) { + // Set up the ruleset. + $standard = __DIR__.'/ProcessRulesetShouldProcessElementTest.xml'; + self::$config = new ConfigDouble(["--standard=$standard"]); + self::$ruleset = new Ruleset(self::$config); + } + + }//end initializeConfigAndRuleset() + + + /** + * Destroy the Config object and restor the ini values after the tests. + * + * @afterClass + * + * @return void + */ + public static function restoreOriginalValues() + { + // 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 this object is destroyed, but we can't definitively rely on that). + if (isset(self::$config) === true) { + self::$config->__destruct(); + } + + foreach (self::$originalIniValues as $name => $value) { + if ($value === null) { + continue; + } + + ini_set($name, $value); + } + + }//end restoreOriginalValues() + + + /** + * Verify that in CS mode, phpcs-only directives are respected and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessConfigCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $this->assertSame('true', Config::getConfigData('neither'), 'Non-selective config directive was not applied.'); + $this->assertSame('true', Config::getConfigData('csOnly'), 'CS-only config directive was not applied.'); + $this->assertSame(null, Config::getConfigData('cbfOnly'), 'CBF-only config directive was applied, while it shouldn\'t have been.'); + + }//end testShouldProcessConfigCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are respected and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessConfigCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $this->assertSame('true', Config::getConfigData('neither'), 'Non-selective config directive was not applied.'); + $this->assertSame(null, Config::getConfigData('csOnly'), 'CS-only config directive was applied, while it shouldn\'t have been.'); + $this->assertSame('true', Config::getConfigData('cbfOnly'), 'CBF-only config directive was not applied.'); + + }//end testShouldProcessConfigCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are respected and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessArgCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $expectedExtensions = [ + 'php' => 'PHP', + 'phpt' => 'PHP', + ]; + $expectedReports = ['full' => null]; + + $this->assertSame($expectedExtensions, self::$config->extensions, 'Non-selective arg directive was not applied.'); + $this->assertTrue(self::$config->showProgress, 'Non-selective short arg directive was not applied [1].'); + $this->assertTrue(self::$config->showSources, 'Non-selective short arg directive was not applied [2].'); + $this->assertTrue(self::$config->colors, 'CS-only arg directive was not applied.'); + $this->assertSame($expectedReports, self::$config->reports, 'CBF-only arg directive was applied, while it shouldn\'t have been.'); + + }//end testShouldProcessArgCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are respected and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessArgCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $expectedExtensions = [ + 'php' => 'PHP', + 'phpt' => 'PHP', + ]; + $expectedReports = ['summary' => null]; + + $this->assertSame($expectedExtensions, self::$config->extensions, 'Non-selective arg directive was not applied.'); + $this->assertTrue(self::$config->showProgress, 'Non-selective short arg directive was not applied [1].'); + $this->assertTrue(self::$config->showSources, 'Non-selective short arg directive was not applied [2].'); + $this->assertFalse(self::$config->colors, 'CS-only arg directive was applied, while it shouldn\'t have been.'); + $this->assertSame($expectedReports, self::$config->reports, 'CBF-only arg directive was not applied.'); + + }//end testShouldProcessArgCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are respected and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessIniCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $this->assertSame('2', ini_get('bcmath.scale'), 'Non-selective ini directive was not applied.'); + $this->assertSame('path/to/docs/', ini_get('docref_root'), 'CS-only ini directive was not applied.'); + $this->assertSame('', ini_get('user_agent'), 'CBF-only ini directive was applied, while it shouldn\'t have been.'); + + }//end testShouldProcessIniCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are respected and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessIniCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $this->assertSame('2', ini_get('bcmath.scale'), 'Non-selective ini directive was not applied.'); + $this->assertSame('', ini_get('docref_root'), 'CS-only ini directive was applied, while it shouldn\'t have been..'); + $this->assertSame('Never mind', ini_get('user_agent'), 'CBF-only ini directive was not applied.'); + + }//end testShouldProcessIniCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are respected and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessExcludePatternCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $expected = [ + './tests/' => 'absolute', + './vendor/' => 'absolute', + ]; + + $this->assertSame($expected, self::$ruleset->ignorePatterns); + + }//end testShouldProcessExcludePatternCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are respected and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessExcludePatternCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $expected = [ + './tests/' => 'absolute', + './node-modules/' => 'absolute', + ]; + + $this->assertSame($expected, self::$ruleset->ignorePatterns); + + }//end testShouldProcessExcludePatternCbfonly() + + + /** + * Verify that in CS mode, phpcs-only directives are respected and phpcbf-only + * directives are ignored. + * + * @return void + */ + public function testShouldProcessRuleCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $this->assertArrayHasKey('PEAR.Formatting.MultiLineAssignment', self::$ruleset->sniffCodes); + $this->assertArrayHasKey('Generic.Arrays.ArrayIndent', self::$ruleset->sniffCodes); + $this->assertArrayNotHasKey('PSR2.Classes.ClassDeclaration', self::$ruleset->sniffCodes); + + }//end testShouldProcessRuleCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only directives are respected and phpcs-only + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessRuleCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $this->assertArrayHasKey('PEAR.Formatting.MultiLineAssignment', self::$ruleset->sniffCodes); + $this->assertArrayNotHasKey('Generic.Arrays.ArrayIndent', self::$ruleset->sniffCodes); + $this->assertArrayHasKey('PSR2.Classes.ClassDeclaration', self::$ruleset->sniffCodes); + + }//end testShouldProcessRuleCbfonly() + + + /** + * Verify that in CS mode, phpcs-only in directives are respected and phpcbf-only in + * directives are ignored. + * + * @return void + */ + public function testShouldProcessRuleExcludeCsonly() + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $expected = [ + 'PEAR.Formatting.MultiLineAssignment.Indent' => [ + 'severity' => 0, + ], + ]; + + $this->assertSame($expected, self::$ruleset->ruleset); + + }//end testShouldProcessRuleExcludeCsonly() + + + /** + * Verify that in CBF mode, phpcbf-only in directives are respected and phpcs-only in + * directives are ignored. + * + * @group CBF + * + * @return void + */ + public function testShouldProcessRuleExcludeCbfonly() + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $expected = [ + 'PEAR.Formatting.MultiLineAssignment.EqualSignLine' => [ + 'severity' => 0, + ], + ]; + + $this->assertSame($expected, self::$ruleset->ruleset); + + }//end testShouldProcessRuleExcludeCbfonly() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.xml new file mode 100644 index 00000000..62ea0e62 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetShouldProcessElementTest.xml @@ -0,0 +1,54 @@ + + + + . + + + + + + + + ./tests/ + + + + + + + + + ./vendor/ + + + + + + + + + + + + + ./node-modules/ + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetTest.php new file mode 100644 index 00000000..d53889a8 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ProcessRulesetTest.php @@ -0,0 +1,263 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHPUnit\Framework\TestCase; + +/** + * Test various aspects of the Ruleset::processRuleset() method not covered via other tests. + * + * @covers \PHP_CodeSniffer\Ruleset::processRuleset + */ +final class ProcessRulesetTest extends TestCase +{ + + + /** + * Verify that a registered standard which doesn't have a "Sniffs" directory, but does have a file + * called "Sniffs" doesn't result in any errors being thrown. + * + * @return void + */ + public function testSniffsFileNotDirectory() + { + // Set up the ruleset. + $standard = __DIR__.'/ProcessRulesetInvalidNoSniffsDirTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $expected = ['Generic.PHP.BacktickOperator' => 'PHP_CodeSniffer\Standards\Generic\Sniffs\PHP\BacktickOperatorSniff']; + + $this->assertSame($expected, $ruleset->sniffCodes); + + }//end testSniffsFileNotDirectory() + + + /** + * Verify that all sniffs in a registered standard included in a ruleset automatically get added. + * + * @return void + */ + public function testAutoExpandSniffsDirectory() + { + // Set up the ruleset. + $standard = __DIR__.'/ProcessRulesetAutoExpandSniffsDirectoryTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $std = 'TestStandard'; + $sniffDir = 'Fixtures\TestStandard\Sniffs'; + $expected = [ + "$std.Deprecated.WithLongReplacement" => "$sniffDir\Deprecated\WithLongReplacementSniff", + "$std.Deprecated.WithReplacement" => "$sniffDir\Deprecated\WithReplacementSniff", + "$std.Deprecated.WithReplacementContainingLinuxNewlines" => "$sniffDir\Deprecated\WithReplacementContainingLinuxNewlinesSniff", + "$std.Deprecated.WithReplacementContainingNewlines" => "$sniffDir\Deprecated\WithReplacementContainingNewlinesSniff", + "$std.Deprecated.WithoutReplacement" => "$sniffDir\Deprecated\WithoutReplacementSniff", + "$std.DeprecatedInvalid.EmptyDeprecationVersion" => "$sniffDir\DeprecatedInvalid\EmptyDeprecationVersionSniff", + "$std.DeprecatedInvalid.EmptyRemovalVersion" => "$sniffDir\DeprecatedInvalid\EmptyRemovalVersionSniff", + "$std.DeprecatedInvalid.InvalidDeprecationMessage" => "$sniffDir\DeprecatedInvalid\InvalidDeprecationMessageSniff", + "$std.DeprecatedInvalid.InvalidDeprecationVersion" => "$sniffDir\DeprecatedInvalid\InvalidDeprecationVersionSniff", + "$std.DeprecatedInvalid.InvalidRemovalVersion" => "$sniffDir\DeprecatedInvalid\InvalidRemovalVersionSniff", + "$std.SetProperty.AllowedAsDeclared" => "$sniffDir\SetProperty\AllowedAsDeclaredSniff", + "$std.SetProperty.AllowedViaMagicMethod" => "$sniffDir\SetProperty\AllowedViaMagicMethodSniff", + "$std.SetProperty.AllowedViaStdClass" => "$sniffDir\SetProperty\AllowedViaStdClassSniff", + "$std.SetProperty.NotAllowedViaAttribute" => "$sniffDir\SetProperty\NotAllowedViaAttributeSniff", + "$std.SetProperty.PropertyTypeHandling" => "$sniffDir\SetProperty\PropertyTypeHandlingSniff", + ]; + + // Sort the value to make the tests stable as different OSes will read directories + // in a different order and the order is not relevant for these tests. Just the values. + $actual = $ruleset->sniffCodes; + ksort($actual); + + $this->assertSame($expected, $actual); + + }//end testAutoExpandSniffsDirectory() + + + /** + * Verify handling of exclusions of groups of sniffs after inclusion via an even larger "group". + * + * @return void + */ + public function testExcludeSniffGroup() + { + // Set up the ruleset. + $standard = __DIR__.'/ProcessRulesetExcludeSniffGroupTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + $expected = [ + 'PSR1.Classes.ClassDeclaration' => 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Classes\ClassDeclarationSniff', + 'PSR1.Methods.CamelCapsMethodName' => 'PHP_CodeSniffer\Standards\PSR1\Sniffs\Methods\CamelCapsMethodNameSniff', + ]; + + // Sort the value to make the tests stable as different OSes will read directories + // in a different order and the order is not relevant for these tests. Just the values. + $actual = $ruleset->sniffCodes; + ksort($actual); + + $this->assertSame($expected, $actual); + + }//end testExcludeSniffGroup() + + + /* + * No test for without "name" as there is nothing we can assert to verify it's being ignored. + */ + + + /** + * Test that an `` directive without a "value" attribute will be set to the ini equivalent of `true`. + * + * @return void + */ + public function testIniWithoutValue() + { + $originalValue = ini_get('user_agent'); + + // Set up the ruleset. + $this->getMiscRuleset(); + + $actualValue = ini_get('user_agent'); + // Reset the ini to its original value before the assertion to ensure it's never left in an incorrect state. + if ($originalValue !== false) { + ini_set('user_agent', $originalValue); + } + + $this->assertSame('1', $actualValue); + + }//end testIniWithoutValue() + + + /** + * Verify that inclusion of a single error code: + * - Includes the sniff, but sets "severity" for the sniff to 0; + * - Sets "severity" for the specific error code included to 5.; + * + * @return void + */ + public function testIncludeSingleErrorCode() + { + // Set up the ruleset. + $ruleset = $this->getMiscRuleset(); + + $key = 'severity'; + + $sniffCode = 'Generic.PHP.RequireStrictTypes'; + $this->assertArrayHasKey($sniffCode, $ruleset->ruleset, "Sniff $sniffCode not registered"); + $this->assertTrue(is_array($ruleset->ruleset[$sniffCode]), "Sniff $sniffCode is not an array"); + $this->assertArrayHasKey($key, $ruleset->ruleset[$sniffCode], "Directive $key not registered for sniff $sniffCode"); + $this->assertSame(0, $ruleset->ruleset[$sniffCode][$key], "$key has unexpected value for sniff $sniffCode"); + + $sniffCode = 'Generic.PHP.RequireStrictTypes.MissingDeclaration'; + $this->assertArrayHasKey($sniffCode, $ruleset->ruleset, "Sniff $sniffCode not registered"); + $this->assertTrue(is_array($ruleset->ruleset[$sniffCode]), "Sniff $sniffCode is not an array"); + $this->assertArrayHasKey($key, $ruleset->ruleset[$sniffCode], "Directive $key not registered for sniff $sniffCode"); + $this->assertSame(5, $ruleset->ruleset[$sniffCode][$key], "$key has unexpected value for sniff $sniffCode"); + + }//end testIncludeSingleErrorCode() + + + /** + * Verify that if all error codes, save one, from a sniff were previously excluded, an include for an additional + * error code from that same sniff will be respected. + * + * @return void + */ + public function testErrorCodeIncludeAfterExclude() + { + // Set up the ruleset. + $ruleset = $this->getMiscRuleset(); + + $key = 'severity'; + + $sniffCode = 'PEAR.Files.IncludingFile'; + $this->assertArrayHasKey($sniffCode, $ruleset->ruleset, "Sniff $sniffCode not registered"); + $this->assertTrue(is_array($ruleset->ruleset[$sniffCode]), "Sniff $sniffCode is not an array"); + $this->assertArrayHasKey($key, $ruleset->ruleset[$sniffCode], "Directive $key not registered for sniff $sniffCode"); + $this->assertSame(0, $ruleset->ruleset[$sniffCode][$key], "$key has unexpected value for sniff $sniffCode"); + + $sniffCode = 'PEAR.Files.IncludingFile.BracketsNotRequired'; + $this->assertArrayHasKey($sniffCode, $ruleset->ruleset, "Sniff $sniffCode not registered"); + $this->assertTrue(is_array($ruleset->ruleset[$sniffCode]), "Sniff $sniffCode is not an array"); + $this->assertArrayHasKey($key, $ruleset->ruleset[$sniffCode], "Directive $key not registered for sniff $sniffCode"); + $this->assertSame(5, $ruleset->ruleset[$sniffCode][$key], "$key has unexpected value for sniff $sniffCode"); + + $sniffCode = 'PEAR.Files.IncludingFile.UseRequire'; + $this->assertArrayHasKey($sniffCode, $ruleset->ruleset, "Sniff $sniffCode not registered"); + $this->assertTrue(is_array($ruleset->ruleset[$sniffCode]), "Sniff $sniffCode is not an array"); + $this->assertArrayHasKey($key, $ruleset->ruleset[$sniffCode], "Directive $key not registered for sniff $sniffCode"); + $this->assertSame(5, $ruleset->ruleset[$sniffCode][$key], "$key has unexpected value for sniff $sniffCode"); + + }//end testErrorCodeIncludeAfterExclude() + + + /** + * Verify that a element without a "ref" is completely ignored. + * + * @return void + */ + public function testRuleWithoutRefIsIgnored() + { + // Set up the ruleset. + $ruleset = $this->getMiscRuleset(); + + $sniffCode = 'Generic.Metrics.CyclomaticComplexity'; + $this->assertArrayNotHasKey($sniffCode, $ruleset->sniffCodes, "Sniff $sniffCode registered"); + $this->assertArrayNotHasKey($sniffCode, $ruleset->ruleset, "Sniff $sniffCode adjusted"); + + }//end testRuleWithoutRefIsIgnored() + + + /** + * Verify that no "ruleset adjustments" are registered via an `` without a "name". + * + * @return void + */ + public function testRuleExcludeWithoutNameIsIgnored() + { + // Set up the ruleset. + $ruleset = $this->getMiscRuleset(); + + $sniffCode = 'Generic.PHP.BacktickOperator'; + $this->assertArrayHasKey($sniffCode, $ruleset->sniffCodes, "Sniff $sniffCode not registered"); + $this->assertArrayNotHasKey($sniffCode, $ruleset->ruleset, "Sniff $sniffCode adjusted"); + + $sniffCode = 'Generic.PHP.BacktickOperator.Found'; + $this->assertArrayNotHasKey($sniffCode, $ruleset->ruleset, "Sniff $sniffCode adjusted"); + + }//end testRuleExcludeWithoutNameIsIgnored() + + + /** + * Test Helper. + * + * @return \PHP_CodeSniffer\Sniffs\Sniff + */ + private function getMiscRuleset() + { + static $ruleset; + + if (isset($ruleset) === false) { + // Set up the ruleset. + $standard = __DIR__.'/ProcessRulesetMiscTest.xml'; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + } + + return $ruleset; + + }//end getMiscRuleset() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingInlineTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingInlineTest.xml new file mode 100644 index 00000000..0bdadc7d --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingInlineTest.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.php new file mode 100644 index 00000000..4c5cd516 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.php @@ -0,0 +1,234 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Ruleset; + +use PHP_CodeSniffer\Files\LocalFile; +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHPUnit\Framework\TestCase; + +/** + * Test the handling of property value types for properties set via the ruleset and inline. + * + * @covers \PHP_CodeSniffer\Ruleset::processRule + * @covers \PHP_CodeSniffer\Ruleset::setSniffProperty + */ +final class PropertyTypeHandlingTest extends TestCase +{ + + /** + * Sniff code for the sniff used in these tests. + * + * @var string + */ + const SNIFF_CODE = 'TestStandard.SetProperty.PropertyTypeHandling'; + + /** + * Class name of the sniff used in these tests. + * + * @var string + */ + const SNIFF_CLASS = 'Fixtures\\TestStandard\\Sniffs\\SetProperty\\PropertyTypeHandlingSniff'; + + + /** + * Test the value type handling for properties set via a ruleset. + * + * @param string $propertyName Property name. + * @param mixed $expected Expected property value. + * + * @dataProvider dataTypeHandling + * + * @return void + */ + public function testTypeHandlingWhenSetViaRuleset($propertyName, $expected) + { + $sniffObject = $this->getSniffObjectForRuleset(); + + $this->assertSame($expected, $sniffObject->$propertyName); + + }//end testTypeHandlingWhenSetViaRuleset() + + + /** + * Test the value type handling for properties set inline in a test case file. + * + * @param string $propertyName Property name. + * @param mixed $expected Expected property value. + * + * @dataProvider dataTypeHandling + * + * @return void + */ + public function testTypeHandlingWhenSetInline($propertyName, $expected) + { + $sniffObject = $this->getSniffObjectAfterProcessingFile(); + + $this->assertSame($expected, $sniffObject->$propertyName); + + }//end testTypeHandlingWhenSetInline() + + + /** + * Data provider. + * + * @see self::testTypeHandlingWhenSetViaRuleset() + * + * @return array> + */ + public static function dataTypeHandling() + { + $expectedArrayOnlyValues = [ + 'string', + '10', + '1.5', + 'null', + 'true', + 'false', + ]; + $expectedArrayKeysAndValues = [ + 'string' => 'string', + 10 => '10', + 'float' => '1.5', + 'null' => 'null', + 'true' => 'true', + 'false' => 'false', + ]; + + return [ + 'String value (default)' => [ + 'propertyName' => 'expectsString', + 'expected' => 'arbitraryvalue', + ], + 'String with whitespace only value becomes null' => [ + 'propertyName' => 'emptyStringBecomesNull', + 'expected' => null, + ], + 'Integer value gets set as string' => [ + 'propertyName' => 'expectsIntButAcceptsString', + 'expected' => '12345', + ], + 'Float value gets set as string' => [ + 'propertyName' => 'expectsFloatButAcceptsString', + 'expected' => '12.345', + ], + 'Null value gets set as string' => [ + 'propertyName' => 'expectsNull', + 'expected' => 'null', + ], + 'Null (uppercase) value gets set as string' => [ + 'propertyName' => 'expectsNullCase', + 'expected' => 'NULL', + ], + 'True value gets set as boolean' => [ + 'propertyName' => 'expectsBooleanTrue', + 'expected' => true, + ], + 'True (mixed case) value gets set as string' => [ + 'propertyName' => 'expectsBooleanTrueCase', + 'expected' => 'True', + ], + 'False value gets set as boolean' => [ + 'propertyName' => 'expectsBooleanFalse', + 'expected' => false, + ], + 'False (mixed case) value gets set as string' => [ + 'propertyName' => 'expectsBooleanFalseCase', + 'expected' => 'fALSe', + ], + 'Array with only values (new style)' => [ + 'propertyName' => 'expectsArrayWithOnlyValues', + 'expected' => $expectedArrayOnlyValues, + ], + 'Array with keys and values (new style)' => [ + 'propertyName' => 'expectsArrayWithKeysAndValues', + 'expected' => $expectedArrayKeysAndValues, + ], + 'Array with only values (old style)' => [ + 'propertyName' => 'expectsOldSchoolArrayWithOnlyValues', + 'expected' => $expectedArrayOnlyValues, + ], + 'Array with keys and values (old style)' => [ + 'propertyName' => 'expectsOldSchoolArrayWithKeysAndValues', + 'expected' => $expectedArrayKeysAndValues, + ], + ]; + + }//end dataTypeHandling() + + + /** + * Test Helper. + * + * @see self::testTypeHandlingWhenSetViaRuleset() + * + * @return \PHP_CodeSniffer\Sniffs\Sniff + */ + private function getSniffObjectForRuleset() + { + static $sniffObject; + + if (isset($sniffObject) === false) { + // Set up the ruleset. + $standard = __DIR__."/PropertyTypeHandlingTest.xml"; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + // Verify that our target sniff has been registered. + $this->assertArrayHasKey(self::SNIFF_CODE, $ruleset->sniffCodes, 'Target sniff not registered'); + $this->assertSame(self::SNIFF_CLASS, $ruleset->sniffCodes[self::SNIFF_CODE], 'Target sniff not registered with the correct class'); + $this->assertArrayHasKey(self::SNIFF_CLASS, $ruleset->sniffs, 'Sniff class not listed in registered sniffs'); + + $sniffObject = $ruleset->sniffs[self::SNIFF_CLASS]; + } + + return $sniffObject; + + }//end getSniffObjectForRuleset() + + + /** + * Test Helper + * + * @see self::testTypeHandlingWhenSetInline() + * + * @return \PHP_CodeSniffer\Sniffs\Sniff + */ + private function getSniffObjectAfterProcessingFile() + { + static $sniffObject; + + if (isset($sniffObject) === false) { + // Set up the ruleset. + $standard = __DIR__."/PropertyTypeHandlingInlineTest.xml"; + $config = new ConfigDouble(["--standard=$standard"]); + $ruleset = new Ruleset($config); + + // Verify that our target sniff has been registered. + $this->assertArrayHasKey(self::SNIFF_CODE, $ruleset->sniffCodes, 'Target sniff not registered'); + $this->assertSame(self::SNIFF_CLASS, $ruleset->sniffCodes[self::SNIFF_CODE], 'Target sniff not registered with the correct class'); + $this->assertArrayHasKey(self::SNIFF_CLASS, $ruleset->sniffs, 'Sniff class not listed in registered sniffs'); + + $sniffObject = $ruleset->sniffs[self::SNIFF_CLASS]; + + // Process the file with inline phpcs:set annotations. + $testFile = realpath(__DIR__.'/Fixtures/PropertyTypeHandlingInline.inc'); + $this->assertNotFalse($testFile); + + $phpcsFile = new LocalFile($testFile, $ruleset, $config); + $phpcsFile->process(); + } + + return $sniffObject; + + }//end getSniffObjectAfterProcessingFile() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.xml new file mode 100644 index 00000000..76817837 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/PropertyTypeHandlingTest.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php index cba45ee3..9dd0370b 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionAbsoluteWindowsTest.php @@ -16,7 +16,9 @@ /** * Tests for the \PHP_CodeSniffer\Ruleset class using a Windows-style absolute path to include a sniff. * - * @covers \PHP_CodeSniffer\Ruleset + * @covers \PHP_CodeSniffer\Ruleset + * @requires OS ^WIN.*. + * @group Windows */ final class RuleInclusionAbsoluteWindowsTest extends TestCase { @@ -52,10 +54,6 @@ final class RuleInclusionAbsoluteWindowsTest extends TestCase */ public function initializeConfigAndRuleset() { - if (DIRECTORY_SEPARATOR === '/') { - $this->markTestSkipped('Windows specific test'); - } - $this->standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; $repoRootDir = dirname(dirname(dirname(__DIR__))); @@ -85,9 +83,7 @@ public function initializeConfigAndRuleset() */ public function resetRuleset() { - if (DIRECTORY_SEPARATOR !== '/') { - file_put_contents($this->standard, $this->contents); - } + file_put_contents($this->standard, $this->contents); }//end resetRuleset() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php index ef3ad83c..e016a7ea 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.php @@ -11,15 +11,14 @@ use PHP_CodeSniffer\Ruleset; use PHP_CodeSniffer\Tests\ConfigDouble; -use PHPUnit\Framework\TestCase; -use ReflectionObject; +use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; /** * Tests for the \PHP_CodeSniffer\Ruleset class. * * @covers \PHP_CodeSniffer\Ruleset */ -final class RuleInclusionTest extends TestCase +final class RuleInclusionTest extends AbstractRulesetTestCase { /** @@ -47,35 +46,37 @@ final class RuleInclusionTest extends TestCase /** * Initialize the config and ruleset objects based on the `RuleInclusionTest.xml` ruleset file. * - * @beforeClass + * @before * * @return void */ public static function initializeConfigAndRuleset() { - $standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; - self::$standard = $standard; + if (self::$standard === '') { + $standard = __DIR__.'/'.basename(__FILE__, '.php').'.xml'; + self::$standard = $standard; - // On-the-fly adjust the ruleset test file to be able to test - // sniffs included with relative paths. - $contents = file_get_contents($standard); - self::$contents = $contents; + // On-the-fly adjust the ruleset test file to be able to test + // sniffs included with relative paths. + $contents = file_get_contents($standard); + self::$contents = $contents; - $repoRootDir = basename(dirname(dirname(dirname(__DIR__)))); + $repoRootDir = basename(dirname(dirname(dirname(__DIR__)))); - $newPath = $repoRootDir; - if (DIRECTORY_SEPARATOR === '\\') { - $newPath = str_replace('\\', '/', $repoRootDir); - } + $newPath = $repoRootDir; + if (DIRECTORY_SEPARATOR === '\\') { + $newPath = str_replace('\\', '/', $repoRootDir); + } - $adjusted = str_replace('%path_root_dir%', $newPath, $contents); + $adjusted = str_replace('%path_root_dir%', $newPath, $contents); - if (file_put_contents($standard, $adjusted) === false) { - self::markTestSkipped('On the fly ruleset adjustment failed'); - } + if (file_put_contents($standard, $adjusted) === false) { + self::markTestSkipped('On the fly ruleset adjustment failed'); + } - $config = new ConfigDouble(["--standard=$standard"]); - self::$ruleset = new Ruleset($config); + $config = new ConfigDouble(["--standard=$standard"]); + self::$ruleset = new Ruleset($config); + }//end if }//end initializeConfigAndRuleset() @@ -101,7 +102,7 @@ public function resetRuleset() */ public function testHasSniffCodes() { - $this->assertCount(48, self::$ruleset->sniffCodes); + $this->assertCount(49, self::$ruleset->sniffCodes); }//end testHasSniffCodes() @@ -318,6 +319,10 @@ public static function dataRegisteredSniffCodes() 'Generic.Metrics.CyclomaticComplexity', 'PHP_CodeSniffer\Standards\Generic\Sniffs\Metrics\CyclomaticComplexitySniff', ], + [ + 'Squiz.Files.FileExtension', + 'PHP_CodeSniffer\Standards\Squiz\Sniffs\Files\FileExtensionSniff', + ], [ 'Generic.NamingConventions.CamelCapsFunctionName', 'PHP_CodeSniffer\Standards\Generic\Sniffs\NamingConventions\CamelCapsFunctionNameSniff', @@ -346,10 +351,7 @@ public static function dataRegisteredSniffCodes() public function testSettingProperties($sniffClass, $propertyName, $expectedValue) { $this->assertArrayHasKey($sniffClass, self::$ruleset->sniffs); - - $hasProperty = (new ReflectionObject(self::$ruleset->sniffs[$sniffClass]))->hasProperty($propertyName); - $errorMsg = sprintf('Property %s does not exist on sniff class %s', $propertyName, $sniffClass); - $this->assertTrue($hasProperty, $errorMsg); + $this->assertXObjectHasProperty($propertyName, self::$ruleset->sniffs[$sniffClass]); $actualValue = self::$ruleset->sniffs[$sniffClass]->$propertyName; $this->assertSame($expectedValue, $actualValue); @@ -438,10 +440,7 @@ public static function dataSettingProperties() public function testSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails($sniffClass, $propertyName) { $this->assertArrayHasKey($sniffClass, self::$ruleset->sniffs, 'Sniff class '.$sniffClass.' not listed in registered sniffs'); - - $hasProperty = (new ReflectionObject(self::$ruleset->sniffs[$sniffClass]))->hasProperty($propertyName); - $errorMsg = sprintf('Property %s registered for sniff %s which does not support it', $propertyName, $sniffClass); - $this->assertFalse($hasProperty, $errorMsg); + $this->assertXObjectNotHasProperty($propertyName, self::$ruleset->sniffs[$sniffClass]); }//end testSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails() @@ -468,6 +467,10 @@ public static function dataSettingInvalidPropertiesOnStandardsAndCategoriesSilen 'sniffClass' => 'PHP_CodeSniffer\Standards\PSR12\Sniffs\Operators\OperatorSpacingSniff', 'propertyName' => 'setforallincategory', ], + 'Set property for all sniffs in included category directory' => [ + 'sniffClass' => 'PHP_CodeSniffer\Standards\Squiz\Sniffs\Files\FileExtensionSniff', + 'propertyName' => 'setforsquizfilessniffs', + ], ]; }//end dataSettingInvalidPropertiesOnStandardsAndCategoriesSilentlyFails() diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml index 8275fe01..6b5c0a97 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/RuleInclusionTest.xml @@ -27,6 +27,14 @@ + + + + + + + + @@ -39,6 +47,7 @@ + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml index 5840d0c3..88eaa5eb 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedAsDeclaredTest.xml @@ -1,7 +1,7 @@ - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml index 7ff21782..e8502e7f 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaMagicMethodTest.xml @@ -1,7 +1,7 @@ - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml index 387f419e..bfbfaf5e 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAllowedViaStdClassTest.xml @@ -1,7 +1,7 @@ - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyAppliesPropertyToMultipleSniffsInCategoryTest.xml index 7c4ca4fd..67fcca35 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 979b48f5..a678c915 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 48a36a83..8ce97e2d 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 7caae3d3..c6a14c25 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyNotAllowedViaAttributeTest.xml @@ -1,7 +1,7 @@ - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetPropertyThrowsErrorOnInvalidPropertyTest.xml index 5dca1a01..a1742618 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/SetSniffPropertyTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetSniffPropertyTest.php index 36e6f009..b974844c 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetSniffPropertyTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/SetSniffPropertyTest.php @@ -11,7 +11,7 @@ use PHP_CodeSniffer\Ruleset; use PHP_CodeSniffer\Tests\ConfigDouble; -use PHPUnit\Framework\TestCase; +use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; use ReflectionObject; /** @@ -19,7 +19,7 @@ * * @covers \PHP_CodeSniffer\Ruleset::setSniffProperty */ -final class SetSniffPropertyTest extends TestCase +final class SetSniffPropertyTest extends AbstractRulesetTestCase { @@ -34,8 +34,8 @@ final class SetSniffPropertyTest extends TestCase */ public function testSniffPropertiesGetSetWhenAllowed($name) { - $sniffCode = "Fixtures.SetProperty.{$name}"; - $sniffClass = 'Fixtures\Sniffs\SetProperty\\'.$name.'Sniff'; + $sniffCode = "TestStandard.SetProperty.{$name}"; + $sniffClass = 'Fixtures\TestStandard\Sniffs\SetProperty\\'.$name.'Sniff'; $properties = [ 'arbitrarystring' => 'arbitraryvalue', 'arbitraryarray' => [ @@ -135,15 +135,8 @@ public function testSetPropertyAppliesPropertyToMultipleSniffsInCategory() */ public function testSetPropertyThrowsErrorOnInvalidProperty() { - $exceptionClass = 'PHP_CodeSniffer\Exceptions\RuntimeException'; - $exceptionMsg = 'Ruleset invalid. Property "indentation" does not exist on sniff Generic.Arrays.ArrayIndent'; - if (method_exists($this, 'expectException') === true) { - $this->expectException($exceptionClass); - $this->expectExceptionMessage($exceptionMsg); - } else { - // PHPUnit < 5.2.0. - $this->setExpectedException($exceptionClass, $exceptionMsg); - } + $exceptionMsg = 'Ruleset invalid. Property "indentation" does not exist on sniff Generic.Arrays.ArrayIndent'; + $this->expectRuntimeExceptionMessage($exceptionMsg); // Set up the ruleset. $standard = __DIR__.'/SetPropertyThrowsErrorOnInvalidPropertyTest.xml'; @@ -162,15 +155,8 @@ public function testSetPropertyThrowsErrorOnInvalidProperty() */ public function testSetPropertyThrowsErrorWhenPropertyOnlyAllowedViaAttribute() { - $exceptionClass = 'PHP_CodeSniffer\Exceptions\RuntimeException'; - $exceptionMsg = 'Ruleset invalid. Property "arbitrarystring" does not exist on sniff Fixtures.SetProperty.NotAllowedViaAttribute'; - if (method_exists($this, 'expectException') === true) { - $this->expectException($exceptionClass); - $this->expectExceptionMessage($exceptionMsg); - } else { - // PHPUnit < 5.2.0. - $this->setExpectedException($exceptionClass, $exceptionMsg); - } + $exceptionMsg = 'Ruleset invalid. Property "arbitrarystring" does not exist on sniff TestStandard.SetProperty.NotAllowedViaAttribute'; + $this->expectRuntimeExceptionMessage($exceptionMsg); // Set up the ruleset. $standard = __DIR__.'/SetPropertyNotAllowedViaAttributeTest.xml'; @@ -216,6 +202,39 @@ public function testSetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCateg }//end testSetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCategory() + /** + * Test that attempting to set a property for a sniff which isn't registered will be ignored. + * + * @return void + */ + public function testDirectCallIgnoredPropertyForUnusedSniff() + { + $sniffCode = 'Generic.Formatting.SpaceAfterCast'; + $sniffClass = 'PHP_CodeSniffer\\Standards\\Generic\\Sniffs\\Formatting\\SpaceAfterCastSniff'; + + // Set up the ruleset. + $config = new ConfigDouble(['--standard=PSR1']); + $ruleset = new Ruleset($config); + + $ruleset->setSniffProperty( + $sniffClass, + 'ignoreNewlines', + [ + 'scope' => 'sniff', + 'value' => true, + ] + ); + + // Verify that there are sniffs registered. + $this->assertGreaterThan(0, count($ruleset->sniffCodes), 'No sniff codes registered'); + + // Verify that our target sniff has NOT been registered after attempting to set the property. + $this->assertArrayNotHasKey($sniffCode, $ruleset->sniffCodes, 'Unused sniff was registered in sniffCodes, but shouldn\'t have been'); + $this->assertArrayNotHasKey($sniffClass, $ruleset->sniffs, 'Unused sniff was registered in sniffs, but shouldn\'t have been'); + + }//end testDirectCallIgnoredPropertyForUnusedSniff() + + /** * Test that setting a property via a direct call to the Ruleset::setSniffProperty() method * sets the property correctly when using the new $settings array format. @@ -225,8 +244,8 @@ public function testSetPropertyDoesNotThrowErrorOnInvalidPropertyWhenSetForCateg public function testDirectCallWithNewArrayFormatSetsProperty() { $name = 'AllowedAsDeclared'; - $sniffCode = "Fixtures.SetProperty.{$name}"; - $sniffClass = 'Fixtures\Sniffs\SetProperty\\'.$name.'Sniff'; + $sniffCode = "TestStandard.SetProperty.{$name}"; + $sniffClass = 'Fixtures\TestStandard\Sniffs\SetProperty\\'.$name.'Sniff'; // Set up the ruleset. $standard = __DIR__."/SetProperty{$name}Test.xml"; @@ -276,8 +295,8 @@ public function testDirectCallWithNewArrayFormatSetsProperty() public function testDirectCallWithOldArrayFormatSetsProperty($propertyValue) { $name = 'AllowedAsDeclared'; - $sniffCode = "Fixtures.SetProperty.{$name}"; - $sniffClass = 'Fixtures\Sniffs\SetProperty\\'.$name.'Sniff'; + $sniffCode = "TestStandard.SetProperty.{$name}"; + $sniffClass = 'Fixtures\TestStandard\Sniffs\SetProperty\\'.$name.'Sniff'; // Set up the ruleset. $standard = __DIR__."/SetProperty{$name}Test.xml"; @@ -383,7 +402,7 @@ public function testDirectCallWithOldArrayFormatThrowsDeprecationNotice() } $name = 'AllowedAsDeclared'; - $sniffClass = 'Fixtures\Sniffs\SetProperty\\'.$name.'Sniff'; + $sniffClass = 'Fixtures\TestStandard\Sniffs\SetProperty\\'.$name.'Sniff'; // Set up the ruleset. $standard = __DIR__."/SetProperty{$name}Test.xml"; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml index 5e2480bf..75527e2b 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyDeprecationVersionTest.xml @@ -1,8 +1,8 @@ - + - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml index 6e667375..150fc3e5 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsEmptyRemovalVersionTest.xml @@ -1,8 +1,8 @@ - + - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml index d3251679..973e065a 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationMessageTest.xml @@ -1,8 +1,8 @@ - + - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml index 89d83ab5..493adfd1 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidDeprecationVersionTest.xml @@ -1,8 +1,8 @@ - + - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml index c1eb062e..358cb0df 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsInvalidRemovalVersionTest.xml @@ -1,8 +1,8 @@ - + - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml index 3ce96ce8..fbc0cb7b 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsOrderTest.xml @@ -1,10 +1,10 @@ - + - + - - + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml index 9f1cc851..86cc615c 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsReportWidthTest.xml @@ -1,8 +1,8 @@ - + - + - + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.php index 8e81f96a..6979d69a 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.php @@ -11,7 +11,7 @@ use PHP_CodeSniffer\Ruleset; use PHP_CodeSniffer\Tests\ConfigDouble; -use PHPUnit\Framework\TestCase; +use PHP_CodeSniffer\Tests\Core\Ruleset\AbstractRulesetTestCase; /** * Tests PHPCS native handling of sniff deprecations. @@ -19,7 +19,7 @@ * @covers \PHP_CodeSniffer\Ruleset::hasSniffDeprecations * @covers \PHP_CodeSniffer\Ruleset::showSniffDeprecations */ -final class ShowSniffDeprecationsTest extends TestCase +final class ShowSniffDeprecationsTest extends AbstractRulesetTestCase { @@ -67,7 +67,7 @@ public static function dataHasSniffDeprecations() /** - * Test that the listing with deprecated sniffs will not show when specific command-line options are being used. + * Test that the listing with deprecated sniffs will not show when specific command-line options are being used [1]. * * @param string $standard The standard to use for the test. * @param array $additionalArgs Optional. Additional arguments to pass. @@ -102,24 +102,62 @@ public function testDeprecatedSniffsListDoesNotShow($standard, $additionalArgs=[ public static function dataDeprecatedSniffsListDoesNotShow() { return [ - 'Standard not using deprecated sniffs: PSR1' => [ + 'Standard not using deprecated sniffs: PSR1' => [ 'standard' => 'PSR1', ], - 'Standard using deprecated sniffs; explain mode' => [ + 'Standard using deprecated sniffs; explain mode' => [ 'standard' => __DIR__.'/ShowSniffDeprecationsTest.xml', 'additionalArgs' => ['-e'], ], - 'Standard using deprecated sniffs; quiet mode' => [ + 'Standard using deprecated sniffs; quiet mode' => [ 'standard' => __DIR__.'/ShowSniffDeprecationsTest.xml', 'additionalArgs' => ['-q'], ], + ]; + + }//end dataDeprecatedSniffsListDoesNotShow() + + + /** + * Test that the listing with deprecated sniffs will not show when specific command-line options are being used [2]. + * + * {@internal Separate test method for the same thing as this test will only work in CS mode.} + * + * @param string $standard The standard to use for the test. + * @param array $additionalArgs Optional. Additional arguments to pass. + * + * @dataProvider dataDeprecatedSniffsListDoesNotShowNeedsCsMode + * + * @return void + */ + public function testDeprecatedSniffsListDoesNotShowNeedsCsMode($standard, $additionalArgs=[]) + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $this->testDeprecatedSniffsListDoesNotShow($standard, $additionalArgs); + + }//end testDeprecatedSniffsListDoesNotShowNeedsCsMode() + + + /** + * Data provider. + * + * @see testDeprecatedSniffsListDoesNotShowNeedsCsMode() + * + * @return array>> + */ + public static function dataDeprecatedSniffsListDoesNotShowNeedsCsMode() + { + return [ 'Standard using deprecated sniffs; documentation is requested' => [ 'standard' => __DIR__.'/ShowSniffDeprecationsTest.xml', 'additionalArgs' => ['--generator=text'], ], ]; - }//end dataDeprecatedSniffsListDoesNotShow() + }//end dataDeprecatedSniffsListDoesNotShowNeedsCsMode() /** @@ -141,12 +179,12 @@ public function testDeprecatedSniffsListDoesNotShowWhenSelectedSniffsAreNotDepre $restrictions = []; $sniffs = [ - 'Fixtures.SetProperty.AllowedAsDeclared', - 'Fixtures.SetProperty.AllowedViaStdClass', + 'TestStandard.SetProperty.AllowedAsDeclared', + 'TestStandard.SetProperty.AllowedViaStdClass', ]; foreach ($sniffs as $sniffCode) { $parts = explode('.', strtolower($sniffCode)); - $sniffName = $parts[0].'\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff'; + $sniffName = $parts[0].'\\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff'; $restrictions[strtolower($sniffName)] = true; } @@ -158,7 +196,7 @@ public function testDeprecatedSniffsListDoesNotShowWhenSelectedSniffsAreNotDepre $sniffFiles[] = $sniffFile; } - $ruleset->registerSniffs($allSniffs, $restrictions, []); + $ruleset->registerSniffs($sniffFiles, $restrictions, []); $ruleset->populateTokenListeners(); $this->expectOutputString(''); @@ -187,15 +225,15 @@ public function testDeprecatedSniffsListDoesNotShowWhenAllDeprecatedSniffsAreExc $exclusions = []; $exclude = [ - 'Fixtures.Deprecated.WithLongReplacement', - 'Fixtures.Deprecated.WithoutReplacement', - 'Fixtures.Deprecated.WithReplacement', - 'Fixtures.Deprecated.WithReplacementContainingLinuxNewlines', - 'Fixtures.Deprecated.WithReplacementContainingNewlines', + 'TestStandard.Deprecated.WithLongReplacement', + 'TestStandard.Deprecated.WithoutReplacement', + 'TestStandard.Deprecated.WithReplacement', + 'TestStandard.Deprecated.WithReplacementContainingLinuxNewlines', + 'TestStandard.Deprecated.WithReplacementContainingNewlines', ]; foreach ($exclude as $sniffCode) { $parts = explode('.', strtolower($sniffCode)); - $sniffName = $parts[0].'\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff'; + $sniffName = $parts[0].'\\sniffs\\'.$parts[1].'\\'.$parts[2].'sniff'; $exclusions[strtolower($sniffName)] = true; } @@ -207,7 +245,7 @@ public function testDeprecatedSniffsListDoesNotShowWhenAllDeprecatedSniffsAreExc $sniffFiles[] = $sniffFile; } - $ruleset->registerSniffs($allSniffs, [], $exclusions); + $ruleset->registerSniffs($sniffFiles, [], $exclusions); $ruleset->populateTokenListeners(); $this->expectOutputString(''); @@ -234,9 +272,9 @@ public function testDeprecatedSniffsWarning() $config = new ConfigDouble(["--standard=$standard", '--no-colors']); $ruleset = new Ruleset($config); - $expected = 'WARNING: The SniffDeprecationTest standard uses 5 deprecated sniffs'.PHP_EOL; + $expected = 'WARNING: The ShowSniffDeprecationsTest standard uses 5 deprecated sniffs'.PHP_EOL; $expected .= '--------------------------------------------------------------------------------'.PHP_EOL; - $expected .= '- Fixtures.Deprecated.WithLongReplacement'.PHP_EOL; + $expected .= '- TestStandard.Deprecated.WithLongReplacement'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0.'.PHP_EOL; $expected .= ' Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel'.PHP_EOL; $expected .= ' vestibulum nunc. Sed luctus dolor tortor, eu euismod purus pretium sed.'.PHP_EOL; @@ -247,12 +285,12 @@ public function testDeprecatedSniffsWarning() $expected .= ' dictum. Suspendisse dictum egestas sapien, eget ullamcorper metus elementum'.PHP_EOL; $expected .= ' semper. Vestibulum sem justo, consectetur ac tincidunt et, finibus eget'.PHP_EOL; $expected .= ' libero.'.PHP_EOL; - $expected .= '- Fixtures.Deprecated.WithoutReplacement'.PHP_EOL; + $expected .= '- TestStandard.Deprecated.WithoutReplacement'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.4.0 and will be removed in v4.0.0.'.PHP_EOL; - $expected .= '- Fixtures.Deprecated.WithReplacement'.PHP_EOL; + $expected .= '- TestStandard.Deprecated.WithReplacement'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0.'.PHP_EOL; $expected .= ' Use the Stnd.Category.OtherSniff sniff instead.'.PHP_EOL; - $expected .= '- Fixtures.Deprecated.WithReplacementContainingLinuxNewlines'.PHP_EOL; + $expected .= '- TestStandard.Deprecated.WithReplacementContainingLinuxNewlines'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0.'.PHP_EOL; $expected .= ' Lorem ipsum dolor sit amet, consectetur adipiscing elit.'.PHP_EOL; $expected .= ' Fusce vel vestibulum nunc. Sed luctus dolor tortor, eu euismod purus pretium'.PHP_EOL; @@ -262,7 +300,7 @@ public function testDeprecatedSniffsWarning() $expected .= ' eros sapien at sem.'.PHP_EOL; $expected .= ' Sed pulvinar aliquam malesuada. Aliquam erat volutpat. Mauris gravida rutrum'.PHP_EOL; $expected .= ' lectus at egestas.'.PHP_EOL; - $expected .= '- Fixtures.Deprecated.WithReplacementContainingNewlines'.PHP_EOL; + $expected .= '- TestStandard.Deprecated.WithReplacementContainingNewlines'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0.'.PHP_EOL; $expected .= ' Lorem ipsum dolor sit amet, consectetur adipiscing elit.'.PHP_EOL; $expected .= ' Fusce vel vestibulum nunc. Sed luctus dolor tortor, eu euismod purus pretium'.PHP_EOL; @@ -321,16 +359,16 @@ public function testReportWidthIsRespected($reportWidth, $expectedOutput) */ public static function dataReportWidthIsRespected() { - $summaryLine = 'WARNING: The SniffDeprecationTest standard uses 1 deprecated sniff'.PHP_EOL; + $summaryLine = 'WARNING: The ShowSniffDeprecationsTest standard uses 1 deprecated sniff'.PHP_EOL; // phpcs:disable Squiz.Strings.ConcatenationSpacing.PaddingFound -- Test readability is more important. return [ 'Report width small: 40; with truncated sniff name and wrapped header and footer lines' => [ 'reportWidth' => 40, - 'expectedOutput' => 'WARNING: The SniffDeprecationTest'.PHP_EOL + 'expectedOutput' => 'WARNING: The ShowSniffDeprecationsTest'.PHP_EOL .'standard uses 1 deprecated sniff'.PHP_EOL .'----------------------------------------'.PHP_EOL - .'- Fixtures.Deprecated.WithLongRepla...'.PHP_EOL + .'- TestStandard.Deprecated.WithLongR...'.PHP_EOL .' This sniff has been deprecated since'.PHP_EOL .' v3.8.0 and will be removed in'.PHP_EOL .' v4.0.0. Lorem ipsum dolor sit amet,'.PHP_EOL @@ -358,7 +396,7 @@ public static function dataReportWidthIsRespected() 'Report width default: 80' => [ 'reportWidth' => 80, 'expectedOutput' => $summaryLine.str_repeat('-', 80).PHP_EOL - .'- Fixtures.Deprecated.WithLongReplacement'.PHP_EOL + .'- TestStandard.Deprecated.WithLongReplacement'.PHP_EOL .' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0.'.PHP_EOL .' Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel'.PHP_EOL .' vestibulum nunc. Sed luctus dolor tortor, eu euismod purus pretium sed.'.PHP_EOL @@ -376,7 +414,7 @@ public static function dataReportWidthIsRespected() // Length = 4 padding + 75 base line + 587 custom message. 'reportWidth' => 666, 'expectedOutput' => $summaryLine.str_repeat('-', 666).PHP_EOL - .'- Fixtures.Deprecated.WithLongReplacement'.PHP_EOL + .'- TestStandard.Deprecated.WithLongReplacement'.PHP_EOL .' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel vestibulum nunc. Sed luctus dolor tortor, eu euismod purus pretium sed. Fusce egestas congue massa semper cursus. Donec quis pretium tellus. In lacinia, augue ut ornare porttitor, diam nunc faucibus purus, et accumsan eros sapien at sem. Sed pulvinar aliquam malesuada. Aliquam erat volutpat. Mauris gravida rutrum lectus at egestas. Fusce tempus elit in tincidunt dictum. Suspendisse dictum egestas sapien, eget ullamcorper metus elementum semper. Vestibulum sem justo, consectetur ac tincidunt et, finibus eget libero.' .PHP_EOL.PHP_EOL .'Deprecated sniffs are still run, but will stop working at some point in the future.'.PHP_EOL.PHP_EOL, @@ -384,7 +422,7 @@ public static function dataReportWidthIsRespected() 'Report width wide: 1000; delimiter line length should match longest line' => [ 'reportWidth' => 1000, 'expectedOutput' => $summaryLine.str_repeat('-', 666).PHP_EOL - .'- Fixtures.Deprecated.WithLongReplacement'.PHP_EOL + .'- TestStandard.Deprecated.WithLongReplacement'.PHP_EOL .' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce vel vestibulum nunc. Sed luctus dolor tortor, eu euismod purus pretium sed. Fusce egestas congue massa semper cursus. Donec quis pretium tellus. In lacinia, augue ut ornare porttitor, diam nunc faucibus purus, et accumsan eros sapien at sem. Sed pulvinar aliquam malesuada. Aliquam erat volutpat. Mauris gravida rutrum lectus at egestas. Fusce tempus elit in tincidunt dictum. Suspendisse dictum egestas sapien, eget ullamcorper metus elementum semper. Vestibulum sem justo, consectetur ac tincidunt et, finibus eget libero.' .PHP_EOL.PHP_EOL .'Deprecated sniffs are still run, but will stop working at some point in the future.'.PHP_EOL.PHP_EOL, @@ -409,11 +447,11 @@ public function testDeprecatedSniffsAreListedAlphabetically() $config = new ConfigDouble(["--standard=$standard", '--no-colors']); $ruleset = new Ruleset($config); - $expected = 'WARNING: The SniffDeprecationTest standard uses 2 deprecated sniffs'.PHP_EOL; + $expected = 'WARNING: The ShowSniffDeprecationsTest standard uses 2 deprecated sniffs'.PHP_EOL; $expected .= '--------------------------------------------------------------------------------'.PHP_EOL; - $expected .= '- Fixtures.Deprecated.WithoutReplacement'.PHP_EOL; + $expected .= '- TestStandard.Deprecated.WithoutReplacement'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.4.0 and will be removed in v4.0.0.'.PHP_EOL; - $expected .= '- Fixtures.Deprecated.WithReplacement'.PHP_EOL; + $expected .= '- TestStandard.Deprecated.WithReplacement'.PHP_EOL; $expected .= ' This sniff has been deprecated since v3.8.0 and will be removed in v4.0.0.'.PHP_EOL; $expected .= ' Use the Stnd.Category.OtherSniff sniff instead.'.PHP_EOL.PHP_EOL; $expected .= 'Deprecated sniffs are still run, but will stop working at some point in the'.PHP_EOL; @@ -426,12 +464,12 @@ public function testDeprecatedSniffsAreListedAlphabetically() // Verify that the sniffs have been registered to run. $this->assertCount(2, $ruleset->sniffCodes, 'Incorrect number of sniff codes registered'); $this->assertArrayHasKey( - 'Fixtures.Deprecated.WithoutReplacement', + 'TestStandard.Deprecated.WithoutReplacement', $ruleset->sniffCodes, 'WithoutReplacement sniff not registered' ); $this->assertArrayHasKey( - 'Fixtures.Deprecated.WithReplacement', + 'TestStandard.Deprecated.WithReplacement', $ruleset->sniffCodes, 'WithReplacement sniff not registered' ); @@ -452,15 +490,7 @@ public function testDeprecatedSniffsAreListedAlphabetically() */ public function testExceptionIsThrownOnIncorrectlyImplementedInterface($standard, $exceptionMessage) { - $exception = 'PHP_CodeSniffer\Exceptions\RuntimeException'; - if (method_exists($this, 'expectException') === true) { - // PHPUnit 5+. - $this->expectException($exception); - $this->expectExceptionMessage($exceptionMessage); - } else { - // PHPUnit 4. - $this->setExpectedException($exception, $exceptionMessage); - } + $this->expectRuntimeExceptionMessage($exceptionMessage); // Set up the ruleset. $standard = __DIR__.'/'.$standard; @@ -484,23 +514,23 @@ public static function dataExceptionIsThrownOnIncorrectlyImplementedInterface() return [ 'getDeprecationVersion() does not return a string' => [ 'standard' => 'ShowSniffDeprecationsInvalidDeprecationVersionTest.xml', - 'exceptionMessage' => 'The Fixtures\Sniffs\DeprecatedInvalid\InvalidDeprecationVersionSniff::getDeprecationVersion() method must return a non-empty string, received double', + 'exceptionMessage' => 'The Fixtures\TestStandard\Sniffs\DeprecatedInvalid\InvalidDeprecationVersionSniff::getDeprecationVersion() method must return a non-empty string, received double', ], 'getRemovalVersion() does not return a string' => [ 'standard' => 'ShowSniffDeprecationsInvalidRemovalVersionTest.xml', - 'exceptionMessage' => 'The Fixtures\Sniffs\DeprecatedInvalid\InvalidRemovalVersionSniff::getRemovalVersion() method must return a non-empty string, received array', + 'exceptionMessage' => 'The Fixtures\TestStandard\Sniffs\DeprecatedInvalid\InvalidRemovalVersionSniff::getRemovalVersion() method must return a non-empty string, received array', ], 'getDeprecationMessage() does not return a string' => [ 'standard' => 'ShowSniffDeprecationsInvalidDeprecationMessageTest.xml', - 'exceptionMessage' => 'The Fixtures\Sniffs\DeprecatedInvalid\InvalidDeprecationMessageSniff::getDeprecationMessage() method must return a string, received object', + 'exceptionMessage' => 'The Fixtures\TestStandard\Sniffs\DeprecatedInvalid\InvalidDeprecationMessageSniff::getDeprecationMessage() method must return a string, received object', ], 'getDeprecationVersion() returns an empty string' => [ 'standard' => 'ShowSniffDeprecationsEmptyDeprecationVersionTest.xml', - 'exceptionMessage' => 'The Fixtures\Sniffs\DeprecatedInvalid\EmptyDeprecationVersionSniff::getDeprecationVersion() method must return a non-empty string, received ""', + 'exceptionMessage' => 'The Fixtures\TestStandard\Sniffs\DeprecatedInvalid\EmptyDeprecationVersionSniff::getDeprecationVersion() method must return a non-empty string, received ""', ], 'getRemovalVersion() returns an empty string' => [ 'standard' => 'ShowSniffDeprecationsEmptyRemovalVersionTest.xml', - 'exceptionMessage' => 'The Fixtures\Sniffs\DeprecatedInvalid\EmptyRemovalVersionSniff::getRemovalVersion() method must return a non-empty string, received ""', + 'exceptionMessage' => 'The Fixtures\TestStandard\Sniffs\DeprecatedInvalid\EmptyRemovalVersionSniff::getRemovalVersion() method must return a non-empty string, received ""', ], ]; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml index 4c1dec22..38c7e022 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Ruleset/ShowSniffDeprecationsTest.xml @@ -1,10 +1,10 @@ - + - + - - + + diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AbstractTokenizerTestCase.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/AbstractTokenizerTestCase.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AbstractTokenizerTestCase.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/AbstractTokenizerTestCase.php index 0f829182..a7c1a6b0 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/AbstractTokenizerTestCase.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/AbstractTokenizerTestCase.php @@ -10,7 +10,7 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers; use PHP_CodeSniffer\Files\DummyFile; use PHP_CodeSniffer\Ruleset; diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/CommentTestCase.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/CommentTestCase.php similarity index 97% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/CommentTestCase.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/CommentTestCase.php index 0dbd9771..625029db 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/CommentTestCase.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/CommentTestCase.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Comment; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Comment; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding1Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding1Test.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding1Test.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding1Test.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding1Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding1Test.php similarity index 97% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding1Test.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding1Test.php index 8f9b8e84..32dbe142 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding1Test.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding1Test.php @@ -7,7 +7,7 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Comment; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Comment; /** * Tests that unclosed docblocks during live coding are handled correctly. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding2Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding2Test.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding2Test.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding2Test.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding2Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding2Test.php similarity index 97% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding2Test.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding2Test.php index 16b9ac34..258b3190 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding2Test.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding2Test.php @@ -7,7 +7,7 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Comment; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Comment; /** * Tests that unclosed docblocks during live coding are handled correctly. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding3Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding3Test.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding3Test.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding3Test.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding3Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding3Test.php similarity index 96% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding3Test.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding3Test.php index 29924ebc..7edfbb45 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding3Test.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding3Test.php @@ -7,7 +7,7 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Comment; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Comment; /** * Tests that unclosed docblocks during live coding are handled correctly. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding4Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding4Test.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding4Test.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding4Test.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding4Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding4Test.php similarity index 97% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding4Test.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding4Test.php index 470c7d9c..7e5087df 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/LiveCoding4Test.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/LiveCoding4Test.php @@ -7,7 +7,7 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Comment; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Comment; /** * Tests that unclosed docblocks during live coding are handled correctly. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/MultiLineDocBlockTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/MultiLineDocBlockTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/MultiLineDocBlockTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/MultiLineDocBlockTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/MultiLineDocBlockTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/MultiLineDocBlockTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/MultiLineDocBlockTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/MultiLineDocBlockTest.php index 04e69cb5..9c05c7c1 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/MultiLineDocBlockTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/MultiLineDocBlockTest.php @@ -7,7 +7,7 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Comment; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Comment; /** * Tests that multiline docblocks are tokenized correctly. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/PhpcsAnnotationsInDocBlockTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/PhpcsAnnotationsInDocBlockTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/PhpcsAnnotationsInDocBlockTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/PhpcsAnnotationsInDocBlockTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/PhpcsAnnotationsInDocBlockTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/PhpcsAnnotationsInDocBlockTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/PhpcsAnnotationsInDocBlockTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/PhpcsAnnotationsInDocBlockTest.php index f0e2ce69..22fb56f5 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/PhpcsAnnotationsInDocBlockTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/PhpcsAnnotationsInDocBlockTest.php @@ -7,7 +7,7 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Comment; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Comment; /** * Tests that PHPCS native annotations in docblocks are tokenized correctly. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/SingleLineDocBlockTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/SingleLineDocBlockTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/SingleLineDocBlockTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/SingleLineDocBlockTest.php index e90b573d..4551f4ec 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Comment/SingleLineDocBlockTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Comment/SingleLineDocBlockTest.php @@ -7,7 +7,7 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Comment; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Comment; /** * Tests that single line docblocks are tokenized correctly. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AnonClassParenthesisOwnerTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AnonClassParenthesisOwnerTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AnonClassParenthesisOwnerTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AnonClassParenthesisOwnerTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AnonClassParenthesisOwnerTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AnonClassParenthesisOwnerTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AnonClassParenthesisOwnerTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AnonClassParenthesisOwnerTest.php index 5277dade..da64f643 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AnonClassParenthesisOwnerTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AnonClassParenthesisOwnerTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class AnonClassParenthesisOwnerTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ArrayKeywordTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ArrayKeywordTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ArrayKeywordTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ArrayKeywordTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ArrayKeywordTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ArrayKeywordTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ArrayKeywordTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ArrayKeywordTest.php index 37528d6d..e19c2ffb 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ArrayKeywordTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ArrayKeywordTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class ArrayKeywordTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AttributesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AttributesTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AttributesTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AttributesTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AttributesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AttributesTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AttributesTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AttributesTest.php index 24b7f079..43952b62 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/AttributesTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/AttributesTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class AttributesTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillEnumTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillEnumTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillEnumTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillEnumTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillEnumTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillEnumTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillEnumTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillEnumTest.php index d97a90b8..9b313ca6 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillEnumTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillEnumTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class BackfillEnumTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillExplicitOctalNotationTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillExplicitOctalNotationTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillExplicitOctalNotationTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillExplicitOctalNotationTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillExplicitOctalNotationTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillExplicitOctalNotationTest.php similarity index 97% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillExplicitOctalNotationTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillExplicitOctalNotationTest.php index 64c82be3..7dc3e139 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillExplicitOctalNotationTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillExplicitOctalNotationTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class BackfillExplicitOctalNotationTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillFnTokenTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillFnTokenTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillFnTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillFnTokenTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php index f268bedd..f4ef2f20 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillFnTokenTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillFnTokenTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class BackfillFnTokenTest extends AbstractTokenizerTestCase { @@ -405,8 +405,6 @@ public function testNamespaceOperatorInTypes() */ public function testKeywordReturnTypes($testMarker) { - $tokens = $this->phpcsFile->getTokens(); - $token = $this->getTargetToken($testMarker, T_FN); $this->backfillHelper($token); $this->scopePositionTestHelper($token, 11, 14); diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillMatchTokenTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillMatchTokenTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillMatchTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillMatchTokenTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.php index 42076c04..ca6d27b3 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillMatchTokenTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillMatchTokenTest.php @@ -8,9 +8,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class BackfillMatchTokenTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillNumericSeparatorTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillNumericSeparatorTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillNumericSeparatorTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillNumericSeparatorTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillNumericSeparatorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillNumericSeparatorTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillNumericSeparatorTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillNumericSeparatorTest.php index 53146730..92bc59bc 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillNumericSeparatorTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillNumericSeparatorTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class BackfillNumericSeparatorTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillReadonlyTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillReadonlyTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillReadonlyTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillReadonlyTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillReadonlyTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillReadonlyTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillReadonlyTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillReadonlyTest.php index 7756afaf..89dc3e19 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BackfillReadonlyTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BackfillReadonlyTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class BackfillReadonlyTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BitwiseOrTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BitwiseOrTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BitwiseOrTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BitwiseOrTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BitwiseOrTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BitwiseOrTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BitwiseOrTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BitwiseOrTest.php index 0648d613..3c9fa50a 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/BitwiseOrTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/BitwiseOrTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class BitwiseOrTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ContextSensitiveKeywordsTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ContextSensitiveKeywordsTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ContextSensitiveKeywordsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ContextSensitiveKeywordsTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.php index 57eb3495..103e5ec9 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ContextSensitiveKeywordsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ContextSensitiveKeywordsTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class ContextSensitiveKeywordsTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError1Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError1Test.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError1Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.php similarity index 95% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError1Test.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.php index fe1761c8..9ceefc4a 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError1Test.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError1Test.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class DNFTypesParseError1Test extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError2Test.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError2Test.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError2Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError2Test.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.php index b0a62cf4..163215e4 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesParseError2Test.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesParseError2Test.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class DNFTypesParseError2Test extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesTest.inc similarity index 90% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesTest.inc index f509c4f3..5043ab7d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesTest.inc +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesTest.inc @@ -53,6 +53,35 @@ callMe(label: CONST_A | CONST_B); /* testParensNoOwnerFunctionCallWithDNFLookALikeNamedParamIntersect */ callMe(label: CONST_A & CONST_B); +/* testSwitchControlStructureCondition */ +switch (CONST_A | CONST_B) { + /* testFunctionCallInSwitchCaseCondition */ + case get_bool(): + /* testFunctionCallInSwitchCaseBody */ + \Name\functionInSwitch(); + break; + + default: + /* testFunctionCallInSwitchDefaultBody */ + functionInSwitch(); + break; +} + +/* testIfAlternativeSyntaxCondition */ +if (true): + /* testFunctionCallInIfBody */ + \B\call(); +/* testElseIfAlternativeSyntaxCondition */ +elseif (10): + /* testFunctionCallInElseIfBody */ + C\call(); +endif; + +gotolabel: + /* testFunctionCallInGotoBody */ + \doSomething(); + + /* * DNF parentheses. */ @@ -165,6 +194,8 @@ $closureWithParamType = function ( /* testDNFTypeClosureParamIllegalNullable */ /* testParensOwnerClosureAmpersandInDefaultValue */ $closureWithReturnType = function ($string = NONSENSE & FAKE) /* testDNFTypeClosureReturn */ : (\Package\MyA&PackageB)|null {}; +$closureWithUseAndReturnType = function ($foo) use ($a) /* testDNFTypeClosureWithUseReturn */ : null|(Foo&\Bar)|false {}; + /* testParensOwnerArrowDNFUsedWithin */ $arrowWithParamType = fn ( /* testDNFTypeArrowParam */ diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesTest.php similarity index 92% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesTest.php index 9d7e395b..75e1b1db 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DNFTypesTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DNFTypesTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class DNFTypesTest extends AbstractTokenizerTestCase @@ -193,6 +193,33 @@ public static function dataNormalParentheses() 'parens without owner in arrow function return expression' => [ 'testMarker' => '/* testParensNoOwnerInArrowReturnExpression */', ], + 'parens with owner: switch condition' => [ + 'testMarker' => '/* testSwitchControlStructureCondition */', + ], + 'parens without owner in switch-case condition' => [ + 'testMarker' => '/* testFunctionCallInSwitchCaseCondition */', + ], + 'parens without owner in switch-case body' => [ + 'testMarker' => '/* testFunctionCallInSwitchCaseBody */', + ], + 'parens without owner in switch-default body' => [ + 'testMarker' => '/* testFunctionCallInSwitchDefaultBody */', + ], + 'parens with owner: if condition, alternative syntax' => [ + 'testMarker' => '/* testIfAlternativeSyntaxCondition */', + ], + 'parens without owner in if body, alternative syntax' => [ + 'testMarker' => '/* testFunctionCallInIfBody */', + ], + 'parens with owner: elseif condition, alternative syntax' => [ + 'testMarker' => '/* testElseIfAlternativeSyntaxCondition */', + ], + 'parens without owner in elseif body, alternative syntax' => [ + 'testMarker' => '/* testFunctionCallInElseIfBody */', + ], + 'parens without owner in goto body' => [ + 'testMarker' => '/* testFunctionCallInGotoBody */', + ], ]; }//end dataNormalParentheses() @@ -423,6 +450,10 @@ public static function dataDNFTypeParentheses() 'closure return type' => [ 'testMarker' => '/* testDNFTypeClosureReturn */', ], + 'closure with use return type' => [ + 'testMarker' => '/* testDNFTypeClosureWithUseReturn */', + ], + 'arrow function param type' => [ 'testMarker' => '/* testDNFTypeArrowParam */', ], diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DefaultKeywordTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DefaultKeywordTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DefaultKeywordTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DefaultKeywordTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DefaultKeywordTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DefaultKeywordTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DefaultKeywordTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DefaultKeywordTest.php index c32d3375..c398aa6c 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DefaultKeywordTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DefaultKeywordTest.php @@ -8,9 +8,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class DefaultKeywordTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleArrowTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleArrowTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleArrowTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleArrowTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleArrowTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleArrowTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleArrowTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleArrowTest.php index 2d050d25..5258d9c1 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleArrowTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleArrowTest.php @@ -9,9 +9,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class DoubleArrowTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleQuotedStringTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleQuotedStringTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleQuotedStringTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleQuotedStringTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleQuotedStringTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleQuotedStringTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleQuotedStringTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleQuotedStringTest.php index 6fb3643f..aa0817a4 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/DoubleQuotedStringTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/DoubleQuotedStringTest.php @@ -8,9 +8,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class DoubleQuotedStringTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/EnumCaseTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/EnumCaseTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/EnumCaseTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/EnumCaseTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/EnumCaseTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/EnumCaseTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/EnumCaseTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/EnumCaseTest.php index f80e19dc..6836ea05 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/EnumCaseTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/EnumCaseTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class EnumCaseTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/FinallyTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/FinallyTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/FinallyTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/FinallyTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/FinallyTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/FinallyTest.php similarity index 96% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/FinallyTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/FinallyTest.php index d74c781a..e73dde12 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/FinallyTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/FinallyTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class FinallyTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/GotoLabelTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/GotoLabelTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/GotoLabelTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/GotoLabelTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/GotoLabelTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/GotoLabelTest.php similarity index 97% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/GotoLabelTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/GotoLabelTest.php index 8e6a5f5c..1b742201 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/GotoLabelTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/GotoLabelTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class GotoLabelTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocNowdocTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocNowdocTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocNowdocTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocNowdocTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocNowdocTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocNowdocTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocNowdocTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocNowdocTest.php index 4c56b698..0de122e7 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocNowdocTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocNowdocTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocParseErrorTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocParseErrorTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocParseErrorTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocParseErrorTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocParseErrorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocParseErrorTest.php similarity index 90% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocParseErrorTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocParseErrorTest.php index 7cca49aa..877706fb 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocParseErrorTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocParseErrorTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; /** * Tests the tokenization for an unclosed heredoc construct. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocStringTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocStringTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocStringTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocStringTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocStringTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocStringTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocStringTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocStringTest.php index 75f64d47..c31c1753 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/HeredocStringTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/HeredocStringTest.php @@ -8,9 +8,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class HeredocStringTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NamedFunctionCallArgumentsTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NamedFunctionCallArgumentsTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NamedFunctionCallArgumentsTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NamedFunctionCallArgumentsTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NamedFunctionCallArgumentsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NamedFunctionCallArgumentsTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NamedFunctionCallArgumentsTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NamedFunctionCallArgumentsTest.php index 14d0c6da..df124e91 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NamedFunctionCallArgumentsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NamedFunctionCallArgumentsTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class NamedFunctionCallArgumentsTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NullsafeObjectOperatorTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NullsafeObjectOperatorTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NullsafeObjectOperatorTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NullsafeObjectOperatorTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NullsafeObjectOperatorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NullsafeObjectOperatorTest.php similarity index 97% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NullsafeObjectOperatorTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NullsafeObjectOperatorTest.php index 95bfc154..368fee4d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/NullsafeObjectOperatorTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/NullsafeObjectOperatorTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class NullsafeObjectOperatorTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/OtherContextSensitiveKeywordsTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/OtherContextSensitiveKeywordsTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/OtherContextSensitiveKeywordsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/OtherContextSensitiveKeywordsTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.php index 3eff0e96..872fab0d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/OtherContextSensitiveKeywordsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/OtherContextSensitiveKeywordsTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; /** * Tests the conversion of PHPCS native context sensitive keyword tokens to T_STRING. diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ResolveSimpleTokenTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ResolveSimpleTokenTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ResolveSimpleTokenTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ResolveSimpleTokenTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ResolveSimpleTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ResolveSimpleTokenTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ResolveSimpleTokenTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ResolveSimpleTokenTest.php index 4045f775..06a130c2 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ResolveSimpleTokenTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ResolveSimpleTokenTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ShortArrayTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ShortArrayTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ShortArrayTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ShortArrayTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ShortArrayTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ShortArrayTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ShortArrayTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ShortArrayTest.php index 06e76621..da9c7c10 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/ShortArrayTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/ShortArrayTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class ShortArrayTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceTest.php index ec287745..ad7d9ceb 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceTest.php @@ -13,9 +13,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class StableCommentWhitespaceTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceWinTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceWinTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceWinTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceWinTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceWinTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceWinTest.php similarity index 96% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceWinTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceWinTest.php index f7f4ba22..875b666d 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/StableCommentWhitespaceWinTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/StableCommentWhitespaceWinTest.php @@ -10,9 +10,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class StableCommentWhitespaceWinTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypeIntersectionTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypeIntersectionTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypeIntersectionTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypeIntersectionTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypeIntersectionTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypeIntersectionTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypeIntersectionTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypeIntersectionTest.php index 99c96edc..8ed951de 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypeIntersectionTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypeIntersectionTest.php @@ -8,9 +8,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class TypeIntersectionTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypedConstantsTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypedConstantsTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypedConstantsTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypedConstantsTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypedConstantsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypedConstantsTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypedConstantsTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypedConstantsTest.php index 60c21b9d..29a1fc7a 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/TypedConstantsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/TypedConstantsTest.php @@ -12,9 +12,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class TypedConstantsTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/UndoNamespacedNameSingleTokenTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/UndoNamespacedNameSingleTokenTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/UndoNamespacedNameSingleTokenTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/UndoNamespacedNameSingleTokenTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/UndoNamespacedNameSingleTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/UndoNamespacedNameSingleTokenTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/UndoNamespacedNameSingleTokenTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/UndoNamespacedNameSingleTokenTest.php index 6decc164..18a88fe8 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/PHP/UndoNamespacedNameSingleTokenTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/UndoNamespacedNameSingleTokenTest.php @@ -17,9 +17,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\PHP; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; use PHP_CodeSniffer\Util\Tokens; final class UndoNamespacedNameSingleTokenTest extends AbstractTokenizerTestCase diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/YieldTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/YieldTest.inc new file mode 100644 index 00000000..3130b846 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/YieldTest.inc @@ -0,0 +1,77 @@ +yield; + + /* testYieldUsedAsPropertyName2 */ + echo $obj?->yield(); + + /* testYieldUsedForClassConstantAccess1 */ + echo MyClass::YIELD; + /* testFromUsedForClassConstantAccess1 */ + echo MyClass::FROM; + } + + /* testYieldUsedAsMethodNameReturnByRef */ + public function &yield() {} +} + +function myGen() { + /* testYieldLiveCoding */ + yield diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/YieldTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/YieldTest.php new file mode 100644 index 00000000..efb12096 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/PHP/YieldTest.php @@ -0,0 +1,448 @@ + + * @copyright 2021 Squiz Pty Ltd (ABN 77 084 670 600) + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\PHP; + +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Util\Tokens; + +/** + * Tests the tokenization of the `yield` and `yield from` keywords. + * + * @covers PHP_CodeSniffer\Tokenizers\PHP::tokenize + */ +final class YieldTest extends AbstractTokenizerTestCase +{ + + + /** + * Test that the yield keyword is tokenized as such. + * + * @param string $testMarker The comment which prefaces the target token in the test file. + * @param string $expectedContent Expected token content. + * + * @dataProvider dataYieldKeyword + * + * @return void + */ + public function testYieldKeyword($testMarker, $expectedContent) + { + $tokens = $this->phpcsFile->getTokens(); + $target = $this->getTargetToken($testMarker, [T_YIELD, T_YIELD_FROM, T_STRING]); + $tokenArray = $tokens[$target]; + + $this->assertSame(T_YIELD, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_YIELD (code)'); + + // This assertion would fail on PHP 5.4 with PHPUnit 4 as PHPUnit polyfills the `T_YIELD` token too, but + // with a different value, which causes the token 'type' to be set to `UNKNOWN`. + // This issue _only_ occurs when running the tests, not when running PHPCS outside of a test situation. + // The PHPUnit polyfilled token is declared in the PHP_CodeCoverage_Report_HTML_Renderer_File class + // in vendor/phpunit/php-code-coverage/src/CodeCoverage/Report/HTML/Renderer/File.php. + if (PHP_VERSION_ID >= 50500) { + $this->assertSame('T_YIELD', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_YIELD (type)'); + } + + $this->assertSame($expectedContent, $tokenArray['content'], 'Token content does not match expectation'); + + }//end testYieldKeyword() + + + /** + * Data provider. + * + * @see testYieldKeyword() + * + * @return array> + */ + public static function dataYieldKeyword() + { + return [ + 'yield' => [ + 'testMarker' => '/* testYield */', + 'expectedContent' => 'yield', + ], + 'yield followed by comment' => [ + 'testMarker' => '/* testYieldFollowedByComment */', + 'expectedContent' => 'YIELD', + ], + 'yield at end of file, live coding' => [ + 'testMarker' => '/* testYieldLiveCoding */', + 'expectedContent' => 'yield', + ], + ]; + + }//end dataYieldKeyword() + + + /** + * Test that the yield from keyword is tokenized as a single token when it in on a single line + * and only has whitespace between the words. + * + * @param string $testMarker The comment which prefaces the target token in the test file. + * @param string $expectedContent Expected token content. + * + * @dataProvider dataYieldFromKeywordSingleToken + * + * @return void + */ + public function testYieldFromKeywordSingleToken($testMarker, $expectedContent) + { + $tokens = $this->phpcsFile->getTokens(); + $target = $this->getTargetToken($testMarker, [T_YIELD, T_YIELD_FROM, T_STRING]); + $tokenArray = $tokens[$target]; + + $this->assertSame(T_YIELD_FROM, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_YIELD_FROM (code)'); + $this->assertSame('T_YIELD_FROM', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_YIELD_FROM (type)'); + + if (isset($tokenArray['orig_content']) === true) { + $this->assertSame($expectedContent, $tokenArray['orig_content'], 'Token (orig) content does not match expectation'); + } else { + $this->assertSame($expectedContent, $tokenArray['content'], 'Token content does not match expectation'); + } + + }//end testYieldFromKeywordSingleToken() + + + /** + * Data provider. + * + * @see testYieldFromKeywordSingleToken() + * + * @return array> + */ + public static function dataYieldFromKeywordSingleToken() + { + return [ + 'yield from' => [ + 'testMarker' => '/* testYieldFrom */', + 'expectedContent' => 'yield from', + ], + 'yield from with extra space between' => [ + 'testMarker' => '/* testYieldFromWithExtraSpacesBetween */', + 'expectedContent' => 'Yield From', + ], + 'yield from with tab between' => [ + 'testMarker' => '/* testYieldFromWithTabBetween */', + 'expectedContent' => 'yield from', + ], + ]; + + }//end dataYieldFromKeywordSingleToken() + + + /** + * Test that the yield from keyword is tokenized as a single token when it in on a single line + * and only has whitespace between the words. + * + * @param string $testMarker The comment which prefaces the target token in the test file. + * @param array> $expectedTokens The tokenization expected. + * + * @dataProvider dataYieldFromKeywordMultiToken + * + * @return void + */ + public function testYieldFromKeywordMultiToken($testMarker, $expectedTokens) + { + $tokens = $this->phpcsFile->getTokens(); + $target = $this->getTargetToken($testMarker, [T_YIELD, T_YIELD_FROM, T_STRING]); + + foreach ($expectedTokens as $nr => $tokenInfo) { + $this->assertSame( + constant($tokenInfo['type']), + $tokens[$target]['code'], + 'Token tokenized as '.Tokens::tokenName($tokens[$target]['code']).', not '.$tokenInfo['type'].' (code)' + ); + $this->assertSame( + $tokenInfo['type'], + $tokens[$target]['type'], + 'Token tokenized as '.$tokens[$target]['type'].', not '.$tokenInfo['type'].' (type)' + ); + $this->assertSame( + $tokenInfo['content'], + $tokens[$target]['content'], + 'Content of token '.($nr + 1).' ('.$tokens[$target]['type'].') does not match expectations' + ); + + ++$target; + } + + }//end testYieldFromKeywordMultiToken() + + + /** + * Data provider. + * + * @see testYieldFromKeywordMultiToken() + * + * @return array>>> + */ + public static function dataYieldFromKeywordMultiToken() + { + return [ + 'yield from with new line' => [ + 'testMarker' => '/* testYieldFromSplitByNewLines */', + 'expectedTokens' => [ + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'yield', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'FROM', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' +', + ], + ], + ], + 'yield from with comment' => [ + 'testMarker' => '/* testYieldFromSplitByComment */', + 'expectedTokens' => [ + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'yield', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_COMMENT', + 'content' => '/* comment */', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'from', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + ], + ], + 'yield from with trailing comment' => [ + 'testMarker' => '/* testYieldFromWithTrailingComment */', + 'expectedTokens' => [ + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'yield', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_COMMENT', + 'content' => '// comment +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'from', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + ], + ], + 'yield from with trailing annotation' => [ + 'testMarker' => '/* testYieldFromWithTrailingAnnotation */', + 'expectedTokens' => [ + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'yield', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_PHPCS_IGNORE', + 'content' => '// phpcs:ignore Stnd.Cat.Sniff -- for reasons. +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'from', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + ], + ], + 'yield from with new line and comment' => [ + 'testMarker' => '/* testYieldFromSplitByNewLineAndComments */', + 'expectedTokens' => [ + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'yield', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_COMMENT', + 'content' => '/* comment line 1 +', + ], + [ + 'type' => 'T_COMMENT', + 'content' => ' line 2 */', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_COMMENT', + 'content' => '// another comment +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'from', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' +', + ], + ], + ], + 'yield from with new line and annotation' => [ + 'testMarker' => '/* testYieldFromSplitByNewLineAndAnnotation */', + 'expectedTokens' => [ + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'YIELD', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_PHPCS_DISABLE', + 'content' => '// @phpcs:disable Stnd.Cat.Sniff -- for reasons. +', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' ', + ], + [ + 'type' => 'T_YIELD_FROM', + 'content' => 'From', + ], + [ + 'type' => 'T_WHITESPACE', + 'content' => ' +', + ], + ], + ], + ]; + + }//end dataYieldFromKeywordMultiToken() + + + /** + * Test that 'yield' or 'from' when not used as the reserved keyword are tokenized as `T_STRING`. + * + * @param string $testMarker The comment which prefaces the target token in the test file. + * + * @dataProvider dataYieldNonKeyword + * + * @return void + */ + public function testYieldNonKeyword($testMarker) + { + $tokens = $this->phpcsFile->getTokens(); + $target = $this->getTargetToken($testMarker, [T_YIELD, T_YIELD_FROM, T_STRING]); + $tokenArray = $tokens[$target]; + + $this->assertSame(T_STRING, $tokenArray['code'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (code)'); + $this->assertSame('T_STRING', $tokenArray['type'], 'Token tokenized as '.$tokenArray['type'].', not T_STRING (type)'); + + }//end testYieldNonKeyword() + + + /** + * Data provider. + * + * @see testYieldNonKeyword() + * + * @return array> + */ + public static function dataYieldNonKeyword() + { + return [ + 'yield used as class name' => ['/* testYieldUsedAsClassName */'], + 'yield used as class constant name' => ['/* testYieldUsedAsClassConstantName */'], + 'yield used as method name' => ['/* testYieldUsedAsMethodName */'], + 'yield used as property access 1' => ['/* testYieldUsedAsPropertyName1 */'], + 'yield used as property access 2' => ['/* testYieldUsedAsPropertyName2 */'], + 'yield used as class constant access' => ['/* testYieldUsedForClassConstantAccess1 */'], + 'from used as class constant access' => ['/* testFromUsedForClassConstantAccess1 */'], + 'yield used as method name with ref' => ['/* testYieldUsedAsMethodNameReturnByRef */'], + ]; + + }//end dataYieldNonKeyword() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php index 7198690d..91d10ac3 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateParenthesisNestingMapDNFTypesTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class CreateParenthesisNestingMapDNFTypesTest extends AbstractTokenizerTestCase { @@ -218,7 +218,6 @@ public function testDNFTypeParentheses($testMarker) $this->assertArrayHasKey('parenthesis_closer', $closer, 'Parenthesis closer is not set'); $this->assertSame($closePtr, $closer['parenthesis_closer'], 'Parenthesis closer is not the expected token'); - $intersectionCount = 0; for ($i = ($openPtr + 1); $i < $closePtr; $i++) { $this->assertArrayHasKey('nested_parenthesis', $tokens[$i], "Nested parenthesis key not set on token $i ({$tokens[$i]['type']})"); $this->assertArrayHasKey($openPtr, $tokens[$i]['nested_parenthesis'], 'Nested parenthesis is missing target parentheses set'); diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocCloserTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocCloserTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocCloserTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocCloserTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocCloserTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocCloserTest.php similarity index 93% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocCloserTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocCloserTest.php index a2357db8..fb9f0493 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocCloserTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocCloserTest.php @@ -7,16 +7,18 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; /** * Heredoc/nowdoc closer token test. * * @requires PHP 7.3 + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap */ -final class HeredocNowdocCloserTest extends AbstractTokenizerTestCase +final class CreatePositionMapHeredocNowdocCloserTest extends AbstractTokenizerTestCase { @@ -27,7 +29,6 @@ final class HeredocNowdocCloserTest extends AbstractTokenizerTestCase * @param array $expected Expectations for the token array. * * @dataProvider dataHeredocNowdocCloserTabReplacement - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap * * @return void */ diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocOpenerTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocOpenerTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocOpenerTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocOpenerTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocOpenerTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocOpenerTest.php similarity index 93% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocOpenerTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocOpenerTest.php index 49f1dab6..2da56703 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/HeredocNowdocOpenerTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapHeredocNowdocOpenerTest.php @@ -7,14 +7,16 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; /** * Heredoc/nowdoc opener token test. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap */ -final class HeredocNowdocOpenerTest extends AbstractTokenizerTestCase +final class CreatePositionMapHeredocNowdocOpenerTest extends AbstractTokenizerTestCase { @@ -25,7 +27,6 @@ final class HeredocNowdocOpenerTest extends AbstractTokenizerTestCase * @param array $expected Expectations for the token array. * * @dataProvider dataHeredocNowdocOpenerTabReplacement - * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap * * @return void */ diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapTabWidth0Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapTabWidth0Test.php new file mode 100644 index 00000000..fd47bf7d --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapTabWidth0Test.php @@ -0,0 +1,107 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; + +/** + * Tab replacement test using tab width 0, means no tab replacement will take place. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap + */ +final class CreatePositionMapTabWidth0Test extends ReplaceTabsInTokenTestCase +{ + + /** + * The tab width setting to use when tokenizing the file. + * + * @var integer + */ + protected $tabWidth = 0; + + + /** + * Data provider helper. + * + * @see ReplaceTabsInTokenTestCase::dataTabReplacement() + * + * @return array> + */ + public static function getTabReplacementExpected() + { + return [ + 'Tab indentation' => [ + 'length' => 2, + 'content' => ' ', + 'orig_content' => null, + ], + 'Mixed tab/space indentation' => [ + 'length' => 3, + 'content' => ' ', + 'orig_content' => null, + ], + 'Inline: single tab in text string' => [ + 'length' => 15, + 'content' => "'tab separated'", + 'orig_content' => null, + ], + 'Inline: single tab between each word in text string' => [ + 'length' => 24, + 'content' => '"tab $between each word"', + 'orig_content' => null, + ], + 'Inline: multiple tabs in heredoc' => [ + 'length' => 15, + 'content' => 'tab separated +', + 'orig_content' => null, + ], + 'Inline: multiple tabs between each word in nowdoc' => [ + 'length' => 27, + 'content' => 'tab between each word +', + 'orig_content' => null, + ], + 'Inline: mixed spaces/tabs in text string' => [ + 'length' => 20, + 'content' => "'tab separated'", + 'orig_content' => null, + ], + 'Inline: mixed spaces/tabs between each word in text string' => [ + 'length' => 31, + 'content' => '"tab $between each word"', + 'orig_content' => null, + ], + 'Inline: tab becomes single space in comment (with tabwidth 4)' => [ + 'length' => 50, + 'content' => '// -123 With tabwidth 4, the tab size should be 1. +', + 'orig_content' => null, + ], + 'Inline: tab becomes 2 spaces in comment (with tabwidth 4)' => [ + 'length' => 52, + 'content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + 'orig_content' => null, + ], + 'Inline: tab becomes 3 spaces in doc comment string (with tabwidth 4)' => [ + 'length' => 45, + 'content' => '-1 With tabwidth 4, the tab size should be 3.', + 'orig_content' => null, + ], + 'Inline: tab becomes 4 spaces in comment (with tabwidth 4)' => [ + 'length' => 47, + 'content' => '// - With tabwidth 4, the tab size should be 4. +', + 'orig_content' => null, + ], + ]; + + }//end getTabReplacementExpected() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapYieldFromTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapYieldFromTest.inc new file mode 100644 index 00000000..59365dd5 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreatePositionMapYieldFromTest.inc @@ -0,0 +1,15 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; + +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; + +/** + * Yield from token test. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::createPositionMap + */ +final class CreatePositionMapYieldFromTest extends AbstractTokenizerTestCase +{ + + + /** + * Verify that spaces/tabs in "yield from" tokens get the tab replacement treatment. + * + * @param string $testMarker The comment prefacing the target token. + * @param array $expected Expectations for the token array. + * @param string $content Optional. The test token content to search for. + * Defaults to null. + * + * @dataProvider dataYieldFromTabReplacement + * + * @return void + */ + public function testYieldFromTabReplacement($testMarker, $expected, $content=null) + { + $tokens = $this->phpcsFile->getTokens(); + $target = $this->getTargetToken($testMarker, [T_YIELD_FROM], $content); + + foreach ($expected as $key => $value) { + if ($key === 'orig_content' && $value === null) { + $this->assertArrayNotHasKey($key, $tokens[$target], "Unexpected 'orig_content' key found in the token array."); + continue; + } + + $this->assertArrayHasKey($key, $tokens[$target], "Key $key not found in the token array."); + $this->assertSame($value, $tokens[$target][$key], "Value for key $key does not match expectation."); + } + + }//end testYieldFromTabReplacement() + + + /** + * Data provider. + * + * @see testYieldFromTabReplacement() + * + * @return array>> + */ + public static function dataYieldFromTabReplacement() + { + return [ + 'Yield from, single line, single space' => [ + 'testMarker' => '/* testYieldFromHasSingleSpace */', + 'expected' => [ + 'length' => 10, + 'content' => 'yield from', + 'orig_content' => null, + ], + ], + 'Yield from, single line, multiple spaces' => [ + 'testMarker' => '/* testYieldFromHasMultiSpace */', + 'expected' => [ + 'length' => 14, + 'content' => 'yield from', + 'orig_content' => null, + ], + ], + 'Yield from, single line, has tabs' => [ + 'testMarker' => '/* testYieldFromHasTabs */', + 'expected' => [ + 'length' => 16, + 'content' => 'yield from', + 'orig_content' => 'yield from', + ], + ], + 'Yield from, single line, mix of tabs and spaces' => [ + 'testMarker' => '/* testYieldFromMixedTabsSpaces */', + 'expected' => [ + 'length' => 20, + 'content' => 'Yield From', + 'orig_content' => 'Yield From', + ], + ], + ]; + + }//end dataYieldFromTabReplacement() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateTokenMapArrayParenthesesTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateTokenMapArrayParenthesesTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateTokenMapArrayParenthesesTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateTokenMapArrayParenthesesTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateTokenMapArrayParenthesesTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateTokenMapArrayParenthesesTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateTokenMapArrayParenthesesTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateTokenMapArrayParenthesesTest.php index e362448c..4b7ac382 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/CreateTokenMapArrayParenthesesTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/CreateTokenMapArrayParenthesesTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class CreateTokenMapArrayParenthesesTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php similarity index 98% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php index 042ee609..7fa4ba55 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapCaseKeywordConditionsTest.php @@ -7,9 +7,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class RecurseScopeMapCaseKeywordConditionsTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php similarity index 99% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php index fb3a76af..064ce8f4 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapDefaultKeywordConditionsTest.php @@ -8,9 +8,9 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; final class RecurseScopeMapDefaultKeywordConditionsTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapWithNamespaceOperatorTest.inc similarity index 100% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/ScopeSettingWithNamespaceOperatorTest.inc rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapWithNamespaceOperatorTest.inc diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapWithNamespaceOperatorTest.php similarity index 95% rename from vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php rename to vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapWithNamespaceOperatorTest.php index dba98cdb..8ed593bf 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/Tokenizer/ScopeSettingWithNamespaceOperatorTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/RecurseScopeMapWithNamespaceOperatorTest.php @@ -7,11 +7,11 @@ * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ -namespace PHP_CodeSniffer\Tests\Core\Tokenizer\Tokenizer; +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; -use PHP_CodeSniffer\Tests\Core\Tokenizer\AbstractTokenizerTestCase; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; -final class ScopeSettingWithNamespaceOperatorTest extends AbstractTokenizerTestCase +final class RecurseScopeMapWithNamespaceOperatorTest extends AbstractTokenizerTestCase { diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenMiscTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenMiscTest.php new file mode 100644 index 00000000..f4bd711a --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenMiscTest.php @@ -0,0 +1,124 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; + +use PHP_CodeSniffer\Files\DummyFile; +use PHP_CodeSniffer\Ruleset; +use PHP_CodeSniffer\Tests\ConfigDouble; +use PHPUnit\Framework\TestCase; + +/** + * Miscellaneous tests for tab replacement. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::replaceTabsInToken + */ +final class ReplaceTabsInTokenMiscTest extends TestCase +{ + + + /** + * Test that when no tab width is set or passed, the tab width will be set to 1. + * + * @return void + */ + public function testTabWidthNotSet() + { + $config = new ConfigDouble(); + $ruleset = new Ruleset($config); + + $content = <<parse(); + + $tokens = $phpcsFile->getTokens(); + $target = $phpcsFile->findNext(T_WHITESPACE, 0); + + // Verify initial state. + $this->assertTrue(is_int($target), 'Target token was not found'); + $this->assertSame(' ', $tokens[$target]['content'], 'Content after initial parsing does not contain tabs'); + $this->assertSame(2, $tokens[$target]['length'], 'Length after initial parsing is not as expected'); + $this->assertArrayNotHasKey('orig_content', $tokens[$target], "Key 'orig_content' found in the initial token array."); + + $phpcsFile->tokenizer->replaceTabsInToken($tokens[$target]); + + // Verify tab replacement. + $this->assertSame(' ', $tokens[$target]['content'], 'Content after tab replacement is not as expected'); + $this->assertSame(2, $tokens[$target]['length'], 'Length after tab replacement is not as expected'); + $this->assertArrayHasKey('orig_content', $tokens[$target], "Key 'orig_content' not found in the token array."); + + }//end testTabWidthNotSet() + + + /** + * Test that the length calculation handles text in non-ascii encodings correctly. + * + * @requires extension iconv + * + * @return void + */ + public function testLengthSettingRespectsEncoding() + { + $config = new ConfigDouble(); + $config->tabWidth = 4; + $ruleset = new Ruleset($config); + + $content = <<parse(); + + $tokens = $phpcsFile->getTokens(); + $target = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, 0); + + $this->assertTrue(is_int($target), 'Target token was not found'); + $this->assertSame("'пасха пасха'", $tokens[$target]['content'], 'Content is not as expected'); + $this->assertSame(17, $tokens[$target]['length'], 'Length is not as expected'); + $this->assertArrayHasKey('orig_content', $tokens[$target], "Key 'orig_content' not found in the token array."); + $this->assertSame("'пасха пасха'", $tokens[$target]['orig_content'], 'Orig_content is not as expected'); + + }//end testLengthSettingRespectsEncoding() + + + /** + * Test that the length calculation falls back to byte length if iconv detects an illegal character. + * + * @requires extension iconv + * + * @return void + */ + public function testLengthSettingFallsBackToBytesWhenTextContainsIllegalChars() + { + $config = new ConfigDouble(); + $config->tabWidth = 4; + $ruleset = new Ruleset($config); + + $content = <<parse(); + + $tokens = $phpcsFile->getTokens(); + $target = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, 0); + + $this->assertTrue(is_int($target), 'Target token was not found'); + $this->assertSame(11, $tokens[$target]['length'], 'Length is not as expected'); + $this->assertArrayHasKey('orig_content', $tokens[$target], "Key 'orig_content' not found in the token array."); + + }//end testLengthSettingFallsBackToBytesWhenTextContainsIllegalChars() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth1Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth1Test.php new file mode 100644 index 00000000..29621534 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth1Test.php @@ -0,0 +1,111 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; + +/** + * Tab replacement test using tab width 1. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::replaceTabsInToken + */ +final class ReplaceTabsInTokenTabWidth1Test extends ReplaceTabsInTokenTestCase +{ + + /** + * The tab width setting to use when tokenizing the file. + * + * @var integer + */ + protected $tabWidth = 1; + + + /** + * Data provider helper. + * + * @see ReplaceTabsInTokenTestCase::dataTabReplacement() + * + * @return array> + */ + public static function getTabReplacementExpected() + { + return [ + 'Tab indentation' => [ + 'length' => 2, + 'content' => ' ', + 'orig_content' => ' ', + ], + 'Mixed tab/space indentation' => [ + 'length' => 3, + 'content' => ' ', + 'orig_content' => ' ', + ], + 'Inline: single tab in text string' => [ + 'length' => 15, + 'content' => "'tab separated'", + 'orig_content' => "'tab separated'", + ], + 'Inline: single tab between each word in text string' => [ + 'length' => 24, + 'content' => '"tab $between each word"', + 'orig_content' => '"tab $between each word"', + ], + 'Inline: multiple tabs in heredoc' => [ + 'length' => 15, + 'content' => 'tab separated +', + 'orig_content' => 'tab separated +', + ], + 'Inline: multiple tabs between each word in nowdoc' => [ + 'length' => 27, + 'content' => 'tab between each word +', + 'orig_content' => 'tab between each word +', + ], + 'Inline: mixed spaces/tabs in text string' => [ + 'length' => 20, + 'content' => "'tab separated'", + 'orig_content' => "'tab separated'", + ], + 'Inline: mixed spaces/tabs between each word in text string' => [ + 'length' => 31, + 'content' => '"tab $between each word"', + 'orig_content' => '"tab $between each word"', + ], + 'Inline: tab becomes single space in comment (with tabwidth 4)' => [ + 'length' => 50, + 'content' => '// -123 With tabwidth 4, the tab size should be 1. +', + 'orig_content' => '// -123 With tabwidth 4, the tab size should be 1. +', + ], + 'Inline: tab becomes 2 spaces in comment (with tabwidth 4)' => [ + 'length' => 52, + 'content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + 'orig_content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + ], + 'Inline: tab becomes 3 spaces in doc comment string (with tabwidth 4)' => [ + 'length' => 45, + 'content' => '-1 With tabwidth 4, the tab size should be 3.', + 'orig_content' => '-1 With tabwidth 4, the tab size should be 3.', + ], + 'Inline: tab becomes 4 spaces in comment (with tabwidth 4)' => [ + 'length' => 47, + 'content' => '// - With tabwidth 4, the tab size should be 4. +', + 'orig_content' => '// - With tabwidth 4, the tab size should be 4. +', + ], + ]; + + }//end getTabReplacementExpected() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth2Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth2Test.php new file mode 100644 index 00000000..92de221d --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth2Test.php @@ -0,0 +1,111 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; + +/** + * Tab replacement test using tab width 2. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::replaceTabsInToken + */ +final class ReplaceTabsInTokenTabWidth2Test extends ReplaceTabsInTokenTestCase +{ + + /** + * The tab width setting to use when tokenizing the file. + * + * @var integer + */ + protected $tabWidth = 2; + + + /** + * Data provider helper. + * + * @see ReplaceTabsInTokenTestCase::dataTabReplacement() + * + * @return array> + */ + public static function getTabReplacementExpected() + { + return [ + 'Tab indentation' => [ + 'length' => 4, + 'content' => ' ', + 'orig_content' => ' ', + ], + 'Mixed tab/space indentation' => [ + 'length' => 4, + 'content' => ' ', + 'orig_content' => ' ', + ], + 'Inline: single tab in text string' => [ + 'length' => 15, + 'content' => "'tab separated'", + 'orig_content' => "'tab separated'", + ], + 'Inline: single tab between each word in text string' => [ + 'length' => 26, + 'content' => '"tab $between each word"', + 'orig_content' => '"tab $between each word"', + ], + 'Inline: multiple tabs in heredoc' => [ + 'length' => 17, + 'content' => 'tab separated +', + 'orig_content' => 'tab separated +', + ], + 'Inline: multiple tabs between each word in nowdoc' => [ + 'length' => 34, + 'content' => 'tab between each word +', + 'orig_content' => 'tab between each word +', + ], + 'Inline: mixed spaces/tabs in text string' => [ + 'length' => 23, + 'content' => "'tab separated'", + 'orig_content' => "'tab separated'", + ], + 'Inline: mixed spaces/tabs between each word in text string' => [ + 'length' => 32, + 'content' => '"tab $between each word"', + 'orig_content' => '"tab $between each word"', + ], + 'Inline: tab becomes single space in comment (with tabwidth 4)' => [ + 'length' => 50, + 'content' => '// -123 With tabwidth 4, the tab size should be 1. +', + 'orig_content' => '// -123 With tabwidth 4, the tab size should be 1. +', + ], + 'Inline: tab becomes 2 spaces in comment (with tabwidth 4)' => [ + 'length' => 53, + 'content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + 'orig_content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + ], + 'Inline: tab becomes 3 spaces in doc comment string (with tabwidth 4)' => [ + 'length' => 45, + 'content' => '-1 With tabwidth 4, the tab size should be 3.', + 'orig_content' => '-1 With tabwidth 4, the tab size should be 3.', + ], + 'Inline: tab becomes 4 spaces in comment (with tabwidth 4)' => [ + 'length' => 48, + 'content' => '// - With tabwidth 4, the tab size should be 4. +', + 'orig_content' => '// - With tabwidth 4, the tab size should be 4. +', + ], + ]; + + }//end getTabReplacementExpected() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth4Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth4Test.php new file mode 100644 index 00000000..5f741879 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth4Test.php @@ -0,0 +1,111 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; + +/** + * Tab replacement test using tab width 4. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::replaceTabsInToken + */ +final class ReplaceTabsInTokenTabWidth4Test extends ReplaceTabsInTokenTestCase +{ + + /** + * The tab width setting to use when tokenizing the file. + * + * @var integer + */ + protected $tabWidth = 4; + + + /** + * Data provider helper. + * + * @see ReplaceTabsInTokenTestCase::dataTabReplacement() + * + * @return array> + */ + public static function getTabReplacementExpected() + { + return [ + 'Tab indentation' => [ + 'length' => 8, + 'content' => ' ', + 'orig_content' => ' ', + ], + 'Mixed tab/space indentation' => [ + 'length' => 6, + 'content' => ' ', + 'orig_content' => ' ', + ], + 'Inline: single tab in text string' => [ + 'length' => 17, + 'content' => "'tab separated'", + 'orig_content' => "'tab separated'", + ], + 'Inline: single tab between each word in text string' => [ + 'length' => 32, + 'content' => '"tab $between each word"', + 'orig_content' => '"tab $between each word"', + ], + 'Inline: multiple tabs in heredoc' => [ + 'length' => 21, + 'content' => 'tab separated +', + 'orig_content' => 'tab separated +', + ], + 'Inline: multiple tabs between each word in nowdoc' => [ + 'length' => 48, + 'content' => 'tab between each word +', + 'orig_content' => 'tab between each word +', + ], + 'Inline: mixed spaces/tabs in text string' => [ + 'length' => 25, + 'content' => "'tab separated'", + 'orig_content' => "'tab separated'", + ], + 'Inline: mixed spaces/tabs between each word in text string' => [ + 'length' => 36, + 'content' => '"tab $between each word"', + 'orig_content' => '"tab $between each word"', + ], + 'Inline: tab becomes single space in comment (with tabwidth 4)' => [ + 'length' => 50, + 'content' => '// -123 With tabwidth 4, the tab size should be 1. +', + 'orig_content' => '// -123 With tabwidth 4, the tab size should be 1. +', + ], + 'Inline: tab becomes 2 spaces in comment (with tabwidth 4)' => [ + 'length' => 53, + 'content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + 'orig_content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + ], + 'Inline: tab becomes 3 spaces in doc comment string (with tabwidth 4)' => [ + 'length' => 47, + 'content' => '-1 With tabwidth 4, the tab size should be 3.', + 'orig_content' => '-1 With tabwidth 4, the tab size should be 3.', + ], + 'Inline: tab becomes 4 spaces in comment (with tabwidth 4)' => [ + 'length' => 50, + 'content' => '// - With tabwidth 4, the tab size should be 4. +', + 'orig_content' => '// - With tabwidth 4, the tab size should be 4. +', + ], + ]; + + }//end getTabReplacementExpected() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth5Test.php b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth5Test.php new file mode 100644 index 00000000..361894fb --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTabWidth5Test.php @@ -0,0 +1,111 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; + +/** + * Tab replacement test using tab width 5. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::replaceTabsInToken + */ +final class ReplaceTabsInTokenTabWidth5Test extends ReplaceTabsInTokenTestCase +{ + + /** + * The tab width setting to use when tokenizing the file. + * + * @var integer + */ + protected $tabWidth = 5; + + + /** + * Data provider helper. + * + * @see ReplaceTabsInTokenTestCase::dataTabReplacement() + * + * @return array> + */ + public static function getTabReplacementExpected() + { + return [ + 'Tab indentation' => [ + 'length' => 10, + 'content' => ' ', + 'orig_content' => ' ', + ], + 'Mixed tab/space indentation' => [ + 'length' => 7, + 'content' => ' ', + 'orig_content' => ' ', + ], + 'Inline: single tab in text string' => [ + 'length' => 15, + 'content' => "'tab separated'", + 'orig_content' => "'tab separated'", + ], + 'Inline: single tab between each word in text string' => [ + 'length' => 25, + 'content' => '"tab $between each word"', + 'orig_content' => '"tab $between each word"', + ], + 'Inline: multiple tabs in heredoc' => [ + 'length' => 24, + 'content' => 'tab separated +', + 'orig_content' => 'tab separated +', + ], + 'Inline: multiple tabs between each word in nowdoc' => [ + 'length' => 54, + 'content' => 'tab between each word +', + 'orig_content' => 'tab between each word +', + ], + 'Inline: mixed spaces/tabs in text string' => [ + 'length' => 30, + 'content' => "'tab separated'", + 'orig_content' => "'tab separated'", + ], + 'Inline: mixed spaces/tabs between each word in text string' => [ + 'length' => 35, + 'content' => '"tab $between each word"', + 'orig_content' => '"tab $between each word"', + ], + 'Inline: tab becomes single space in comment (with tabwidth 4)' => [ + 'length' => 52, + 'content' => '// -123 With tabwidth 4, the tab size should be 1. +', + 'orig_content' => '// -123 With tabwidth 4, the tab size should be 1. +', + ], + 'Inline: tab becomes 2 spaces in comment (with tabwidth 4)' => [ + 'length' => 55, + 'content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + 'orig_content' => '/* -12 With tabwidth 4, the tab size should be 2. */', + ], + 'Inline: tab becomes 3 spaces in doc comment string (with tabwidth 4)' => [ + 'length' => 49, + 'content' => '-1 With tabwidth 4, the tab size should be 3.', + 'orig_content' => '-1 With tabwidth 4, the tab size should be 3.', + ], + 'Inline: tab becomes 4 spaces in comment (with tabwidth 4)' => [ + 'length' => 47, + 'content' => '// - With tabwidth 4, the tab size should be 4. +', + 'orig_content' => '// - With tabwidth 4, the tab size should be 4. +', + ], + ]; + + }//end getTabReplacementExpected() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTest.inc b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTest.inc new file mode 100644 index 00000000..e6046500 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizers/Tokenizer/ReplaceTabsInTokenTest.inc @@ -0,0 +1,46 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Tokenizers\Tokenizer; + +use Exception; +use PHP_CodeSniffer\Tests\Core\Tokenizers\AbstractTokenizerTestCase; + +/** + * Tab replacement test case. + * + * @covers PHP_CodeSniffer\Tokenizers\Tokenizer::replaceTabsInToken + */ +abstract class ReplaceTabsInTokenTestCase extends AbstractTokenizerTestCase +{ + + /** + * The name of the test case file used by this test. + * + * @var string + */ + private static $caseFileName; + + + /** + * Make a copy the test case file we want to use for this test (as the file will be used by multiple tests). + * + * @beforeClass + * + * @return void + * + * @throws \Exception In case the base test case file would not be available. + */ + public static function copyCaseFile() + { + $relativeCN = str_replace(__NAMESPACE__.'\\', '', get_called_class()); + self::$caseFileName = __DIR__.DIRECTORY_SEPARATOR.$relativeCN.'.inc'; + + $baseFileName = realpath(__DIR__.'/ReplaceTabsInTokenTest.inc'); + if (is_string($baseFileName) === false) { + throw new Exception('Base test case file "ReplaceTabsInTokenTest.inc" not found'); + } + + if (copy($baseFileName, self::$caseFileName) === false) { + throw new Exception(sprintf('Failed to copy test case file "ReplaceTabsInTokenTest.inc" to %s', self::$caseFileName)); + } + + }//end copyCaseFile() + + + /** + * Delete the copied test case file after use. + * + * @afterClass + * + * @return void + */ + public static function deleteCaseFile() + { + @unlink(self::$caseFileName); + + }//end deleteCaseFile() + + + /** + * Verify that if a token not containing tabs would be passed to the replaceTabsInToken() method, + * yes, the `orig_content` key is added, but no changes are made to the token `content` or `length` values. + * + * @param string $testMarker The comment prefacing the target token. + * @param int|string $testTarget Token code to look for. + * @param array $expected Expectations for the token array. + * @param int $offset Optional. Offset from the target token to get to the _real_ target. + * This is specifically needed to target indentation whitespace. + * + * @dataProvider dataNoReplacementsAreMadeWhenNoTabsAreFound + * + * @return void + */ + public function testNoReplacementsAreMadeWhenNoTabsAreFound($testMarker, $testTarget, $expected, $offset=0) + { + $tokens = $this->phpcsFile->getTokens(); + $target = $this->getTargetToken($testMarker, $testTarget); + $target += $offset; + + foreach ($expected as $key => $value) { + if ($key === 'orig_content' && $value === null) { + $this->assertArrayNotHasKey($key, $tokens[$target], "Unexpected 'orig_content' key found in the token array."); + continue; + } + + $this->assertArrayHasKey($key, $tokens[$target], "Key $key not found in the token array."); + $this->assertSame($value, $tokens[$target][$key], "Value for key $key does not match expectation."); + } + + }//end testNoReplacementsAreMadeWhenNoTabsAreFound() + + + /** + * Data provider. + * + * @see testNoReplacementsAreMadeWhenNoTabsAreFound() + * + * @return array>> + */ + public static function dataNoReplacementsAreMadeWhenNoTabsAreFound() + { + return [ + 'Indentation whitespace, only spaces' => [ + 'testMarker' => '/* testNoReplacementNeeded */', + 'testTarget' => T_WHITESPACE, + 'expected' => [ + 'length' => 4, + 'content' => ' ', + 'orig_content' => null, + ], + 'offset' => 1, + ], + 'Trailing comment not containing any tabs' => [ + 'testMarker' => '/* testNoReplacementNeeded */', + 'testTarget' => T_COMMENT, + 'expected' => [ + 'length' => 35, + 'content' => '// Comment not containing any tabs. +', + 'orig_content' => null, + ], + ], + ]; + + }//end dataNoReplacementsAreMadeWhenNoTabsAreFound() + + + /** + * Test tab replacement in tokens. + * + * @param string $testMarker The comment prefacing the target token. + * @param int|string $testTarget Token code to look for. + * @param array $expected Expectations for the token array. + * @param int $offset Optional. Offset from the target token to get to the _real_ target. + * This is specifically needed to target indentation whitespace. + * + * @dataProvider dataTabReplacement + * + * @return void + */ + public function testTabReplacement($testMarker, $testTarget, $expected, $offset=0) + { + $tokens = $this->phpcsFile->getTokens(); + $target = $this->getTargetToken($testMarker, $testTarget); + $target += $offset; + + foreach ($expected as $key => $value) { + if ($key === 'orig_content' && $value === null) { + $this->assertArrayNotHasKey($key, $tokens[$target], "Unexpected 'orig_content' key found in the token array."); + continue; + } + + $this->assertArrayHasKey($key, $tokens[$target], "Key $key not found in the token array."); + $this->assertSame($value, $tokens[$target][$key], "Value for key $key does not match expectation."); + } + + }//end testTabReplacement() + + + /** + * Data provider. + * + * @see testTabReplacement() + * + * @return array>> + * + * @throws \Exception When the getTabReplacementExpected() method doesn't provide data in the correct format. + */ + public static function dataTabReplacement() + { + $data = [ + 'Tab indentation' => [ + 'testMarker' => '/* testTabIndentation */', + 'testTarget' => T_WHITESPACE, + ], + 'Mixed tab/space indentation' => [ + 'testMarker' => '/* testMixedIndentation */', + 'testTarget' => T_WHITESPACE, + ], + 'Inline: single tab in text string' => [ + 'testMarker' => '/* testInlineSingleTab */', + 'testTarget' => T_CONSTANT_ENCAPSED_STRING, + ], + 'Inline: single tab between each word in text string' => [ + 'testMarker' => '/* testInlineSingleTabBetweenEachWord */', + 'testTarget' => T_DOUBLE_QUOTED_STRING, + ], + 'Inline: multiple tabs in heredoc' => [ + 'testMarker' => '/* testInlineMultiTab */', + 'testTarget' => T_HEREDOC, + ], + 'Inline: multiple tabs between each word in nowdoc' => [ + 'testMarker' => '/* testInlineMultipleTabsBetweenEachWord */', + 'testTarget' => T_NOWDOC, + ], + 'Inline: mixed spaces/tabs in text string' => [ + 'testMarker' => '/* testInlineMixedSpacesTabs */', + 'testTarget' => T_CONSTANT_ENCAPSED_STRING, + ], + 'Inline: mixed spaces/tabs between each word in text string' => [ + 'testMarker' => '/* testInlineMixedSpacesTabsBetweenEachWord */', + 'testTarget' => T_DOUBLE_QUOTED_STRING, + ], + 'Inline: tab becomes single space in comment (with tabwidth 4)' => [ + 'testMarker' => '/* testInlineSize1 */', + 'testTarget' => T_COMMENT, + ], + 'Inline: tab becomes 2 spaces in comment (with tabwidth 4)' => [ + 'testMarker' => '/* testInlineSize2 */', + 'testTarget' => T_COMMENT, + ], + 'Inline: tab becomes 3 spaces in doc comment string (with tabwidth 4)' => [ + 'testMarker' => '/* testInlineSize3 */', + 'testTarget' => T_DOC_COMMENT_STRING, + ], + 'Inline: tab becomes 4 spaces in comment (with tabwidth 4)' => [ + 'testMarker' => '/* testInlineSize4 */', + 'testTarget' => T_COMMENT, + ], + ]; + + $expectations = static::getTabReplacementExpected(); + + foreach ($data as $key => $value) { + if (isset($expectations[$key]) === false || is_array($expectations[$key]) === false) { + throw new Exception( + sprintf('Invalid getTabReplacementExpected() method. Missing expectation array for the "%s" test case', $key) + ); + } + + if (isset($expectations[$key]['length'], $expectations[$key]['content']) === false + || array_key_exists('orig_content', $expectations[$key]) === false + ) { + throw new Exception( + sprintf('Invalid expectation array for the "%s" test case. The array must contain the "length", "content" and "orig_content" keys', $key) + ); + } + + $data[$key]['expected'] = $expectations[$key]; + } + + // Set offset for test cases targetting whitespace. + $data['Tab indentation']['offset'] = 1; + $data['Mixed tab/space indentation']['offset'] = 1; + + return $data; + + }//end dataTabReplacement() + + + /** + * Data provider helper. + * + * Should be declared in child classes to set the expectations for the token array. + * + * @see dataTabReplacement() + * + * @return array> + */ + abstract public static function getTabReplacementExpected(); + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/EscapeshellcmdTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/EscapeshellcmdTest.php new file mode 100644 index 00000000..d5b35b0a --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/EscapeshellcmdTest.php @@ -0,0 +1,91 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Util\Common; + +use PHP_CodeSniffer\Util\Common; +use PHPUnit\Framework\TestCase; + +/** + * Tests for the \PHP_CodeSniffer\Util\Common::escapeshellcmd() method. + * + * @covers \PHP_CodeSniffer\Util\Common::escapeshellcmd + * @group Windows + */ +final class EscapeshellcmdTest extends TestCase +{ + + + /** + * Test escaping shell commands. + * + * @param string $command The command provided. + * @param string $expected Expected function output. + * @param string $expectedWin Optional. Expected function output on Windows. + * Only needs to be passed if the output on Windows would be different. + * + * @dataProvider dataEscapeshellcmd + * + * @return void + */ + public function testEscapeshellcmd($command, $expected, $expectedWin=null) + { + if (stripos(PHP_OS, 'WIN') === 0 && empty($expectedWin) === false) { + $expected = $expectedWin; + } + + $this->assertSame($expected, Common::escapeshellcmd($command)); + + }//end testEscapeshellcmd() + + + /** + * Data provider. + * + * Note: we're only testing the PHPCS functionality, not the PHP native `escapeshellcmd()` + * function (as that's not our responsibility). + * + * @see testEscapeshellcmd() + * + * @return array> + */ + public static function dataEscapeshellcmd() + { + return [ + 'Command is empty string' => [ + 'text' => '', + 'expected' => '', + ], + 'Command is simple string' => [ + 'text' => 'csslint', + 'expected' => 'csslint', + ], + 'Command containing characters which PHP escapes' => [ + 'text' => '&#;`|*?~<>^()[]{}$\,%!', + 'expected' => '\&\#\;\`\|\*\?\~\<\>\^\(\)\[\]\{\}\$\\\\,%!', + 'expectedWin' => '^&^#^;^`^|^*^?^~^<^>^^^(^)^[^]^{^}^$^\,^%^!', + ], + // @link https://github.com/squizlabs/PHP_CodeSniffer/pull/3214 + 'Command containing spaces, which can cause problems on Windows' => [ + 'text' => 'C:\Program Files\nodejs\csslint.cmd', + 'expected' => 'C:\\\\Program Files\\\\nodejs\\\\csslint.cmd', + 'expectedWin' => 'C:^\Program^ Files^\nodejs^\csslint.cmd', + ], + // @link https://github.com/php/doc-en/pull/511 + 'Command containing spaces with additional arguments' => [ + 'text' => 'php -f ./~home/path to/file.php', + 'expected' => 'php -f ./\~home/path to/file.php', + 'expectedWin' => 'php^ -f^ ./^~home/path^ to/file.php', + ], + ]; + + }//end dataEscapeshellcmd() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/GetSniffCodeTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/GetSniffCodeTest.php new file mode 100644 index 00000000..48161f1c --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/GetSniffCodeTest.php @@ -0,0 +1,200 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Util\Common; + +use PHP_CodeSniffer\Util\Common; +use PHPUnit\Framework\TestCase; + +/** + * Tests for the \PHP_CodeSniffer\Util\Common::getSniffCode() method. + * + * @covers \PHP_CodeSniffer\Util\Common::getSniffCode + */ +final class GetSniffCodeTest extends TestCase +{ + + + /** + * Test receiving an expected exception when the $sniffClass parameter is not passed a string value or is passed an empty string. + * + * @param string $input NOT a fully qualified sniff class name. + * + * @dataProvider dataGetSniffCodeThrowsExceptionOnInvalidInput + * + * @return void + */ + public function testGetSniffCodeThrowsExceptionOnInvalidInput($input) + { + $exception = 'InvalidArgumentException'; + $message = 'The $sniffClass parameter must be a non-empty string'; + + if (method_exists($this, 'expectException') === true) { + // PHPUnit 5+. + $this->expectException($exception); + $this->expectExceptionMessage($message); + } else { + // PHPUnit 4. + $this->setExpectedException($exception, $message); + } + + Common::getSniffCode($input); + + }//end testGetSniffCodeThrowsExceptionOnInvalidInput() + + + /** + * Data provider. + * + * @see testGetSniffCodeThrowsExceptionOnInvalidInput() + * + * @return array> + */ + public static function dataGetSniffCodeThrowsExceptionOnInvalidInput() + { + return [ + 'Class name is not a string' => [true], + 'Class name is empty' => [''], + ]; + + }//end dataGetSniffCodeThrowsExceptionOnInvalidInput() + + + /** + * Test receiving an expected exception when the $sniffClass parameter is not passed a value which + * could be a fully qualified sniff(test) class name. + * + * @param string $input String input which can not be a fully qualified sniff(test) class name. + * + * @dataProvider dataGetSniffCodeThrowsExceptionOnInputWhichIsNotASniffTestClass + * + * @return void + */ + public function testGetSniffCodeThrowsExceptionOnInputWhichIsNotASniffTestClass($input) + { + $exception = 'InvalidArgumentException'; + $message = 'The $sniffClass parameter was not passed a fully qualified sniff(test) class name. Received:'; + + if (method_exists($this, 'expectException') === true) { + // PHPUnit 5+. + $this->expectException($exception); + $this->expectExceptionMessage($message); + } else { + // PHPUnit 4. + $this->setExpectedException($exception, $message); + } + + Common::getSniffCode($input); + + }//end testGetSniffCodeThrowsExceptionOnInputWhichIsNotASniffTestClass() + + + /** + * Data provider. + * + * @see testGetSniffCodeThrowsExceptionOnInputWhichIsNotASniffTestClass() + * + * @return array> + */ + public static function dataGetSniffCodeThrowsExceptionOnInputWhichIsNotASniffTestClass() + { + return [ + 'Unqualified class name' => ['ClassName'], + 'Fully qualified class name, not enough parts' => ['Fully\\Qualified\\ClassName'], + 'Fully qualified class name, doesn\'t end on Sniff or UnitTest' => ['Fully\\Sniffs\\Qualified\\ClassName'], + ]; + + }//end dataGetSniffCodeThrowsExceptionOnInputWhichIsNotASniffTestClass() + + + /** + * Test transforming a sniff class name to a sniff code. + * + * @param string $fqnClass A fully qualified sniff class name. + * @param string $expected Expected function output. + * + * @dataProvider dataGetSniffCode + * + * @return void + */ + public function testGetSniffCode($fqnClass, $expected) + { + $this->assertSame($expected, Common::getSniffCode($fqnClass)); + + }//end testGetSniffCode() + + + /** + * Data provider. + * + * @see testGetSniffCode() + * + * @return array> + */ + public static function dataGetSniffCode() + { + return [ + 'PHPCS native sniff' => [ + 'fqnClass' => 'PHP_CodeSniffer\\Standards\\Generic\\Sniffs\\Arrays\\ArrayIndentSniff', + 'expected' => 'Generic.Arrays.ArrayIndent', + ], + 'Class is a PHPCS native test class' => [ + 'fqnClass' => 'PHP_CodeSniffer\\Standards\\Generic\\Tests\\Arrays\\ArrayIndentUnitTest', + 'expected' => 'Generic.Arrays.ArrayIndent', + ], + 'Sniff in external standard without namespace prefix' => [ + 'fqnClass' => 'MyStandard\\Sniffs\\PHP\\MyNameSniff', + 'expected' => 'MyStandard.PHP.MyName', + ], + 'Test in external standard without namespace prefix' => [ + 'fqnClass' => 'MyStandard\\Tests\\PHP\\MyNameSniff', + 'expected' => 'MyStandard.PHP.MyName', + ], + 'Sniff in external standard with namespace prefix' => [ + 'fqnClass' => 'Vendor\\Package\\MyStandard\\Sniffs\\Category\\AnalyzeMeSniff', + 'expected' => 'MyStandard.Category.AnalyzeMe', + ], + 'Test in external standard with namespace prefix' => [ + 'fqnClass' => 'Vendor\\Package\\MyStandard\\Tests\\Category\\AnalyzeMeUnitTest', + 'expected' => 'MyStandard.Category.AnalyzeMe', + ], + + /* + * These are not valid sniff codes and is an undesirable result, but can't be helped + * as changing this would be a BC-break. + * Supporting these to allow for tags directly including sniff files. + * See: https://github.com/PHPCSStandards/PHP_CodeSniffer/issues/675 + */ + + 'Fully qualified class name, ends on Sniff, but isn\'t' => [ + 'fqnClass' => 'Fully\\Sniffs\\AbstractSomethingSniff', + 'expected' => '.Sniffs.AbstractSomething', + ], + 'Sniff provided via file include and doesn\'t comply with naming conventions [1]' => [ + 'fqnClass' => 'CheckMeSniff', + 'expected' => '..CheckMe', + ], + 'Sniff provided via file include and doesn\'t comply with naming conventions [2]' => [ + 'fqnClass' => 'CompanyName\\CheckMeSniff', + 'expected' => '.CompanyName.CheckMe', + ], + 'Sniff provided via file include and doesn\'t comply with naming conventions [3]' => [ + 'fqnClass' => 'CompanyName\\Sniffs\\CheckMeSniff', + 'expected' => '.Sniffs.CheckMe', + ], + 'Sniff provided via file include and doesn\'t comply with naming conventions [4]' => [ + 'fqnClass' => 'CompanyName\\CustomSniffs\\Whatever\\CheckMeSniff', + 'expected' => 'CompanyName.Whatever.CheckMe', + ], + ]; + + }//end dataGetSniffCode() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/PrepareForOutputTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/PrepareForOutputTest.php new file mode 100644 index 00000000..8eb2fc22 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Common/PrepareForOutputTest.php @@ -0,0 +1,113 @@ +assertSame($expected, Common::prepareForOutput($content, $exclude)); + + }//end testPrepareForOutput() + + + /** + * Test formatting whitespace characters, on Windows. + * + * @param string $content The content to prepare. + * @param string[] $exclude A list of characters to leave invisible. + * @param string $expected Expected function output (unused in this test). + * @param string $expectedWin Expected function output on Windows. + * + * @requires OS ^WIN.*. + * @dataProvider dataPrepareForOutput + * + * @return void + */ + public function testPrepareForOutputWindows($content, $exclude, $expected, $expectedWin) + { + $this->assertSame($expectedWin, Common::prepareForOutput($content, $exclude)); + + }//end testPrepareForOutputWindows() + + + /** + * Data provider. + * + * @see testPrepareForOutput() + * @see testPrepareForOutputWindows() + * + * @return array> + */ + public static function dataPrepareForOutput() + { + return [ + 'Special characters are replaced with their escapes' => [ + 'content' => "\r\n\t", + 'exclude' => [], + 'expected' => "\033[30;1m\\r\033[0m\033[30;1m\\n\033[0m\033[30;1m\\t\033[0m", + 'expectedWin' => "\\r\\n\\t", + ], + 'Spaces are replaced with a unique mark' => [ + 'content' => " ", + 'exclude' => [], + 'expected' => "\033[30;1m·\033[0m\033[30;1m·\033[0m\033[30;1m·\033[0m\033[30;1m·\033[0m", + 'expectedWin' => " ", + ], + 'Other characters are unaffected' => [ + 'content' => "{echo 1;}", + 'exclude' => [], + 'expected' => "{echo\033[30;1m·\033[0m1;}", + 'expectedWin' => "{echo 1;}", + ], + 'No replacements' => [ + 'content' => 'nothing-should-be-replaced', + 'exclude' => [], + 'expected' => 'nothing-should-be-replaced', + 'expectedWin' => 'nothing-should-be-replaced', + ], + 'Excluded whitespace characters are unaffected' => [ + 'content' => "\r\n\t ", + 'exclude' => [ + "\r", + "\n", + ], + 'expected' => "\r\n\033[30;1m\\t\033[0m\033[30;1m·\033[0m", + 'expectedWin' => "\r\n\\t ", + ], + ]; + + }//end dataPrepareForOutput() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Help/HelpTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Help/HelpTest.php index f09a4c17..b3d51a5c 100644 --- a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Help/HelpTest.php +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Help/HelpTest.php @@ -3,7 +3,7 @@ * Tests to verify that the "help" command functions as expected. * * @author Juliette Reinders Folmer - * @copyright 2024 Juliette Reinders Folmer. All rights reserved. + * @copyright 2024 PHPCSStandards and contributors * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence */ @@ -386,7 +386,7 @@ public static function dataOptionFilteringSpacerHandling() /** - * Test that if no short/long options are passed, only usage information is displayed (and displayed correctly). + * Test that if no short/long options are passed, only usage information is displayed (CS mode). * * @param array $cliArgs Command line arguments. * @param string $expectedRegex Regex to validate expected output. @@ -395,7 +395,51 @@ public static function dataOptionFilteringSpacerHandling() * * @return void */ - public function testDisplayUsage($cliArgs, $expectedRegex) + public function testDisplayUsageCS($cliArgs, $expectedRegex) + { + if (PHP_CODESNIFFER_CBF === true) { + $this->markTestSkipped('This test needs CS mode to run'); + } + + $expectedRegex = str_replace('phpc(bf|s)', 'phpcs', $expectedRegex); + $this->verifyDisplayUsage($cliArgs, $expectedRegex); + + }//end testDisplayUsageCS() + + + /** + * Test that if no short/long options are passed, only usage information is displayed (CBF mode). + * + * @param array $cliArgs Command line arguments. + * @param string $expectedRegex Regex to validate expected output. + * + * @dataProvider dataDisplayUsage + * @group CBF + * + * @return void + */ + public function testDisplayUsageCBF($cliArgs, $expectedRegex) + { + if (PHP_CODESNIFFER_CBF === false) { + $this->markTestSkipped('This test needs CBF mode to run'); + } + + $expectedRegex = str_replace('phpc(bf|s)', 'phpcbf', $expectedRegex); + $this->verifyDisplayUsage($cliArgs, $expectedRegex); + + }//end testDisplayUsageCBF() + + + /** + * Helper method to test that if no short/long options are passed, only usage information is displayed + * (and displayed correctly). + * + * @param array $cliArgs Command line arguments. + * @param string $expectedRegex Regex to validate expected output. + * + * @return void + */ + private function verifyDisplayUsage($cliArgs, $expectedRegex) { $help = new Help(new ConfigDouble($cliArgs), []); @@ -403,7 +447,7 @@ public function testDisplayUsage($cliArgs, $expectedRegex) $help->display(); - }//end testDisplayUsage() + }//end verifyDisplayUsage() /** diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/GetHumanReadableDurationTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/GetHumanReadableDurationTest.php new file mode 100644 index 00000000..93b3d05e --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/GetHumanReadableDurationTest.php @@ -0,0 +1,114 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Util\Timing; + +use PHP_CodeSniffer\Util\Timing; +use PHPUnit\Framework\TestCase; + +/** + * Tests for the \PHP_CodeSniffer\Util\Timing::getHumanReadableDuration() method. + * + * @covers \PHP_CodeSniffer\Util\Timing::getHumanReadableDuration + */ +final class GetHumanReadableDurationTest extends TestCase +{ + + + /** + * Test the method. + * + * @param int|float $duration A duration in milliseconds. + * @param string $expected The expected human readable string. + * + * @dataProvider dataGetHumanReadableDuration + * + * @return void + */ + public function testGetHumanReadableDuration($duration, $expected) + { + $this->assertSame($expected, Timing::getHumanReadableDuration($duration)); + + }//end testGetHumanReadableDuration() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataGetHumanReadableDuration() + { + return [ + 'Duration: 0' => [ + 'duration' => 0, + 'expected' => '0ms', + ], + 'Duration: 13 milliseconds' => [ + 'duration' => 13.232101565, + 'expected' => '13ms', + ], + 'Duration: 14 milliseconds' => [ + 'duration' => 13.916015625, + 'expected' => '14ms', + ], + 'Duration: 999 milliseconds' => [ + 'duration' => 999.2236, + 'expected' => '999ms', + ], + 'Duration: 999+ milliseconds' => [ + 'duration' => 999.89236, + 'expected' => '1000ms', + ], + 'Duration: 1 second' => [ + 'duration' => 1000, + 'expected' => '1 secs', + ], + 'Duration: slightly more than 1 second' => [ + 'duration' => 1001.178215, + 'expected' => '1 secs', + ], + 'Duration: just under a 1 minute' => [ + 'duration' => 59999.3851, + 'expected' => '60 secs', + ], + 'Duration: exactly 1 minute' => [ + 'duration' => 60000, + 'expected' => '1 mins', + ], + 'Duration: slightly more than 1 minute' => [ + 'duration' => 60001.7581235, + 'expected' => '1 mins', + ], + 'Duration: 1 minute, just under half a second' => [ + 'duration' => 60499.83639, + 'expected' => '1 mins, 0.5 secs', + ], + 'Duration: 1 minute, just over half a second' => [ + 'duration' => 60501.961238, + 'expected' => '1 mins, 0.5 secs', + ], + 'Duration: 1 minute, 1 second' => [ + 'duration' => 61000, + 'expected' => '1 mins, 1 secs', + ], + 'Duration: exactly 1 hour' => [ + 'duration' => 3600000, + 'expected' => '60 mins', + ], + 'Duration: 89.4 mins' => [ + 'duration' => 5364000, + 'expected' => '89 mins, 24 secs', + ], + ]; + + }//end dataGetHumanReadableDuration() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/TimingTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/TimingTest.php new file mode 100644 index 00000000..79952c8c --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Timing/TimingTest.php @@ -0,0 +1,123 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Util\Timing; + +use PHP_CodeSniffer\Util\Timing; +use PHPUnit\Framework\TestCase; + +/** + * Tests for the \PHP_CodeSniffer\Util\Timing class. + * + * {@internal These tests need to run in separate processes as the Timing class uses static properties + * to keep track of the start time and whether or not the runtime has been printed and these + * can't be unset/reset once set.} + * + * @covers \PHP_CodeSniffer\Util\Timing + * + * @runTestsInSeparateProcesses + * @preserveGlobalState disabled + */ +final class TimingTest extends TestCase +{ + + + /** + * Verify that getDuration() returns 0 when the timer wasn't started. + * + * @return void + */ + public function testGetDurationWithoutStartReturnsZero() + { + $this->assertSame(0, Timing::getDuration()); + + }//end testGetDurationWithoutStartReturnsZero() + + + /** + * Verify that getDuration() returns 0 when the timer wasn't started. + * + * @return void + */ + public function testGetDurationWithStartReturnsMilliseconds() + { + Timing::startTiming(); + usleep(1500); + $duration = Timing::getDuration(); + + $this->assertTrue(is_float($duration)); + $this->assertGreaterThan(1, $duration); + $this->assertLessThan(15, $duration); + + }//end testGetDurationWithStartReturnsMilliseconds() + + + /** + * Verify that printRunTime() doesn't print anything if the timer wasn't started. + * + * @return void + */ + public function testTimeIsNotPrintedIfTimerWasNeverStarted() + { + $this->expectOutputString(''); + Timing::printRunTime(); + + }//end testTimeIsNotPrintedIfTimerWasNeverStarted() + + + /** + * Verify that printRunTime() doesn't print anything if the timer wasn't started. + * + * @return void + */ + public function testTimeIsNotPrintedIfTimerWasNeverStartedEvenWhenForced() + { + $this->expectOutputString(''); + Timing::printRunTime(true); + + }//end testTimeIsNotPrintedIfTimerWasNeverStartedEvenWhenForced() + + + /** + * Verify that printRunTime() when called multiple times only prints the runtime information once. + * + * @return void + */ + public function testTimeIsPrintedOnlyOnce() + { + $this->expectOutputRegex('`^Time: [0-9]+ms; Memory: [0-9\.]+MB'.PHP_EOL.PHP_EOL.'$`'); + + Timing::startTiming(); + usleep(2000); + Timing::printRunTime(); + Timing::printRunTime(); + Timing::printRunTime(); + + }//end testTimeIsPrintedOnlyOnce() + + + /** + * Verify that printRunTime() when called multiple times prints the runtime information multiple times if forced. + * + * @return void + */ + public function testTimeIsPrintedMultipleTimesOnlyIfForced() + { + $this->expectOutputRegex('`^(Time: [0-9]+ms; Memory: [0-9\.]+MB'.PHP_EOL.PHP_EOL.'){3}$`'); + + Timing::startTiming(); + usleep(2000); + Timing::printRunTime(true); + Timing::printRunTime(true); + Timing::printRunTime(true); + + }//end testTimeIsPrintedMultipleTimesOnlyIfForced() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php new file mode 100644 index 00000000..f03d20a3 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Tokens/GetHighestWeightedTokenTest.php @@ -0,0 +1,162 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Util\Tokens; + +use PHP_CodeSniffer\Util\Tokens; +use PHPUnit\Framework\TestCase; + +/** + * Tests for the \PHP_CodeSniffer\Util\Tokens::getHighestWeightedToken() method. + * + * @covers \PHP_CodeSniffer\Util\Tokens::getHighestWeightedToken + */ +final class GetHighestWeightedTokenTest extends TestCase +{ + + + /** + * Test the method. + * + * @param array $tokens The tokens to find the heighest weighted one. + * @param int|false $expected The expected function return value. + * + * @dataProvider dataGetHighestWeightedToken + * + * @return void + */ + public function testGetHighestWeightedToken($tokens, $expected) + { + $this->assertSame($expected, Tokens::getHighestWeightedToken($tokens)); + + }//end testGetHighestWeightedToken() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataGetHighestWeightedToken() + { + $data = [ + 'Array of non-tokens passed, returns first' => [ + 'tokens' => [ + PHP_SAPI, + PHP_MAJOR_VERSION, + PHP_OS, + ], + 'expected' => PHP_SAPI, + ], + 'No weightings available for any of the selected tokens, first one wins' => [ + 'tokens' => [ + T_VARIABLE, + T_STRING, + T_EXTENDS, + T_IMPLEMENTS, + ], + 'expected' => T_VARIABLE, + ], + 'single token always returns that token' => [ + 'tokens' => [T_VARIABLE], + 'expected' => T_VARIABLE, + ], + 'Unknown and known token, known token wins' => [ + 'tokens' => [ + T_VARIABLE, + T_SELF, + ], + 'expected' => T_SELF, + ], + 'Known and unknown token, known token wins' => [ + 'tokens' => [ + T_CLOSURE, + T_STRING, + ], + 'expected' => T_CLOSURE, + ], + 'Two tokens with equal weights passed, first one wins' => [ + 'tokens' => [ + T_CLOSURE, + T_FUNCTION, + ], + 'expected' => T_CLOSURE, + ], + 'Five tokens with equal weights passed, first one wins' => [ + 'tokens' => [ + T_NAMESPACE, + T_TRAIT, + T_ENUM, + T_CLASS, + T_INTERFACE, + ], + 'expected' => T_NAMESPACE, + ], + 'Tokens with different weights passed, heightest (25) wins' => [ + 'tokens' => [ + T_BITWISE_OR, + T_SELF, + T_MUL_EQUAL, + ], + 'expected' => T_SELF, + ], + 'Tokens with different weights passed, heightest (50) wins' => [ + 'tokens' => [ + T_BITWISE_XOR, + T_CATCH, + T_SPACESHIP, + T_PARENT, + ], + 'expected' => T_CATCH, + ], + ]; + + $high100 = [ + T_MULTIPLY, + T_BITWISE_AND, + T_SELF, + T_FOREACH, + T_CLOSURE, + ]; + $data['Tokens with different weights passed, ordered low-high, heightest (100) wins'] = [ + 'tokens' => $high100, + 'expected' => T_CLOSURE, + ]; + + shuffle($high100); + $data['Tokens with different weights passed, order random, heightest (100) wins'] = [ + 'tokens' => $high100, + 'expected' => T_CLOSURE, + ]; + + $high1000 = [ + T_ENUM, + T_FUNCTION, + T_ELSEIF, + T_PARENT, + T_BITWISE_OR, + T_MODULUS, + ]; + $data['Tokens with different weights passed, ordered low-high, heightest (1000) wins'] = [ + 'tokens' => $high1000, + 'expected' => T_ENUM, + ]; + + shuffle($high1000); + $data['Tokens with different weights passed, order random, heightest (1000) wins'] = [ + 'tokens' => $high1000, + 'expected' => T_ENUM, + ]; + + return $data; + + }//end dataGetHighestWeightedToken() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/Core/Util/Tokens/TokenNameTest.php b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Tokens/TokenNameTest.php new file mode 100644 index 00000000..435df071 --- /dev/null +++ b/vendor/squizlabs/php_codesniffer/tests/Core/Util/Tokens/TokenNameTest.php @@ -0,0 +1,81 @@ + + * @copyright 2024 PHPCSStandards and contributors + * @license https://github.com/PHPCSStandards/PHP_CodeSniffer/blob/master/licence.txt BSD Licence + */ + +namespace PHP_CodeSniffer\Tests\Core\Util\Tokens; + +use PHP_CodeSniffer\Util\Tokens; +use PHPUnit\Framework\TestCase; + +/** + * Tests for the \PHP_CodeSniffer\Util\Tokens::tokenName() method. + * + * @covers \PHP_CodeSniffer\Util\Tokens::tokenName + */ +final class TokenNameTest extends TestCase +{ + + + /** + * Test the method. + * + * @param int|string $tokenCode The PHP/PHPCS token code to get the name for. + * @param string $expected The expected token name. + * + * @dataProvider dataTokenName + * + * @return void + */ + public function testTokenName($tokenCode, $expected) + { + $this->assertSame($expected, Tokens::tokenName($tokenCode)); + + }//end testTokenName() + + + /** + * Data provider. + * + * @return array> + */ + public static function dataTokenName() + { + return [ + 'PHP native token: T_ECHO' => [ + 'tokenCode' => T_ECHO, + 'expected' => 'T_ECHO', + ], + 'PHP native token: T_FUNCTION' => [ + 'tokenCode' => T_FUNCTION, + 'expected' => 'T_FUNCTION', + ], + 'PHPCS native token: T_CLOSURE' => [ + 'tokenCode' => T_CLOSURE, + 'expected' => 'T_CLOSURE', + ], + 'PHPCS native token: T_STRING_CONCAT' => [ + 'tokenCode' => T_STRING_CONCAT, + 'expected' => 'T_STRING_CONCAT', + ], + + // Document the current behaviour for invalid input. + // This behaviour is subject to change. + 'Non-token integer passed' => [ + 'tokenCode' => 100000, + 'expected' => 'UNKNOWN', + ], + 'Non-token string passed' => [ + 'tokenCode' => 'something', + 'expected' => 'ing', + ], + ]; + + }//end dataTokenName() + + +}//end class diff --git a/vendor/squizlabs/php_codesniffer/tests/bootstrap.php b/vendor/squizlabs/php_codesniffer/tests/bootstrap.php index cf4936da..e8ebdbbd 100644 --- a/vendor/squizlabs/php_codesniffer/tests/bootstrap.php +++ b/vendor/squizlabs/php_codesniffer/tests/bootstrap.php @@ -11,8 +11,27 @@ define('PHP_CODESNIFFER_IN_TESTS', true); } +/* + * Determine whether the test suite should be run in CBF mode. + * + * Use `` in a `phpunit.xml` file + * or set the ENV variable at an OS-level to enable CBF mode. + * + * To run the CBF specific tests, use the following command: + * vendor/bin/phpunit --group CBF --exclude-group nothing + * + * If the ENV variable has not been set, or is set to "false", the tests will run in CS mode. + */ + if (defined('PHP_CODESNIFFER_CBF') === false) { - define('PHP_CODESNIFFER_CBF', false); + $cbfMode = getenv('PHP_CODESNIFFER_CBF'); + if ($cbfMode === '1') { + define('PHP_CODESNIFFER_CBF', true); + echo 'Note: Tests are running in "CBF" mode'.PHP_EOL.PHP_EOL; + } else { + define('PHP_CODESNIFFER_CBF', false); + echo 'Note: Tests are running in "CS" mode'.PHP_EOL.PHP_EOL; + } } if (defined('PHP_CODESNIFFER_VERBOSITY') === false) { diff --git a/vendor/yoast/phpunit-polyfills/CHANGELOG.md b/vendor/yoast/phpunit-polyfills/CHANGELOG.md index f2277ab4..0774b5aa 100644 --- a/vendor/yoast/phpunit-polyfills/CHANGELOG.md +++ b/vendor/yoast/phpunit-polyfills/CHANGELOG.md @@ -2,13 +2,38 @@ All notable changes to this project will be documented in this file. -This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses [Semantic Versioning](http://semver.org/). +This projects adheres to [Keep a CHANGELOG](http://keepachangelog.com/) and uses [Semantic Versioning](https://semver.org/). ## [Unreleased] _Nothing yet._ +## [3.1.1] - 2025-01-12 + +### Fixed +* AssertContainsOnly::assertContainsNotOnlyInstancesOf(): incorrect parameter name. PR [#235] + +### Changed +* General housekeeping. + +[#235]: https://github.com/Yoast/PHPUnit-Polyfills/pull/235 + + +## [3.1.0] - 2025-01-08 + +### Added +* `Yoast\PHPUnitPolyfills\Polyfills\AssertContainsOnly` trait to polyfill the specialized `Assert::assertContains[Not]Only*()` methods as introduced in PHPUnit 11.5.0. PR [#225]. + +### Changed +* README: fix links which were broken due to an upstream branch removal. PR [#213]. +* README: fixed a few broken badges. +* General housekeeping. + +[#213]: https://github.com/Yoast/PHPUnit-Polyfills/pull/213 +[#225]: https://github.com/Yoast/PHPUnit-Polyfills/pull/225 + + ## [3.0.0] - 2024-09-07 ### PHPUnit 11 support @@ -64,6 +89,15 @@ _In practical terms, the net effect of this is that tests on PHP 8.1 will run on [readme-on-expectuserdeprecation]: https://github.com/Yoast/PHPUnit-Polyfills/tree/3.x?tab=readme-ov-file#phpunit--1100-yoastphpunitpolyfillspolyfillsexpectuserdeprecation +## [2.0.3] - 2025-01-08 + +This is a maintenance release. + +### Changed +* README: fixed a few broken badges. +* General housekeeping. + + ## [2.0.2] - 2024-09-07 This is a maintenance release. @@ -144,6 +178,15 @@ Projects which don't use any of the new or removed functionality in their test s [#130]: https://github.com/Yoast/PHPUnit-Polyfills/pull/130 +## [1.1.3] - 2025-01-08 + +This is a maintenance release. + +### Changed +* README: fixed a few broken badges. +* General housekeeping. + + ## [1.1.2] - 2024-09-07 This is a maintenance release. @@ -323,11 +366,15 @@ As of version 2.15.0 of the `shivammathur/setup-php` action for GitHub Actions, Initial release. -[Unreleased]: https://github.com/Yoast/PHPUnit-Polyfills/compare/3.x...HEAD -[3.0.0]: https://github.com/Yoast/PHPUnit-Polyfills/compare/2.0.2...3.0.0 +[Unreleased]: https://github.com/Yoast/PHPUnit-Polyfills/compare/main...HEAD +[3.1.1]: https://github.com/Yoast/PHPUnit-Polyfills/compare/3.1.0...3.1.1 +[3.1.0]: https://github.com/Yoast/PHPUnit-Polyfills/compare/3.0.0...3.1.0 +[3.0.0]: https://github.com/Yoast/PHPUnit-Polyfills/compare/2.0.3...3.0.0 +[2.0.3]: https://github.com/Yoast/PHPUnit-Polyfills/compare/2.0.2...2.0.3 [2.0.2]: https://github.com/Yoast/PHPUnit-Polyfills/compare/2.0.1...2.0.2 [2.0.1]: https://github.com/Yoast/PHPUnit-Polyfills/compare/2.0.0...2.0.1 -[2.0.0]: https://github.com/Yoast/PHPUnit-Polyfills/compare/1.1.2...2.0.0 +[2.0.0]: https://github.com/Yoast/PHPUnit-Polyfills/compare/1.1.3...2.0.0 +[1.1.3]: https://github.com/Yoast/PHPUnit-Polyfills/compare/1.1.2...1.1.3 [1.1.2]: https://github.com/Yoast/PHPUnit-Polyfills/compare/1.1.1...1.1.2 [1.1.1]: https://github.com/Yoast/PHPUnit-Polyfills/compare/1.1.0...1.1.1 [1.1.0]: https://github.com/Yoast/PHPUnit-Polyfills/compare/1.0.5...1.1.0 diff --git a/vendor/yoast/phpunit-polyfills/README.md b/vendor/yoast/phpunit-polyfills/README.md index 870edb93..44018c9f 100644 --- a/vendor/yoast/phpunit-polyfills/README.md +++ b/vendor/yoast/phpunit-polyfills/README.md @@ -1,15 +1,16 @@ PHPUnit Polyfills ===================================================== -[![Version](https://poser.pugx.org/yoast/phpunit-polyfills/version)](//packagist.org/packages/yoast/phpunit-polyfills) +[![Version](https://img.shields.io/packagist/v/yoast/phpunit-polyfills?label=stable)][Packagist] [![CS Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/cs.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/cs.yml) [![Lint Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/lint.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/lint.yml) [![Test Build Status](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/test.yml/badge.svg)](https://github.com/Yoast/PHPUnit-Polyfills/actions/workflows/test.yml) [![Coverage Status](https://coveralls.io/repos/github/Yoast/PHPUnit-Polyfills/badge.svg?branch=3.x)](https://coveralls.io/github/Yoast/PHPUnit-Polyfills?branch=3.x) -[![Minimum PHP Version](https://img.shields.io/packagist/php-v/yoast/phpunit-polyfills.svg?maxAge=3600)](https://packagist.org/packages/yoast/phpunit-polyfills) -[![License: BSD3](https://poser.pugx.org/yoast/phpunit-polyfills/license)](https://github.com/Yoast/PHPUnit-Polyfills/blob/main/LICENSE) +[![Minimum PHP Version](https://img.shields.io/packagist/dependency-v/yoast/phpunit-polyfills/php.svg)][Packagist] +[![License: BSD3](https://img.shields.io/github/license/Yoast/PHPUnit-Polyfills)](https://github.com/Yoast/PHPUnit-Polyfills/blob/main/LICENSE) +[Packagist]: https://packagist.org/packages/yoast/phpunit-polyfills Set of polyfills for changed PHPUnit functionality to allow for creating PHPUnit cross-version compatible tests. @@ -150,7 +151,7 @@ The polyfills in this library support the first two ways of calling the assertio For the polyfills to work, a test class is **required** to be a (grand-)child of the PHPUnit native `TestCase` class. -[four ways of calling assertions]: https://docs.phpunit.de/en/main/assertions.html#static-vs-non-static-usage-of-assertion-methods +[four ways of calling assertions]: https://docs.phpunit.de/en/11.5/assertions.html#static-vs-non-static-usage-of-assertion-methods ### Use with PHPUnit < 7.5.0 @@ -200,45 +201,50 @@ Features #### PHPUnit < 7.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertIsType` Polyfills the following methods: -| | | | -| --------------------------------- | --------------------------------- | ------------------------------- | -| [`Assert::assertIsArray()`] | [`Assert::assertIsBool()`] | [`Assert::assertIsFloat()`] | -| [`Assert::assertIsInt()`] | [`Assert::assertIsNumeric()`] | [`Assert::assertIsObject()`] | -| [`Assert::assertIsResource()`] | [`Assert::assertIsString()`] | [`Assert::assertIsScalar()`] | -| [`Assert::assertIsCallable()`] | [`Assert::assertIsIterable()`] | | -| [`Assert::assertIsNotArray()`] | [`Assert::assertIsNotBool()`] | [`Assert::assertIsNotFloat()`] | -| [`Assert::assertIsNotInt()`] | [`Assert::assertIsNotNumeric()`] | [`Assert::assertIsNotObject()`] | -| [`Assert::assertIsNotResource()`] | [`Assert::assertIsNotString()`] | [`Assert::assertIsNotScalar()`] | -| [`Assert::assertIsNotCallable()`] | [`Assert::assertIsNotIterable()`] | | + +| | | +| ------------------------------ | --------------------------------- | +| [`Assert::assertIsArray()`] | [`Assert::assertIsNotArray()`] | +| [`Assert::assertIsBool()`] | [`Assert::assertIsNotBool()`] | +| [`Assert::assertIsFloat()`] | [`Assert::assertIsNotFloat()`] | +| [`Assert::assertIsInt()`] | [`Assert::assertIsNotInt()`] | +| [`Assert::assertIsNumeric()`] | [`Assert::assertIsNotNumeric()`] | +| [`Assert::assertIsObject()`] | [`Assert::assertIsNotObject()`] | +| [`Assert::assertIsResource()`] | [`Assert::assertIsNotResource()`] | +| [`Assert::assertIsString()`] | [`Assert::assertIsNotString()`] | +| [`Assert::assertIsScalar()`] | [`Assert::assertIsNotScalar()`] | +| [`Assert::assertIsCallable()`] | [`Assert::assertIsNotCallable()`] | +| [`Assert::assertIsIterable()`] | [`Assert::assertIsNotIterable()`] | These methods were introduced in PHPUnit 7.5.0 as alternatives to the `Assert::assertInternalType()` and `Assert::assertNotInternalType()` methods, which were soft deprecated in PHPUnit 7.5.0, hard deprecated (warning) in PHPUnit 8.0.0 and removed in PHPUnit 9.0.0. -[`Assert::assertIsArray()`]: https://docs.phpunit.de/en/main/assertions.html#assertisarray -[`Assert::assertIsNotArray()`]: https://docs.phpunit.de/en/main/assertions.html#assertisarray -[`Assert::assertIsBool()`]: https://docs.phpunit.de/en/main/assertions.html#assertisbool -[`Assert::assertIsNotBool()`]: https://docs.phpunit.de/en/main/assertions.html#assertisbool -[`Assert::assertIsFloat()`]: https://docs.phpunit.de/en/main/assertions.html#assertisfloat -[`Assert::assertIsNotFloat()`]: https://docs.phpunit.de/en/main/assertions.html#assertisfloat -[`Assert::assertIsInt()`]: https://docs.phpunit.de/en/main/assertions.html#assertisint -[`Assert::assertIsNotInt()`]: https://docs.phpunit.de/en/main/assertions.html#assertisint -[`Assert::assertIsNumeric()`]: https://docs.phpunit.de/en/main/assertions.html#assertisnumeric -[`Assert::assertIsNotNumeric()`]: https://docs.phpunit.de/en/main/assertions.html#assertisnumeric -[`Assert::assertIsObject()`]: https://docs.phpunit.de/en/main/assertions.html#assertisobject -[`Assert::assertIsNotObject()`]: https://docs.phpunit.de/en/main/assertions.html#assertisobject -[`Assert::assertIsResource()`]: https://docs.phpunit.de/en/main/assertions.html#assertisresource -[`Assert::assertIsNotResource()`]: https://docs.phpunit.de/en/main/assertions.html#assertisresource -[`Assert::assertIsString()`]: https://docs.phpunit.de/en/main/assertions.html#assertisstring -[`Assert::assertIsNotString()`]: https://docs.phpunit.de/en/main/assertions.html#assertisstring -[`Assert::assertIsScalar()`]: https://docs.phpunit.de/en/main/assertions.html#assertisscalar -[`Assert::assertIsNotScalar()`]: https://docs.phpunit.de/en/main/assertions.html#assertisscalar -[`Assert::assertIsCallable()`]: https://docs.phpunit.de/en/main/assertions.html#assertiscallable -[`Assert::assertIsNotCallable()`]: https://docs.phpunit.de/en/main/assertions.html#assertiscallable -[`Assert::assertIsIterable()`]: https://docs.phpunit.de/en/main/assertions.html#assertisiterable -[`Assert::assertIsNotIterable()`]: https://docs.phpunit.de/en/main/assertions.html#assertisiterable +[`Assert::assertIsArray()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisarray +[`Assert::assertIsNotArray()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisarray +[`Assert::assertIsBool()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisbool +[`Assert::assertIsNotBool()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisbool +[`Assert::assertIsFloat()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisfloat +[`Assert::assertIsNotFloat()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisfloat +[`Assert::assertIsInt()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisint +[`Assert::assertIsNotInt()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisint +[`Assert::assertIsNumeric()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisnumeric +[`Assert::assertIsNotNumeric()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisnumeric +[`Assert::assertIsObject()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisobject +[`Assert::assertIsNotObject()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisobject +[`Assert::assertIsResource()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisresource +[`Assert::assertIsNotResource()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisresource +[`Assert::assertIsString()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisstring +[`Assert::assertIsNotString()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisstring +[`Assert::assertIsScalar()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisscalar +[`Assert::assertIsNotScalar()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisscalar +[`Assert::assertIsCallable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertiscallable +[`Assert::assertIsNotCallable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertiscallable +[`Assert::assertIsIterable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisiterable +[`Assert::assertIsNotIterable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisiterable #### PHPUnit < 7.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertStringContains` Polyfills the following methods: + | | | | ---------------------------------------------------- | ------------------------------------------------------- | | [`Assert::assertStringContainsString()`] | [`Assert::assertStringNotContainsString()`] | @@ -246,14 +252,15 @@ Polyfills the following methods: These methods were introduced in PHPUnit 7.5.0 as alternatives to using `Assert::assertContains()` and `Assert::assertNotContains()` with string haystacks. Passing string haystacks to these methods was soft deprecated in PHPUnit 7.5.0, hard deprecated (warning) in PHPUnit 8.0.0 and removed in PHPUnit 9.0.0. -[`Assert::assertStringContainsString()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstring -[`Assert::assertStringNotContainsString()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstring -[`Assert::assertStringContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstringignoringcase -[`Assert::assertStringNotContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstringignoringcase +[`Assert::assertStringContainsString()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertstringcontainsstring +[`Assert::assertStringNotContainsString()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertstringcontainsstring +[`Assert::assertStringContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertstringcontainsstringignoringcase +[`Assert::assertStringNotContainsStringIgnoringCase()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertstringcontainsstringignoringcase #### PHPUnit < 7.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations` Polyfills the following methods: + | | | | ---------------------------------------- | ------------------------------------------- | | [`Assert::assertEqualsCanonicalizing()`] | [`Assert::assertNotEqualsCanonicalizing()`] | @@ -262,12 +269,13 @@ Polyfills the following methods: These methods were introduced in PHPUnit 7.5.0 as alternatives to using `Assert::assertEquals()` and `Assert::assertNotEquals()` with these optional parameters. Passing the respective optional parameters to these methods was soft deprecated in PHPUnit 7.5.0, hard deprecated (warning) in PHPUnit 8.0.0 and removed in PHPUnit 9.0.0. -[`Assert::assertEqualsCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalscanonicalizing -[`Assert::assertNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalscanonicalizing -[`Assert::assertEqualsIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalsignoringcase -[`Assert::assertNotEqualsIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalsignoringcase -[`Assert::assertEqualsWithDelta()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalswithdelta -[`Assert::assertNotEqualsWithDelta()`]: https://docs.phpunit.de/en/main/assertions.html#assertequalswithdelta +[`Assert::assertEqualsCanonicalizing()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertequalscanonicalizing +[`Assert::assertNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertequalscanonicalizing +[`Assert::assertEqualsIgnoringCase()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertequalsignoringcase +[`Assert::assertNotEqualsIgnoringCase()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertequalsignoringcase +[`Assert::assertEqualsWithDelta()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertequalswithdelta +[`Assert::assertNotEqualsWithDelta()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertequalswithdelta + #### PHPUnit < 8.4.0: `Yoast\PHPUnitPolyfills\Polyfills\ExpectExceptionMessageMatches` @@ -276,11 +284,12 @@ Polyfills the [`TestCase::expectExceptionMessageMatches()`] method. This method was introduced in PHPUnit 8.4.0 to improve the name of the `TestCase::expectExceptionMessageRegExp()` method. The `TestCase::expectExceptionMessageRegExp()` method was soft deprecated in PHPUnit 8.4.0, hard deprecated (warning) in PHPUnit 8.5.3 and removed in PHPUnit 9.0.0. -[`TestCase::expectExceptionMessageMatches()`]: https://docs.phpunit.de/en/main/writing-tests-for-phpunit.html#testing-exceptions +[`TestCase::expectExceptionMessageMatches()`]: https://docs.phpunit.de/en/11.5/writing-tests-for-phpunit.html#expecting-exceptions #### PHPUnit < 8.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertFileEqualsSpecializations` Polyfills the following methods: + | | | | -------------------------------------------------- | ----------------------------------------------------- | | [`Assert::assertFileEqualsCanonicalizing()`] | [`Assert::assertFileNotEqualsCanonicalizing()`] | @@ -290,18 +299,19 @@ Polyfills the following methods: These methods were introduced in PHPUnit 8.5.0 as alternatives to using `Assert::assertFileEquals()` and `Assert::assertFileNotEquals()` with these optional parameters. Passing the respective optional parameters to these methods was hard deprecated in PHPUnit 8.5.0 and removed in PHPUnit 9.0.0. -[`Assert::assertFileEqualsCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals -[`Assert::assertFileNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals -[`Assert::assertFileEqualsIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals -[`Assert::assertFileNotEqualsIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals -[`Assert::assertStringEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals -[`Assert::assertStringNotEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals -[`Assert::assertStringEqualsFileIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals -[`Assert::assertStringNotEqualsFileIgnoringCase()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileequals +[`Assert::assertFileEqualsCanonicalizing()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileequals +[`Assert::assertFileNotEqualsCanonicalizing()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileequals +[`Assert::assertFileEqualsIgnoringCase()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileequals +[`Assert::assertFileNotEqualsIgnoringCase()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileequals +[`Assert::assertStringEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileequals +[`Assert::assertStringNotEqualsFileCanonicalizing()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileequals +[`Assert::assertStringEqualsFileIgnoringCase()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileequals +[`Assert::assertStringNotEqualsFileIgnoringCase()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileequals #### PHPUnit < 9.0.0: `Yoast\PHPUnitPolyfills\Polyfills\EqualToSpecializations` Polyfills the following methods: + | | | | --------------------------------- | ------------------------------- | | `Assert::equalToCanonicalizing()` | `Assert::equalToIgnoringCase()` | @@ -326,28 +336,29 @@ Polyfills the following renamed methods: These methods were introduced in PHPUnit 9.1.0. The original methods these new methods replace were hard deprecated in PHPUnit 9.1.0 and removed in PHPUnit 10.0.0. -[`Assert::assertIsNotReadable()`]: https://docs.phpunit.de/en/main/assertions.html#assertisreadable -[`Assert::assertIsNotWritable()`]: https://docs.phpunit.de/en/main/assertions.html#assertiswritable -[`Assert::assertDirectoryDoesNotExist()`]: https://docs.phpunit.de/en/main/assertions.html#assertdirectoryexists -[`Assert::assertDirectoryIsNotReadable()`]: https://docs.phpunit.de/en/main/assertions.html#assertdirectoryisreadable -[`Assert::assertDirectoryIsNotWritable()`]: https://docs.phpunit.de/en/main/assertions.html#assertdirectoryiswritable -[`Assert::assertFileDoesNotExist()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileexists -[`Assert::assertFileIsNotReadable()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileisreadable -[`Assert::assertFileIsNotWritable()`]: https://docs.phpunit.de/en/main/assertions.html#assertfileiswritable -[`Assert::assertMatchesRegularExpression()`]: https://docs.phpunit.de/en/main/assertions.html#assertmatchesregularexpression -[`Assert::assertDoesNotMatchRegularExpression()`]: https://docs.phpunit.de/en/main/assertions.html#assertmatchesregularexpression +[`Assert::assertIsNotReadable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisreadable +[`Assert::assertIsNotWritable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertiswritable +[`Assert::assertDirectoryDoesNotExist()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertdirectoryexists +[`Assert::assertDirectoryIsNotReadable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertdirectoryisreadable +[`Assert::assertDirectoryIsNotWritable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertdirectoryiswritable +[`Assert::assertFileDoesNotExist()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileexists +[`Assert::assertFileIsNotReadable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileisreadable +[`Assert::assertFileIsNotWritable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertfileiswritable +[`Assert::assertMatchesRegularExpression()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertmatchesregularexpression +[`Assert::assertDoesNotMatchRegularExpression()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertmatchesregularexpression #### PHPUnit < 9.3.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource` Polyfills the following methods: + | | | | ------------------------------------ | --------------------------------------- | | [`Assert::assertIsClosedResource()`] | [`Assert::assertIsNotClosedResource()`] | These methods were introduced in PHPUnit 9.3.0. -[`Assert::assertIsClosedResource()`]: https://docs.phpunit.de/en/main/assertions.html#assertisresource -[`Assert::assertIsNotClosedResource()`]: https://docs.phpunit.de/en/main/assertions.html#assertisresource +[`Assert::assertIsClosedResource()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisresource +[`Assert::assertIsNotClosedResource()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertisresource Additionally, this trait contains a helper method `shouldClosedResourceAssertionBeSkipped()`. @@ -384,35 +395,38 @@ The `assertObjectEquals()` assertion was introduced in PHPUnit 9.4.0. > :information_source: In PHPUnit Polyfills 1.x and 2.x, the polyfill for this assertion had [some limitations][assertobjectequals-limitations]. These limitations are no longer present in PHPUnit Polyfills 3.x and the assertion now matches the PHPUnit native implementation. -[`Assert::assertObjectEquals()`]: https://docs.phpunit.de/en/main/assertions.html#assertobjectequals +[`Assert::assertObjectEquals()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertobjectequals [assertobjectequals-limitations]: https://github.com/Yoast/PHPUnit-Polyfills/?tab=readme-ov-file#phpunit--940-yoastphpunitpolyfillspolyfillsassertobjectequals #### PHPUnit < 10.0.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertIgnoringLineEndings` Polyfills the following methods: + | | | | --------------------------------------------------------- | ----------------------------------------------------------- | | [`Assert::assertStringEqualsStringIgnoringLineEndings()`] | [`Assert::assertStringContainsStringIgnoringLineEndings()`] | These methods were introduced in PHPUnit 10.0.0. -[`Assert::assertStringEqualsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringequalsstringignoringlineendings -[`Assert::assertStringContainsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/main/assertions.html#assertstringcontainsstringignoringlineendings +[`Assert::assertStringEqualsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertstringequalsstringignoringlineendings +[`Assert::assertStringContainsStringIgnoringLineEndings()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertstringcontainsstring #### PHPUnit < 10.0.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertIsList` Polyfills the following method: + | | | -------------------------- | | [`Assert::assertIsList()`] | This method was introduced in PHPUnit 10.0.0. -[`Assert::assertIsList()`]: https://docs.phpunit.de/en/main/assertions.html#assertislist +[`Assert::assertIsList()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertislist #### PHPUnit < 10.1.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertObjectProperty` -Polyfills the following method: +Polyfills the following methods: + | | | | ------------------------------------- | ---------------------------------------- | | [`Assert::assertObjectHasProperty()`] | [`Assert::assertObjectNotHasProperty()`] | @@ -421,12 +435,13 @@ These methods were introduced in PHPUnit 10.1.0 as alternatives to the `Assert:: These methods were later backported to the PHPUnit 9 branch and included in the PHPUnit 9.6.11 release. -[`Assert::assertObjectHasProperty()`]: https://docs.phpunit.de/en/main/assertions.html#assertObjectHasProperty -[`Assert::assertObjectNotHasProperty()`]: https://docs.phpunit.de/en/main/assertions.html#assertObjectHasProperty +[`Assert::assertObjectHasProperty()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertobjecthasproperty +[`Assert::assertObjectNotHasProperty()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertobjecthasproperty #### PHPUnit < 11.0.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertArrayWithListKeys` -Polyfills the following method: +Polyfills the following methods: + | | | | -------------------------------------------------------------------- | ------------------------------------------------------------- | | [`Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys()`] | [`Assert::assertArrayIsEqualToArrayIgnoringListOfKeys()`] | @@ -438,10 +453,10 @@ This functionality resembles the functionality previously offered by the `Assert Refactoring tests which still use `Assert::assertArraySubset()` to use the new assertions should be considered as an upgrade path. -[`Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys()`]: https://docs.phpunit.de/en/main/assertions.html#assertarrayisequaltoarrayonlyconsideringlistofkeys -[`Assert::assertArrayIsEqualToArrayIgnoringListOfKeys()`]: https://docs.phpunit.de/en/main/assertions.html#assertarrayisequaltoarrayignoringlistofkeys -[`Assert::assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()`]: https://docs.phpunit.de/en/main/assertions.html#assertarrayisidenticaltoarrayonlyconsideringlistofkeys -[`Assert::assertArrayIsIdenticalToArrayIgnoringListOfKeys()`]: https://docs.phpunit.de/en/main/assertions.html#assertarrayisidenticaltoarrayignoringlistofkeys +[`Assert::assertArrayIsEqualToArrayOnlyConsideringListOfKeys()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertarrayisequaltoarrayonlyconsideringlistofkeys +[`Assert::assertArrayIsEqualToArrayIgnoringListOfKeys()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertarrayisequaltoarrayignoringlistofkeys +[`Assert::assertArrayIsIdenticalToArrayOnlyConsideringListOfKeys()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertarrayisidenticaltoarrayonlyconsideringlistofkeys +[`Assert::assertArrayIsIdenticalToArrayIgnoringListOfKeys()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertarrayisidenticaltoarrayignoringlistofkeys #### PHPUnit < 11.0.0: `Yoast\PHPUnitPolyfills\Polyfills\ExpectUserDeprecation` @@ -469,9 +484,9 @@ As long at the actual test uses the `expectUserDeprecationMessage*()` expectatio > :information_source: Important: when using the `expectUserDeprecationMessage*()` expectation(s) in a test, the test should be annotated with a [`#[IgnoreDeprecations]`][ignoredeprecations-attribute] attribute. -[`TestCase::expectUserDeprecationMessage()`]: https://docs.phpunit.de/en/main/error-handling.html#expecting-deprecations-e-user-deprecated -[`TestCase::expectUserDeprecationMessageMatches()`]: https://docs.phpunit.de/en/main/error-handling.html#expecting-deprecations-e-user-deprecated -[ignoredeprecations-attribute]: https://docs.phpunit.de/en/main/attributes.html#ignoredeprecations +[`TestCase::expectUserDeprecationMessage()`]: https://docs.phpunit.de/en/11.5/error-handling.html#expecting-deprecations-e-user-deprecated +[`TestCase::expectUserDeprecationMessageMatches()`]: https://docs.phpunit.de/en/11.5/error-handling.html#expecting-deprecations-e-user-deprecated +[ignoredeprecations-attribute]: https://docs.phpunit.de/en/11.5/attributes.html#ignoredeprecations #### PHPUnit < 11.2.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertObjectNotEquals` @@ -482,7 +497,61 @@ This assertion expects an object to contain a comparator method in the object it The `assertObjectNotEquals()` assertion was introduced in PHPUnit 11.2.0. -[`Assert::assertObjectNotEquals()`]: https://docs.phpunit.de/en/main/assertions.html#assertobjectequals +[`Assert::assertObjectNotEquals()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertobjectequals + +#### PHPUnit < 11.5.0: `Yoast\PHPUnitPolyfills\Polyfills\AssertContainsOnly` + +Polyfills the following methods: + +| | | +| ------------------------------------------------ | --------------------------------------------------- | +| [`Assert::assertContainsOnlyArray()`] | [`Assert::assertContainsNotOnlyArray()`] | +| [`Assert::assertContainsOnlyBool()`] | [`Assert::assertContainsNotOnlyBool()`] | +| [`Assert::assertContainsOnlyCallable()`] | [`Assert::assertContainsNotOnlyCallable()`] | +| [`Assert::assertContainsOnlyFloat()`] | [`Assert::assertContainsNotOnlyFloat()`] | +| [`Assert::assertContainsOnlyInt()`] | [`Assert::assertContainsNotOnlyInt()`] | +| [`Assert::assertContainsOnlyIterable()`] | [`Assert::assertContainsNotOnlyIterable()`] | +| [`Assert::assertContainsOnlyNull()`] | [`Assert::assertContainsNotOnlyNull()`] | +| [`Assert::assertContainsOnlyNumeric()`] | [`Assert::assertContainsNotOnlyNumeric()`] | +| [`Assert::assertContainsOnlyObject()`] | [`Assert::assertContainsNotOnlyObject()`] | +| [`Assert::assertContainsOnlyResource()`] | [`Assert::assertContainsNotOnlyResource()`] | +| [`Assert::assertContainsOnlyClosedResource()`] * | [`Assert::assertContainsNotOnlyClosedResource()`] * | +| [`Assert::assertContainsOnlyScalar()`] | [`Assert::assertContainsNotOnlyScalar()`] | +| [`Assert::assertContainsOnlyString()`] | [`Assert::assertContainsNotOnlyString()`] | +| | [`Assert::assertContainsNotOnlyInstancesOf()`] | + + +These methods were introduced in PHPUnit 11.5.0 as alternatives to the `Assert::assertContainsOnly()` and `Assert::assertNotContainsOnly()` methods, which were soft deprecated in PHPUnit 11.5.0, hard deprecated (warning) in PHPUnit 12.0.0 and will be removed in PHPUnit 13.0.0. + +* The `assertContains[Not]OnlyClosedResource()` methods are affected by issues in older PHP versions. Please read the [warning about checking for closed resources and how to optional skip such tests](https://github.com/Yoast/PHPUnit-Polyfills/tree/1.x?tab=readme-ov-file#phpunit--930-yoastphpunitpolyfillspolyfillsassertclosedresource). + +[`Assert::assertContainsOnlyArray()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyarray +[`Assert::assertContainsNotOnlyArray()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyarray +[`Assert::assertContainsOnlyBool()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlybool +[`Assert::assertContainsNotOnlyBool()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlybool +[`Assert::assertContainsOnlyCallable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlycallable +[`Assert::assertContainsNotOnlyCallable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlycallable +[`Assert::assertContainsOnlyFloat()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyfloat +[`Assert::assertContainsNotOnlyFloat()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyfloat +[`Assert::assertContainsOnlyInt()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyint +[`Assert::assertContainsNotOnlyInt()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyint +[`Assert::assertContainsOnlyIterable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyiterable +[`Assert::assertContainsNotOnlyIterable()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyiterable +[`Assert::assertContainsOnlyNull()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlynull +[`Assert::assertContainsNotOnlyNull()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlynull +[`Assert::assertContainsOnlyNumeric()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlynumeric +[`Assert::assertContainsNotOnlyNumeric()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlynumeric +[`Assert::assertContainsOnlyObject()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyobject +[`Assert::assertContainsNotOnlyObject()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyobject +[`Assert::assertContainsOnlyResource()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyresource +[`Assert::assertContainsNotOnlyResource()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyresource +[`Assert::assertContainsOnlyClosedResource()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyclosedresource +[`Assert::assertContainsNotOnlyClosedResource()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyclosedresource +[`Assert::assertContainsOnlyScalar()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyscalar +[`Assert::assertContainsNotOnlyScalar()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyscalar +[`Assert::assertContainsOnlyString()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlystring +[`Assert::assertContainsNotOnlyString()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlystring +[`Assert::assertContainsNotOnlyInstancesOf()`]: https://docs.phpunit.de/en/11.5/assertions.html#assertcontainsonlyinstancesof ### TestCases @@ -490,7 +559,7 @@ The `assertObjectNotEquals()` assertion was introduced in PHPUnit 11.2.0. PHPUnit 8.0.0 introduced a `void` return type declaration to the ["fixture" methods] - `setUpBeforeClass()`, `setUp()`, `tearDown()` and `tearDownAfterClass()`. As the `void` return type was not introduced until PHP 7.1, this makes it more difficult to create cross-version compatible tests when using fixtures, due to signature mismatches. -["fixture" methods]: https://docs.phpunit.de/en/main/fixtures.html +["fixture" methods]: https://docs.phpunit.de/en/11.5/fixtures.html This library contains two basic `TestCase` options to overcome this issue. @@ -554,10 +623,10 @@ This `TestCase` overcomes the signature mismatch by using the PHPUnit `@before[C When using this TestCase, overloaded fixture methods need to use the [`@beforeClass`], [`@before`], [`@after`] and [`@afterClass`] annotations. The naming of the overloaded methods is open as long as the method names don't conflict with the PHPUnit native method names. -[`@beforeClass`]: https://docs.phpunit.de/en/main/annotations.html#beforeclass -[`@before`]: https://docs.phpunit.de/en/main/annotations.html#before -[`@after`]: https://docs.phpunit.de/en/main/annotations.html#after -[`@afterClass`]: https://docs.phpunit.de/en/main/annotations.html#afterclass +[`@beforeClass`]: https://docs.phpunit.de/en/11.5/annotations.html#beforeclass +[`@before`]: https://docs.phpunit.de/en/11.5/annotations.html#before +[`@after`]: https://docs.phpunit.de/en/11.5/annotations.html#after +[`@afterClass`]: https://docs.phpunit.de/en/11.5/annotations.html#afterclass ```php use Yoast\PHPUnitPolyfills\TestCases\XTestCase; diff --git a/vendor/yoast/phpunit-polyfills/composer.json b/vendor/yoast/phpunit-polyfills/composer.json index ba280868..c8599265 100644 --- a/vendor/yoast/phpunit-polyfills/composer.json +++ b/vendor/yoast/phpunit-polyfills/composer.json @@ -67,9 +67,6 @@ "lint-gte80": [ "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --show-deprecated --exclude vendor --exclude .git" ], - "lint-gte84": [ - "@php ./vendor/php-parallel-lint/php-parallel-lint/parallel-lint . -e php --show-deprecated --exclude vendor --exclude .git" - ], "check-cs": [ "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs --runtime-set testVersion 7.0-" ], @@ -92,8 +89,7 @@ "scripts-descriptions": { "lint7": "Check the PHP files for parse errors. (PHP 7.1 - 7.4)", "lint70": "Check the PHP files for parse errors. (PHP 7.0)", - "lint-gte80": "Check the PHP files for parse errors. (PHP 8.0 - 8.3)", - "lint-gte84": "Check the PHP files for parse errors. (PHP 8.4+)", + "lint-gte80": "Check the PHP files for parse errors. (PHP 8.0+)", "check-cs": "Check the PHP files for code style violations and best practices.", "fix-cs": "Auto-fix code style violations in the PHP files.", "test": "Run the unit tests without code coverage (PHPUnit < 10).", diff --git a/vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php b/vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php index 1a59b735..cd443431 100644 --- a/vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php +++ b/vendor/yoast/phpunit-polyfills/phpunitpolyfills-autoload.php @@ -10,15 +10,19 @@ /** * Custom autoloader. + * + * @since 0.1.0 */ final class Autoload { /** * Version number. * + * @since 1.0.1 + * * @var string */ - const VERSION = '3.0.0'; + const VERSION = '3.1.1'; /** * Loads a class. @@ -94,6 +98,10 @@ public static function load( $className ) { self::loadAssertObjectNotEquals(); return true; + case 'Yoast\PHPUnitPolyfills\Polyfills\AssertContainsOnly': + self::loadAssertContainsOnly(); + return true; + case 'Yoast\PHPUnitPolyfills\TestCases\TestCase': self::loadTestCase(); return true; @@ -377,6 +385,23 @@ public static function loadAssertObjectNotEquals() { require_once __DIR__ . '/src/Polyfills/AssertObjectNotEquals_Empty.php'; } + /** + * Load the AssertContainsOnly polyfill or an empty trait with the same name + * if a PHPUnit version is used which already contains this functionality. + * + * @return void + */ + public static function loadAssertContainsOnly() { + if ( \method_exists( Assert::class, 'assertContainsOnlyIterable' ) === false ) { + // PHPUnit < 11.5.0. + require_once __DIR__ . '/src/Polyfills/AssertContainsOnly.php'; + return; + } + + // PHPUnit >= 11.5.0. + require_once __DIR__ . '/src/Polyfills/AssertContainsOnly_Empty.php'; + } + /** * Load the appropriate TestCase class based on the PHPUnit version being used. * diff --git a/vendor/yoast/phpunit-polyfills/src/Exceptions/InvalidComparisonMethodException.php b/vendor/yoast/phpunit-polyfills/src/Exceptions/InvalidComparisonMethodException.php index a3d077a4..089f07b1 100644 --- a/vendor/yoast/phpunit-polyfills/src/Exceptions/InvalidComparisonMethodException.php +++ b/vendor/yoast/phpunit-polyfills/src/Exceptions/InvalidComparisonMethodException.php @@ -9,6 +9,8 @@ * * PHPUnit natively throws a range of different exceptions. * The polyfills throw just one exception type with different messages. + * + * @since 1.0.0 */ final class InvalidComparisonMethodException extends Exception { diff --git a/vendor/yoast/phpunit-polyfills/src/Helpers/ComparatorValidator.php b/vendor/yoast/phpunit-polyfills/src/Helpers/ComparatorValidator.php index c6c3ed01..0de5dd3a 100644 --- a/vendor/yoast/phpunit-polyfills/src/Helpers/ComparatorValidator.php +++ b/vendor/yoast/phpunit-polyfills/src/Helpers/ComparatorValidator.php @@ -19,9 +19,11 @@ * --------------------------------------------------------------------------------------------- * * @internal + * + * @since 3.0.0 */ final class ComparatorValidator { - + /** * Asserts that a custom object comparison method complies with the requirements set by PHPUnit. * diff --git a/vendor/yoast/phpunit-polyfills/src/Helpers/ResourceHelper.php b/vendor/yoast/phpunit-polyfills/src/Helpers/ResourceHelper.php index 15769fcd..020fc51f 100644 --- a/vendor/yoast/phpunit-polyfills/src/Helpers/ResourceHelper.php +++ b/vendor/yoast/phpunit-polyfills/src/Helpers/ResourceHelper.php @@ -16,6 +16,8 @@ * --------------------------------------------------------------------------------------------- * * @internal + * + * @since 1.0.0 */ final class ResourceHelper { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertArrayWithListKeys_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertArrayWithListKeys_Empty.php index 0e647c6d..a5df522b 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertArrayWithListKeys_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertArrayWithListKeys_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 11.0.0 in which the polyfill is not needed. + * + * @since 3.0.0 */ trait AssertArrayWithListKeys {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertClosedResource.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertClosedResource.php index 36f0c5c1..f38025ce 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertClosedResource.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertClosedResource.php @@ -14,6 +14,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/issues/4276 * @link https://github.com/sebastianbergmann/phpunit/pull/4365 + * + * @since 1.0.0 */ trait AssertClosedResource { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertClosedResource_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertClosedResource_Empty.php index 8cb4c554..863963cf 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertClosedResource_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertClosedResource_Empty.php @@ -10,6 +10,8 @@ * For consistency, the "should this test be skipped" method is included * as the PHPUnit native versions of the `assertIs[Not]ClosedResource()` * assertions are affected by the same bugs. + * + * @since 1.0.0 */ trait AssertClosedResource { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertContainsOnly.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertContainsOnly.php new file mode 100644 index 00000000..308dfe1b --- /dev/null +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertContainsOnly.php @@ -0,0 +1,472 @@ + $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyInstancesOf( string $className, $haystack, string $message = '' ) { + static::assertNotContainsOnly( $className, $haystack, false, $message ); + } + + /** + * Asserts that $haystack only contains values of type array. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyArray( $haystack, string $message = '' ) { + static::assertContainsOnly( 'array', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type array. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyArray( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'array', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type boolean. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyBool( $haystack, string $message = '' ) { + static::assertContainsOnly( 'bool', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type boolean. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyBool( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'bool', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type callable. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyCallable( $haystack, string $message = '' ) { + static::assertContainsOnly( 'callable', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type callable. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyCallable( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'callable', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type float. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyFloat( $haystack, string $message = '' ) { + static::assertContainsOnly( 'float', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type float. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyFloat( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'float', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type integer. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyInt( $haystack, string $message = '' ) { + static::assertContainsOnly( 'int', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type integer. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyInt( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'int', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type iterable. + * + * {@internal Support for `iterable` was only added to the `IsType` constraint + * in PHPUnit 7.1.0, so this polyfill can't use a direct fall-through to the PHPUnit native + * functionality until the minimum supported PHPUnit version of this library would be PHPUnit 7.1.0.} + * + * @link https://github.com/sebastianbergmann/phpunit/pull/3035 PR which added support for `is_iterable`. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyIterable( $haystack, string $message = '' ) { + if ( \function_exists( 'is_iterable' ) === true + && \version_compare( Autoload::getPHPUnitVersion(), '7.1.0', '>=' ) + ) { + // PHP >= 7.1 with PHPUnit >= 7.1.0. + static::assertContainsOnly( 'iterable', $haystack, true, $message ); + } + else { + // PHP < 7.1 or PHPUnit 6.x/7.0.0. + $exporter = self::getPHPUnitExporterObjectForContainsOnly(); + $msg = \sprintf( 'Failed asserting that %s contains only values of type "iterable".', $exporter->export( $haystack ) ); + + if ( $message !== '' ) { + $msg = $message . \PHP_EOL . $msg; + } + + $hasOnlyIterable = true; + foreach ( $haystack as $value ) { + if ( \is_array( $value ) || $value instanceof Traversable ) { + continue; + } + + $hasOnlyIterable = false; + break; + } + + static::assertTrue( $hasOnlyIterable, $msg ); + } + } + + /** + * Asserts that $haystack does not only contain values of type iterable. + * + * {@internal Support for `iterable` was only added to the `IsType` constraint + * in PHPUnit 7.1.0, so this polyfill can't use a direct fall-through to the PHPUnit native + * functionality until the minimum supported PHPUnit version of this library would be PHPUnit 7.1.0.} + * + * @link https://github.com/sebastianbergmann/phpunit/pull/3035 PR which added support for `is_iterable`. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyIterable( $haystack, string $message = '' ) { + if ( \function_exists( 'is_iterable' ) === true + && \version_compare( Autoload::getPHPUnitVersion(), '7.1.0', '>=' ) + ) { + // PHP >= 7.1 with PHPUnit >= 7.1.0. + static::assertNotContainsOnly( 'iterable', $haystack, true, $message ); + } + else { + // PHP < 7.1 or PHPUnit 6.x/7.0.0. + $exporter = self::getPHPUnitExporterObjectForContainsOnly(); + $msg = \sprintf( 'Failed asserting that %s does not contain only values of type "iterable".', $exporter->export( $haystack ) ); + + if ( $message !== '' ) { + $msg = $message . \PHP_EOL . $msg; + } + + $hasOnlyIterable = true; + foreach ( $haystack as $value ) { + if ( \is_array( $value ) || $value instanceof Traversable ) { + continue; + } + + $hasOnlyIterable = false; + break; + } + + static::assertFalse( $hasOnlyIterable, $msg ); + } + } + + /** + * Asserts that $haystack only contains values of type null. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyNull( $haystack, string $message = '' ) { + static::assertContainsOnly( 'null', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type null. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyNull( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'null', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type numeric. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyNumeric( $haystack, string $message = '' ) { + static::assertContainsOnly( 'numeric', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type numeric. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyNumeric( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'numeric', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type object. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyObject( $haystack, string $message = '' ) { + static::assertContainsOnly( 'object', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type object. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyObject( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'object', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type resource. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyResource( $haystack, string $message = '' ) { + static::assertContainsOnly( 'resource', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type resource. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyResource( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'resource', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type closed resource. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyClosedResource( $haystack, string $message = '' ) { + $exporter = self::getPHPUnitExporterObjectForContainsOnly(); + $msg = \sprintf( 'Failed asserting that %s contains only values of type "resource (closed)".', $exporter->export( $haystack ) ); + + if ( $message !== '' ) { + $msg = $message . \PHP_EOL . $msg; + } + + $hasOnlyClosedResources = true; + foreach ( $haystack as $value ) { + if ( ResourceHelper::isClosedResource( $value ) ) { + continue; + } + + $hasOnlyClosedResources = false; + break; + } + + static::assertTrue( $hasOnlyClosedResources, $msg ); + } + + /** + * Asserts that $haystack does not only contain values of type closed resource. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyClosedResource( $haystack, string $message = '' ) { + $exporter = self::getPHPUnitExporterObjectForContainsOnly(); + $msg = \sprintf( 'Failed asserting that %s does not contain only values of type "resource (closed)".', $exporter->export( $haystack ) ); + + if ( $message !== '' ) { + $msg = $message . \PHP_EOL . $msg; + } + + $hasOnlyClosedResources = true; + foreach ( $haystack as $value ) { + if ( ResourceHelper::isClosedResource( $value ) ) { + continue; + } + + $hasOnlyClosedResources = false; + break; + } + + static::assertFalse( $hasOnlyClosedResources, $msg ); + } + + /** + * Asserts that $haystack only contains values of type scalar. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyScalar( $haystack, string $message = '' ) { + static::assertContainsOnly( 'scalar', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type scalar. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyScalar( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'scalar', $haystack, true, $message ); + } + + /** + * Asserts that $haystack only contains values of type string. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsOnlyString( $haystack, string $message = '' ) { + static::assertContainsOnly( 'string', $haystack, true, $message ); + } + + /** + * Asserts that $haystack does not only contain values of type string. + * + * @param iterable $haystack The variable to test. + * @param string $message Optional failure message to display. + * + * @return void + */ + final public static function assertContainsNotOnlyString( $haystack, string $message = '' ) { + static::assertNotContainsOnly( 'string', $haystack, true, $message ); + } + + /** + * Helper function to obtain an instance of the Exporter class. + * + * @return Exporter|Exporter_In_Phar|Exporter_In_Phar_Old + */ + private static function getPHPUnitExporterObjectForContainsOnly() { + if ( \class_exists( Exporter::class ) ) { + // Composer install or really old PHAR files. + return new Exporter(); + } + elseif ( \class_exists( Exporter_In_Phar::class ) ) { + // PHPUnit PHAR file for 8.5.38+, 9.6.19+, 10.5.17+ and 11.0.10+. + return new Exporter_In_Phar(); + } + + // PHPUnit PHAR file for < 8.5.38, < 9.6.19, < 10.5.17 and < 11.0.10. + return new Exporter_In_Phar_Old(); + } +} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertContainsOnly_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertContainsOnly_Empty.php new file mode 100644 index 00000000..e2b29c97 --- /dev/null +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertContainsOnly_Empty.php @@ -0,0 +1,10 @@ += 11.5.0 in which the polyfill is not needed. + * + * @since 3.1.0 + */ +trait AssertContainsOnly {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertEqualsSpecializations.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertEqualsSpecializations.php index ac04cef3..c37b89db 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertEqualsSpecializations.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertEqualsSpecializations.php @@ -12,6 +12,8 @@ * deprecated in PHPUnit 7.5.0 and removed in PHPUnit 9.0.0. * * @link https://github.com/sebastianbergmann/phpunit/issues/3340 + * + * @since 0.1.0 */ trait AssertEqualsSpecializations { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertEqualsSpecializations_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertEqualsSpecializations_Empty.php index b8fbaa68..ef848bb9 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertEqualsSpecializations_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertEqualsSpecializations_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertEqualsSpecializations {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertFileEqualsSpecializations.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertFileEqualsSpecializations.php index 1ddbbcab..c108e6db 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertFileEqualsSpecializations.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertFileEqualsSpecializations.php @@ -15,6 +15,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/issues/3949 * @link https://github.com/sebastianbergmann/phpunit/issues/3951 + * + * @since 0.1.0 */ trait AssertFileEqualsSpecializations { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertFileEqualsSpecializations_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertFileEqualsSpecializations_Empty.php index 18009a86..56adb719 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertFileEqualsSpecializations_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertFileEqualsSpecializations_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 8.5.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertFileEqualsSpecializations {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsType.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsType.php index 34007d69..487d6547 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsType.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsType.php @@ -14,6 +14,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/issues/3368 * @link https://github.com/sebastianbergmann/phpunit/issues/3369 + * + * @since 0.1.0 */ trait AssertIsType { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsType_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsType_Empty.php index e89add2a..14b7bfdd 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsType_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertIsType_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertIsType {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectEquals.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectEquals.php index efd13e74..d814d1a5 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectEquals.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectEquals.php @@ -18,6 +18,8 @@ * @link https://github.com/sebastianbergmann/phpunit/issues/4707 * @link https://github.com/sebastianbergmann/phpunit/commit/1dba8c3a4b2dd04a3ff1869f75daaeb6757a14ee * @link https://github.com/sebastianbergmann/phpunit/commit/6099c5eefccfda860c889f575d58b5fe6cc10c83 + * + * @since 1.0.0 */ trait AssertObjectEquals { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectEquals_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectEquals_Empty.php index 4390a976..9546154d 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectEquals_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectEquals_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 9.4.0 in which this polyfill is not needed. + * + * @since 1.0.0 */ trait AssertObjectEquals {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectNotEquals.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectNotEquals.php index 8463cb2e..2f9c0bd1 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectNotEquals.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectNotEquals.php @@ -16,6 +16,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/issues/5811 * @link https://github.com/sebastianbergmann/phpunit/commit/8e3b7c18506312df0676f2e079c414cc56b49f69 + * + * @since 3.0.0 */ trait AssertObjectNotEquals { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectNotEquals_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectNotEquals_Empty.php index 7d345df1..4f92f678 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectNotEquals_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectNotEquals_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 11.2.0 in which this polyfill is not needed. + * + * @since 3.0.0 */ trait AssertObjectNotEquals {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectProperty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectProperty.php index 5e5a06e4..1b98bf97 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectProperty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectProperty.php @@ -18,6 +18,8 @@ * * @link https://github.com/sebastianbergmann/phpunit/pull/5231 * @link https://github.com/sebastianbergmann/phpunit/issues/5478 + * + * @since 2.0.0 */ trait AssertObjectProperty { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectProperty_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectProperty_Empty.php index fd7e73ef..8cb93aca 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectProperty_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertObjectProperty_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 9.6.11 < 10.0.0 and PHPUnit >= 10.1.0 in which this polyfill is not needed. + * + * @since 2.0.0 */ trait AssertObjectProperty {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertStringContains.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertStringContains.php index 151e4ad6..980e3865 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertStringContains.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertStringContains.php @@ -13,6 +13,8 @@ * @link https://github.com/sebastianbergmann/phpunit/issues/3422 * @link https://github.com/sebastianbergmann/phpunit/issues/2520 * @link https://github.com/sebastianbergmann/phpunit/pull/2778 + * + * @since 0.1.0 */ trait AssertStringContains { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertStringContains_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertStringContains_Empty.php index 6d82e87d..1002b00f 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertStringContains_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertStringContains_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 7.5.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertStringContains {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertionRenames.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertionRenames.php index c30480b0..659a6f15 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertionRenames.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertionRenames.php @@ -38,6 +38,8 @@ * @link https://github.com/sebastianbergmann/phpunit/issues/4088 * @link https://github.com/sebastianbergmann/phpunit/issues/4089 * @link https://github.com/sebastianbergmann/phpunit/issues/4090 + * + * @since 0.1.0 */ trait AssertionRenames { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertionRenames_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertionRenames_Empty.php index 4de78582..250aa5d8 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertionRenames_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/AssertionRenames_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 9.1.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait AssertionRenames {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/EqualToSpecializations.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/EqualToSpecializations.php index 15cd1cfa..89581e21 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/EqualToSpecializations.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/EqualToSpecializations.php @@ -3,7 +3,6 @@ namespace Yoast\PHPUnitPolyfills\Polyfills; use PHPUnit\Framework\Constraint\IsEqual; -use PHPUnit_Framework_Constraint_IsEqual; /** * Polyfill the Assert::equalToCanonicalizing(), Assert::equalToIgnoringCase() and @@ -15,6 +14,8 @@ * never deprecated but leads to unexpected behaviour as they are ignored in PHPUnit 9.0.0. * * @link https://github.com/sebastianbergmann/phpunit/commit/43c01a4e0c74a4bf019a8d879bced5146af2fbb6 + * + * @since 1.0.0 */ trait EqualToSpecializations { @@ -23,7 +24,7 @@ trait EqualToSpecializations { * * @param mixed $value Expected value for constraint. * - * @return IsEqual|PHPUnit_Framework_Constraint_IsEqual An isEqual constraint instance. + * @return IsEqual An isEqual constraint instance. */ final public static function equalToCanonicalizing( $value ) { return static::equalTo( $value, 0.0, 10, true, false ); @@ -34,7 +35,7 @@ final public static function equalToCanonicalizing( $value ) { * * @param mixed $value Expected value for constraint. * - * @return IsEqual|PHPUnit_Framework_Constraint_IsEqual An isEqual constraint instance. + * @return IsEqual An isEqual constraint instance. */ final public static function equalToIgnoringCase( $value ) { return static::equalTo( $value, 0.0, 10, false, true ); @@ -46,7 +47,7 @@ final public static function equalToIgnoringCase( $value ) { * @param mixed $value Expected value for constraint. * @param float $delta The delta to allow between the expected and the actual value. * - * @return IsEqual|PHPUnit_Framework_Constraint_IsEqual An isEqual constraint instance. + * @return IsEqual An isEqual constraint instance. */ final public static function equalToWithDelta( $value, $delta ) { return static::equalTo( $value, $delta, 10, false, false ); diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/EqualToSpecializations_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/EqualToSpecializations_Empty.php index a03eb52c..6275d07f 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/EqualToSpecializations_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/EqualToSpecializations_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 9.0.0 in which this polyfill is not needed. + * + * @since 1.0.0 */ trait EqualToSpecializations {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches.php index e9267f3a..85778dd0 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches.php @@ -13,6 +13,8 @@ * @link https://github.com/sebastianbergmann/phpunit/commit/d1199cb2e43a934b51521656be9748f63febe18e * @link https://github.com/sebastianbergmann/phpunit/issues/4133 * @link https://github.com/sebastianbergmann/phpunit/issues/3957 + * + * @since 0.1.0 */ trait ExpectExceptionMessageMatches { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches_Empty.php index f6278c1b..7ddc36f6 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectExceptionMessageMatches_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 8.4.0 in which this polyfill is not needed. + * + * @since 0.1.0 */ trait ExpectExceptionMessageMatches {} diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectUserDeprecation.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectUserDeprecation.php index e0069f4e..5a486201 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectUserDeprecation.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectUserDeprecation.php @@ -13,6 +13,8 @@ * Note: PHPUnit 10 is not and will not be supported for these polyfills. * * @link https://github.com/sebastianbergmann/phpunit/pull/5605 + * + * @since 3.0.0 */ trait ExpectUserDeprecation { diff --git a/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectUserDeprecation_Empty.php b/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectUserDeprecation_Empty.php index 7a1ac9b5..249df881 100644 --- a/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectUserDeprecation_Empty.php +++ b/vendor/yoast/phpunit-polyfills/src/Polyfills/ExpectUserDeprecation_Empty.php @@ -4,5 +4,7 @@ /** * Empty trait for use with PHPUnit >= 11.0.0 in which this polyfill is not needed. + * + * @since 3.0.0 */ trait ExpectUserDeprecation {} diff --git a/vendor/yoast/phpunit-polyfills/src/TestCases/TestCasePHPUnitGte8.php b/vendor/yoast/phpunit-polyfills/src/TestCases/TestCasePHPUnitGte8.php index 88280119..930a6a2a 100644 --- a/vendor/yoast/phpunit-polyfills/src/TestCases/TestCasePHPUnitGte8.php +++ b/vendor/yoast/phpunit-polyfills/src/TestCases/TestCasePHPUnitGte8.php @@ -5,6 +5,7 @@ use PHPUnit\Framework\TestCase as PHPUnit_TestCase; use Yoast\PHPUnitPolyfills\Polyfills\AssertArrayWithListKeys; use Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource; +use Yoast\PHPUnitPolyfills\Polyfills\AssertContainsOnly; use Yoast\PHPUnitPolyfills\Polyfills\AssertFileEqualsSpecializations; use Yoast\PHPUnitPolyfills\Polyfills\AssertIgnoringLineEndings; use Yoast\PHPUnitPolyfills\Polyfills\AssertionRenames; @@ -24,11 +25,14 @@ * methods to get round the signature change in PHPUnit 8. * * When using this TestCase, the snakecase method names need to be used to overload a fixture method. + * + * @since 0.1.0 */ abstract class TestCase extends PHPUnit_TestCase { use AssertArrayWithListKeys; use AssertClosedResource; + use AssertContainsOnly; use AssertFileEqualsSpecializations; use AssertIgnoringLineEndings; use AssertionRenames; @@ -69,6 +73,8 @@ protected function setUp(): void { * * This method is called before the execution of a test starts and after setUp() is called. * + * @since 0.2.0 + * * @return void */ protected function assertPreConditions(): void { @@ -81,6 +87,8 @@ protected function assertPreConditions(): void { * * This method is called before the execution of a test ends and before tearDown() is called. * + * @since 0.2.0 + * * @return void */ protected function assertPostConditions(): void { diff --git a/vendor/yoast/phpunit-polyfills/src/TestCases/TestCasePHPUnitLte7.php b/vendor/yoast/phpunit-polyfills/src/TestCases/TestCasePHPUnitLte7.php index 6245003f..e9becbdd 100644 --- a/vendor/yoast/phpunit-polyfills/src/TestCases/TestCasePHPUnitLte7.php +++ b/vendor/yoast/phpunit-polyfills/src/TestCases/TestCasePHPUnitLte7.php @@ -5,6 +5,7 @@ use PHPUnit\Framework\TestCase as PHPUnit_TestCase; use Yoast\PHPUnitPolyfills\Polyfills\AssertArrayWithListKeys; use Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource; +use Yoast\PHPUnitPolyfills\Polyfills\AssertContainsOnly; use Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations; use Yoast\PHPUnitPolyfills\Polyfills\AssertFileEqualsSpecializations; use Yoast\PHPUnitPolyfills\Polyfills\AssertIgnoringLineEndings; @@ -27,11 +28,14 @@ * methods to get round the signature change in PHPUnit 8. * * When using this TestCase, the snakecase method names need to be used to overload a fixture method. + * + * @since 0.1.0 */ abstract class TestCase extends PHPUnit_TestCase { use AssertArrayWithListKeys; use AssertClosedResource; + use AssertContainsOnly; use AssertEqualsSpecializations; use AssertFileEqualsSpecializations; use AssertIgnoringLineEndings; @@ -75,6 +79,8 @@ protected function setUp() { * * This method is called before the execution of a test starts and after setUp() is called. * + * @since 0.2.0 + * * @return void */ protected function assertPreConditions() { @@ -87,6 +93,8 @@ protected function assertPreConditions() { * * This method is called before the execution of a test ends and before tearDown() is called. * + * @since 0.2.0 + * * @return void */ protected function assertPostConditions() { diff --git a/vendor/yoast/phpunit-polyfills/src/TestCases/XTestCase.php b/vendor/yoast/phpunit-polyfills/src/TestCases/XTestCase.php index 9041f467..ccba952e 100644 --- a/vendor/yoast/phpunit-polyfills/src/TestCases/XTestCase.php +++ b/vendor/yoast/phpunit-polyfills/src/TestCases/XTestCase.php @@ -9,6 +9,7 @@ use PHPUnit\Framework\TestCase as PHPUnit_TestCase; use Yoast\PHPUnitPolyfills\Polyfills\AssertArrayWithListKeys; use Yoast\PHPUnitPolyfills\Polyfills\AssertClosedResource; +use Yoast\PHPUnitPolyfills\Polyfills\AssertContainsOnly; use Yoast\PHPUnitPolyfills\Polyfills\AssertEqualsSpecializations; use Yoast\PHPUnitPolyfills\Polyfills\AssertFileEqualsSpecializations; use Yoast\PHPUnitPolyfills\Polyfills\AssertIgnoringLineEndings; @@ -33,11 +34,14 @@ * `@after` and `@afterClass` annotations. * The naming of the overloaded methods is open as long as the method names don't conflict with * the PHPUnit native method names. + * + * @since 0.1.0 */ abstract class XTestCase extends PHPUnit_TestCase { use AssertArrayWithListKeys; use AssertClosedResource; + use AssertContainsOnly; use AssertEqualsSpecializations; use AssertFileEqualsSpecializations; use AssertIgnoringLineEndings; diff --git a/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php b/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php index 93e1d97d..d6bca59b 100644 --- a/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php +++ b/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerDefaultImplementationPHPUnit6.php @@ -16,6 +16,8 @@ * * When using this TestListener trait, the snake_case method names need to be used to implement * the listener functionality. + * + * @since 0.2.0 */ trait TestListenerDefaultImplementation { diff --git a/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php b/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php index ed6d61cc..1a175233 100644 --- a/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php +++ b/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerDefaultImplementationPHPUnitGte7.php @@ -16,6 +16,8 @@ * * When using this TestListener trait, the snake_case method names need to be used to implement * the listener functionality. + * + * @since 0.2.0 */ trait TestListenerDefaultImplementation { diff --git a/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerSnakeCaseMethods.php b/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerSnakeCaseMethods.php index 8985de64..1072f48b 100644 --- a/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerSnakeCaseMethods.php +++ b/vendor/yoast/phpunit-polyfills/src/TestListeners/TestListenerSnakeCaseMethods.php @@ -11,6 +11,10 @@ /** * Renamed snake_case TestListener method collection used by the TestListenerDefaultImplementation traits. + * + * @since 0.2.0 + * + * @phpcs:disable VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable -- This is intentional as these are template methods. */ trait TestListenerSnakeCaseMethods {