php8 compat;+code coverage

This commit is contained in:
Leon 2020-12-06 11:41:18 +11:00
parent 2d2b921b1a
commit df7ed9b48f
7 changed files with 35 additions and 29 deletions

View file

@ -13,7 +13,7 @@ jobs:
strategy: strategy:
matrix: matrix:
php: [7.3.9] php: ["7.3", "7.4"]
name: PHP-${{ matrix.php }} name: PHP-${{ matrix.php }}
@ -38,7 +38,7 @@ jobs:
run: composer validate --strict run: composer validate --strict
- name: Install PHP dependencies - name: Install PHP dependencies
run: composer install --no-interaction --no-suggest run: composer install --no-interaction
- name: Run our Linter and PHPStan - name: Run our Linter and PHPStan
run: composer test run: composer run-script test

View file

@ -1,3 +1,11 @@
## WP2Static S3 Add-on 1.0.1
- compatibility fix for PHP 8
- publish to Packagist
- update GH actions for PHP 7.3 and 7.4 testing
- PHPStan test PHP 8
- expand PHPStan analysis coverage
## WP2Static S3 Add-on 1.0 ## WP2Static S3 Add-on 1.0
- non-functional dependency updates only but time for a 1.0 release - non-functional dependency updates only but time for a 1.0 release

View file

@ -47,9 +47,6 @@
} }
}, },
"config": { "config": {
"platform": {
"php": "7.3"
},
"preferred-install": { "preferred-install": {
"*": "dist" "*": "dist"
}, },
@ -60,14 +57,16 @@
"phpcs": "vendor/bin/phpcs --standard=./tools/phpcs.xml --ignore=*/tests/*,*/admin/*,**/coverage/*,*.js,*/vendor/*,*/views/*.php ./", "phpcs": "vendor/bin/phpcs --standard=./tools/phpcs.xml --ignore=*/tests/*,*/admin/*,**/coverage/*,*.js,*/vendor/*,*/views/*.php ./",
"phpcbf": "vendor/bin/phpcbf --standard=./tools/phpcs.xml --ignore=*/js/*,*/tests/*,*/admin/*,*/coverage/*,*.js,*/vendor/*,*/views/*.php ./", "phpcbf": "vendor/bin/phpcbf --standard=./tools/phpcs.xml --ignore=*/js/*,*/tests/*,*/admin/*,*/coverage/*,*.js,*/vendor/*,*/views/*.php ./",
"phpunit": "vendor/bin/phpunit ./tests/unit/", "phpunit": "vendor/bin/phpunit ./tests/unit/",
"phpcompat": "vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 7.3 --ignore=*/tests/*,*/admin/*,**/coverage/*,*.js,*/vendor/*,*/views/*.php ./", "php73": "vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 7.3 --ignore=*/tests/*,*/admin/*,**/coverage/*,*.js,*/vendor/*,*/views/*.php ./",
"php74": "vendor/bin/phpcs --standard=PHPCompatibility --runtime-set testVersion 7.4 --ignore=*/tests/*,*/admin/*,**/coverage/*,*.js,*/vendor/*,*/views/*.php ./",
"coverage": "vendor/bin/phpunit tests/unit --coverage-html coverage --whitelist src/", "coverage": "vendor/bin/phpunit tests/unit --coverage-html coverage --whitelist src/",
"lint": "vendor/bin/parallel-lint --exclude vendor .", "lint": "vendor/bin/parallel-lint --exclude vendor .",
"test": [ "test": [
"composer validate --strict", "composer validate --strict",
"@lint", "@lint",
"@phpcs", "@phpcs",
"@phpcompat", "@php73",
"@php74",
"@phpstan" "@phpstan"
], ],
"build": "/bin/sh tools/build_release.sh" "build": "/bin/sh tools/build_release.sh"

33
composer.lock generated
View file

@ -4,20 +4,20 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "36bf1438b3536d362b9c3459085c65e2", "content-hash": "9e3f0e9e0e32ac911b219b876a265782",
"packages": [ "packages": [
{ {
"name": "aws/aws-sdk-php", "name": "aws/aws-sdk-php",
"version": "3.166.1", "version": "3.166.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/aws/aws-sdk-php.git", "url": "https://github.com/aws/aws-sdk-php.git",
"reference": "36788095cfab7850400e337a3128572cfc1537e6" "reference": "fe0ec9235d07b0f51ec4396dce0dd639020ae1a7"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/36788095cfab7850400e337a3128572cfc1537e6", "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/fe0ec9235d07b0f51ec4396dce0dd639020ae1a7",
"reference": "36788095cfab7850400e337a3128572cfc1537e6", "reference": "fe0ec9235d07b0f51ec4396dce0dd639020ae1a7",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -92,9 +92,9 @@
"support": { "support": {
"forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80",
"issues": "https://github.com/aws/aws-sdk-php/issues", "issues": "https://github.com/aws/aws-sdk-php/issues",
"source": "https://github.com/aws/aws-sdk-php/tree/3.166.1" "source": "https://github.com/aws/aws-sdk-php/tree/3.166.2"
}, },
"time": "2020-12-03T19:25:02+00:00" "time": "2020-12-04T19:12:30+00:00"
}, },
{ {
"name": "guzzlehttp/guzzle", "name": "guzzlehttp/guzzle",
@ -1968,16 +1968,16 @@
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "9.4.4", "version": "9.5.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "6535e637961f0829832621dc1b7308c2d24a799e" "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/6535e637961f0829832621dc1b7308c2d24a799e", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8e16c225d57c3d6808014df6b1dd7598d0a5bbbe",
"reference": "6535e637961f0829832621dc1b7308c2d24a799e", "reference": "8e16c225d57c3d6808014df6b1dd7598d0a5bbbe",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1993,7 +1993,7 @@
"phar-io/version": "^3.0.2", "phar-io/version": "^3.0.2",
"php": ">=7.3", "php": ">=7.3",
"phpspec/prophecy": "^1.12.1", "phpspec/prophecy": "^1.12.1",
"phpunit/php-code-coverage": "^9.2", "phpunit/php-code-coverage": "^9.2.3",
"phpunit/php-file-iterator": "^3.0.5", "phpunit/php-file-iterator": "^3.0.5",
"phpunit/php-invoker": "^3.1.1", "phpunit/php-invoker": "^3.1.1",
"phpunit/php-text-template": "^2.0.3", "phpunit/php-text-template": "^2.0.3",
@ -2024,7 +2024,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "9.4-dev" "dev-master": "9.5-dev"
} }
}, },
"autoload": { "autoload": {
@ -2055,7 +2055,7 @@
], ],
"support": { "support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues", "issues": "https://github.com/sebastianbergmann/phpunit/issues",
"source": "https://github.com/sebastianbergmann/phpunit/tree/9.4.4" "source": "https://github.com/sebastianbergmann/phpunit/tree/9.5.0"
}, },
"funding": [ "funding": [
{ {
@ -2067,7 +2067,7 @@
"type": "github" "type": "github"
} }
], ],
"time": "2020-12-01T04:58:47+00:00" "time": "2020-12-04T05:05:53+00:00"
}, },
{ {
"name": "sebastian/cli-parser", "name": "sebastian/cli-parser",
@ -3530,8 +3530,5 @@
"php": ">=7.3" "php": ">=7.3"
}, },
"platform-dev": [], "platform-dev": [],
"platform-overrides": {
"php": "7.3"
},
"plugin-api-version": "2.0.0" "plugin-api-version": "2.0.0"
} }

View file

@ -4,9 +4,11 @@ includes:
- vendor/szepeviktor/phpstan-wordpress/extension.neon - vendor/szepeviktor/phpstan-wordpress/extension.neon
parameters: parameters:
level: max level: max
phpVersion: 80000
inferPrivatePropertyTypeFromConstructor: true inferPrivatePropertyTypeFromConstructor: true
paths: paths:
- %currentWorkingDirectory%/src/ - %currentWorkingDirectory%/src/
- %currentWorkingDirectory%/wp2static-addon-s3.php
scanFiles: scanFiles:
- %currentWorkingDirectory%/tests/phpstan/bootstrap.php - %currentWorkingDirectory%/tests/phpstan/bootstrap.php
- %currentWorkingDirectory%/tests/phpstan/wp-cli-stubs-2.2.0.php - %currentWorkingDirectory%/tests/phpstan/wp-cli-stubs-2.2.0.php

View file

@ -20,7 +20,7 @@ class CLI {
* @param string[] $args CLI args * @param string[] $args CLI args
* @param string[] $assoc_args CLI args * @param string[] $assoc_args CLI args
*/ */
public function s3( public static function s3(
array $args, array $args,
array $assoc_args array $assoc_args
) : void { ) : void {

View file

@ -5,11 +5,11 @@
* Plugin URI: https://wp2static.com * Plugin URI: https://wp2static.com
* Description: AWS S3 deployment add-on for WP2Static. * Description: AWS S3 deployment add-on for WP2Static.
* Version: 1.0.1-dev * Version: 1.0.1-dev
* Requires PHP: 7.3
* Author: Leon Stafford * Author: Leon Stafford
* Author URI: https://ljs.dev * Author URI: https://ljs.dev
* License: Unlicense * License: Unlicense
* License URI: http://unlicense.org * License URI: http://unlicense.org
* Text Domain: wp2static-addon-s3
*/ */
if ( ! defined( 'WPINC' ) ) { if ( ! defined( 'WPINC' ) ) {
@ -23,7 +23,7 @@ if ( file_exists( WP2STATIC_S3_PATH . 'vendor/autoload.php' ) ) {
require_once WP2STATIC_S3_PATH . 'vendor/autoload.php'; require_once WP2STATIC_S3_PATH . 'vendor/autoload.php';
} }
function run_wp2static_addon_s3() { function run_wp2static_addon_s3() : void {
$controller = new WP2StaticS3\Controller(); $controller = new WP2StaticS3\Controller();
$controller->run(); $controller->run();
} }