summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'CommentStreams/includes/ApiCSBase.php')
-rw-r--r--CommentStreams/includes/ApiCSBase.php11
1 files changed, 8 insertions, 3 deletions
diff --git a/CommentStreams/includes/ApiCSBase.php b/CommentStreams/includes/ApiCSBase.php
index ac0a9991..51ec172e 100644
--- a/CommentStreams/includes/ApiCSBase.php
+++ b/CommentStreams/includes/ApiCSBase.php
@@ -21,6 +21,12 @@
* DEALINGS IN THE SOFTWARE.
*/
+namespace MediaWiki\Extension\CommentStreams;
+
+use ApiBase;
+use ApiMessage;
+use ManualLogEntry;
+
abstract class ApiCSBase extends ApiBase {
private $edit;
@@ -44,11 +50,11 @@ abstract class ApiCSBase extends ApiBase {
$wikipage = $this->getTitleOrPageId( $params,
$this->edit ? 'frommasterdb' : 'fromdb' );
$this->comment = Comment::newFromWikiPage( $wikipage );
- if ( is_null( $this->comment ) ) {
+ if ( $this->comment === null ) {
$this->dieCustomUsageMessage( 'commentstreams-api-error-notacomment' );
}
$result = $this->executeBody();
- if ( !is_null( $result ) ) {
+ if ( $result !== null ) {
$this->getResult()->addValue( null, $this->getModuleName(), $result );
}
}
@@ -112,7 +118,6 @@ abstract class ApiCSBase extends ApiBase {
$logEntry->setTarget( $this->comment->getWikiPage()->getTitle() );
}
$logid = $logEntry->insert();
- $logEntry->publish($logid);
}
/**