MediaWiki-CodeSniffer
MediaWiki CodeSniffer Standards
|
Replace calls to MockBuilder::setMethods (deprecated in PHPUnit 8) with MockBuilder::onlyMethods. More...
Public Member Functions | |
register () | |
@inheritDoc | |
process (File $phpcsFile, $stackPtr) | |
Replace calls to MockBuilder::setMethods (deprecated in PHPUnit 8) with MockBuilder::onlyMethods.
This is based on the assumption that most such calls do not intend to add new methods (which would require using addMethods). As such, this sniff only serves as a first automatic step, but manual review of replacements is necessary (which shouldn't be hard anyway, as PHPUnit will fail hard if the wrong method is used). This is also not going to trigger for setMethods() calls that don't belong to MockBuilder.
MediaWiki\Sniffs\PHPUnit\SetMethodsSniff::process | ( | File | $phpcsFile, |
$stackPtr ) |
File | $phpcsFile | |
int | $stackPtr |