diff --git a/.travis.yml b/.travis.yml
index f15d510..d9fe5cb 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -35,17 +35,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
- if [[ "$WP_TRAVISCI" == "node" ]]; then yarn 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
- if [[ "$WP_TRAVISCI" == "node" ]]; then yarn lint; fi
diff --git a/README.md b/README.md
index 1deb7bb..ea11b74 100644
--- a/README.md
+++ b/README.md
@@ -14,8 +14,17 @@ Install the module using Composer `composer require dekodeinteraktiv/hogan-galle
## Changelog
-## [1.2.0]
-### Breaking Changes
+### 1.2.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.2.1
+- Add support for Photoswipe animation.
+- Enable animation by default.
+
+### 1.2.0
+#### Breaking Changes
- Remove heading field, provided from Core in [#53](https://github.com/DekodeInteraktiv/hogan-core/pull/53)
- Heading field has to be added using filter (was default on before).
@@ -23,7 +32,3 @@ Install the module using Composer `composer require dekodeinteraktiv/hogan-galle
- Heading classname changed from `.heading` to `.hogan-heading`. (#5)
- Template markup changed from `ul > li` to `div` (#7)
- Added schema to markup (#7)
-
-### 1.2.1
-- Add support for Photoswipe animation.
-- Enable animation by default.
diff --git a/assets/photoswipe-template.php b/assets/photoswipe-template.php
index ce4683c..5c1d012 100644
--- a/assets/photoswipe-template.php
+++ b/assets/photoswipe-template.php
@@ -5,6 +5,8 @@
* @package Hogan
*/
+declare( strict_types = 1 );
+
?>
diff --git a/composer.json b/composer.json
index 147d76d..0b938e7 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": [
@@ -22,5 +22,14 @@
"phpcs.xml",
"yarn.lock"
]
+ },
+ "require-dev": {
+ "dekodeinteraktiv/coding-standards": "^0.3.1"
+ },
+ "scripts": {
+ "test": [
+ "@composer install",
+ "./vendor/bin/phpcs"
+ ]
}
}
diff --git a/composer.lock b/composer.lock
index 90e7440..b0c6c0d 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,20 +4,20 @@
"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": "744527b75d3ca191a6a85a0accecb747",
+ "content-hash": "9f418c70ec7446bf37ee9c5a0be9733a",
"packages": [
{
"name": "composer/installers",
- "version": "v1.4.0",
+ "version": "v1.5.0",
"source": {
"type": "git",
"url": "https://github.com/composer/installers.git",
- "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b"
+ "reference": "049797d727261bf27f2690430d935067710049c2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/composer/installers/zipball/9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b",
- "reference": "9ce17fb70e9a38dd8acff0636a29f5cf4d575c1b",
+ "url": "https://api.github.com/repos/composer/installers/zipball/049797d727261bf27f2690430d935067710049c2",
+ "reference": "049797d727261bf27f2690430d935067710049c2",
"shasum": ""
},
"require": {
@@ -29,7 +29,7 @@
},
"require-dev": {
"composer/composer": "1.0.*@dev",
- "phpunit/phpunit": "4.1.*"
+ "phpunit/phpunit": "^4.8.36"
},
"type": "composer-plugin",
"extra": {
@@ -100,15 +100,18 @@
"lavalite",
"lithium",
"magento",
+ "majima",
"mako",
"mediawiki",
"modulework",
+ "modx",
"moodle",
"osclass",
"phpbb",
"piwik",
"ppi",
"puppet",
+ "pxcms",
"reindex",
"roundcube",
"shopware",
@@ -121,37 +124,315 @@
"zend",
"zikula"
],
- "time": "2017-08-09T07:53:48+00:00"
+ "time": "2017-12-29T09:13:20+00:00"
},
{
"name": "dekodeinteraktiv/hogan-core",
- "version": "1.0.3",
+ "version": "1.1.7",
"source": {
"type": "git",
"url": "https://github.com/DekodeInteraktiv/hogan-core.git",
- "reference": "010ce97f21587722e4d8c2c70860a49323647d29"
+ "reference": "46d5dd20ad7388ee014bc74efdde9261bb2c2ac0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/DekodeInteraktiv/hogan-core/zipball/010ce97f21587722e4d8c2c70860a49323647d29",
- "reference": "010ce97f21587722e4d8c2c70860a49323647d29",
+ "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": "2017-12-06T08:05:41+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": [],
diff --git a/hogan-gallery.php b/hogan-gallery.php
index daee616..3d8b214 100644
--- a/hogan-gallery.php
+++ b/hogan-gallery.php
@@ -4,7 +4,7 @@
* Plugin URI: https://github.com/dekodeinteraktiv/hogan-gallery
* GitHub Plugin URI: https://github.com/dekodeinteraktiv/hogan-gallery
* Description: Image Gallery Module for Hogan
- * Version: 1.2.1
+ * Version: 1.2.2
* Author: Dekode
* Author URI: https://en.dekode.no
* License: GPL-3.0-or-later
@@ -24,10 +24,10 @@
exit; // Exit if accessed directly.
}
-define( 'HOGAN_GALLERY_VERSION', '1.2.1' );
+define( 'HOGAN_GALLERY_VERSION', '1.2.2' );
add_action( 'plugins_loaded', __NAMESPACE__ . '\\hogan_load_textdomain' );
-add_action( 'hogan/include_modules', __NAMESPACE__ . '\\hogan_register_module' );
+add_action( 'hogan/include_modules', __NAMESPACE__ . '\\hogan_register_module', 10, 1 );
/**
* Register module text domain
@@ -41,9 +41,10 @@ function hogan_load_textdomain() {
/**
* Register module in Hogan
*
+ * @param \Dekode\Hogan\Core $core Hogan Core instance.
* @return void
*/
-function hogan_register_module() {
+function hogan_register_module( \Dekode\Hogan\Core $core ) {
require_once 'class-gallery.php';
- \hogan_register_module( new \Dekode\Hogan\Gallery() );
+ $core->register_module( new \Dekode\Hogan\Gallery() );
}
diff --git a/phpcs.xml b/phpcs.xml
index ca1d5f4..2ff5acc 100644
--- a/phpcs.xml
+++ b/phpcs.xml
@@ -1,10 +1,8 @@
Write code using Hogan's standards and Hogan will stay happy!
-
-
-
-
-
-
+ .
+
+
+