EBernhardson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/155853
Change subject: Hygiene: Anchor is a model class
......................................................................
Hygiene: Anchor is a model class
Change-Id: I3f5bf50eb420bd36f665cb5d2c477a52857cd637
---
M Flow.php
M includes/Formatter/AbstractFormatter.php
M includes/Formatter/RevisionFormatter.php
M includes/Formatter/TopicListFormatter.php
R includes/Model/Anchor.php
M includes/Notifications/Formatter.php
M includes/UrlGenerator.php
M includes/View.php
M includes/api/ApiFlowBaseGet.php
M includes/api/ApiFlowBasePost.php
M includes/api/ApiQueryFlow.php
M tests/phpunit/UrlGeneratorTest.php
12 files changed, 14 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow
refs/changes/53/155853/1
diff --git a/Flow.php b/Flow.php
index 2c5ab3e..446bece 100755
--- a/Flow.php
+++ b/Flow.php
@@ -74,7 +74,6 @@
$wgAutoloadClasses['Flow\Parsoid\ContentFixer'] = $dir .
'includes/Parsoid/ContentFixer.php';
$wgAutoloadClasses['Flow\Parsoid\Redlinker'] = $dir .
'includes/Parsoid/Redlinker.php';
$wgAutoloadClasses['Flow\Parsoid\BadImageRemover'] = $dir .
'includes/Parsoid/BadImageRemover.php';
-$wgAutoloadClasses['Flow\Anchor'] = $dir . 'includes/Anchor.php';
$wgAutoloadClasses['Flow\BaseUrlGenerator'] = $dir .
'includes/BaseUrlGenerator.php';
$wgAutoloadClasses['Flow\Parsoid\ReferenceExtractor'] = $dir .
'includes/Parsoid/ReferenceExtractor.php';
$wgAutoloadClasses['Flow\UrlGenerator'] = $dir . 'includes/UrlGenerator.php';
@@ -106,6 +105,7 @@
$wgAutoloadClasses['Flow\Data\OccupationListener'] =
"$dir/includes/Data/OccupationListener.php";
// Classes that model our data
+$wgAutoloadClasses['Flow\Model\Anchor'] = $dir . 'includes/Model/Anchor.php';
$wgAutoloadClasses['Flow\Model\Metadata'] = $dir .
'includes/Model/Metadata.php';
$wgAutoloadClasses['Flow\Model\AbstractRevision'] = $dir .
'includes/Model/AbstractRevision.php';
$wgAutoloadClasses['Flow\Model\PostRevision'] = $dir .
'includes/Model/PostRevision.php';
diff --git a/includes/Formatter/AbstractFormatter.php
b/includes/Formatter/AbstractFormatter.php
index 60d4ef9..c1e5d48 100644
--- a/includes/Formatter/AbstractFormatter.php
+++ b/includes/Formatter/AbstractFormatter.php
@@ -2,8 +2,8 @@
namespace Flow\Formatter;
-use Flow\Anchor;
use Flow\Container;
+use Flow\Model\Anchor;
use Flow\Model\PostRevision;
use Flow\RevisionActionPermissions;
use Html;
diff --git a/includes/Formatter/RevisionFormatter.php
b/includes/Formatter/RevisionFormatter.php
index 67f50c3..10c60cf 100644
--- a/includes/Formatter/RevisionFormatter.php
+++ b/includes/Formatter/RevisionFormatter.php
@@ -2,11 +2,11 @@
namespace Flow\Formatter;
-use Flow\Anchor;
use Flow\Collection\PostCollection;
use Flow\Data\UserNameBatch;
use Flow\Exception\FlowException;
use Flow\Model\AbstractRevision;
+use Flow\Model\Anchor;
use Flow\Model\PostRevision;
use Flow\Model\PostSummary;
use Flow\Model\UUID;
diff --git a/includes/Formatter/TopicListFormatter.php
b/includes/Formatter/TopicListFormatter.php
index b625eaa..d3d90da 100644
--- a/includes/Formatter/TopicListFormatter.php
+++ b/includes/Formatter/TopicListFormatter.php
@@ -2,8 +2,8 @@
namespace Flow\Formatter;
-use Flow\Anchor;
use Flow\Data\PagerPage;
+use Flow\Model\Anchor;
use Flow\Model\Workflow;
use Flow\Templating;
use Flow\UrlGenerator;
diff --git a/includes/Anchor.php b/includes/Model/Anchor.php
similarity index 98%
rename from includes/Anchor.php
rename to includes/Model/Anchor.php
index 3e87a4d..70381ac 100644
--- a/includes/Anchor.php
+++ b/includes/Model/Anchor.php
@@ -1,6 +1,6 @@
<?php
-namespace Flow;
+namespace Flow\Model;
use Html;
use Message;
diff --git a/includes/Notifications/Formatter.php
b/includes/Notifications/Formatter.php
index b2eb78a..a126748 100644
--- a/includes/Notifications/Formatter.php
+++ b/includes/Notifications/Formatter.php
@@ -3,6 +3,7 @@
namespace Flow;
use Flow\Exception\FlowException;
+use Flow\Model\Anchor;
use Flow\Model\UUID;
use Flow\Parsoid\Utils;
use EchoBasicFormatter;
diff --git a/includes/UrlGenerator.php b/includes/UrlGenerator.php
index da6880d..8bd33e9 100644
--- a/includes/UrlGenerator.php
+++ b/includes/UrlGenerator.php
@@ -3,6 +3,7 @@
namespace Flow;
use Flow\Model\AbstractRevision;
+use Flow\Model\Anchor;
use Flow\Model\UUID;
use SpecialPage;
use Title;
diff --git a/includes/View.php b/includes/View.php
index 10ecd65..b93b718 100644
--- a/includes/View.php
+++ b/includes/View.php
@@ -3,6 +3,7 @@
namespace Flow;
use Flow\Exception\InvalidActionException;
+use Flow\Model\Anchor;
use Flow\Model\Workflow;
use Html;
use IContextSource;
diff --git a/includes/api/ApiFlowBaseGet.php b/includes/api/ApiFlowBaseGet.php
index 3510636..d6a489c 100644
--- a/includes/api/ApiFlowBaseGet.php
+++ b/includes/api/ApiFlowBaseGet.php
@@ -1,7 +1,7 @@
<?php
-use Flow\Anchor;
use Flow\Block\AbstractBlock;
+use Flow\Model\Anchor;
abstract class ApiFlowBaseGet extends ApiFlowBase {
public function execute() {
diff --git a/includes/api/ApiFlowBasePost.php b/includes/api/ApiFlowBasePost.php
index 990dd35..9edcf08 100644
--- a/includes/api/ApiFlowBasePost.php
+++ b/includes/api/ApiFlowBasePost.php
@@ -1,8 +1,8 @@
<?php
-use Flow\Anchor;
use Flow\Block\AbstractBlock;
use Flow\Container;
+use Flow\Model\Anchor;
abstract class ApiFlowBasePost extends ApiFlowBase {
public function execute() {
diff --git a/includes/api/ApiQueryFlow.php b/includes/api/ApiQueryFlow.php
index d7fc1b0..bca52fc 100644
--- a/includes/api/ApiQueryFlow.php
+++ b/includes/api/ApiQueryFlow.php
@@ -1,6 +1,6 @@
<?php
-use Flow\Anchor;
+use Flow\Model\Anchor;
use Flow\Model\UUID;
/**
diff --git a/tests/phpunit/UrlGeneratorTest.php
b/tests/phpunit/UrlGeneratorTest.php
index 8a201bc..d7f8e51 100644
--- a/tests/phpunit/UrlGeneratorTest.php
+++ b/tests/phpunit/UrlGeneratorTest.php
@@ -48,7 +48,7 @@
*/
public function testBoardLink( Title $title, $sortBy = null,
$saveSortBy = false ) {
$anchor = $this->urlGenerator->boardLink( $title, $sortBy,
$saveSortBy );
- $this->assertInstanceOf( '\Flow\Anchor', $anchor );
+ $this->assertInstanceOf( '\Flow\Model\Anchor', $anchor );
$link = $anchor->getFullURL();
$option = parse_url( $link );
@@ -89,7 +89,7 @@
*/
public function testWatchTopicLink( Title $title, $workflowId ) {
$anchor = $this->urlGenerator->watchTopicLink( $title,
$workflowId );
- $this->assertInstanceOf( '\Flow\Anchor', $anchor );
+ $this->assertInstanceOf( '\Flow\Model\Anchor', $anchor );
$link = $anchor->getFullURL();
$option = parse_url( $link );
@@ -103,7 +103,7 @@
*/
public function testUnwatchTopicLink( Title $title, $workflowId ) {
$anchor = $this->urlGenerator->unwatchTopicLink( $title,
$workflowId );
- $this->assertInstanceOf( '\Flow\Anchor', $anchor );
+ $this->assertInstanceOf( '\Flow\Model\Anchor', $anchor );
$link = $anchor->getFullURL();
$option = parse_url( $link );
--
To view, visit https://gerrit.wikimedia.org/r/155853
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f5bf50eb420bd36f665cb5d2c477a52857cd637
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: EBernhardson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits