Make Importer fail in a nice way with empty ImportOperations
It should be impossible to have a file with zero file revisions as well
as zero text revisions. The API request can not return something like
this. However, the code consuming the two arrays can not know this.
Currently the import fails with a bad PHP error when trying to access
a non-existing array index …. If this error is ignored, the import
goes on and even succeeds, but creates an empty, broken page. Just
returning false makes the whole thing collapse in an *expected* way, and
shows a nice error message.
This patch also adds a missing sanity check to the ImportOperations
class. Before it was possible to add operations in the middle of the
The same "… === " can be added to all 3 operations. But this would not
make any difference. It would even be impossible to test this, and
therefor dead code.