$code = 500;
$message = 'Unknown error';
- if ( !isset( $subPage ) or $subPage === '' ) {
+ if ( !isset( $subPage ) || $subPage === '' ) {
// the user probably visited the page just to see what would happen, so explain it a bit.
$code = '400';
$message = "Missing key\n\n"
$file = $this->getLocalFile();
// TODO This cries out for refactoring. We really want to say $file->getAllInfo(); here.
// Perhaps "info" methods should be moved into files, and the API should just wrap them in queries.
- if ( is_a( $file, 'UploadStashFile' ) ) {
+ if ( $file instanceof UploadStashFile ) {
$imParam = ApiQueryStashImageInfo::getPropertyNames();
$info = ApiQueryStashImageInfo::getInfo( $file, array_flip( $imParam ), $result );
} else {
$imParam = ApiQueryImageInfo::getPropertyNames();
$info = ApiQueryImageInfo::getInfo( $file, array_flip( $imParam ), $result );
- }
+ }
return $info;
}