Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Releases: Yoast/yoastcs

3.4.1

13 Mar 20:12
@jrfnl jrfnl
Immutable release. Only release title and notes can be modified.
dedd30d
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

3.4.1 - 2026年03月03日

Fixed

  • PHPCS: a PHPCS run with the SlevomatCodingStandard locked at a version below 8.17.0 would error out on a "ERROR: Property "checkIfConditions" does not exist" error.
Assets 3
Loading

3.4.0

20 Feb 10:22
@enricobattocchi enricobattocchi
Immutable release. Only release title and notes can be modified.
c3f5b28
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

3.4.0 - 2026年02月20日

Changed

  • Composer: Supported version of PHPCompatibilityWP has been changed from ^2.1.6 to ^3.0.0@alpha.
    This allows for installing the much, much improved PHPCompatibility 10.0.0 (prerelease).
    To do so, the composer.json file of packages requiring this package must have "minimum-stability": "dev" or "alpha" (or other tweaks which net the same effect).
Loading

3.3.0

04 Feb 12:38
@enricobattocchi enricobattocchi
Immutable release. Only release title and notes can be modified.
54fdadb
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

3.3.0 - 2026年02月04日

Added

  • PHPCS: The SlevomatCodingStandard.Arrays.ArrayAccess sniff.
  • PHPCS: The SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator sniff.
  • PHPCS: The SlevomatCodingStandard.ControlStructures.RequireNullCoalesceEqualOperator sniff.
  • PHPCS: The SlevomatCodingStandard.Functions.RequireTrailingCommaInCall sniff.
  • PHPCS: The SlevomatCodingStandard.Functions.DisallowTrailingCommaInCall sniff (for single-line function calls).
  • PHPCS: The SlevomatCodingStandard.Numbers.RequireNumericLiteralSeparator sniff.
  • PHPCS: The Universal.Attributes.TrailingComma sniff.
  • PHPCS: The Universal.Attributes.BracketSpacing sniff (via WordPressCS).
  • PHPCS: The Universal.Attributes.DisallowAttributeParentheses sniff (via WordPressCS).
  • PHPCS: The Universal.PHP.NoFQNTrueFalseNull sniff.
  • PHPCS: The Universal.PHP.RequireExitDieParentheses sniff.
  • PHPCS: The WordPress.WP.GetMetaSingle sniff (via WordPressCS).

Changed

  • Composer: Supported version of PHPCSExtra has been changed from ^1.2.1 to ^1.5.0.
  • Composer: Supported version of VariableAnalysis has been changed from ^2.12.0 to ^2.13.0.
  • Composer: Supported version of WordPressCS has been changed from ^3.1.0 to ^3.3.0.
  • PHPCS: The default value for the minimum_wp_version property which is used by various WPCS sniffs has been updated to WP 6.8 (was 6.6).
  • Various housekeeping.
Loading

3.2.0

19 Mar 11:56
@enricobattocchi enricobattocchi
2594255
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

3.2.0 - 2025年03月19日

Added

  • PHPCS: The Generic.Strings.UnnecessaryHeredoc sniff.
  • PHPCS: The Generic.WhiteSpace.HereNowdocIdentifierSpacing sniff.

Changed

  • Composer: Supported version of PHP_CodeSniffer has been changed from ^3.9.1 to ^3.12.0.
  • Composer: Supported version of PHPCSUtils has been changed from ^1.0.10 to ^1.0.12.
  • Composer: Supported version of PHPCompatibilityWP has been changed from ^2.1.4 to ^2.1.6.
  • Composer: Supported version of VariableAnalysis has been changed from ^2.11.17 to ^2.12.0.
  • Composer: Supported version of WordPressVIP Coding Standards has been changed from ^3.0.0 to ^3.0.1.
  • Composer: Updated the supported versions of dev dependencies.
  • PHPCS: The default setting for the minimum supported PHP version for repos using YoastCS is now PHP 7.4 (was 7.2).
  • PHPCS: The default value for the minimum_wp_version property which is used by various WPCS sniffs has been updated to WP 6.6 (was 6.3).
  • PHPCS: verified runtime compatibility with PHP 8.4.
  • PHPCS: compatibility with SlevomatCodingStandard 8.16.0.
  • Various housekeeping.

Fixed

  • PHPCS: The spacing around comma's in short arrays nested in function calls will now be flagged correctly again.
