Delete always true condition
authorJakub Vrana <jakub@vrana.cz>
Sun, 2 Dec 2018 18:14:36 +0000 (19:14 +0100)
committerJakub Vrana <jakub@vrana.cz>
Sun, 2 Dec 2018 18:14:36 +0000 (19:14 +0100)
Found by PHPStan.

Change-Id: I3198b9ab568f469e32b3a511d8a0506fcc030fee

includes/filerepo/file/ForeignAPIFile.php

index 4c1bc4d..aff0e3f 100644 (file)
@@ -77,9 +77,7 @@ class ForeignAPIFile extends File {
                        if ( $lastRedirect >= 0 ) {
                                $newtitle = Title::newFromText( $data['query']['redirects'][$lastRedirect]['to'] );
                                $img = new self( $newtitle, $repo, $info, true );
-                               if ( $img ) {
-                                       $img->redirectedFrom( $title->getDBkey() );
-                               }
+                               $img->redirectedFrom( $title->getDBkey() );
                        } else {
                                $img = new self( $title, $repo, $info, true );
                        }