[MediaWiki-commits] [Gerrit] integration/docroot[master]: build: Updating mediawiki/mediawiki-codesniffer to 15.0.0

2017-12-30 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/401070 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
..


build: Updating mediawiki/mediawiki-codesniffer to 15.0.0

The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Files.ClassMatchesFilename.NotMatch

And moved phpcs.xml to .phpcs.xml (T177256).

Also added phpcbf to "composer fix" command.

Change-Id: I713be5442edc42b2f509434116570fa6951c4c97
---
A .phpcs.xml
M composer.json
D phpcs.xml
M shared/Page.php
4 files changed, 49 insertions(+), 39 deletions(-)

Approvals:
  Legoktm: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 000..c2ab9d5
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,28 @@
+
+
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   .
+   
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   vendor
+
diff --git a/composer.json b/composer.json
index 672564a..ff9c61a 100644
--- a/composer.json
+++ b/composer.json
@@ -1,17 +1,20 @@
 {
-"require": {
-"php": ">= 5.5.9"
-},
-"require-dev": {
-"jakub-onderka/php-parallel-lint": "0.9",
-"mediawiki/mediawiki-codesniffer": "0.7.2",
-"phpunit/phpunit": "4.8.*"
-},
-"scripts": {
-"test": [
-"parallel-lint . --exclude vendor",
-"phpunit",
-"phpcs -p -s"
-]
-}
+   "require": {
+   "php": ">= 5.5.9"
+   },
+   "require-dev": {
+   "jakub-onderka/php-parallel-lint": "0.9",
+   "mediawiki/mediawiki-codesniffer": "15.0.0",
+   "phpunit/phpunit": "4.8.*"
+   },
+   "scripts": {
+   "test": [
+   "parallel-lint . --exclude vendor",
+   "phpunit",
+   "phpcs -p -s"
+   ],
+   "fix": [
+   "phpcbf"
+   ]
+   }
 }
diff --git a/phpcs.xml b/phpcs.xml
deleted file mode 100644
index 76e2f1b..000
--- a/phpcs.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-   
-   .
-   
-   
-   
-   0
-   
-   
-   0
-   
-   
-   0
-   
-   
-   0
-   
-   vendor
-
diff --git a/shared/Page.php b/shared/Page.php
index 96aed10..801aa40 100644
--- a/shared/Page.php
+++ b/shared/Page.php
@@ -121,14 +121,14 @@
$path = dirname( $_SERVER['SCRIPT_NAME'] ) . '/';
}
if ( !$path || !isset( $_SERVER['DOCUMENT_ROOT'] ) ) {
-   Page::error( 'Invalid context.' );
+   self::error( 'Invalid context.' );
}
// Use realpath() to prevent escalation through e.g. "../"
// Note: realpath() also normalises paths to have no trailing 
slash
$realPath = realpath( $_SERVER['DOCUMENT_ROOT'] . $path );
if ( !$realPath || strpos( $realPath, $_SERVER['DOCUMENT_ROOT'] 
) !== 0 ) {
// Path escalation. Should be impossible as Apache 
normalises this.
-   Page::error( 'Invalid context.' );
+   self::error( 'Invalid context.' );
}
if ( substr( $path, -1 ) === '/' ) {
$realPath .= '/';
@@ -164,7 +164,7 @@
}
 
/**
-* @return string: URL path to shared/lib (without trailing slash).
+* @return string URL path to shared/lib (without trailing slash).
 */
