Samwilson has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/383302 )
Change subject: Move classes into src directory, and remove exclusions for phpcs ...................................................................... Move classes into src directory, and remove exclusions for phpcs Bug: T97105 Change-Id: Ia85f6fd7367f63e0922ec64f2c9bb46a48e416e0 --- M README.md M extension.json M phpcs.xml R src/Hooks.php R src/SpecialHelloWorld.php 5 files changed, 17 insertions(+), 13 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/BoilerPlate refs/changes/02/383302/1 diff --git a/README.md b/README.md index c973562..4bec7a3 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,10 @@ This automates the recommended code checkers for PHP and JavaScript code in Wikimedia projects (see https://www.mediawiki.org/wiki/Continuous_integration/Entry_points). To take advantage of this automation. - # install nodejs, npm, and PHP composer - # change to the extension's directory - # npm install - # composer install + +1. install nodejs, npm, and PHP composer +2. change to the extension's directory +3. `npm install` +4. `composer install` Once set up, running `npm test` and `composer test` will run automated code checks. diff --git a/extension.json b/extension.json index 51c48ce..0f3b1ae 100644 --- a/extension.json +++ b/extension.json @@ -9,8 +9,8 @@ "license-name": "MIT", "type": "other", "AutoloadClasses": { - "MediaWiki\\Extension\\BoilerPlate\\Hooks": "BoilerPlate.hooks.php", - "MediaWiki\\Extension\\BoilerPlate\\SpecialHelloWorld": "specials/SpecialHelloWorld.php" + "MediaWiki\\Extension\\BoilerPlate\\Hooks": "src/Hooks.php", + "MediaWiki\\Extension\\BoilerPlate\\SpecialHelloWorld": "src/SpecialHelloWorld.php" }, "ConfigRegistry": { "boilerplate": "GlobalVarConfig::newInstance" diff --git a/phpcs.xml b/phpcs.xml index e688c40..95b1ff2 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,11 +1,6 @@ <?xml version="1.0"?> <ruleset> - <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki"> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" /> - <exclude name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" /> - <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" /> - <exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" /> - </rule> + <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki" /> <file>.</file> <arg name="extensions" value="php,php5,inc" /> <arg name="encoding" value="utf8" /> diff --git a/BoilerPlate.hooks.php b/src/Hooks.php similarity index 100% rename from BoilerPlate.hooks.php rename to src/Hooks.php diff --git a/specials/SpecialHelloWorld.php b/src/SpecialHelloWorld.php similarity index 92% rename from specials/SpecialHelloWorld.php rename to src/SpecialHelloWorld.php index 5e1162b..292135b 100644 --- a/specials/SpecialHelloWorld.php +++ b/src/SpecialHelloWorld.php @@ -42,7 +42,8 @@ 'myfield2' => [ 'section' => 'section1', 'label-message' => 'testform-myfield2', - 'class' => 'HTMLTextField', // same as type 'text' + // HTMLTextField class is the same as type 'text' + 'class' => 'HTMLTextField', ], 'myfield3' => [ 'class' => 'HTMLTextField', @@ -94,6 +95,10 @@ $htmlForm->show(); } + /** + * @param string[] $formData The submitted form data. + * @return bool|string + */ static function trySubmit( $formData ) { if ( $formData['myfield1'] == 'Fleep' ) { return true; @@ -102,6 +107,9 @@ return 'HAHA FAIL'; } + /** + * @return string + */ protected function getGroupName() { return 'other'; } -- To view, visit https://gerrit.wikimedia.org/r/383302 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia85f6fd7367f63e0922ec64f2c9bb46a48e416e0 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/BoilerPlate Gerrit-Branch: master Gerrit-Owner: Samwilson <s...@samwilson.id.au> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits