diff --git a/.travis.yml b/.travis.yml index 0aad9a3..b5b0111 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,12 +2,17 @@ sudo: false language: php cache: npm php: - - 5.6 - - 5.5 - - 5.4 +- '5.6' +- '5.5' +- '5.4' + before_install: - npm install -g bower - npm install + - pyrus install pear/PHP_CodeSniffer + - phpenv rehash + script: - npm run build - npm run jshint + - phpcs --standard=ruleset.xml --extensions=php -n -s . diff --git a/CHANGELOG.md b/CHANGELOG.md index 7057ec2..c4ae76f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ ### 8.0.0: TBD * Change theme name from Roots to Sage * Bump required PHP version to >=5.4 +* Add coding standards based on PSR-2 * Add namespace * Use short array syntax * Use short echo syntax diff --git a/base.php b/base.php index 80bb5fc..5bab6b1 100644 --- a/base.php +++ b/base.php @@ -1,8 +1,10 @@ diff --git a/lib/assets.php b/lib/assets.php index 553f660..23996a9 100644 --- a/lib/assets.php +++ b/lib/assets.php @@ -93,7 +93,7 @@ function google_analytics() { e=o.createElement(i);r=o.getElementsByTagName(i)[0]; e.src='//www.google-analytics.com/analytics.js'; r.parentNode.insertBefore(e,r)}(window,document,'script','ga')); - + function ga() { if (window.console) { console.log('Google Analytics: ' + [].slice.call(arguments)); diff --git a/lib/config.php b/lib/config.php index 6e9b735..c51d360 100644 --- a/lib/config.php +++ b/lib/config.php @@ -1,6 +1,7 @@ Home *
  • Sample PageHome
  • * */ -class Sage_Nav_Walker extends \Walker_Nav_Menu { - function check_current($classes) { +class SageNavWalker extends \Walker_Nav_Menu { + public function checkCurrent($classes) { return preg_match('/(current[-_])|active|dropdown/', $classes); } + // @codingStandardsIgnoreStart function start_lvl(&$output, $depth = 0, $args = []) { $output .= "\n