Commit graph

17 commits

Author SHA1 Message Date
Umherirrender
a30fe542ae build: Enable SecurityCheck-DoubleEscaped and suppress issues
This issue type was globally suppressed in
I849ac4f120fd15b483e8939d4db45c98dc351259 to make reviewer easier.

This adds inline suppressions or @suppress directives on function
docs for false positives, mostly restoring those removed in
I849ac4f120fd15b483e8939d4db45c98dc351259

Bug: T231311
Change-Id: I1b1d814bd907e9d49fcc39f777982936574fc7c6
2020-12-30 23:34:20 +00:00
jenkins-bot
970ad46508 Merge "Deprecate FormatMetadata::flattenArrayContentLang()" 2020-10-30 19:22:55 +00:00
C. Scott Ananian
1c54541204 Deprecate FormatMetadata::flattenArrayContentLang()
There appear to be no callers to flattenArrayContentLang() in code
search.  It also takes a $noHtml parameter which is labeled as a
backward-compat hack and we'd like to get rid of, in the case where
some caller for flattenArrayContentLang() does turn up.

Also mark FormatMetadata::flattenArrayReal() as @internal.  It's a
poorly named method and no one outside the media-handling code should
need to use it.

Change-Id: Ie3296d115816280740b5c182e7d0e2df20a4f909
2020-10-30 12:15:59 -04:00
Thiemo Kreuz
fe252d715a media: Fix mismatching/incomplete PHPDocs related to metadata
* Use false instead of bool in PHPDocs, because that's the only bool
value that's allowed.

* This patch also fixes DjVuHandler::getPageText() not returning
strings, but XML objects. This kind of "worked" because all consuming
code magically casts these to strings. But this is an actual violation
of the contract of the method. This is also why the test was doing this
weird (string) cast, instead of actually testing the type of the return
value.

Change-Id: I00db6b910f1de6d37a80543b8a5dd5ea3bab3c76
2020-10-30 11:59:42 -04:00
Thiemo Kreuz
d11fac94e0 Fix incomplete type hint for File::formatMetadata
Change-Id: I4e4d779230b8151500ed828c5a9554274c739811
2020-10-28 22:00:36 +01:00
Ammar Abdulhamid
a31b638245 Typehint FormatMetadata::collapseContactInfO()
The method expects array, but was given a string.
Since there's only one caller, the caller is fixed
and the method typehinted.

Also fix doc comment

Bug: T257497
Change-Id: I67c337c4ee95ca30d968b89251dbbe077d2110e3
2020-07-14 20:26:47 +00:00
daniel
3c50afa46b Replace "@stable for subclassing" with "@stable to extend"
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: Ie32c1b11b3d16ddfc0c83a757327d449ff80b2e4
2020-07-13 11:00:30 +02:00
daniel
aedc93fdb0 Mark remaining eligible classes as stable for subclassing
This classes were found by surveying concrete classes derved from base
classes in core.

Bug: T247862
Change-Id: I231752aaad26e2ab3f097301e449b31e723590f0
2020-07-10 15:02:27 +02:00
Tim Starling
47a1619027 Remove terminating line breaks from debug messages
A terminating line break has not been required in wfDebug() since 2014,
however no migration was done. Some of these line breaks found their way
into LoggerInterface::debug() calls, where they mess up the formatting
of the debug log.

So, remove terminating line breaks from wfDebug() and
LoggerInterface::debug() calls.

Also:
* Fix the stripping of leading line breaks from the log header emitted
  by Setup.php. This feature, accidentally broken in 2014, allows
  requests to be distinguished in the log file.
* Avoid using the global variable $self.
* Move the logging of the client IP back to Setup.php. It was moved to
  WebRequest in the hopes that it would not always be needed, however
  $wgRequest->getIP() is now called unconditionally a few lines up in
  Setup.php. This means that it is put in its proper place after the
  "start request" message.
* Wrap the log header code in a closure so that variables like $name do
  not leak into global scope.
* In Linker.php, remove a few instances of an unnecessary second
  parameter to wfDebug().

Change-Id: I96651d3044a95b9d210b51cb8368edc76bebbb9e
2020-06-03 12:01:16 +10:00
Reedy
161baa43dd Fix includes/media/ Squiz.Scope.MethodScope.Missing
Change-Id: I2bf5543b99dc2ae05f7de02940d120dee353adfe
2020-05-18 21:02:22 +00:00
Max Semenik
73cfdfefa4 Add const visibility to includes/media
Change-Id: I80ec7aa44b1ea5e7b7d6193732b7da03d7f11960
2020-04-26 23:25:41 +00:00
Daimona Eaytoy
b5cbb5ab3f Upgrade phan config to 0.7.1
This allows us to remove many suppressions for phan false positives.

Bug: T231636
Depends-On: I82a279e1f7b0fdefd3bb712e46c7d0665429d065
Change-Id: I5c251e9584a1ae9fb1577afcafb5001e0dcd41c7
2019-09-04 08:20:53 +00:00
Daimona Eaytoy
43cc14657d Unsuppress phan issues, part 8
And also clean up the config.

Bug: T231636
Depends-On: Ie6233561de78457cae5e4e44e220feec2d1272d8
Change-Id: I82a279e1f7b0fdefd3bb712e46c7d0665429d065
2019-09-04 01:02:06 +00:00
Daimona Eaytoy
5eac6d131c Unsuppress more phan issues (part 3)
Bug: T231636
Depends-On: I78354bf5f0c831108c8f606e50c87cf6bc00d8bd
Change-Id: I58e67c2b38389df874438deada4239510d21654f
2019-08-31 16:38:55 +00:00
Umherirrender
6207fa9be1 Fix return type hints in media related classes
Change-Id: Id326fb2a54aac62cb27aa7045082924b5cd84940
2019-06-18 22:11:10 +02:00
Thiemo Kreuz
867ec07040 media: Mark public MediaHandler/ImageHandler methods as such
Note I'm intentionally not touching the entire file, but only methods
I'm absolutely sure are already called from outside, e.g. from
MediaHandlerFactory, and must be public because of this.

I'm intentionally not doing anything with private or protected in this
patch, as such changes are much more fragile.

This is a direct follow up for the changes proposed in Iaa4f60d.

Change-Id: Ida817b289ddd5e9a8c162cc1fa3335c639a0bbe5
2019-02-25 10:16:30 +01:00
Timo Tijhof
9bf3916322 media: Rename files to match the name of the class they define
This will make jumping from file to file much easier in text
editors when file name lookups will autocomplete naturally when
looking for a class by name.

Change-Id: I4b2e55a2e72674b619d5a592866c8a019a2b0224
2018-04-28 02:07:33 +01:00
Renamed from includes/media/ExifBitmap.php (Browse further)