Commit graph

8 commits

Author SHA1 Message Date
Aryeh Gregor
c435212260 Get rid of warnings on PHP 8.1
This is mostly about adding return types to methods that implement PHP
interfaces, and not passing null to core functions that want a string.
After this patch, and an update to return types in RemexHtml,
tests/phpunit/integration/ has no more errors than in PHP 8.0.

Bug: T289879
Bug: T289926
Change-Id: Ia424f5cc897070f4188ae126b5bf6a1f552db0e1
2022-06-13 04:42:20 -04:00
Aryeh Gregor
4851f512b3 IResultWrapper::next() now returns void
As required by the Iterator interface. In PHP 8.1 we can suppress the
warning with #[\ReturnTypeWillChange], but it's wrong and should change
anyway.

Depends-On: I576109808755b054e7876556f244ee8eafd12f9d
Change-Id: Ibaa7b4c81d8f114783db45c9100200ba14547c8f
2022-05-02 10:43:51 +03:00
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
Reedy
a5a6cc3495 Fix more Squiz.Scope.MethodScope.Missing
Change-Id: If48a16c4c1139342d597c2f6204348c1070dfc71
2020-05-18 20:42:50 +00:00
Umherirrender
0688dd7c6d Set method visibility for various constructors
Change-Id: Id3c88257e866923b06e878ccdeddded7f08f2c98
2019-12-03 20:17:30 +01: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
Brad Jorsch
d032bb52cd Add a central ID lookup service
Anything that wants to be "central" right now has to depend on
CentralAuth, and then either can't work without CentralAuth or has to
branch all over the place based on whether CentralAuth is present. Most
of the time all it really needs is a mapping from local users to central
user IDs and back or the ability to query whether the local user is
attached on some other wiki, so let's make an interface for that in
core.

See I52aa0460 for an example implementation (CentralAuth), and Ibd192e29
for an example use (OAuth).

Bug: T111302
Change-Id: I49568358ec35fdfd0b9e53e441adabded5c7b80f
2015-12-02 14:50:36 -07:00
Renamed from includes/UserArrayFromResult.php (Browse further)