jenkins-bot has submitted this change and it was merged. Change subject: Add mediawiki-codesniffer ......................................................................
Add mediawiki-codesniffer Fix a few trivial style issues such as array() and whitespaces. Change-Id: I22778c27e090bd0d0b7bdbf0b9ca9d79d289e36a --- M Timeline.body.php M Timeline.i18n.php M composer.json A phpcs.xml 4 files changed, 20 insertions(+), 7 deletions(-) Approvals: Legoktm: Looks good to me, approved jenkins-bot: Verified diff --git a/Timeline.body.php b/Timeline.body.php index 29a7e33..8cc9519 100644 --- a/Timeline.body.php +++ b/Timeline.body.php @@ -93,8 +93,7 @@ . " -m -P " . wfEscapeShellArg( $wgTimelinePloticusCommand ) . " -T " . wfEscapeShellArg( $wgTmpDirectory ) . " -A " . wfEscapeShellArg( $wgArticlePath ) - . " -f " . wfEscapeShellArg( $wgTimelineFontFile ) - ; + . " -f " . wfEscapeShellArg( $wgTimelineFontFile ); // Actually run the command... wfDebug( "Timeline cmd: $cmdline\n" ); diff --git a/Timeline.i18n.php b/Timeline.i18n.php index a0f596f..98ec6ff 100644 --- a/Timeline.i18n.php +++ b/Timeline.i18n.php @@ -10,12 +10,12 @@ * * This shim maintains compatibility back to MediaWiki 1.17. */ -$messages = array(); +$messages = []; if ( !function_exists( 'wfJsonI18nShim96c961c7746fddd4' ) ) { function wfJsonI18nShim96c961c7746fddd4( $cache, $code, &$cachedData ) { - $codeSequence = array_merge( array( $code ), $cachedData['fallbackSequence'] ); + $codeSequence = array_merge( [ $code ], $cachedData['fallbackSequence'] ); foreach ( $codeSequence as $csCode ) { - $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json"; + $fileName = __DIR__ . "/i18n/$csCode.json"; if ( is_readable( $fileName ) ) { $data = FormatJson::decode( file_get_contents( $fileName ), true ); foreach ( array_keys( $data ) as $key ) { diff --git a/composer.json b/composer.json index 1c63f9e..4653c05 100644 --- a/composer.json +++ b/composer.json @@ -1,10 +1,15 @@ { "require-dev": { - "jakub-onderka/php-parallel-lint": "0.9.2" + "jakub-onderka/php-parallel-lint": "0.9.2", + "mediawiki/mediawiki-codesniffer": "0.7.2" }, "scripts": { "test": [ - "parallel-lint . --exclude vendor" + "parallel-lint . --exclude vendor", + "phpcs -p -s" + ], + "fix": [ + "phpcbf" ] } } diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..3e4aafb --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<ruleset> + <rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/> + <file>.</file> + <arg name="extensions" value="php,php5,inc"/> + <arg name="encoding" value="utf8"/> + <exclude-pattern>vendor/</exclude-pattern> + <exclude-pattern>node_modules/</exclude-pattern> +</ruleset> -- To view, visit https://gerrit.wikimedia.org/r/321617 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22778c27e090bd0d0b7bdbf0b9ca9d79d289e36a Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/timeline Gerrit-Branch: master Gerrit-Owner: Hashar <has...@free.fr> Gerrit-Reviewer: Legoktm <lego...@member.fsf.org> Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com> Gerrit-Reviewer: Reedy <re...@wikimedia.org> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits