$setOpts += Database::getCacheSetOptions( $dbr );
- if ( $title instanceof Title ) {
- $row = $dbr->selectRow(
- [ 'page', 'redirect' ],
- [ 'rd_namespace', 'rd_title' ],
- [
- 'page_namespace' => $title->getNamespace(),
- 'page_title' => $title->getDBkey(),
- 'rd_from = page_id'
- ],
- $method
- );
- } else {
- $row = false;
- }
+ $row = $dbr->selectRow(
+ [ 'page', 'redirect' ],
+ [ 'rd_namespace', 'rd_title' ],
+ [
+ 'page_namespace' => $title->getNamespace(),
+ 'page_title' => $title->getDBkey(),
+ 'rd_from = page_id'
+ ],
+ $method
+ );
return ( $row && $row->rd_namespace == NS_FILE )
? Title::makeTitle( $row->rd_namespace, $row->rd_title )->getDBkey()
* @return array[] An Array of arrays or iterators of file objects and the hash as key
*/
function findBySha1s( array $hashes ) {
- if ( !count( $hashes ) ) {
+ if ( $hashes === [] ) {
return []; // empty parameter
}