Commit graph

12 commits

Author SHA1 Message Date
Umherirrender
24d64c7557 docs: Declare UserArray/TitleArray as Iterator<User>/Iterator<Title>
Declaring the abstract functions and using return type hints helps
phan to understands foreach loop over TitleArray objects

$extraPages = TitleArray::newFromResult( ... );
foreach ( $extraPages as $oldSubpage ) {
	$oldSubpage->getDBkey();
}

It also helps phan-seccheck to decide another issue type in
UploadFromFile

Change-Id: I5f9a0dd5578bd9b585fb4d086a3e133a5ca35cf6
2021-08-30 22:37:54 +02:00
daniel
272db6afde Replace "@stable for calling" by "@stable to call"
For compliance with the new version of the table interface policy
(T255803).

This patch was created by an automated search & replace operation
on the includes/ directory.

Bug: T257789
Change-Id: If560596f5e1e0a3da91afc36e656e7c27f040968
2020-07-13 08:55:28 +00:00
daniel
128565505c Mark additional classes as newable for now.
The following glasses are marked as newable per the
Stable Interface Policy, even though logically, they should not be
newable. This is done for classes that are currently instantiated
by extensions, and lack an alternative.

A better way for obtaining an instance of these classes should be
created in the future. At that point, direct instantiation should
be deprecated and replaced.

- includes/ApiMain.php - needs factory
- includes/media/BitmapMetadataHandler.php - should become a stateless service or use handler pattern
- includes/GitInfo.php - should become a stateless service
- includes/logging/LogPage.php - should become a stateless service or use command pattern
- includes/logging/ManualLogEntry.php - should become a stateless service or use command pattern
- includes/poolcounter/PoolCounterWorkViaCallback.php - needs a factory
- includes/context/RequestContext.php - needs to be narrowed down, and should use a factory
- includes/search/SearchHighlighter.php - should have a factory
- includes/TitleArrayFromResult.php - should perhaps be part of TitleFactory
- includes/user/User.php - should at least get a factory method for anons
- includes/diff/Diff.php: needs a TextDiffGenerator service or a factory
- includes/EditPage.php: needs a factory

Bug: T247862
Change-Id: I033158e693c98630ee167d9528fc8c9936f978d4
2020-07-08 18:06:12 +02:00
Reedy
f91b404f2b Explicit visibility modifiers in TitleArrayFromResult.php
Change-Id: I0c455d96bd58306f47d7723c553cdafcec7bc9e5
2020-05-09 22:45:14 +00:00
Umherirrender
0688dd7c6d Set method visibility for various constructors
Change-Id: Id3c88257e866923b06e878ccdeddded7f08f2c98
2019-12-03 20:17:30 +01:00
Umherirrender
0ef4f68ec4 Fix param doc of TitleArrayFromResult::setCurrent
$row is a stdClass, not the ResultWrapper, which is a list of stdClass

Change-Id: Ic96354a6283fcf42ac1c75f524f1da45117100ce
2019-07-18 16:43:02 +00:00
Umherirrender
cd8568ad89 Use IResultWrapper in UserArray and TitleArray
The result of IDatabase::select is directly passed around and that type
is IResultWrapper

Change-Id: I7668fcac960bb83e834d849aaef5fe90e5bc115b
2018-04-06 00:06:35 +02:00
Aaron Schulz
e01fd44388 Move ResultWrapper subclasses to Rdbms
Change-Id: I6f3f0e85e268b24c57c537aa6ad8016e0b4cdddb
2017-03-03 00:44:41 +00:00
Siebrand Mazeland
2daa1fab7a Make phpcs-strict pass on includes/ (3/~10)
Change-Id: Ibf86d03b5479c47ee72c0dafea6777ef8178fe68
2014-05-11 19:28:07 +00:00
umherirrender
829886b10a Fixed some @params documentation
Swapped some "$var type" to "type $var" or added missing types
before the $var. Changed some other types to match the more common
spelling. Makes beginning of some text in captial.

Change-Id: I64e8cfe478cb0ba438f40b0631d6e9049cdab567
2014-04-14 12:59:19 +00:00
umherirrender
2000672ac3 Fixed spacing
- Added spaces after if/foreach/catch
- Added new line before end of file
- Added or removed spaces before/after parenthesis, comma
- Added spaces around string concat

Change-Id: I0590070f1b3542108e242730e8d9a3ba9831e94f
2014-03-20 20:37:30 +00:00
addshore
e3c0ab20bf Split Title and User ArrayFromResult classes to own files
Change-Id: I8744627330eb9c8f183a8d418d6eb168e6c5407b
2014-01-26 18:32:43 +00:00