diff --git a/composer.json b/composer.json index 3d3098abaff758..f94b3c18e89fd6 100644 --- a/composer.json +++ b/composer.json @@ -11,11 +11,11 @@ "issues": "https://github.com/WordPress/gutenberg/issues" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", - "squizlabs/php_codesniffer": "^3.4.2", - "phpcompatibility/php-compatibility": "^9.2.0", - "wp-coding-standards/wpcs": "^2.1.1", - "sirbrillig/phpcs-variable-analysis": "^2.7" + "dealerdirect/phpcodesniffer-composer-installer": "^0.6", + "squizlabs/php_codesniffer": "^3.5", + "phpcompatibility/php-compatibility": "^9.3", + "wp-coding-standards/wpcs": "^2.2", + "sirbrillig/phpcs-variable-analysis": "^2.8" }, "require": { "composer/installers": "~1.0" diff --git a/composer.lock b/composer.lock index 594d8bb48c929d..3ac63fed05df15 100644 --- a/composer.lock +++ b/composer.lock @@ -1,35 +1,38 @@ { "_readme": [ "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "f802871495ce4d7ed5928e17524d0cdb", + "content-hash": "9745a2b1c8d1005bf9f7617061e4fc7d", "packages": [ { "name": "composer/installers", - "version": "v1.6.0", + "version": "v1.9.0", "source": { "type": "git", "url": "https://github.com/composer/installers.git", - "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b" + "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/installers/zipball/cfcca6b1b60bc4974324efb5783c13dca6932b5b", - "reference": "cfcca6b1b60bc4974324efb5783c13dca6932b5b", + "url": "https://api.github.com/repos/composer/installers/zipball/b93bcf0fa1fccb0b7d176b0967d969691cd74cca", + "reference": "b93bcf0fa1fccb0b7d176b0967d969691cd74cca", "shasum": "" }, "require": { - "composer-plugin-api": "^1.0" + "composer-plugin-api": "^1.0 || ^2.0" }, "replace": { "roundcube/plugin-installer": "*", "shama/baton": "*" }, "require-dev": { - "composer/composer": "1.0.*@dev", - "phpunit/phpunit": "^4.8.36" + "composer/composer": "1.6.* || 2.0.*@dev", + "composer/semver": "1.0.* || 2.0.*@dev", + "phpunit/phpunit": "^4.8.36", + "sebastian/comparator": "^1.2.4", + "symfony/process": "^2.3" }, "type": "composer-plugin", "extra": { @@ -65,6 +68,7 @@ "Kanboard", "Lan Management System", "MODX Evo", + "MantisBT", "Mautic", "Maya", "OXID", @@ -73,6 +77,7 @@ "RadPHP", "SMF", "Thelia", + "Whmcs", "WolfCMS", "agl", "aimeos", @@ -95,6 +100,7 @@ "installer", "itop", "joomla", + "known", "kohana", "laravel", "lavalite", @@ -117,6 +123,7 @@ "shopware", "silverstripe", "sydes", + "sylius", "symfony", "typo3", "wordpress", @@ -124,22 +131,22 @@ "zend", "zikula" ], - "time": "2018-08-27T06:10:37+00:00" + "time": "2020-04-07T06:57:05+00:00" } ], "packages-dev": [ { "name": "dealerdirect/phpcodesniffer-composer-installer", - "version": "v0.5.0", + "version": "v0.6.2", "source": { "type": "git", "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132" + "reference": "8001af8eb107fbfcedc31a8b51e20b07d85b457a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/e749410375ff6fb7a040a68878c656c2e610b132", - "reference": "e749410375ff6fb7a040a68878c656c2e610b132", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/8001af8eb107fbfcedc31a8b51e20b07d85b457a", + "reference": "8001af8eb107fbfcedc31a8b51e20b07d85b457a", "shasum": "" }, "require": { @@ -192,20 +199,20 @@ "stylecheck", "tests" ], - "time": "2018-10-26T13:21:45+00:00" + "time": "2020-01-29T20:22:20+00:00" }, { "name": "phpcompatibility/php-compatibility", - "version": "9.2.0", + "version": "9.3.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibility.git", - "reference": "3db1bf1e28123fd574a4ae2e9a84072826d51b5e" + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/3db1bf1e28123fd574a4ae2e9a84072826d51b5e", - "reference": "3db1bf1e28123fd574a4ae2e9a84072826d51b5e", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibility/zipball/9fb324479acf6f39452e0655d2429cc0d3914243", + "reference": "9fb324479acf6f39452e0655d2429cc0d3914243", "shasum": "" }, "require": { @@ -228,10 +235,6 @@ "LGPL-3.0-or-later" ], "authors": [ - { - "name": "Contributors", - "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" - }, { "name": "Wim Godden", "homepage": "https://github.com/wimg", @@ -241,6 +244,10 @@ "name": "Juliette Reinders Folmer", "homepage": "https://github.com/jrfnl", "role": "lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCompatibility/PHPCompatibility/graphs/contributors" } ], "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP cross-version compatibility.", @@ -250,32 +257,32 @@ "phpcs", "standards" ], - "time": "2019-06-27T19:58:56+00:00" + "time": "2019-12-27T09:44:58+00:00" }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.7.0", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "1b1b2b503a19bb56fa75f4a2d959b12c8ed28c12" + "reference": "5be26b4d719acaf7a433d1cad469159cbf034f2a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/1b1b2b503a19bb56fa75f4a2d959b12c8ed28c12", - "reference": "1b1b2b503a19bb56fa75f4a2d959b12c8ed28c12", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/5be26b4d719acaf7a433d1cad469159cbf034f2a", + "reference": "5be26b4d719acaf7a433d1cad469159cbf034f2a", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": ">=5.6.0", + "squizlabs/php_codesniffer": "^3.1" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4 || ^0.5 || ^0.6", "limedeck/phpunit-detailed-printer": "^3.1", "phpstan/phpstan": "^0.11.8", - "phpunit/phpunit": "^6.5", - "sirbrillig/phpcs-import-detection": "^1.1", - "squizlabs/php_codesniffer": "^3.1" + "phpunit/phpunit": "^5.0 || ^6.5", + "sirbrillig/phpcs-import-detection": "^1.1" }, "type": "phpcodesniffer-standard", "autoload": { @@ -288,30 +295,30 @@ "BSD-2-Clause" ], "authors": [ - { - "name": "Payton Swick", - "email": "payton@foolord.com" - }, { "name": "Sam Graham", "email": "php-codesniffer-variableanalysis@illusori.co.uk" + }, + { + "name": "Payton Swick", + "email": "payton@foolord.com" } ], "description": "A PHPCS sniff to detect problems with variables.", - "time": "2019-06-24T23:57:11+00:00" + "time": "2020-02-11T22:18:48+00:00" }, { "name": "squizlabs/php_codesniffer", - "version": "3.4.2", + "version": "3.5.5", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8" + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", - "reference": "b8a7362af1cc1aadb5bd36c3defc4dda2cf5f0a8", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/73e2e7f57d958e7228fce50dc0c61f58f017f9f6", + "reference": "73e2e7f57d958e7228fce50dc0c61f58f017f9f6", "shasum": "" }, "require": { @@ -349,20 +356,20 @@ "phpcs", "standards" ], - "time": "2019-04-10T23:49:02+00:00" + "time": "2020-04-17T01:09:41+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "2.1.1", + "version": "2.2.1", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "bd9c33152115e6741e3510ff7189605b35167908" + "reference": "b5a453203114cc2284b1a614c4953456fbe4f546" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/bd9c33152115e6741e3510ff7189605b35167908", - "reference": "bd9c33152115e6741e3510ff7189605b35167908", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b5a453203114cc2284b1a614c4953456fbe4f546", + "reference": "b5a453203114cc2284b1a614c4953456fbe4f546", "shasum": "" }, "require": { @@ -370,12 +377,12 @@ "squizlabs/php_codesniffer": "^3.3.1" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0", + "dealerdirect/phpcodesniffer-composer-installer": "^0.5 || ^0.6", "phpcompatibility/php-compatibility": "^9.0", "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.5.0 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." + "dealerdirect/phpcodesniffer-composer-installer": "^0.6 || This Composer plugin will sort out the PHPCS 'installed_paths' automatically." }, "type": "phpcodesniffer-standard", "notification-url": "https://packagist.org/downloads/", @@ -385,7 +392,7 @@ "authors": [ { "name": "Contributors", - "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors" + "homepage": "https://github.com/WordPress/WordPress-Coding-Standards/graphs/contributors" } ], "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", @@ -394,7 +401,7 @@ "standards", "wordpress" ], - "time": "2019-05-21T02:50:00+00:00" + "time": "2020-02-04T02:52:06+00:00" } ], "aliases": [], diff --git a/lib/class-wp-rest-block-directory-controller.php b/lib/class-wp-rest-block-directory-controller.php index 7360fa9d2533ff..9c2c2f96160cfe 100644 --- a/lib/class-wp-rest-block-directory-controller.php +++ b/lib/class-wp-rest-block-directory-controller.php @@ -303,7 +303,7 @@ private static function parse_block_metadata( $plugin ) { $block->humanized_updated = sprintf( /* translators: %s: Human-readable time difference. */ __( '%s ago', 'gutenberg' ), - human_time_diff( strtotime( $plugin['last_updated'] ), current_time( 'timestamp' ) ) + human_time_diff( strtotime( $plugin['last_updated'] ), time() ) ); return $block; diff --git a/lib/client-assets.php b/lib/client-assets.php index 32b92c7bdbde68..4a0b6c3824f1d0 100644 --- a/lib/client-assets.php +++ b/lib/client-assets.php @@ -644,7 +644,7 @@ function gutenberg_load_block_pattern( $name ) { */ function gutenberg_extend_settings_block_patterns( $settings ) { if ( empty( $settings['__experimentalBlockPatterns'] ) ) { - $settings['__experimentalBlockPatterns'] = []; + $settings['__experimentalBlockPatterns'] = array(); } $settings['__experimentalBlockPatterns'] = array_merge( diff --git a/lib/template-loader.php b/lib/template-loader.php index 7bab80566db1b7..0ef843f205bc7d 100644 --- a/lib/template-loader.php +++ b/lib/template-loader.php @@ -167,12 +167,17 @@ function gutenberg_find_template( $template_file ) { // See if there is a theme block template with higher priority than the resolved template post. $higher_priority_block_template_path = null; $higher_priority_block_template_priority = PHP_INT_MAX; - $block_template_files = glob( get_stylesheet_directory() . '/block-templates/*.html' ) ?: array(); + $block_template_files = glob( get_stylesheet_directory() . '/block-templates/*.html' ); + $block_template_files = is_array( $block_template_files ) ? $block_template_files : array(); if ( is_child_theme() ) { - $block_template_files = array_merge( $block_template_files, glob( get_template_directory() . '/block-templates/*.html' ) ?: array() ); + $child_block_template_files = glob( get_template_directory() . '/block-templates/*.html' ); + $child_block_template_files = is_array( $child_block_template_files ) ? $child_block_template_files : array(); + $block_template_files = array_merge( $block_template_files, $child_block_template_files ); } if ( gutenberg_is_experiment_enabled( 'gutenberg-full-site-editing-demo' ) ) { - $block_template_files = array_merge( $block_template_files, glob( dirname( __FILE__ ) . '/demo-block-templates/*.html' ) ?: array() ); + $demo_block_template_files = glob( dirname( __FILE__ ) . '/demo-block-templates/*.html' ); + $demo_block_template_files = is_array( $demo_block_template_files ) ? $demo_block_template_files : array(); + $block_template_files = array_merge( $block_template_files, $demo_block_template_files ); } foreach ( $block_template_files as $path ) { if ( ! isset( $slug_priorities[ basename( $path, '.html' ) ] ) ) {