diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml new file mode 100644 index 0000000000000..cd8f31d41a74a --- /dev/null +++ b/.github/workflows/coding-standards.yml @@ -0,0 +1,69 @@ +name: PHP Coding standards + +on: + push: + pull_request: + +jobs: + # Runs PHP coding standards checks. + # + # Violations are reported inline with annotations. + # + # Performs the following steps: + # - Checks out the repository. + # - Configures caching for Composer. + # - Sets up PHP. + # - Logs debug information. + # - Installs Composer dependencies (from cache if possible). + # - Logs PHP_CodeSniffer debug information. + # - Runs PHPCS tests. + # - todo: Add a PHP_CodeSniffer scan for the `tests` directory that does not suppress warnings. + # - todo: Configure Slack notifications for failing scans. + phpcs: + name: Check PHP coding standards + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Set up Composer caching + uses: actions/cache@v2 + env: + cache-name: cache-composer-dependencies + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "latest" + coverage: none + + - name: Log debug information + run: | + php --version + composer --version + + - name: Install Composer dependencies + run: | + composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction + echo "vendor/bin" >> $GITHUB_PATH + + - name: Log PHPCS debug information + run: phpcs -i + + - name: Run PHPCS on Core files + uses: wearerequired/lint-action@v1 + with: + github_token: ${{ secrets.github_token }} + check_name: PHP-Coding-Standards-${linter} + php_codesniffer: true + # Ignore warnings + php_codesniffer_args: "-n" diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml new file mode 100644 index 0000000000000..e5718481c3ec9 --- /dev/null +++ b/.github/workflows/end-to-end-tests.yml @@ -0,0 +1,104 @@ +name: End-to-end Tests + +on: + push: + pull_request: + +env: + LOCAL_DIR: build + PHP_FPM_UID: 1001 # This needs to be dynamic + PHP_FPM_GID: 116 # This needs to be dynamic + +jobs: + # Runs the end-to-end test suite. + # + # Performs the following steps: + # - Cancels all previous workflow runs that have not completed. + # - Checks out the repository. + # - Logs debug information about the runner container. + # - Sets up caching for NPM. + # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches) + # _ Installs NPM dependencies. + # - Builds WordPress to run from the `build` directory. + # - Starts the WordPress Docker container. + # - Logs general debug information. + # - Logs the running Docker containers. + # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container) + # - Install WordPress within the Docker container. + # - Run the E2E tests. + # - todo: Configure Slack notifications for failing tests. + e2e-tests: + name: E2E Tests + runs-on: ubuntu-latest + steps: + - name: Cancel previous runs of this workflow + uses: styfle/cancel-workflow-action@0.5.0 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log debug information + run: | + npm --version + node --version + curl --version + git --version + svn --version + php --version + php -i + locale -a + + - name: Cache NodeJS modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install Dependencies + run: npm ci + + - name: Build WordPress + run: npm run build + + - name: Start Docker environment + run: | + npm run env:start + + - name: General debug information + run: | + npm --version + node --version + curl --version + git --version + svn --version + + - name: Log running Docker containers + run: docker ps -a + + - name: Docker debug information + run: | + docker -v + docker-compose -v + docker-compose run --rm mysql mysql --version + docker-compose run --rm php php --version + docker-compose run --rm php php -m + docker-compose run --rm php php -i + docker-compose run --rm php locale -a + + - name: Install WordPress + run: npm run env:install + + - name: Run E2E tests + run: npm run test:e2e diff --git a/.github/workflows/javascript-tests.yml b/.github/workflows/javascript-tests.yml new file mode 100644 index 0000000000000..bbbbfe447e47a --- /dev/null +++ b/.github/workflows/javascript-tests.yml @@ -0,0 +1,64 @@ +name: JavaScript Standards & Tests + +on: + push: + pull_request: + +jobs: + # Runs the QUnit tests for WordPress. + # + # Performs the following steps: + # - Cancels all previous workflow runs that have not completed. + # - Checks out the repository. + # - Logs debug information about the runner container. + # - Sets up caching for NPM. + # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches) + # - Logs updated debug information. + # _ Installs NPM dependencies. + # - Run the WordPress JavaScript coding standards checks and QUnit tests. + # - todo: Configure Slack notifications for failing tests. + test-js: + name: QUnit Tests + runs-on: ubuntu-latest + steps: + - name: Cancel previous runs of this workflow + uses: styfle/cancel-workflow-action@0.5.0 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log debug information + run: | + npm --version + node --version + git --version + svn --version + + - name: Cache NodeJS modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Log debug information + run: | + npm --version + node --version + + - name: Install Dependencies + run: npm ci + + - name: Run QUnit tests + run: npm run grunt travis:js diff --git a/.github/workflows/php-compatibility-testing.yml b/.github/workflows/php-compatibility-testing.yml new file mode 100644 index 0000000000000..07f47d4cdc43e --- /dev/null +++ b/.github/workflows/php-compatibility-testing.yml @@ -0,0 +1,69 @@ +name: PHP Compatibility + +on: + push: + pull_request: + +jobs: + + # Runs PHP compatibility testing. + # + # Violations are reported inline with annotations. + # + # Performs the following steps: + # - Checks out the repository. + # - Configures caching for Composer. + # - Sets up PHP. + # - Logs debug information about the runner container. + # - Installs Composer dependencies (from cache if possible). + # - Logs PHP_CodeSniffer debug information. + # - Runs the PHP compatibility tests. + # - todo: Configure Slack notifications for failing scans. + php-comatibility: + name: Check PHP compatibility + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Get Composer cache directory + id: composer-cache + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Set up Composer caching + uses: actions/cache@v2 + env: + cache-name: cache-composer-dependencies + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Set up PHP + uses: shivammathur/setup-php@v2 + with: + php-version: "latest" + coverage: none + + - name: Log debug information + run: | + php --version + composer --version + + - name: Install Composer dependencies + run: | + composer install --prefer-dist --no-suggest --no-progress --no-ansi --no-interaction + echo "vendor/bin" >> $GITHUB_PATH + + - name: Log PHPCS debug information + run: phpcs -i + + - name: Run PHP compatibility tests + uses: wearerequired/lint-action@v1 + with: + github_token: ${{ secrets.github_token }} + check_name: PHP-Compatibility-${linter} + php_codesniffer: true + php_codesniffer_args: "--standard=phpcompat.xml.dist" diff --git a/.github/workflows/test-wordpress.yml b/.github/workflows/test-wordpress.yml new file mode 100644 index 0000000000000..ffd0940867f42 --- /dev/null +++ b/.github/workflows/test-wordpress.yml @@ -0,0 +1,270 @@ +name: PHPUnit Tests + +on: + # Anytime a branch or tag is created. + create: + # Anytime a commit is pushed. + push: + # Anytime a pull request is opened. + pull_request: + # Once weekly On Sundays at 00:00 UTC. + schedule: + - cron: '0 0 * * 0' + +env: + LOCAL_DIR: build + PUPPETEER_SKIP_CHROMIUM_DOWNLOAD: ${{ true }} + PHP_FPM_UID: 1001 # This needs to be dynamic + PHP_FPM_GID: 116 # This needs to be dynamic + COMPOSER_INSTALL: ${{ false }} + # Controls which NPM script to use for running PHPUnit tests. Options are `php` and `php-composer`. + PHPUNIT_SCRIPT: php + LOCAL_PHP_MEMCACHED: ${{ false }} + +jobs: + # Sets up WordPress for testing or development use. + # + # Performs the following steps: + # - Cancels all previous workflow runs that have not completed. + # - Checks out the repository. + # - Checks out the WordPress Importer plugin (needed for the Core PHPUnit tests). + # - Logs debug information about the runner container. + # - Sets up caching for NPM. + # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches) + # _ Installs NPM dependencies. + # - Builds WordPress to run from the `build` directory. + # - Creates a ZIP file of compiled WordPress + # - Uploads ZIP file as an artifact. + setup-wordpress: + name: Setup WordPress + runs-on: ubuntu-latest + steps: + - name: Cancel previous runs of this workflow + uses: styfle/cancel-workflow-action@0.5.0 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Checkout the WordPress Importer plugin + run: svn checkout -r 2387243 https://plugins.svn.wordpress.org/wordpress-importer/trunk/ tests/phpunit/data/plugins/wordpress-importer + + - name: Log debug information + run: | + npm --version + node --version + curl --version + git --version + svn --version + php --version + php -i + locale -a + + - name: Cache NodeJS modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install Dependencies + run: npm ci + + - name: Build WordPress + run: npm run build + + - name: Create ZIP artifact + uses: thedoctor0/zip-release@0.4.1 + with: + filename: built-wp-${{ github.sha }}.zip + exclusions: '/*node_modules/*' + + - name: Upload build artifact + uses: actions/upload-artifact@v2 + with: + name: built-wp-${{ github.sha }} + path: built-wp-${{ github.sha }}.zip + if-no-files-found: error + + # Runs the PHPUnit tests for WordPress. + # + # Performs the following steps: + # - Downloads the built WordPress artifact from the previous job. + # - Unzips the artifact. + # - Sets up the environment variables needed for testing with memcached (if desired). + # - Sets up caching for the NPM packages for the package-lock.json file (the cache from the previous job will be used + # if it was stored successfully). + # - Installs NodeJS 12 (todo: install the version of NPM specified in the `nvmrc` file to support older branches) + # _ Installs NPM dependencies. + # - Configures caching for Composer. + # _ Installs Composer dependencies (if desired) + # - Logs Docker debug information (about both the Docker installation within the runner) + # - Starts the WordPress Docker container. + # - Starts the memcached server after the Docker network has been created (if desired). + # - Logs WordPress Docker container debug information. + # - Logs the running Docker containers. + # - Logs Docker debug information (about both the Docker installation within the runner and the WordPress container) # - Install WordPress inside the WordPress Docker container. + # - Install WordPress within the Docker container. + # - Run the PHPUnit tests. + # - Reports test results to the Distributed Hosting Tests. + # - todo: Configure Slack notifications for failing tests. + test-php: + name: ${{ matrix.php_versions }} on ${{ matrix.os }} (PHPUnit) + needs: setup-wordpress + runs-on: ${{ matrix.os }} + strategy: + matrix: + php_versions: [ '8.0', 7.4, '7.4 with memcached', 7.3, 7.2, 7.1, '7.0', 5.6.20 ] + os: [ ubuntu-latest ] + env: + LOCAL_PHP: ${{ matrix.php_versions }}-fpm + + steps: + - name: Download the built WordPress artifact + uses: actions/download-artifact@v2 + with: + name: built-wp-${{ github.sha }} + + - name: Unzip built artifact + run: unzip built-wp-${{ github.sha }}.zip + + - name: Configure memcached + if: ${{ contains( matrix.php_versions, 'memcached' ) }} + # TODO: Make LOCAL_PHP be the value of matrix.php_versions with memcached replaced with '-fpm' + run: | + echo "LOCAL_PHP=latest" >> $GITHUB_ENV + echo "LOCAL_PHP_MEMCACHED=true" >> $GITHUB_ENV + + - name: Use cached Node modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + # npm cache files are stored in `~/.npm` on Linux/macOS + path: ~/.npm + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install Dependencies + run: npm ci + + - name: Get composer cache directory + id: composer-cache + if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }} + run: echo "::set-output name=dir::$(composer config cache-files-dir)" + + - name: Cache Composer dependencies + if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }} + uses: actions/cache@v2 + env: + cache-name: cache-composer-dependencies + with: + path: ${{ steps.composer-cache.outputs.dir }} + key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }} + restore-keys: | + ${{ runner.os }}-composer- + + - name: Install Composer dependencies + if: ${{ env.COMPOSER_INSTALL == true || env.LOCAL_PHP == '8.0-fpm' }} + run: | + docker-compose run --rm php composer --version + + # The PHPUnit 7.x phar is not compatible with PHP 8 and won't be updated, + # as PHPUnit 7 is no longer supported. The Composer-installed PHPUnit should be + # used for PHP 8 testing instead. + if [ ${{ env.LOCAL_PHP }} == '8.0-fpm' ]; then + docker-compose run --rm php composer install --ignore-platform-reqs + echo "PHPUNIT_SCRIPT=php-composer" >> $GITHUB_ENV + else + docker-compose run --rm php composer install + fi + + - name: Docker debug information + run: | + docker -v + docker-compose -v + + - name: Start Docker environment + run: | + npm run env:start + + # The memcached server needs to start after the Docker network has been set up with `npm run env:start`. + - name: Start the Memcached server. + if: ${{ contains( matrix.php_versions, 'memcached' ) }} + run: | + cp tests/phpunit/includes/object-cache.php build/wp-content/object-cache.php + docker run --name memcached --net $(basename "$PWD")_wpdevnet -d memcached + + - name: General debug information + run: | + npm --version + node --version + curl --version + git --version + svn --version + + - name: Log running Docker containers + run: docker ps -a + + - name: WordPress Docker container debug information + run: | + docker -v + docker-compose -v + docker-compose run --rm mysql mysql --version + docker-compose run --rm php php --version + docker-compose run --rm php php -m + docker-compose run --rm php php -i + docker-compose run --rm php locale -a + + - name: Install WordPress + run: npm run env:install + + - name: Run PHPUnit tests + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist + + - name: Run AJAX tests + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group ajax + + - name: Run tests as a multisite install + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml + + - name: Run mutlisite file tests + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c tests/phpunit/multisite.xml --group ms-files + + - name: Run external HTTP tests + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group external-http + + - name: Run REST API tests + run: npm run test:${{ env.PHPUNIT_SCRIPT }} -- --verbose -c phpunit.xml.dist --group restapi-jsclient + + # Xdebug supports PHP 8 only from version 3.0, which is not released yet. + # Once Xdebug 3.0 is released and included in the Docker image, the IF condition should be removed. + # __fakegroup__ is excluded to force PHPUnit to ignore the settings in phpunit.xml.dist. + - name: Run (xDebug) tests + if: ${{ env.LOCAL_PHP != '8.0-fpm' }} + run: LOCAL_PHP_XDEBUG=true npm run test:php -- -v --group xdebug --exclude-group __fakegroup__ + + - name: WordPress Test Reporter + if: ${{ matrix.php_versions == '7.4' }} + uses: actions/checkout@v2 + with: + repository: 'WordPress/phpunit-test-runner' + path: 'test-runner' + # TODO: Configure hidden keys to successfully report test results. + # run: docker-compose run --rm -e WPT_REPORT_API_KEY -e WPT_PREPARE_DIR=/var/www -e WPT_TEST_DIR=/var/www php php test-runner/report.php diff --git a/.github/workflows/verify-npm-windows.yml b/.github/workflows/verify-npm-windows.yml new file mode 100644 index 0000000000000..bf10f6f99846c --- /dev/null +++ b/.github/workflows/verify-npm-windows.yml @@ -0,0 +1,61 @@ +name: Test NPM on Windows + +on: + push: + pull_request: + +jobs: + # Verifies that installing NPM dependencies and building WordPress works on Windows. + # + # Performs the following steps: + # - Cancels all previous workflow runs that have not completed. + # - Checks out the repository. + # - Logs debug information about the runner container. + # - Sets up caching for NPM. + # - Installs NodeJS 12 (todo: install the version of NPM specified in the `.nvmrc` file to support older branches) + # _ Installs NPM dependencies. + # - Builds WordPress to run from the `build` directory. + test-npm: + name: Tests NPM on Windows + runs-on: windows-latest + steps: + - name: Cancel previous runs of this workflow + uses: styfle/cancel-workflow-action@0.5.0 + with: + access_token: ${{ github.token }} + + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Log debug information + run: | + npm --version + node --version + curl --version + git --version + svn --version + + - name: Get NPM cache directory + id: npm-cache + run: echo "::set-output name=dir::$(npm config get cache)" + + - name: Cache NodeJS modules + uses: actions/cache@v2 + env: + cache-name: cache-node-modules + with: + path: ${{ steps.npm-cache.outputs.dir }} + key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-npm- + + - name: Install NodeJS + uses: actions/setup-node@v1 + with: + node-version: 12 + + - name: Install Dependencies + run: npm ci + + - name: Build WordPress + run: npm run build diff --git a/.github/workflows/welcome-new-contributors.yml b/.github/workflows/welcome-new-contributors.yml new file mode 100644 index 0000000000000..d961c46ce6175 --- /dev/null +++ b/.github/workflows/welcome-new-contributors.yml @@ -0,0 +1,43 @@ +name: Welcome New Contributors + +on: + pull_request: + types: [ opened ] + +jobs: + post-welcome-message: + runs-on: ubuntu-latest + + steps: + - uses: bubkoo/welcome-action@v1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + FIRST_PR_COMMENT: > + Hi @{{ author }}! 👋 + + Thank you for your contribution to WordPress! 💖 + + It looks like this is your first pull request, so here are a few things to be aware of that may help you out. + + **No one monitors this repository for new pull requests.** Pull requests **must** be attached to a Trac ticket to be considered for inclusion in WordPress Core. To attach a pull request to a Trac ticket, simply include the ticket's full URL in your pull request description. + + **Pull requests are never merged on GitHub.** The WordPress codebase continues to be managed through the SVN repository that this one mirrors. But please feel free to use pull requests to work on any contribution you are making. + + More information about how GitHub pull requests can be used to contribute to WordPress can be found in [this blog post](https://make.wordpress.org/core/2020/02/21/working-on-trac-tickets-using-github-pull-requests/). + + Including tests in your pull request is one way to help your patch be considered faster. To learn about WordPress' test suites, visit the [Automated Testing](https://make.wordpress.org/core/handbook/testing/automated-testing/) page in the handbook. + + If you have not had a chance, please review the [Contribute with Code page](https://make.wordpress.org/core/handbook/contribute/) in the [WordPress Core Handbook](https://make.wordpress.org/core/handbook/). + + The [Developer Hub](https://developer.wordpress.org/) also documents the various [coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/) that are followed: + - [PHP Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/) + - [CSS Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/css/) + - [HTML Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/html/) + - [JavaScript Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/) + - [Accessibility Coding Standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/) + - [Inline Documentation Standards](https://developer.wordpress.org/coding-standards/inline-documentation-standards/) + + Please remember that the WordPress project is largely maintained by volunteers + + Thank you, + The WordPress Project diff --git a/composer.lock b/composer.lock index d189396da647a..793c9cd4247fb 100644 --- a/composer.lock +++ b/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": "798cd84a945e4caa3d0161ff63ec3743", + "content-hash": "979b0a8c63a104744b5f2cce4920264b", "packages": [], "packages-dev": [ { @@ -175,12 +175,6 @@ "object", "object graph" ], - "funding": [ - { - "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", - "type": "tidelift" - } - ], "time": "2020-06-29T13:22:24+00:00" }, { @@ -496,16 +490,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.0", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "3170448f5769fe19f456173d833734e0ff1b84df" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/3170448f5769fe19f456173d833734e0ff1b84df", - "reference": "3170448f5769fe19f456173d833734e0ff1b84df", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { @@ -544,20 +538,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-07-20T20:05:34+00:00" + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "shasum": "" }, "require": { @@ -589,32 +583,32 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-06-27T10:12:23+00:00" + "time": "2020-09-17T18:55:26+00:00" }, { "name": "phpspec/prophecy", - "version": "1.11.1", + "version": "1.12.1", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160" + "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/b20034be5efcdab4fb60ca3a29cba2949aead160", - "reference": "b20034be5efcdab4fb60ca3a29cba2949aead160", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/8ce87516be71aae9b956f81906aaf0338e0d8a2d", + "reference": "8ce87516be71aae9b956f81906aaf0338e0d8a2d", "shasum": "" }, "require": { "doctrine/instantiator": "^1.2", - "php": "^7.2", - "phpdocumentor/reflection-docblock": "^5.0", + "php": "^7.2 || ~8.0, <8.1", + "phpdocumentor/reflection-docblock": "^5.2", "sebastian/comparator": "^3.0 || ^4.0", "sebastian/recursion-context": "^3.0 || ^4.0" }, "require-dev": { "phpspec/phpspec": "^6.0", - "phpunit/phpunit": "^8.0" + "phpunit/phpunit": "^8.0 || ^9.0 <9.3" }, "type": "library", "extra": { @@ -652,7 +646,7 @@ "spy", "stub" ], - "time": "2020-07-08T12:44:21+00:00" + "time": "2020-09-29T09:10:42+00:00" }, { "name": "phpunit/php-code-coverage", @@ -1558,16 +1552,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.5.5", + "version": "3.5.6", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" + "reference": "e97627871a7eab2f70e59166072a6b767d5834e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", - "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/e97627871a7eab2f70e59166072a6b767d5834e0", + "reference": "e97627871a7eab2f70e59166072a6b767d5834e0", "shasum": "" }, "require": { @@ -1605,7 +1599,7 @@ "phpcs", "standards" ], - "time": "2020-04-17T01:09:41+00:00" + "time": "2020-08-10T04:50:15+00:00" }, { "name": "symfony/polyfill-ctype", @@ -1667,20 +1661,6 @@ "polyfill", "portable" ], - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], "time": "2020-07-14T12:35:20+00:00" }, { @@ -1721,12 +1701,6 @@ } ], "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", - "funding": [ - { - "url": "https://github.com/theseer", - "type": "github" - } - ], "time": "2020-07-12T23:59:07+00:00" }, { diff --git a/phpcompat.xml.dist b/phpcompat.xml.dist index 5af8e2a5039ae..1254643e16274 100644 --- a/phpcompat.xml.dist +++ b/phpcompat.xml.dist @@ -31,6 +31,17 @@ ./src/ + + /tests + /node_modules/* diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php index 0625bec9e257f..af1b177c31523 100644 --- a/src/wp-admin/includes/file.php +++ b/src/wp-admin/includes/file.php @@ -1262,7 +1262,6 @@ function verify_file_signature( $filename, $signatures, $filename_for_errors = f ), array( 'php' => phpversion(), - // phpcs:ignore PHPCompatibility.Constants.NewConstants.sodium_library_versionFound 'sodium' => defined( 'SODIUM_LIBRARY_VERSION' ) ? SODIUM_LIBRARY_VERSION : ( defined( 'ParagonIE_Sodium_Compat::VERSION_STRING' ) ? ParagonIE_Sodium_Compat::VERSION_STRING : false ), ) ); diff --git a/src/wp-includes/functions.php b/src/wp-includes/functions.php index fe68d7f760909..4e88dd668517a 100644 --- a/src/wp-includes/functions.php +++ b/src/wp-includes/functions.php @@ -34,12 +34,12 @@ function mysql2date( $format, $date, $translate = true ) { $datetime = date_create( $date, wp_timezone() ); - if ( false === $datetime ) { + if (false === $datetime) { return false; } // Returns a sum of timestamp with timezone offset. Ideally should never be used. - if ( 'G' === $format || 'U' === $format ) { + if ( 'G'===$format || 'U' === $format ) { return $datetime->getTimestamp() + $datetime->getOffset(); } @@ -166,9 +166,9 @@ function date_i18n( $format, $timestamp_with_offset = false, $gmt = false ) { $timestamp = $timestamp_with_offset; // If timestamp is omitted it should be current time (summed with offset, unless `$gmt` is true). - if ( ! is_numeric( $timestamp ) ) { + if ( ! is_numeric( $timestamp ) ) $timestamp = current_time( 'timestamp', $gmt ); - } + /* * This is a legacy implementation quirk that the returned timestamp is also with offset. @@ -6673,7 +6673,7 @@ function mbstring_binary_safe_encoding( $reset = false ) { static $overloaded = null; if ( is_null( $overloaded ) ) { - $overloaded = function_exists( 'mb_internal_encoding' ) && ( ini_get( 'mbstring.func_overload' ) & 2 ); // phpcs:ignore PHPCompatibility.IniDirectives.RemovedIniDirectives.mbstring_func_overloadDeprecated + $overloaded = function_exists( 'mb_internal_encoding' ) && ( ini_get( 'mbstring.func_overload' ) & 2 ); } if ( false === $overloaded ) {