| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
The output of this script is completely unreadable when using a terminal
with a light background. The output is fine without the colours. The
colours break the PHPUnit test.
Change-Id: I731b2e79994194ff1d6c1fc4742be8391c7e1724
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
F–P. Still need to do P–Z.
there's a couple spots where I added `use
MediaWiki\Maintenance\LoggedUpdateMaintenance;` or similar instead.
some of the existing "use" blocks were in weird spots (e.g. above the copyright
docblock, or too far down). i didn't move those because they are out of scope
for this patch.
Change-Id: I5b6a8f3eae5be85d67bccfcce31c0c2027850f45
|
|
|
|
|
|
| |
Bug: T379508
Change-Id: Ia693d5e3424d925172cd2e4b7cb501a031822f3b
Depends-On: Iec814da22ff34810077876d3ee0ad0264cfc54a9
|
|
|
|
|
|
| |
So that the script does not require posix extension
Change-Id: Id74aa62a8b9844667b1c9d55c2f031998c0f9a3e
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* Maintenance scripts in core have low test coverage
* This can cause issues such as the findDeprecated.php maintenance
script not working, as described in T374832
* Testing the broken script after fixing it will avoid the script
breaking again.
What:
* Fix the findDeprecated.php maintenance script to actually
show when code is hard-deprecated.
* Modify the script to allow mocking of the MediaWiki install
path in PHPUnit tests
* Create FindDeprecatedTest which tests that the script produces
an expected output, without being specific about how the
code finds the methods (to allow the method to be changed
as discussed in T243403)
** To do this, create a folder in the data folder for the PHPUnit
tests that has a mock file structure allowing the test to
use a fixed list of soft and hard deprecated methods.
Bug: T374832
Bug: T371167
Change-Id: Ic4933cef95ef1af7fa3939625ac1747106c71230
|
|
|
|
|
|
|
|
|
|
| |
Add doc-typehints to class properties found by the PropertyDocumentation
sniff to improve the documentation.
Once the sniff is enabled it avoids that new code is missing type
declarations. This is focused on documentation and does not change code.
Change-Id: I7dec01892a987a87b1b79374a1c28f97d055e8fa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Why:
* Maintenance scripts in core have bolierplate code that is
added before and after the class to allow directly running
the maintenance script.
* Running the maintenance script directly has been deprecated
since 1.40, so this boilerplate code is only to support a now
deprecated method of running maintenance scripts.
* This code cannot also be marked as covered, due to PHPUnit
not recognising code coverage for files.
* Therefore, it is best to ignore this boilerplate code in code
coverage reports as it cannot be marked as covered and also
is for deprecated code.
What:
* Wrap the boilerplate code (requiring Maintenance.php and then
later defining the maintenance script class and running if the
maintenance script was called directly) with @codeCoverageIgnore
comments.
* Some files use a different boilerplate code, however, these
should also be marked as ignored for coverage for the same
reason that coverage is not properly reported for files.
Bug: T371167
Change-Id: I32f5c6362dfb354149a48ce9c28da9a7fc494f7c
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The idea here was obviously to speed up the process by skipping files
that don't contain the substring "@deprecated" anywhere. Only these
files are parsed and traversed – which can be expensive.
The problem is that PHP's strpos() function never returns -1. It
returns false.
This patch doesn't change what the script does. It just runs faster.
Change-Id: I95a5a0fd3e024ec4132f53d770e3f61031d81250
|
|
|
|
| |
Change-Id: Id2d91e30a6f7cc4eb93427b50efc1c5c77f14b75
|
|
|
|
|
|
|
|
|
| |
php internal functions like floor/round/ceil documented to return
float, most cases the result is used as int, added casts
Found by phan strict checks
Change-Id: I92daeb0f7be8a0566fd9258f66ed3aced9a7b792
|
|
|
|
|
| |
Bug: T274036
Change-Id: Ic959dfddcf2867e4cf26970f375b347f4b41584d
|
|
|
|
|
|
|
| |
And remove the issue from the exclusions list.
Bug: T231636
Change-Id: Iee73ddb554e354abe52d13dcfc453f9a15bb8877
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
`$a <=> $b` returns `-1` if `$a` is lesser, `1` if `$b` is lesser,
and `0` if they are equal, which are exactly the values 'sort()'
callbacks are supposed to return.
It also enables the neat idiom `$a[x] <=> $b[x] ?: $a[y] <=> $b[y]`
to sort arrays of objects first by 'x', and by 'y' if they are equal.
* Replace a common pattern like `return $a < $b ? -1 : 1` with the
new operator (and similar patterns with the variables, the numbers
or the comparison inverted). Some of the uses were previously not
correctly handling the variables being equal; this is now
automatically fixed.
* Also replace `return $a - $b`, which is equivalent to `return
$a <=> $b` if both variables are integers but less intuitive.
* (Do not replace `return strcmp( $a, $b )`. It is also equivalent
when both variables are strings, but if any of the variables is not,
'strcmp()' converts it to a string before comparison, which could
give different results than '<=>', so changing this would require
careful review and isn't worth it.)
* Also replace `return $a > $b`, which presumably sort of works most
of the time (returns `1` if `$b` is lesser, and `0` if they are
equal or `$a` is lesser) but is erroneous.
Change-Id: I19a3d2fc8fcdb208c10330bd7a42c4e05d7f5cf3
|
|
|
|
|
|
|
| |
This helps to find renamed or misspelled classes earlier.
Phan will check the class names
Change-Id: I1d4567f47f93eb1436cb98558388e48d35258666
|
|
|
|
|
|
|
|
| |
And fix the only incompatibility in findDeprecated.php. It's OK to throw
exceptions on invalid files since we lint all PHP files so there
should be no invalid ones.
Change-Id: Ie5913c2aae4b521a4b6f805e911e4e2764386b45
|
|
|
|
|
|
| |
Add missing @return and @param to function docs and fixed some @param
Change-Id: I810727961057cfdcc274428b239af5975c57468d
|
|
|
|
|
|
|
|
| |
The old PhpParser had dynamic class_alias() calls in its autoloader
which caused HHVM RepoAuthoritative compilation to fail with a fatal
error. These b/c aliases were removed in 2.0.
Change-Id: I6e2e3412204249a50a5806c33f48f426ab8c4511
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
Change-Id: I0e2aa83024b8abf5298cfea4b21bf45722ad3103
|
|
|
|
|
|
|
| |
The double empty newline is not needed between functions, variable or at
end of file
Change-Id: Ib866a95084c4601ac150a2b402cfa184ebc18afa
|
|
Add a maintenance script, findDeprecated.php, which iterates through
$IP/include/**.php, looking for functions and methods which have been marked as
deprecated (via a '@deprecated' tag in the doc-block), and then prints a
detailed report indicating the version, file, line and version of each
deprecated interface.
Change-Id: I9518a52b8c51ee972552a94f5367c1faa7e04a3a
|