Umherirrender has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/398632 )
Change subject: Split RatingDataClass.php into two files
......................................................................
Split RatingDataClass.php into two files
Makes MediaWiki.Files.OneClassPerFile.MultipleFound pass
Change-Id: I55d41d0d354a9bbd7757a326588bc4ac6bb364fc
---
M .phpcs.xml
R Rating.php
A RatingData.php
M extension.json
4 files changed, 31 insertions(+), 31 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ArticleRatings
refs/changes/32/398632/1
diff --git a/.phpcs.xml b/.phpcs.xml
index 6e97740..66496e3 100644
--- a/.phpcs.xml
+++ b/.phpcs.xml
@@ -2,7 +2,6 @@
<ruleset>
<rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
<exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
- <exclude name="MediaWiki.Files.OneClassPerFile.MultipleFound" />
<exclude
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
<exclude
name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
<exclude
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
diff --git a/RatingDataClass.php b/Rating.php
similarity index 72%
rename from RatingDataClass.php
rename to Rating.php
index e056b4e..1341195 100644
--- a/RatingDataClass.php
+++ b/Rating.php
@@ -1,33 +1,5 @@
<?php
-class RatingData {
- public static function getJSON() {
- $json = wfMessage( 'are-ratings' )->plain();
- if ( empty( $json ) ) {
- trigger_error( 'ARE Error: empty JSON' );
- }
- return json_decode( $json, true );
- }
-
- public static function getAllRatings() {
- $JSON = self::getJSON();
-
- $returners = [];
-
- foreach ( $JSON as $data ) {
- $returners[] = new Rating( $data['codename'] );
- }
-
- return $returners;
- }
-
- public static function getDefaultRating() {
- $JSON = self::getJSON();
-
- return new Rating( $JSON[0]['codename'] );
- }
-}
-
class Rating {
protected $codename;
protected $data = [];
diff --git a/RatingData.php b/RatingData.php
new file mode 100644
index 0000000..00c4eb7
--- /dev/null
+++ b/RatingData.php
@@ -0,0 +1,29 @@
+<?php
+
+class RatingData {
+ public static function getJSON() {
+ $json = wfMessage( 'are-ratings' )->plain();
+ if ( empty( $json ) ) {
+ trigger_error( 'ARE Error: empty JSON' );
+ }
+ return json_decode( $json, true );
+ }
+
+ public static function getAllRatings() {
+ $JSON = self::getJSON();
+
+ $returners = [];
+
+ foreach ( $JSON as $data ) {
+ $returners[] = new Rating( $data['codename'] );
+ }
+
+ return $returners;
+ }
+
+ public static function getDefaultRating() {
+ $JSON = self::getJSON();
+
+ return new Rating( $JSON[0]['codename'] );
+ }
+}
diff --git a/extension.json b/extension.json
index 85c663c..6612316 100644
--- a/extension.json
+++ b/extension.json
@@ -33,8 +33,8 @@
"ArticleRatingsAlias": "ArticleRatings.alias.php"
},
"AutoloadClasses": {
- "RatingData": "RatingDataClass.php",
- "Rating": "RatingDataClass.php",
+ "RatingData": "RatingData.php",
+ "Rating": "Rating.php",
"AreHooks": "ArticleRatingsHooks.php",
"SpecialChangeRating": "SpecialChangeRating.php",
"SpecialMassRatings": "SpecialMassRatings.php"
--
To view, visit https://gerrit.wikimedia.org/r/398632
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I55d41d0d354a9bbd7757a326588bc4ac6bb364fc
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ArticleRatings
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits