From 04ef27353153d7ceac0ba1b23c2b6e63ff7e4c54 Mon Sep 17 00:00:00 2001 From: Oscar Sanchez S Date: Sat, 19 Mar 2022 11:21:42 -0600 Subject: [PATCH 01/12] PHP Compatibility workflow --- .github/workflows/php-compatibility.yml | 49 +++++++++++++ composer.json | 9 ++- composer.lock | 91 ++++++++++++++++++------- 3 files changed, 123 insertions(+), 26 deletions(-) create mode 100644 .github/workflows/php-compatibility.yml diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml new file mode 100644 index 00000000..7f451527 --- /dev/null +++ b/.github/workflows/php-compatibility.yml @@ -0,0 +1,49 @@ +name: PHP Compatibility + +env: + COMPOSER_VERSION: "1" + COMPOSER_CACHE: "${{ github.workspace }}/.composer-cache" + +on: + push: + branches: + - trunk + pull_request: + branches: + - trunk + +jobs: + php_compatibility: + name: PHP ${{ matrix.php }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + php: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set standard 10up cache directories + run: | + composer config -g cache-dir "${{ env.COMPOSER_CACHE }}" + - name: Prepare composer cache + uses: actions/cache@v2 + with: + path: ${{ env.COMPOSER_CACHE }} + key: composer-${{ env.COMPOSER_VERSION }}-${{ hashFiles('**/composer.lock') }} + restore-keys: | + composer-${{ env.COMPOSER_VERSION }}- + - name: Set PHP version + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + coverage: none + tools: prestissimo, composer:v1 + + - name: Install dependencies + run: composer install + + - name: Check PHP Compatibility + run: ./vendor/bin/phpcs -p brightcove-video-connect.php includes --standard=PHPCompatibilityWP --extensions=php --runtime-set testVersion ${{ matrix.php }} \ No newline at end of file diff --git a/composer.json b/composer.json index 15b3e412..66e6a705 100644 --- a/composer.json +++ b/composer.json @@ -15,10 +15,17 @@ "composer/installers": "~1.0" }, "require-dev": { - "10up/phpcs-composer": "dev-master" + "10up/phpcs-composer": "dev-master", + "phpcompatibility/phpcompatibility-wp": "*" }, "scripts": { "lint": "phpcs .", "lint-fix": "phpcbf ." + }, + "config": { + "allow-plugins": { + "composer/installers": true, + "dealerdirect/phpcodesniffer-composer-installer": true + } } } diff --git a/composer.lock b/composer.lock index aa878f2b..b7d08f8f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,20 +4,20 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4f0b735f346177388e9a92413784755b", + "content-hash": "2239e42882be891f0fe701e05cea414c", "packages": [ { "name": "composer/installers", - "version": "v1.11.0", + "version": "v1.12.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "ae03311f45dfe194412081526be2e003960df74b" + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/ae03311f45dfe194412081526be2e003960df74b", - "reference": "ae03311f45dfe194412081526be2e003960df74b", + "url": "https://api.github.com/repos/composer/installers/zipball/d20a64ed3c94748397ff5973488761b22f6d3f19", + "reference": "d20a64ed3c94748397ff5973488761b22f6d3f19", "shasum": "" }, "require": { @@ -116,6 +116,7 @@ "modx", "moodle", "osclass", + "pantheon", "phpbb", "piwik", "ppi", @@ -136,6 +137,10 @@ "zend", "zikula" ], + "support": { + "issues": "https://github.com/composer/installers/issues", + "source": "https://github.com/composer/installers/tree/v1.12.0" + }, "funding": [ { "url": "https://packagist.com", @@ -150,7 +155,7 @@ "type": "tidelift" } ], - "time": "2021-04-28T06:42:17+00:00" + "time": "2021-09-13T08:19:44+00:00" } ], "packages-dev": [ @@ -174,6 +179,7 @@ "squizlabs/php_codesniffer": "^3.4.0", "wp-coding-standards/wpcs": "*" }, + "default-branch": true, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", "license": [ @@ -185,31 +191,35 @@ "email": "ephraim.gregor@10up.com" } ], + "support": { + "issues": "https://github.com/10up/phpcs-composer/issues", + "source": "https://github.com/10up/phpcs-composer/tree/master" + }, "time": "2021-01-08T03:03:06+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.7.1", + "version": "v0.7.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c" + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/fe390591e0241955f22eb9ba327d137e501c771c", - "reference": "fe390591e0241955f22eb9ba327d137e501c771c", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", + "reference": "1c968e542d8843d7cd71de3c5c9c3ff3ad71a1db", "shasum": "" }, "require": { "composer-plugin-api": "^1.0 || ^2.0", "php": ">=5.3", - "squizlabs/php_codesniffer": "^2.0 || ^3.0 || ^4.0" + "squizlabs/php_codesniffer": "^2.0 || ^3.1.0 || ^4.0" }, "require-dev": { "composer/composer": "*", - "phpcompatibility/php-compatibility": "^9.0", - "sensiolabs/security-checker": "^4.1.0" + "php-parallel-lint/php-parallel-lint": "^1.3.1", + "phpcompatibility/php-compatibility": "^9.0" }, "type": "composer-plugin", "extra": { @@ -230,6 +240,10 @@ "email": "franck.nijhof@dealerdirect.com", "homepage": "http://www.frenck.nl", "role": "Developer / IT Manager" + }, + { + "name": "Contributors", + "homepage": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer/graphs/contributors" } ], "description": "PHP_CodeSniffer Standards Composer Installer Plugin", @@ -241,6 +255,7 @@ "codesniffer", "composer", "installer", + "phpcbf", "phpcs", "plugin", "qa", @@ -251,7 +266,11 @@ "stylecheck", "tests" ], - "time": "2020-12-07T18:04:37+00:00" + "support": { + "issues": "https://github.com/dealerdirect/phpcodesniffer-composer-installer/issues", + "source": "https://github.com/dealerdirect/phpcodesniffer-composer-installer" + }, + "time": "2022-02-04T12:51:07+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -309,6 +328,10 @@ "phpcs", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibility/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibility" + }, "time": "2019-12-27T09:44:58+00:00" }, { @@ -361,20 +384,24 @@ "polyfill", "standards" ], + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" + }, "time": "2021-02-15T10:24:51+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.1", + "version": "2.1.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e" + "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e", - "reference": "b7dc0cd7a8f767ccac5e7637550ea1c50a67b09e", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/d55de55f88697b9cdb94bccf04f14eb3b11cf308", + "reference": "d55de55f88697b9cdb94bccf04f14eb3b11cf308", "shasum": "" }, "require": { @@ -411,20 +438,24 @@ "standards", "wordpress" ], - "time": "2021-02-15T12:58:46+00:00" + "support": { + "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" + }, + "time": "2021-12-30T16:37:40+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.6.0", + "version": "3.6.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625" + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ffced0d2c8fa8e6cdc4d695a743271fab6c38625", - "reference": "ffced0d2c8fa8e6cdc4d695a743271fab6c38625", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, "require": { @@ -462,7 +493,12 @@ "phpcs", "standards" ], - "time": "2021-04-09T00:54:41+00:00" + "support": { + "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", + "source": "https://github.com/squizlabs/PHP_CodeSniffer", + "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" + }, + "time": "2021-12-12T21:44:58+00:00" }, { "name": "wp-coding-standards/wpcs", @@ -508,6 +544,11 @@ "standards", "wordpress" ], + "support": { + "issues": "https://github.com/WordPress/WordPress-Coding-Standards/issues", + "source": "https://github.com/WordPress/WordPress-Coding-Standards", + "wiki": "https://github.com/WordPress/WordPress-Coding-Standards/wiki" + }, "time": "2020-05-13T23:57:56+00:00" } ], @@ -522,5 +563,5 @@ "php": ">=5.2.4" }, "platform-dev": [], - "plugin-api-version": "1.1.0" + "plugin-api-version": "2.2.0" } From 615f2459cf3fdab232f302206c1fcdc2ce75fbcb Mon Sep 17 00:00:00 2001 From: Oscar Sanchez S Date: Sat, 19 Mar 2022 11:26:50 -0600 Subject: [PATCH 02/12] Fix branch names --- .github/workflows/php-compatibility.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/php-compatibility.yml b/.github/workflows/php-compatibility.yml index 7f451527..738b3dbc 100644 --- a/.github/workflows/php-compatibility.yml +++ b/.github/workflows/php-compatibility.yml @@ -7,10 +7,11 @@ env: on: push: branches: - - trunk + - develop + - master pull_request: branches: - - trunk + - develop jobs: php_compatibility: From d4ac2bce97ae185958be63afc7dd090e0fb5932e Mon Sep 17 00:00:00 2001 From: Oscar Sanchez S Date: Sat, 19 Mar 2022 11:59:51 -0600 Subject: [PATCH 03/12] phpcbf fixes --- .../admin/api/class-bc-admin-media-api.php | 2 +- includes/admin/class-bc-templates.php | 636 +++++++++--------- includes/api/class-bc-cms-api.php | 2 +- includes/class-bc-labels.php | 2 +- includes/class-bc-setup.php | 2 +- includes/class-bc-utility.php | 2 +- includes/sync/class-bc-videos.php | 4 +- 7 files changed, 325 insertions(+), 325 deletions(-) diff --git a/includes/admin/api/class-bc-admin-media-api.php b/includes/admin/api/class-bc-admin-media-api.php index bb90a772..cf4ca937 100644 --- a/includes/admin/api/class-bc-admin-media-api.php +++ b/includes/admin/api/class-bc-admin-media-api.php @@ -117,7 +117,7 @@ public function bc_ajax_update_video_or_playlist() { 'scheduled_start_date', 'scheduled_end_date', 'sub_type', - 'language' + 'language', ); foreach ( $fields as $field ) { diff --git a/includes/admin/class-bc-templates.php b/includes/admin/class-bc-templates.php index e403541d..334d57a9 100644 --- a/includes/admin/class-bc-templates.php +++ b/includes/admin/class-bc-templates.php @@ -101,331 +101,331 @@ public function add_templates() { + +