mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/PdfHandler
synced 2024-11-24 08:14:37 +00:00
build: Updating mediawiki/mediawiki-codesniffer to 0.9.0
The following sniffs are failing and were disabled: * MediaWiki.Commenting.FunctionComment.MissingParamComment * MediaWiki.Commenting.FunctionComment.MissingParamName * MediaWiki.Commenting.FunctionComment.MissingParamTag * MediaWiki.FunctionComment.Missing.Protected * MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment Change-Id: I405ecfeaa12fb7bddb31dcbe0070a97c01ed15f8
This commit is contained in:
parent
caee98e781
commit
26124f261b
|
@ -66,7 +66,7 @@ class PdfHandler extends ImageHandler {
|
|||
* @return bool
|
||||
*/
|
||||
function validateParam( $name, $value ) {
|
||||
if ( $name === 'page' && trim( $value ) !== (string) intval( $value ) ) {
|
||||
if ( $name === 'page' && trim( $value ) !== (string)intval( $value ) ) {
|
||||
// Extra junk on the end of page, probably actually a caption
|
||||
// e.g. [[File:Foo.pdf|thumb|Page 3 of the document shows foo]]
|
||||
return false;
|
||||
|
@ -171,7 +171,7 @@ class PdfHandler extends ImageHandler {
|
|||
if ( $image->getSize() >= 1e7 ) { // 10MB
|
||||
$work = new PoolCounterWorkViaCallback( 'GetLocalFileCopy', sha1( $image->getName() ),
|
||||
[
|
||||
'doWork' => function() use ( $image ) {
|
||||
'doWork' => function () use ( $image ) {
|
||||
return $image->getLocalRefPath();
|
||||
}
|
||||
]
|
||||
|
@ -264,7 +264,7 @@ class PdfHandler extends ImageHandler {
|
|||
'PdfHandler-unserialize-metadata',
|
||||
$image->getName(),
|
||||
[
|
||||
'doWork' => function() use ( $image, $metadata ) {
|
||||
'doWork' => function () use ( $image, $metadata ) {
|
||||
wfSuppressWarnings();
|
||||
$image->pdfMetaArray = unserialize( $metadata );
|
||||
wfRestoreWarnings();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"require-dev": {
|
||||
"jakub-onderka/php-parallel-lint": "0.9.2",
|
||||
"jakub-onderka/php-console-highlighter": "0.3.2",
|
||||
"mediawiki/mediawiki-codesniffer": "0.7.2"
|
||||
"mediawiki/mediawiki-codesniffer": "0.9.0"
|
||||
},
|
||||
"scripts": {
|
||||
"fix": "phpcbf",
|
||||
|
|
14
phpcs.xml
14
phpcs.xml
|
@ -1,9 +1,15 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<?xml version="1.0"?>
|
||||
<ruleset>
|
||||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki"/>
|
||||
<rule ref="vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamComment" />
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamName" />
|
||||
<exclude name="MediaWiki.Commenting.FunctionComment.MissingParamTag" />
|
||||
<exclude name="MediaWiki.FunctionComment.Missing.Protected" />
|
||||
<exclude name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
|
||||
</rule>
|
||||
<file>.</file>
|
||||
<arg name="extensions" value="php,php5,inc"/>
|
||||
<arg name="encoding" value="utf8"/>
|
||||
<arg name="extensions" value="php,php5,inc" />
|
||||
<arg name="encoding" value="utf8" />
|
||||
<exclude-pattern>vendor</exclude-pattern>
|
||||
<exclude-pattern>node_modules</exclude-pattern>
|
||||
</ruleset>
|
||||
|
|
Loading…
Reference in a new issue