diff --git a/.travis.yml b/.travis.yml index d13031f..88cf686 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,15 +26,16 @@ before_script: fi - | if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then - composer global require wp-coding-standards/wpcs - composer global require wimg/php-compatibility - phpcs --config-set installed_paths $HOME/.composer/vendor/wp-coding-standards/wpcs,$HOME/.composer/vendor/wimg/php-compatibility + composer install fi + script: - | if [[ "$WP_TRAVISCI" == "phpcs" ]] ; then - find -L . -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l - phpcs -p -s -v . --standard=./phpcs.xml --extensions=php --runtime-set testVersion $TRAVIS_PHP_VERSION + find . -name '*.php' ! -path "./vendor/*" ! -path "./wp-content/*" -print0 | xargs -0 -n 1 -P 4 php -l + echo Running phpcs for PHP version $TRAVIS_PHP_VERSION … + ./vendor/bin/phpcs --runtime-set testVersion $TRAVIS_PHP_VERSION fi + notifications: - email: false + email: false \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c5af94..b875f29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## [1.1.2] +- Update module to new registration method introduced in [Hogan Core 1.1.7](https://github.com/DekodeInteraktiv/hogan-core/releases/tag/1.1.7) +- Set hogan-core dependency `"dekodeinteraktiv/hogan-core": ">=1.1.7"` +- Add Dekode Coding Standards + ## [1.1.1] `wp_enqueue_scripts` action hook removed. Handled by `hogan-core`. diff --git a/composer.json b/composer.json index f362db0..79ef2be 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "require": { "php": ">=7.0", "composer/installers": "~1.2", - "dekodeinteraktiv/hogan-core": "^1.0" + "dekodeinteraktiv/hogan-core": ">=1.1.7" }, "archive": { "exclude": [ @@ -18,5 +18,8 @@ "LICENSE", "phpcs.xml" ] + }, + "require-dev": { + "dekodeinteraktiv/coding-standards": "^0.3.1" } } diff --git a/composer.lock b/composer.lock index 4adf99e..24bc78a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "2031918e2c5d4b321f0698bd7471d899", + "content-hash": "d36e49627919544e1f7262d362b01c5e", "packages": [ { "name": "composer/installers", @@ -128,40 +128,318 @@ }, { "name": "dekodeinteraktiv/hogan-core", - "version": "1.0.12", + "version": "1.1.7", "source": { "type": "git", "url": "https://github.com/DekodeInteraktiv/hogan-core.git", - "reference": "2e57d2a0a575028d62bdf68a4b291fd6a5bb1421" + "reference": "46d5dd20ad7388ee014bc74efdde9261bb2c2ac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/DekodeInteraktiv/hogan-core/zipball/2e57d2a0a575028d62bdf68a4b291fd6a5bb1421", - "reference": "2e57d2a0a575028d62bdf68a4b291fd6a5bb1421", + "url": "https://api.github.com/repos/DekodeInteraktiv/hogan-core/zipball/46d5dd20ad7388ee014bc74efdde9261bb2c2ac0", + "reference": "46d5dd20ad7388ee014bc74efdde9261bb2c2ac0", "shasum": "" }, "require": { "composer/installers": "~1.2", "php": ">=7.0" }, + "require-dev": { + "dekodeinteraktiv/coding-standards": "^0.3.1" + }, "type": "wordpress-plugin", "notification-url": "https://packagist.org/downloads/", "license": [ - "GPL-3.0" + "GPL-3.0-or-later" ], "description": "Modular Flexible Content System for ACF Pro", "homepage": "https://github.com/DekodeInteraktiv/hogan-core", - "time": "2018-01-08T15:42:29+00:00" + "time": "2018-04-04T09:25:18+00:00" + } + ], + "packages-dev": [ + { + "name": "automattic/phpcs-neutron-standard", + "version": "v1.5.0", + "source": { + "type": "git", + "url": "https://github.com/Automattic/phpcs-neutron-standard.git", + "reference": "7491ee86f705082ebd318fc90d16f8b874440901" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Automattic/phpcs-neutron-standard/zipball/7491ee86f705082ebd318fc90d16f8b874440901", + "reference": "7491ee86f705082ebd318fc90d16f8b874440901", + "shasum": "" + }, + "require-dev": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "limedeck/phpunit-detailed-printer": "^3.1", + "phpunit/phpunit": "^6.4", + "sirbrillig/phpcs-variable-analysis": "^2.0.1", + "squizlabs/php_codesniffer": "^3.2.1" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Payton Swick", + "email": "payton@foolord.com" + } + ], + "description": "A set of phpcs sniffs for modern php development.", + "time": "2018-03-16T03:07:32+00:00" + }, + { + "name": "dealerdirect/phpcodesniffer-composer-installer", + "version": "v0.4.4", + "source": { + "type": "git", + "url": "https://github.com/Dealerdirect/phpcodesniffer-composer-installer.git", + "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Dealerdirect/phpcodesniffer-composer-installer/zipball/2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "reference": "2e41850d5f7797cbb1af7b030d245b3b24e63a08", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0", + "php": "^5.3|^7", + "squizlabs/php_codesniffer": "*" + }, + "require-dev": { + "composer/composer": "*", + "wimg/php-compatibility": "^8.0" + }, + "suggest": { + "dealerdirect/qa-tools": "All the PHP QA tools you'll need" + }, + "type": "composer-plugin", + "extra": { + "class": "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\Plugin" + }, + "autoload": { + "psr-4": { + "Dealerdirect\\Composer\\Plugin\\Installers\\PHPCodeSniffer\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Franck Nijhof", + "email": "f.nijhof@dealerdirect.nl", + "homepage": "http://workingatdealerdirect.eu", + "role": "Developer" + } + ], + "description": "PHP_CodeSniffer Standards Composer Installer Plugin", + "homepage": "http://workingatdealerdirect.eu", + "keywords": [ + "PHPCodeSniffer", + "PHP_CodeSniffer", + "code quality", + "codesniffer", + "composer", + "installer", + "phpcs", + "plugin", + "qa", + "quality", + "standard", + "standards", + "style guide", + "stylecheck", + "tests" + ], + "time": "2017-12-06T16:27:17+00:00" + }, + { + "name": "dekodeinteraktiv/coding-standards", + "version": "0.3.1", + "source": { + "type": "git", + "url": "https://github.com/DekodeInteraktiv/coding-standards.git", + "reference": "89e9a14ffbeb632fbe4a42a5a72648e08aeda573" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/DekodeInteraktiv/coding-standards/zipball/89e9a14ffbeb632fbe4a42a5a72648e08aeda573", + "reference": "89e9a14ffbeb632fbe4a42a5a72648e08aeda573", + "shasum": "" + }, + "require": { + "automattic/phpcs-neutron-standard": "^1.4", + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.4", + "wimg/php-compatibility": "^8.1", + "wp-coding-standards/wpcs": "^0.14.1" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Dekode Coding Standards", + "time": "2018-03-23T08:47:02+00:00" + }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.2.3", + "source": { + "type": "git", + "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "reference": "4842476c434e375f9d3182ff7b89059583aa8b27" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4842476c434e375f9d3182ff7b89059583aa8b27", + "reference": "4842476c434e375f9d3182ff7b89059583aa8b27", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + }, + "bin": [ + "bin/phpcs", + "bin/phpcbf" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "lead" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "http://www.squizlabs.com/php-codesniffer", + "keywords": [ + "phpcs", + "standards" + ], + "time": "2018-02-20T21:35:23+00:00" + }, + { + "name": "wimg/php-compatibility", + "version": "8.1.0", + "source": { + "type": "git", + "url": "https://github.com/wimg/PHPCompatibility.git", + "reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/wimg/PHPCompatibility/zipball/4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e", + "reference": "4ac01e4fe8faaa4f8d3b3cd06ea92e5418ce472e", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.2 || ^3.0.2" + }, + "conflict": { + "squizlabs/php_codesniffer": "2.6.2" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3" + }, + "type": "phpcodesniffer-standard", + "autoload": { + "psr-4": { + "PHPCompatibility\\": "PHPCompatibility/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "LGPL-3.0" + ], + "authors": [ + { + "name": "Wim Godden", + "role": "lead" + } + ], + "description": "A set of sniffs for PHP_CodeSniffer that checks for PHP version compatibility.", + "homepage": "http://techblog.wimgodden.be/tag/codesniffer/", + "keywords": [ + "compatibility", + "phpcs", + "standards" + ], + "time": "2017-12-27T21:58:38+00:00" + }, + { + "name": "wp-coding-standards/wpcs", + "version": "0.14.1", + "source": { + "type": "git", + "url": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards.git", + "reference": "cf6b310caad735816caef7573295f8a534374706" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/WordPress-Coding-Standards/WordPress-Coding-Standards/zipball/cf6b310caad735816caef7573295f8a534374706", + "reference": "cf6b310caad735816caef7573295f8a534374706", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "squizlabs/php_codesniffer": "^2.9.0 || ^3.0.2" + }, + "suggest": { + "dealerdirect/phpcodesniffer-composer-installer": "^0.4.3" + }, + "type": "phpcodesniffer-standard", + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Contributors", + "homepage": "https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer rules (sniffs) to enforce WordPress coding conventions", + "keywords": [ + "phpcs", + "standards", + "wordpress" + ], + "time": "2018-02-16T01:57:48+00:00" } ], - "packages-dev": [], "aliases": [], "minimum-stability": "stable", "stability-flags": [], "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">=5.5" + "php": ">=7.0" }, "platform-dev": [] } diff --git a/hogan-expandable-list.php b/hogan-expandable-list.php index a9c122f..89d7550 100644 --- a/hogan-expandable-list.php +++ b/hogan-expandable-list.php @@ -4,7 +4,7 @@ * Plugin URI: https://github.com/dekodeinteraktiv/hogan-expandable-list * GitHub Plugin URI: https://github.com/dekodeinteraktiv/hogan-expandable-list * Description: Expandable List Module for Hogan - * Version: 1.1.1 + * Version: 1.1.2 * Author: Dekode * Author URI: https://dekode.no * License: GPL-3.0 @@ -25,7 +25,7 @@ } add_action( 'plugins_loaded', __NAMESPACE__ . '\\hogan_load_textdomain' ); -add_action( 'hogan/include_modules', __NAMESPACE__ . '\\hogan_register_module' ); +add_action( 'hogan/include_modules', __NAMESPACE__ . '\\register_module', 10, 1 ); /** * Register module text domain @@ -36,8 +36,11 @@ function hogan_load_textdomain() { /** * Register module in Hogan + * + * @param \Dekode\Hogan\Core $core Hogan Core instance. + * @return void */ -function hogan_register_module() { +function register_module( \Dekode\Hogan\Core $core ) { require_once 'class-expandable-list.php'; - \hogan_register_module( new \Dekode\Hogan\Expandable_List() ); + $core->register_module( new \Dekode\Hogan\Expandable_List() ); } diff --git a/phpcs.xml b/phpcs.xml index ca1d5f4..4fd79a4 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,10 +1,11 @@ Write code using Hogan's standards and Hogan will stay happy! - - + . + + + + + - - -