public function getLibPath() {
if ( $this->libPath ) {
@@ -216,7 +216,6 @@
 * @param string $file
 */
public function addHtmlFile( $file ) {
-
$isRelativePath = ( substr( $file, 0 ) !== '/' );
 
if ( $isRelativePath && $this->dir ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/401070
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I713be5442edc42b2f509434116570fa6951c4c97
Gerrit-PatchSet: 1
Gerrit-Project: integration/docroot
Gerrit-Branch: master
Gerrit-Owner: Libraryupgrader 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Legoktm 

[MediaWiki-commits] [Gerrit] integration/docroot[master]: build: Updating mediawiki/mediawiki-codesniffer to 15.0.0

2017-12-30 Thread Libraryupgrader (Code Review)
Libraryupgrader has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/401070 )

Change subject: build: Updating mediawiki/mediawiki-codesniffer to 15.0.0
..

build: Updating mediawiki/mediawiki-codesniffer to 15.0.0

The following sniffs are failing and were disabled:
* MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected
* MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic
* MediaWiki.Commenting.FunctionComment.MissingParamComment
* MediaWiki.Commenting.FunctionComment.MissingParamName
* MediaWiki.Commenting.FunctionComment.MissingParamTag
* MediaWiki.Commenting.FunctionComment.MissingReturn
* MediaWiki.Files.ClassMatchesFilename.NotMatch

And moved phpcs.xml to .phpcs.xml (T177256).

Also added phpcbf to "composer fix" command.

Change-Id: I713be5442edc42b2f509434116570fa6951c4c97
---
A .phpcs.xml
M composer.json
D phpcs.xml
M shared/Page.php
4 files changed, 49 insertions(+), 39 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/integration/docroot 
refs/changes/70/401070/1

diff --git a/.phpcs.xml b/.phpcs.xml
new file mode 100644
index 000..c2ab9d5
--- /dev/null
+++ b/.phpcs.xml
@@ -0,0 +1,28 @@
+
+
+   
+   
+   
+   
+   
+   
+   
+   
+   
+   .
+   
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   
+   0
+   
+   vendor
+
diff --git a/composer.json b/composer.json
index 672564a..ff9c61a 100644
--- a/composer.json
+++ b/composer.json
@@ -1,17 +1,20 @@
 {
-"require": {
-"php": ">= 5.5.9"
-},
-"require-dev": {
-"jakub-onderka/php-parallel-lint": "0.9",
-"mediawiki/mediawiki-codesniffer": "0.7.2",
-"phpunit/phpunit": "4.8.*"
-},
-"scripts": {
-"test": [
-"parallel-lint . --exclude vendor",
-"phpunit",
-"phpcs -p -s"
-]
-}
+   "require": {
+   "php": ">= 5.5.9"
+   },
+   "require-dev": {
+   "jakub-onderka/php-parallel-lint": "0.9",
+   "mediawiki/mediawiki-codesniffer": "15.0.0",
+   "phpunit/phpunit": "4.8.*"
+   },
+   "scripts": {
+   "test": [
+   "parallel-lint . --exclude vendor",
+   "phpunit",
+   "phpcs -p -s"
+   ],
+   "fix": [
+   "phpcbf"
+   ]
+   }
 }
diff --git a/phpcs.xml b/phpcs.xml
deleted file mode 100644
index 76e2f1b..000
--- a/phpcs.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-   
-   .
-   
-   
-   
-   0
-   
-   
-   0
-   
-   
-   0
-   
-   
-   0
-   
-   vendor
-
diff --git a/shared/Page.php b/shared/Page.php
index 96aed10..801aa40 100644
--- a/shared/Page.php
+++ b/shared/Page.php
@@ -121,14 +121,14 @@
$path = dirname( $_SERVER['SCRIPT_NAME'] ) . '/';
}
if ( !$path || !isset( $_SERVER['DOCUMENT_ROOT'] ) ) {
-   Page::error( 'Invalid context.' );
+   self::error( 'Invalid context.' );
}
// Use realpath() to prevent escalation through e.g. "../"
// Note: realpath() also normalises paths to have no trailing 
slash
$realPath = realpath( $_SERVER['DOCUMENT_ROOT'] . $path );
if ( !$realPath || strpos( $realPath, $_SERVER['DOCUMENT_ROOT'] 
) !== 0 ) {
// Path escalation. Should be impossible as Apache 
normalises this.
-   Page::error( 'Invalid context.' );
+   self::error( 'Invalid context.' );
}
if ( substr( $path, -1 ) === '/' ) {
$realPath .= '/';
@@ -164,7 +164,7 @@
}
 
/**
-* @return string: URL path to shared/lib (without trailing slash).
+* @return string URL path to shared/lib (without trailing slash).
 */
public function getLibPath() {
if ( $this->libPath ) {
@@ -216,7 +216,6 @@
 * @param string $file
 */
public function addHtmlFile( $file ) {
-
$isRelativePath = ( substr( $file, 0 ) !== '/' );
 
if ( $isRelativePath && $this->dir ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/401070
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I713be5442edc42b2f509434116570fa6951c4c97
Gerrit-PatchSet: 1
Gerrit-Project: integration/docroot
Gerrit-Branch: master
Gerrit-Owner: Libraryupgrader 

___