jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/354030 )
Change subject: Introduce PHPCS check in CI ...................................................................... Introduce PHPCS check in CI Introduced PHPCS check in CI - using same configuration as in MobileFrontend. Additionally fixed wrong code style. Change-Id: I0c879553d355c2a277fcc4349a93e85c65eb2291 --- M composer.json M includes/PopupsGadgetsIntegration.php A phpcs.xml M tests/phpunit/PopupsHooksTest.php 4 files changed, 25 insertions(+), 3 deletions(-) Approvals: Bmansurov: Looks good to me, approved jenkins-bot: Verified diff --git a/composer.json b/composer.json index 686b65b..3e676f3 100644 --- a/composer.json +++ b/composer.json @@ -1,11 +1,16 @@ { "require-dev": { "jakub-onderka/php-parallel-lint": "0.9.2", + "mediawiki/mediawiki-codesniffer": "0.7.2", "jakub-onderka/php-console-highlighter": "0.3.2" }, "scripts": { "test": [ - "parallel-lint . --exclude vendor" + "parallel-lint . --exclude vendor", + "phpcs -p -s" + ], + "fix": [ + "phpcbf" ] } } diff --git a/includes/PopupsGadgetsIntegration.php b/includes/PopupsGadgetsIntegration.php index 763999d..4693653 100644 --- a/includes/PopupsGadgetsIntegration.php +++ b/includes/PopupsGadgetsIntegration.php @@ -49,7 +49,7 @@ * @param Config $config * @param ExtensionRegistry $extensionRegistry */ - public function __construct( Config $config , ExtensionRegistry $extensionRegistry ) { + public function __construct( Config $config, ExtensionRegistry $extensionRegistry ) { $this->extensionRegistry = $extensionRegistry; $this->navPopupsGadgetName = $this->sanitizeGadgetName( $config->get( self::CONFIG_NAVIGATION_POPUPS_NAME ) ); diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..750e66a --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,16 @@ +<?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> + + <rule ref="Squiz.Functions.FunctionDeclarationArgumentSpacing"> + <properties> + <property name="equalsSpacing" value="1" /> + <property name="requiredSpacesAfterOpen" value="1"/> + <property name="requiredSpacesBeforeClose" value="1" /> + </properties> + </rule> +</ruleset> diff --git a/tests/phpunit/PopupsHooksTest.php b/tests/phpunit/PopupsHooksTest.php index e50ff5c..6dc50fd 100644 --- a/tests/phpunit/PopupsHooksTest.php +++ b/tests/phpunit/PopupsHooksTest.php @@ -263,7 +263,8 @@ * @covers ::onBeforePageDisplay * @dataProvider providerOnBeforePageDisplay */ - public function testOnBeforePageDisplay( $shouldSendModuleToUser, $isBetaFeatureEnabled, $isCodeLoaded ) { + public function testOnBeforePageDisplay( $shouldSendModuleToUser, + $isBetaFeatureEnabled, $isCodeLoaded ) { $skinMock = $this->getMock( Skin::class ); $outPageMock = $this->getMock( -- To view, visit https://gerrit.wikimedia.org/r/354030 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c879553d355c2a277fcc4349a93e85c65eb2291 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Popups Gerrit-Branch: master Gerrit-Owner: Pmiazga <pmia...@wikimedia.org> Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Jhernandez <jhernan...@wikimedia.org> Gerrit-Reviewer: Phuedx <samsm...@wikimedia.org> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits