Index: branches/RL2/extensions/Gadgets/GadgetHooks.php |
— | — | @@ -42,7 +42,7 @@ |
43 | 43 | return true; |
44 | 44 | } |
45 | 45 | |
46 | | - $repo = new LocalGadgetRepo( array() ); |
| 46 | + $repo = new LocalGadgetRepo; |
47 | 47 | $repo->deleteGadget( $id ); |
48 | 48 | // deleteGadget() may return an error if the Gadget didn't exist, but we don't care here |
49 | 49 | return true; |
— | — | @@ -73,7 +73,7 @@ |
74 | 74 | $prevTs = $previousRev instanceof Revision ? $previousRev->getTimestamp() : wfTimestampNow(); |
75 | 75 | |
76 | 76 | // Update the database entry for this gadget |
77 | | - $repo = new LocalGadgetRepo( array() ); |
| 77 | + $repo = new LocalGadgetRepo; |
78 | 78 | // TODO: Timestamp in the constructor is ugly |
79 | 79 | $gadget = new Gadget( $id, $repo, $text, $prevTs ); |
80 | 80 | $repo->modifyGadget( $gadget, $revision->getTimestamp() ); |
— | — | @@ -98,7 +98,7 @@ |
99 | 99 | |
100 | 100 | // Check whether this undeletion changed the latest revision of the page, by comparing |
101 | 101 | // the timestamp of the latest revision with the timestamp in the DB |
102 | | - $repo = new LocalGadgetRepo( array() ); |
| 102 | + $repo = new LocalGadgetRepo; |
103 | 103 | $gadget = $repo->getGadget( $id ); |
104 | 104 | $gadgetTS = $gadget ? $gadget->getTimestamp() : 0; |
105 | 105 | |
— | — | @@ -195,7 +195,7 @@ |
196 | 196 | */ |
197 | 197 | public static function getPreferences( $user, &$preferences ) { |
198 | 198 | // TODO: Part of this is duplicated from registerModules(), factor out into the repo |
199 | | - $repo = new LocalGadgetRepo( array() ); |
| 199 | + $repo = new LocalGadgetRepo; |
200 | 200 | |
201 | 201 | $gadgets = $repo->getGadgetIds(); |
202 | 202 | $categories = array(); // array( category => array( desc => name ) ) |
Index: branches/RL2/extensions/Gadgets/backend/LocalGadgetRepo.php |
— | — | @@ -15,14 +15,10 @@ |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Constructor. |
19 | | - * @param info array of options |
| 19 | + * @param info array of options. There are no applicable options for this class |
20 | 20 | */ |
21 | | - public function __construct( array $options ) { |
| 21 | + public function __construct( array $options = array() ) { |
22 | 22 | parent::__construct( $options ); |
23 | | - |
24 | | - // TODO: define options |
25 | | - // FIXME if there are none, drop the mandatory param |
26 | | - |
27 | 23 | $this->namesKey = $this->getMemcKey( 'gadgets', 'localreponames' ); |
28 | 24 | } |
29 | 25 | |
Index: branches/RL2/extensions/Gadgets/backend/GadgetRepo.php |
— | — | @@ -8,8 +8,7 @@ |
9 | 9 | * Constructor. |
10 | 10 | * @param $info array with configuration data, depends on repo type |
11 | 11 | */ |
12 | | - public function __construct( array $info ) { |
13 | | - // TODO: Common config stuff for all repos? |
| 12 | + public function __construct( array $info = array() ) { |
14 | 13 | } |
15 | 14 | |
16 | 15 | /**** Abstract functions ****/ |
Index: branches/RL2/extensions/Gadgets/api/ApiQueryGadgets.php |
— | — | @@ -51,7 +51,7 @@ |
52 | 52 | } |
53 | 53 | |
54 | 54 | private function getList() { |
55 | | - $repo = new LocalGadgetRepo( array() ); |
| 55 | + $repo = new LocalGadgetRepo; |
56 | 56 | $result = array(); |
57 | 57 | |
58 | 58 | if ( $this->neededIds !== false ) { |
Index: branches/RL2/extensions/Gadgets/api/ApiQueryGadgetCategories.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | private function getList() { |
45 | 45 | $data = array(); |
46 | 46 | $result = $this->getResult(); |
47 | | - $repo = new LocalGadgetRepo( array() ); |
| 47 | + $repo = new LocalGadgetRepo; |
48 | 48 | |
49 | 49 | $gadgetsByCategory = $repo->getGadgetsByCategory(); |
50 | 50 | foreach ( $gadgetsByCategory as $category => $gadgets ) { |
Index: branches/RL2/extensions/Gadgets/SpecialGadgetManager.php |
— | — | @@ -43,7 +43,7 @@ |
44 | 44 | private function generateOverview() { |
45 | 45 | global $wgGadgetEnableSharing; |
46 | 46 | |
47 | | - $repo = new LocalGadgetRepo( array() ); |
| 47 | + $repo = new LocalGadgetRepo; |
48 | 48 | $gadgetsByCategory = $repo->getGadgetsByCategory(); |
49 | 49 | |
50 | 50 | // If there there are no gadgets at all, exit early. |