Loading

3.1.0

05 Apr 08:59
@enricobattocchi enricobattocchi
533b74e
This commit was created on GitHub.com and signed with GitHub’s verified signature.
GPG key ID: B5690EEEBB952194
Verified
Learn about vigilant mode.

Choose a tag to compare

3.1.0 - 2024年04月05日

Added

  • Threshold report: aside from the pre-existing YOASTCS_ABOVE_THRESHOLD constant, a new YOASTCS_THRESHOLD_EXACT_MATCH constant will now be available to determine (from a calling script) whether the error/warning thresholds were matched exactly or need to be updated.

Changed

  • Composer: Supported version of PHP_CodeSniffer has been changed from ^3.8.0 to ^3.9.1.
  • Composer: Supported version of PHPCSUtils has been changed from ^1.0.9 to ^1.0.10.
  • Composer: Supported version of WordPressCS has been changed from ^3.0.1 to ^3.1.0.
    This introduces one new sniff - Generic.CodeAnalysis.RequireExplicitBooleanOperatorPrecedence - to the YoastCS ruleset.
  • Composer: Supported version of SlevomatCodingStandard has been changed from ^8.14.0 to ^8.15.0.
  • Composer: Supported version of PHP Parallel Lint has been changed from ^1.3.2 to ^1.4.0.
  • PHPCS: The default value for the minimum_wp_version (previously minimum_supported_wp_version) property which is used by various WPCS sniffs has been updated to WP 6.3 (was 6.2).
  • Various housekeeping.
Loading

3.0.0

14 Dec 15:22
@enricobattocchi enricobattocchi

Choose a tag to compare

3.0.0 - 2023年12月14日

Added

  • Composer/PHPCS: Dependencies on the following external PHPCS standards packages: PHPCSUtils, PHPCSExtra, SlevomatCodingStandard, VariableAnalysis and WordPressVIP Coding Standards.
  • PHPCS: A best effort has been made to add support for new PHP syntaxes/features to all YoastCS native sniffs and utility functions (or to verify/improve existing support).
    YoastCS native sniffs and utilities have received fixes for the following syntaxes:
    • PHP 5.6
      • Parameter unpacking in function calls.
    • PHP 8.0
      • Named arguments in function calls.
    • PHP 8.1
      • Enumerations.
      • First class callables.
    • PHP 8.2
      • Readonly classes.
  • PHPCS: The Yoast.Commenting.CoversTag sniff includes a new warning for the use of ClassName<*> type @covers annotations, as these have been deprecated as of PHPUnit 9.0.
  • PHPCS: The Yoast.Files.FileName sniff now has the (optional) ability to check whether file names comply with PSR-4.
    To enable this ability, add the custom psr4_paths property to your ruleset. The psr4_paths property is an array property and mirrors the psr4 setting in the Composer autoload directive. It expects a namespace prefix as the array key and a comma separated list of relative paths as the array value. Multiple PSR-4 paths can be passed (array elements).
    For files containing OO structures in a "PSR4 path", the oo_prefixes and the excluded_files_strict_check properties will be ignored.
  • PHPCS: The Yoast.NamingConventions.NamespaceName sniff will now throw a MissingPrefix error if a prefix is expected, but the namespace name does not include a prefix.
  • PHPCS: The Yoast.NamingConventions.NamespaceName sniff will now throw a DirectoryInvalid error if a file is in a directory which would not result in a valid namespace name.
  • PHPCS: The Yoast.NamingConventions.NamespaceName sniff now has the (optional) ability to check whether namespace names comply with PSR-4.
    To enable this ability, add the custom psr4_paths property to your ruleset. The psr4_paths property is an array property and mirrors the psr4 setting in the Composer autoload directive. It expects a namespace prefix as the array key and a comma separated list of relative paths as the array value. Multiple PSR-4 paths can be passed (array elements).
    A psr4_paths property will take precedence over the, potentially set, src_directory and prefixes properties.
  • PHPCS: The following sniffs/error codes have been added to/enabled in the YoastCS ruleset (with appropriate configuration):
    • All new sniffs which were added/included in WordPressCS 3.0.0.
    • PSR1.Classes.ClassDeclaration (for tests only)
    • PSR12.Properties.ConstantVisibility
    • SlevomatCodingStandard.Arrays.DisallowImplicitArrayCreation
    • SlevomatCodingStandard.Classes.ClassStructure
    • SlevomatCodingStandard.Classes.ModernClassNameReference
    • SlevomatCodingStandard.Functions.StaticClosure
    • SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses
    • SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalConstants
    • SlevomatCodingStandard.Namespaces.FullyQualifiedGlobalFunctions
    • SlevomatCodingStandard.Namespaces.ReferenceUsedNamesOnly
    • SlevomatCodingStandard.Namespaces.UnusedUses
    • SlevomatCodingStandard.Namespaces.UseFromSameNamespace
    • SlevomatCodingStandard.TypeHints.DisallowMixedTypeHint (tests excluded)
    • SlevomatCodingStandard.TypeHints.LongTypeHints
    • SlevomatCodingStandard.TypeHints.NullableTypeForNullDefaultValue
    • SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition
    • SlevomatCodingStandard.TypeHints.ParameterTypeHint
    • SlevomatCodingStandard.TypeHints.PropertyTypeHint
    • SlevomatCodingStandard.TypeHints.ReturnTypeHint
    • Squiz.Commenting.FunctionComment.InvalidReturnNotVoid
    • Squiz.Commenting.FunctionComment.MissingReturn
    • Squiz.Commenting.FunctionComment.ParamCommentNotCapital
    • Squiz.Commenting.FunctionComment.SpacingAfterParamName
    • Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines
    • Universal.Classes.RequireFinalClass (for tests only, doubles/mocks excluded)
    • Universal.CodeAnalysis.NoDoubleNegative
    • Universal.ControlStructures.DisallowAlternativeSyntax
    • Universal.ControlStructures.IfElseDeclaration
    • Universal.FunctionDeclarations.NoLongClosures
    • Universal.Operators.ConcatPosition
    • Universal.Operators.DisallowLogicalAndOr
    • Universal.PHP.LowercasePHPTag
    • Universal.UseStatements.DisallowUseConst
    • Universal.UseStatements.DisallowUseFunction
    • VariableAnalysis.CodeAnalysis.VariableAnalysis
    • WordPressVIPMinimum.Classes.DeclarationCompatibility
    • WordPressVIPMinimum.Hooks.AlwaysReturnInFilter
    • WordPressVIPMinimum.Security.EscapingVoidReturnFunctions
    • WordPressVIPMinimum.Security.ProperEscapingFunction
  • PHPCS: New PathHelper, PathValidationHelper and PSR4PathsTraits classes/traits for use by the sniffs.
  • Readme: section on the YoastCS Threshold report.

Changed

  • ⚠️ The minimum supported PHP version for this package is now PHP 7.2 (was 5.4).
  • PHPCS: all sniffs are now runtime compatible with PHP 7.2 - 8.3.
  • ⚠️ PHPCS: All non-abstract classes in YoastCS are now final and all non-public methods and properties are now private.
    Additionally, all non-private methods in traits have also been made final.
  • Composer: Supported version of PHP_CodeSniffer has been changed from ^3.7.1 to ^3.8.0.
  • ⚠️ Composer: Supported version of WordPressCS has been changed from ^2.3.0 to ^3.0.1.
    YoastCS is now fully compatible with WordPressCS 3.0.
    Note: WordPressCS 3.0.0 contains breaking changes. Please read the WordPressCS release announcement and follow the WordPressCS upgrade guides.
  • PHPCS: The default value for the minimum_wp_version (previously minimum_supported_wp_version) property which is used by various WPCS sniffs has been updated to WP 6.2 (was 6.0).
  • PHPCS: Files in a wp-content/plugins/ subdirectory will now always be ignored for PHPCS scans.
  • PHPCS: The ruleset included value for the doubles_path property in the Yoast.Files.TestDoubles sniff has been updated to include the typical Yoast test/Unit/Doubles and test/WP/Doubles directories as per the restructured tests.
  • PHPCS: The Yoast.Commenting.CodeCoverageIgnoreDeprecated sniff will now also examine class docblocks.
  • PHPCS: The Yoast.Commenting.FileComment sniff will no longer flag a file docblock in a namespaced file which doesn't contain an OO structure as redundant.
  • PHPCS: The Yoast.Files.FileName sniff will now also examine the file name of PHP files using only the PHP short open tag (<?=).
  • PHPCS: The Yoast.Files.FileName sniff will now respect inline PHPCS native ignore/disable annotations for the sniff.
    Note: the annotations are respected for the sniff itself, but not for individual error codes from the sniff!
  • PHPCS: The Yoast.Files.FileName sniff now recognizes more word separators, meaning that files using other word separators than underscores will now be flagged for not using hyphenation.
  • PHPCS: The Yoast.Files.FileName sniff will now throw a potential "missing basepath" warning only once per run, not for each file triggering the sniff.
  • PHPCS: The default value for the doubles_path property in the Yoast.Files.TestDoubles sniff is now an empty array.
    This property should now always be set in a custom ruleset.
    Note: the YoastCS ruleset sets this property, so if the ruleset is used instead of explicitly including the individual sniff, this change has no impact.
  • PHPCS: The "namespace level depth" check in the Yoast.NamingConventions.NamespaceName sniff now allows for test fixtures directories being at a deeper level than directly under a tests directory.
  • PHPCS: The Yoast.NamingConventions.ObjectNameDepth sniff now allows for test classes using a _TestCase suffix and will allow for extra object name depth for those, same as for test classes with a _Test suffix.
  • ⚠️ PHPCS: The Yoast.Yoast.AlternativeFunctions sniff has been renamed to Yoast.Yoast.JsonEncodeAlternative.
  • The Yoast.Yoast.JsonEncodeAlternative sniff (previously Yoast.Yoast.AlternativeFunctions) is now disabled by default for files in a /tests/ directory.
  • The Generic.CodeAnalysis.UselessOverridingMethod sniff is now disabled by default for files in a /tests/*/Doubles/ directory.
  • The WordPress.WP.GlobalVariablesOverride sniff is now disabled by default for files in a /tests/ directory.
  • PHPCS: The eror messages for the Yoast.Files.TestDoubles sniff have been improved for accuracy.
  • PHPCS: The error message for the Yoast.NamingConventions.NamespaceName.Invalid error has been made more informative/actionable.
  • PHPCS: The error message for the Yoast.NamingConventions.ValidHookName.NonString warning has been made more actionable.
  • PHPCS: Various sniffs have received efficiency fixes for improved performance.
  • PHPCS: the XML documentation for various sniffs ha...
Read more
Loading

2.3.1

09 Mar 10:18
@enricobattocchi enricobattocchi

Choose a tag to compare

2.3.1 - 2023年03月09日

Changed

  • PHPCS: The default setting for the minimum supported PHP version for repos using YoastCS is now PHP 7.2 (was 5.6).
  • Composer: Supported version of PHP_CodeSniffer has been changed from ^3.7.1 to ^3.7.2.
Loading

2.3.0

09 Jan 11:35
@enricobattocchi enricobattocchi

Choose a tag to compare

2.3.0 - 2023年01月09日

Added

  • PHPCS: New Yoast.Tools.BrainMonkeyRaceCondition sniff.
    This sniff will flag test code which is likely to run into a particular race condition when using BrainMonkey to set expectations for WP hook functions.

Changed

  • PHPCS: The default value for the minimum_supported_wp_version property which is used by various WPCS sniffs has been updated to WP 6.0 (was 5.7).
  • Composer: The package will now identify itself as a static analysis tool. Thanks @GaryJones!
  • Composer: Supported version of PHP_CodeSniffer has been changed from ^3.6.2 to ^3.7.1.
  • Composer: Supported version of PHPCompatibilityWP has been changed from ^2.1.3 to ^2.1.4.
  • Composer: Supported version of the Composer PHPCS plugin has been changed from ^0.5 || ^0.6.2 || ^0.7 to ^0.6.2 || ^0.7 || ^1.0.
  • Various housekeeping.

Fixed

  • PHPCS: Yoast.Files.FileComment: the sniff will now allow for and respect phpcs:disable comments for this sniff when found in a file docblock.

Contributors

GaryJones
Loading

2.2.1

22 Feb 12:56
@IreneStr IreneStr

Choose a tag to compare

2.2.1 - 2022年02月22日

Changed

  • Composer: Supported version of PHP_CodeSniffer has been changed from ^3.6.0 to ^3.6.2.
  • Composer: Supported version of PHPCompatibilityWP has been changed from ^2.1.0 to ^2.1.3.
  • Composer: Supported version of PHP Parallel Lint has been changed from ^1.3.1 to ^1.3.2.
  • Composer: Supported version of PHP Console Highlighter has been changed from ^0.5.0 to ^1.0.0.
  • Readme: Updated installation instructions for compatibility with Composer 2.2+ and other minor improvements.
  • Various housekeeping.
Loading

2.2.0

22 Sep 14:15
@IreneStr IreneStr

Choose a tag to compare

2.2.0 - 2021年09月22日

Added

  • PHP Parallel Lint will now be provided via YoastCS.
    If php-parallel-lint/php-parallel-lint and php-parallel-lint/php-console-highlighter are included in the require-dev of your composer.json file, you can remove these after updating the version constraint for YoastCS to "yoast/yoastcs": "^2.2.0".
  • PHPCS: A custom YoastCS\Yoast\Reports\Threshold report.
    This commit adds a custom report for use with PHPCS to compare the run results with "threshold" settings.
    • The report will look in the runtime environment for the following two environment variables and will take the values of those as the thresholds to compare the PHPCS run results against:
      • YOASTCS_THRESHOLD_ERRORS
      • YOASTCS_THRESHOLD_WARNINGS
    • If the environment variables are not set, they will default to 0 for both, i.e. no errors or warnings allowed.
    • After the report has run, a global YOASTCS_ABOVE_THRESHOLD constant (boolean) will be available which can be used in calling scripts.
    • To use this report, run PHPCS with the following command-line argument: --report=YoastCS\Yoast\Reports\Threshold.
      Note: depending on the OS the command is run on, the backslashes in the report name may need to be escaped (doubled).
  • PHPCS: The PSR12.ControlStructures.BooleanOperatorPlacement sniff.
    Enforces that boolean operators in multi-line control structures are always placed at the start of a line.
  • PHPCS: Yoast.Commenting.CodeCoverageIgnoreDeprecated: Support for attributes (PHP 8.0+) placed between a function or class declaration and the associated docblock.
  • PHPCS: Yoast.Commenting.TestHaveCoversTag: Support for attributes (PHP 8.0+) placed between a function or class declaration and the associated docblock.
  • PHPCS: Yoast.NamingConventions.ObjectNameDepth: Support for attributes (PHP 8.0+) placed between a function or class declaration and the associated docblock.
  • PHPCS: Yoast.NamingConventions.ObjectNameDepth: Support for examining the word count in CamelCaps class names.
  • PHPCS: Yoast.NamingConventions.ValidHookName: Verification that backslashes in namespace-like prefixes in double quoted strings are slash-escaped.
  • An initial CONTRIBUTING file with guidelines on acceptance testing changes to the sniffs in this repository.

Changed

  • PHPCS: The default value for the minimum_supported_wp_version property which is used by various WPCS sniffs has been updated to WP 5.7 (was 5.4).
  • Composer: Supported version of PHP_CodeSniffer has been changed from ^3.5.0 to ^3.6.0.
  • Composer: Supported version of WordPressCS has been changed from ^2.2.0 to ^2.3.0.
  • Composer: Updated the supported versions of dev dependencies.
  • Readme: Minor documentation improvements.
  • Continuous Integration: CI has been moved from Travis to GitHub Actions.
  • Various housekeeping.

Fixed

  • PHPCS: Yoast.Commenting.CoversTag: @covers tags refering to classes and functions which don't follow the WordPressCS naming conventions will now be regarded as valid.
  • PHPCS: Yoast.Commenting.TestsHaveCoversTag: the sniff will now also report missing @covers tags for test methods without docblock.
  • PHPCS: Yoast.Commenting.TestsHaveCoversTag: the determination whether a class or method is a test class or method has been made more flexible to allow for different test naming conventions.
  • PHPCS: Yoast.Commenting.TestsHaveCoversTag: will no longer expect a @covers tag for abstract test methods.
  • PHPCS: Yoast.Files.FileComment: fixed performance issue.
  • PHPCS: Yoast.Files.FileName: will no longer throw an error when a class names is an exact match for one of the "removable" prefixes (as there would be nothing left to name the file as).
  • PHPCS: Yoast.NamingConventions.ObjectNameDepth: the object name depth for underscore prefixed class names will now be calculated correctly.
  • PHPCS: Yoast.NamingConventions.ValidHookName: will now recognize slash-escaped backslashes in namespace-like prefixes correctly when in a double quoted string.
Loading
Previous 1 3
Previous

AltStyle によって変換されたページ (->オリジナル) /