Commit graph

7 commits

Author SHA1 Message Date
Timo Tijhof
9a0cb0940b ResourceLoader: Switch Image.php to injected log channel
Avoid having to look at and query multiple channels for the same
core component. Use different log levels and messages instead.

E.g. avoid Foo and FooError or FooBar, use only "Foo".

This also switched to the injected Logger object at the same time.
This also avoids global wfDebugLog() at the same time.

Bug: T32956
Change-Id: I3e43b10d26858c5b3851476c8bbd27282316dd32
2022-07-08 03:57:16 +00:00
DannyS712
30483a3b29 ResourceLoader: Simplify Image::rasterize() and reduce indentation
Use guard clause to avoid needing to indent large blocks
of code, simplify return value checking.

Change-Id: I66d91ea7c1cf9586cd4d6a7f5092405e4d07f7c7
2022-06-28 04:50:41 +00:00
Timo Tijhof
af3481b3ba ResourceLoader: Let Image throw RuntimeException instead of MWException
Bug: T32956
Change-Id: Ib2b77c93d874d30847797a7b2a4ee324e0863042
2022-06-22 00:26:49 +01:00
Adam Wight
360343afb3 ResourceLoader: Remove unchecked exception annotations
Also repair two `@see` annotations referring to methods that didn't
exist.

Bug: T240672
Change-Id: I2edb39554bcf46fdc83bd138ef7bb9065c2c0696
2022-06-22 00:25:57 +01:00
Tim Starling
3e2653f83b ResourceLoader namespace (attempt 2)
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader itself.

Move the tests by analogy.

I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".

I did not address DependencyStore which continues to have a non-standard
location and namespace.

Revert of a241d83e0a.

Bug: T308718
Change-Id: Id08a220e1d6085e2b33f3f6c9d0e3935a4204659
2022-05-24 15:41:46 +00:00
Lucas Werkmeister (WMDE)
a241d83e0a Revert "ResourceLoader namespace"
This reverts commit e08ea8ccb9.

Reason for revert: Breaks Phan in extensions, and as far as I’m aware,
this change isn’t urgently needed for anything, so the simplest fix is
to revert it again for now. After PHP 7.4 it should be safer to try this
again (we hopefully won’t need the two “hack” classes by then).

Bug: T308443
Change-Id: Iff3318cbf97a67f821f78e60da62a583f63e389e
2022-05-16 14:43:33 +00:00
Tim Starling
e08ea8ccb9 ResourceLoader namespace
Move ResourceLoader classes to their own namespace. Strip the
"ResourceLoader" prefix from all except ResourceLoader and
ResourceLoaderContext.

Move the tests by analogy.

I used a namespace alias "RL" in some callers since RL\Module is less
ambiguous at the call site than just "Module".

I did not address DependencyStore which continues to have a non-standard
location and namespace.

Change-Id: I92998ae6a82e0b935c13e02a183e7c324fa410a3
2022-05-16 14:41:27 +10:00
Renamed from includes/resourceloader/ResourceLoaderImage.php (Browse further)