Commit graph

8 commits

Author SHA1 Message Date
Umherirrender
45da581551 Use ::class to resolve class names in tests
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: Ie541a7baae10ab6f5c13f95ac2ff6598b8f8950c
2018-01-26 22:49:13 +01:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
Amir E. Aharoni
94068c3e81 Fix Generic.Files.LineLength phpcs check under phpunit/includes/api
Bug: T102614
Change-Id: Ic0b3d9b58fee8dc20a976ae65dcb7072a3afc3b1
2015-10-03 17:18:05 +00:00
Kunal Mehta
26ded3a545 Add @covers tags to ApiModuleManagerTest
Change-Id: Iaac773576a663d2f426632ad95f94b3556ef15b2
2014-09-08 10:52:10 +00:00
Kunal Mehta
ad9bb085a6 Add ApiModuleManager::getClassName()
In cases where an extension has multiple API modules that
have the same exact factory requirements, it would let them
use the same factory function and check with the module manager
what the class name to construct should be. This is already possible
using getNamesWithClasses, but this makes it much more
straightforward.

Change-Id: I889e3e6f15907896a8df376913125d903debe984
2014-09-08 02:06:33 -07:00
Kunal Mehta
6f7e29a773 Make ApiModuleManagerTest::testAddModules un-risky
Change-Id: Idbea51cf45fc95676759e5ac9abb342701e5b551
2014-08-21 22:47:24 -07:00
umherirrender
ab20f80116 Fixed spacing
- Added newline at end of files
- Added/Removed spaces around comma, parentheses and negation
- Added space after function word

Change-Id: I2dd338153aeb5f07702ba015945e95c7d0ae673b
2014-08-13 20:14:56 +00:00
daniel
baa11f7430 Allow factory functions for creating API modules.
This enables factory functions to be registered for API modules,
in addition to the module class itself. This allows modules to
use proper dependency injection via the modules constructor.

Example:

  $wgAPIModules['foo'] = array(
    'class' => 'ApiFoo',
    'factory' => function( $main, $action ) { ... }
  )

Change-Id: Ieb85493a7765f466317f5fa74b0b0e262220deab
2014-08-06 22:58:14 +02:00