Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update APII.php #124

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/src/Core/APII.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
*/

use Wikimedia\DeadlinkChecker\CheckIfDead;
use function Sentry\captureException;

Check failure on line 31 in app/src/Core/APII.php

View workflow job for this annotation

GitHub Actions / phpstan_analyse

Used function Sentry\captureException not found.

/**
* API class
Expand Down Expand Up @@ -243,7 +243,7 @@
'rvslots' => '*',
];

$batch = $objects;
if( !isset( $batch ) ) $batch = $objects;

switch( $objectType ) {
case 'pagetitle':
Expand Down Expand Up @@ -345,7 +345,7 @@
public static function getPageText( $object, $objectType = 'pagetitle', &$sectionID = false, $returnHTML = false,
$forceURL = false
) {
if( $sectionID !== false || $returnHTML !== false ) {

Check failure on line 348 in app/src/Core/APII.php

View workflow job for this annotation

GitHub Actions / phpstan_analyse

Method API::getPageText() should return string but return statement is missing.
$queryArray = [
'action' => 'parse'
];
Expand Down Expand Up @@ -1671,7 +1671,7 @@
}
}

$text = UtfNormal\Validator::cleanUp( $text );

Check failure on line 1674 in app/src/Core/APII.php

View workflow job for this annotation

GitHub Actions / phpstan_analyse

Call to static method cleanUp() on an unknown class UtfNormal\Validator.

$post = [
'action' => 'edit', 'title' => $page, 'text' => $text, 'format' => 'json', 'summary' => $summary,
Expand Down Expand Up @@ -1814,7 +1814,7 @@
return true;
} else return false;
}
if( RUNPAGE === false ) return true;

Check failure on line 1817 in app/src/Core/APII.php

View workflow job for this annotation

GitHub Actions / phpstan_analyse

Method API::isEnabled() should return bool but return statement is missing.
}

/**
Expand Down Expand Up @@ -2442,7 +2442,7 @@
* @author Maximilian Doerr (Cyberpower678)
*/
public static function resolveCatalonianArchiveURL( $url ) {
$checkIfDead = new CheckIfDead();

Check failure on line 2445 in app/src/Core/APII.php

View workflow job for this annotation

GitHub Actions / phpstan_analyse

Instantiated class Wikimedia\DeadlinkChecker\CheckIfDead not found.
$returnArray = [];
if( preg_match( '/\/\/(?:www\.)?padi.cat(?:\:8080)?\/wayback\/(\d*?)\/(\S*)/i', $url, $match
) ) {
Expand Down Expand Up @@ -2903,7 +2903,7 @@
} elseif( $intermediateRevisionLink['has_archive'] === false ) return true;
}

if( isset( $link['newdata']['tagged_dead'] ) && $link['newdata']['tagged_dead'] === true &&

Check failure on line 2906 in app/src/Core/APII.php

View workflow job for this annotation

GitHub Actions / phpstan_analyse

Method API::isReverted() should return bool but return statement is missing.
$oldLink['tagged_dead'] === false ) {
return false;
} elseif( isset( $link['newdata']['tagged_dead'] ) && $link['newdata']['tagged_dead'] === false &&
Expand Down Expand Up @@ -2984,7 +2984,7 @@
"Job ID: {$res[$tid]['error']['job_id']}\nException: {$res[$tid]['error']['exception']}", 1
);
} catch( SPNException $e ) {
captureException( $e );

Check failure on line 2987 in app/src/Core/APII.php

View workflow job for this annotation

GitHub Actions / phpstan_analyse

Function Sentry\captureException not found.
}
}
} else {
Expand Down Expand Up @@ -3386,7 +3386,7 @@
try {
throw new AvailabilityException( $body, $returnArray['code'] );
} catch( AvailabilityException $e ) {
captureException( $e );

Check failure on line 3389 in app/src/Core/APII.php

View workflow job for this annotation

GitHub Actions / phpstan_analyse

Function Sentry\captureException not found.
}
} else {
self::sendMail( TO, FROM, "Errors encountered while querying the availability API!!", $body );
Expand Down
Loading