FileRepo: Use Late Static Binding in File static constructors
authorMáté Szabó <mszabo@wikia-inc.com>
Wed, 22 May 2019 19:26:35 +0000 (21:26 +0200)
committerMáté Szabó <mszabo@wikia-inc.com>
Sat, 15 Jun 2019 11:41:39 +0000 (13:41 +0200)
commit94d8579d2c03b579ae83d8503d38aa593c566feb
tree771433e00c67184fba50c3f3887ddc3e12c2ff70
parent64a6eb12f7b096e2af763b6f78ca0f05a0dcdd76
FileRepo: Use Late Static Binding in File static constructors

The FileRepo extension API allows to specify factory methods that
FileRepo implementations will use to instantiate File instances.
Currently, the default static constructors in LocalFile and OldLocalFile
do not use Late Static Binding, so every subclass is forced to re-implement them,
even if they would not need any custom logic. Switching to Late Static Binding
(available since PHP 5.3) allows File implementors to reduce boilerplate
if they do not need to overwrite the existing logic.

Change-Id: Id8f6f5362b68269c2a3232796a1703be14116dd5
includes/filerepo/file/ForeignDBFile.php
includes/filerepo/file/LocalFile.php
includes/filerepo/file/OldLocalFile.php
includes/filerepo/file/UnregisteredLocalFile.php
tests/phpunit/includes/filerepo/file/ForeignDBFileTest.php [new file with mode: 0644]