Make WordPress Core


Ignore:
Timestamp:
09/25/2019 01:46:55 PM (5 years ago)
Author:
desrosj
Message:

Build/Test Tools: Introduce automated PHP compatibility checking.

This change introduces a new Composer script, compat that will scan the codebase for (detectable) potential PHP compatibility issues using the PHP_CodeSniffer and a custom ruleset based off of the PHPCompayibilityWP ruleset (phpcompat.xml.dist).

The command will be run as a separate job within each Travis build. While many compatibility issues and false positives have already been corrected in this commit and other Trac tickets, there are still some remaining. For that reason, the job is allowed to fail while the remainder of the potential compatibility issues are investigated and addressed. After those are resolved, the job should be set as required to pass to help prevent new compatibility issues from being introduced.

Props desrosj, jrf, all PHPCompatibilityWP and PHPCompatibility contributors.
Fixes #46152.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/file.php

    r46232 r46290  
    12811281            array(
    12821282                'php'    => phpversion(),
     1283                // phpcs:ignore PHPCompatibility.Constants.NewConstants.sodium_library_versionFound
    12831284                'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
    12841285            )
     
    13141315                array(
    13151316                    'php'                => phpversion(),
     1317                    // phpcs:ignore PHPCompatibility.Constants.NewConstants.sodium_library_versionFound
    13161318                    'sodium'             => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
    13171319                    'polyfill_is_fast'   => false,
     
    13871389            'skipped_sig' => $skipped_signature,
    13881390            'php'         => phpversion(),
     1391            // phpcs:ignore PHPCompatibility.Constants.NewConstants.sodium_library_versionFound
    13891392            'sodium'      => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ),
    13901393        )
Note: See TracChangeset for help on using the changeset viewer.