[MediaWiki-commits] [Gerrit] mediawiki...Graph[master]: Rm b/c code

2017-05-05 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/331802 )

Change subject: Rm b/c code
..


Rm b/c code

Change-Id: I5df347a57b39d0ec5a811fe832b65af07e12e1e9
---
M includes/ApiGraph.php
1 file changed, 10 insertions(+), 46 deletions(-)

Approvals:
  Yurik: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/ApiGraph.php b/includes/ApiGraph.php
index f2f387e..82c8748 100644
--- a/includes/ApiGraph.php
+++ b/includes/ApiGraph.php
@@ -29,31 +29,17 @@
 
if ( $params['title'] !== null ) {
if ( $params['hash'] === null ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
-   $this->dieWithError(
-   [ 
'apierror-invalidparammix-mustusewith', 'title', 'hash' ], 'missingparam'
-   );
-   } else {
-   $this->dieUsage( 'Parameter "hash" is 
required', 'missingparam' );
-   }
+   $this->dieWithError( [ 
'apierror-invalidparammix-mustusewith', 'title', 'hash' ],
+   'missingparam' );
}
$graph = $this->getFromStorage( $params['title'], 
$params['hash'] );
} else {
if ( !$this->getRequest()->wasPosted() ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
-   $this->dieWithError( 
'apierror-graph-mustposttext', 'mustposttext' );
-   } else {
-   $this->dieUsage( 'Request had to be 
POSTed when used with "text" parameter', 'mustposttext' );
-   }
+   $this->dieWithError( 
'apierror-graph-mustposttext', 'mustposttext' );
}
if ( $params['hash'] !== null ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
-   $this->dieWithError(
-   [ 
'apierror-invalidparammix-cannotusewith', 'hash', 'text' ], 'invalidparammix'
-   );
-   } else {
-   $this->dieUsage( 'Parameter "hash" 
cannot be used with "text"', 'invalidparammix' );
-   }
+   $this->dieWithError( [ 
'apierror-invalidparammix-cannotusewith', 'hash', 'text' ],
+   'invalidparammix' );
}
$graph = $this->preprocess( $params['text'] );
}
@@ -101,11 +87,7 @@
$st = FormatJson::parse( $text );
}
if ( !$st->isOK() ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
-   $this->dieWithError( 
'apierror-graph-invalid', 'invalidtext' );
-   } else {
-   $this->dieUsage( 'Graph is not valid.', 
'invalidtext' );
-   }
+   $this->dieWithError( 'apierror-graph-invalid', 
'invalidtext' );
}
}
return $st->getValue();
@@ -125,26 +107,12 @@
if ( !$graph ) {
$title = Title::newFromText( $titleText );
if ( !$title ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
-   $this->dieWithError( [ 
'apierror-invalidtitle', wfEscapeWikiText( $titleText ) ] );
-   } else {
-   $this->dieUsage( 'Invalid title 
given.', 'invalidtitle' );
-   }
+   $this->dieWithError( [ 'apierror-invalidtitle', 
wfEscapeWikiText( $titleText ) ] );
}
if ( !$title->exists() ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) 
{
-   $this->dieWithError( 
'apierror-missingtitle' );
-   } else {
-   $this->dieUsage( 'The page you 
specified doesn\'t exist.', 'missingtitle' );
-   }
+   $this->dieWithError( 'apierror-missingtitle' );
}
-   if ( is_callable( [ $this, 'checkTitleUserPermissions' 
] ) ) {
- 

[MediaWiki-commits] [Gerrit] mediawiki...Graph[master]: Rm b/c code

2017-01-11 Thread MaxSem (Code Review)
MaxSem has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/331802 )

Change subject: Rm b/c code
..

Rm b/c code

Change-Id: I5df347a57b39d0ec5a811fe832b65af07e12e1e9
---
M includes/ApiGraph.php
1 file changed, 1 insertion(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Graph 
refs/changes/02/331802/1

diff --git a/includes/ApiGraph.php b/includes/ApiGraph.php
index db3bc12..127b868 100644
--- a/includes/ApiGraph.php
+++ b/includes/ApiGraph.php
@@ -167,11 +167,7 @@
}
}
if ( !$graph ) {
-   if ( is_callable( [ $this, 'dieWithError' ] ) ) {
-   $this->dieWithError( 'apierror-graph-missing', 
'invalidhash' );
-   } else {
-   $this->dieUsage( 'No graph found.', 
'invalidhash' );
-   }
+   $this->dieWithError( 'apierror-graph-missing', 
'invalidhash' );
}
return $graph;
}

-- 
To view, visit https://gerrit.wikimedia.org/r/331802
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5df347a57b39d0ec5a811fe832b65af07e12e1e9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Graph
Gerrit-Branch: master
Gerrit-Owner: MaxSem 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits