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'
] ) ) {
-