Skip to content

Commit c4ac593

Browse files
committed
Releasing v1.0.0 - Updating all libraries and standards
1 parent 87e423b commit c4ac593

File tree

537 files changed

+37661
-33421
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

537 files changed

+37661
-33421
lines changed

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ c9.ide.language.php.wordpress
33

44
__Name__ : WordPress Coding Standards Linter for Cloud9
55

6-
__Current Version__: 0.0.2a
6+
__Current Version__: 1.0.0 (2018-10-10)
77

88
__Author__ : [EP4](https://ep4.com)
99

1010
__Contributors__ : [Dave Lavoie](https://github.com/davelavoie)
1111

1212
__License__ : GPLv3 or later
1313

14-
Provides a linter in Cloud9 IDE for WordPress development using PHP CodeSniffer (PHPCS) based on WordPress Coding Standards (WPCS) and PHPCompatibility rules.
14+
Provides a linter in Cloud9 IDE for WordPress development using PHP CodeSniffer (PHPCS) based on WordPress Coding Standards (WPCS) and PHPCompatibility/PHPCompabitityWP rules.
1515

1616
Installation
1717
------------
@@ -69,18 +69,33 @@ Since there is no simple way to allow HTML in these tooltips, we use some custom
6969
Ressources
7070
----------
7171

72-
* PHP CodeSniffer : [GitHub repo](https://github.com/squizlabs/PHP_CodeSniffer) & [Wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki)
72+
* PHP CodeSniffer : [GitHub Repo](https://github.com/squizlabs/PHP_CodeSniffer), [Wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki) & [Analysis of Coding Conventions for WP](https://squizlabs.github.io/PHP_CodeSniffer/analysis/WordPress/WordPress/index.html)
7373
* WordPress Coding Standards : [GitHub Repo](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards), [Wiki](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki) & [Whitelisting code which flags errors](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki/Whitelisting-code-which-flags-errors)
74-
* PHPCompatibility : [GitHub Repo](https://github.com/wimg/PHPCompatibility)
74+
* PHPCompatibility : [GitHub Repo](https://github.com/PHPCompatibility/PHPCompatibility)
75+
* PHPCompatibilityWP : [GitHub Repo](https://github.com/PHPCompatibility/PHPCompatibilityWP)
7576
* Cloud9 : [SDK](https://cloud9-sdk.readme.io/) & [API](https://apidoc.c9.io)
7677

7778
Changelog
7879
---------
7980

81+
### 1.0.0 - 2018-10-10
82+
83+
* Updating PHP_CodeSniffer library to version 3.3.2.
84+
* Updating WordPress Coding Standards to version 1.1.0.
85+
* Updading PHPCompabitity standards to version 9.0.0.
86+
* Adding PHPCompabitityWP 2.0.0 and PHPCompatibilityParagonie 1.0.0 standards.
87+
* Increasing the stdout max output from 200KB to 500KB.
88+
* Increasing the timeout from 5 to 10 seconds.
89+
* Moving the checkmark icon (✔) after the position in the tooltip.
90+
* Including license files for each coding standards.
91+
* Removing the CSS rule used for hiding the debug bar since the plugin can be used without activating the debug mode now.
92+
* Some code refactoring.
93+
* Updating the 'Installation' section of the docs.
94+
8095
### 0.0.2a - 2017-02-13
8196

82-
* Updating WP Coding Standards with the latest release as of 2017-02-10.
83-
* Updading PHPCompabitity with the latest release as of 2017-02-06
97+
* Updating WordPress Coding Standards with the latest release as of 2017-02-10.
98+
* Updading PHPCompabitity standards with the latest release as of 2017-02-06
8499

85100
### 0.0.1 (alpha) - 2017-02-10
86101

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
22
"name": "phpcs.wpcs",
33
"description": "Displays warnings in the IDE with the help of PHP CodeSniffer configured with WordPress Coding Standards and PHPCompatibility rules.",
4-
"version": "0.0.2",
4+
"version": "1.0.0",
55
"author": "EP4",
66
"contributors": [
77
{
88
"name": "Dave Lavoie",
9-
"email": "dave.lavoie+c9@ep4.com"
9+
"email": "dave.lavoie@ep4.com"
1010
}
1111
],
1212
"repository": {

phpcs.wpcs.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
// @see https://cloud9-sdk.readme.io/docs/language-handlers
12
define(function(require, exports, module) {
2-
main.consumes = ["Plugin", "language","ui"];
3+
main.consumes = ["Plugin", "language", "ui"];
34
main.provides = ["phpcs.wpcs"];
45
return main;
56

server/phpcs/README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
## About
2+
3+
PHP\_CodeSniffer is a set of two PHP scripts; the main `phpcs` script that tokenizes PHP, JavaScript and CSS files to detect violations of a defined coding standard, and a second `phpcbf` script to automatically correct coding standard violations. PHP\_CodeSniffer is an essential development tool that ensures your code remains clean and consistent.
4+
5+
[![Build Status](https://travis-ci.org/squizlabs/PHP_CodeSniffer.svg?branch=phpcs-fixer)](https://travis-ci.org/squizlabs/PHP_CodeSniffer) [![Code consistency](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer/grade.svg)](http://squizlabs.github.io/PHP_CodeSniffer/analysis/squizlabs/PHP_CodeSniffer) [![Join the chat at https://gitter.im/squizlabs/PHP_CodeSniffer](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/squizlabs/PHP_CodeSniffer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
6+
7+
## Requirements
8+
9+
PHP\_CodeSniffer requires PHP version 5.4.0 or greater, although individual sniffs may have additional requirements such as external applications and scripts. See the [Configuration Options manual page](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Configuration-Options) for a list of these requirements.
10+
11+
## Installation
12+
13+
The easiest way to get started with PHP\_CodeSniffer is to download the Phar files for each of the commands:
14+
```
15+
# Download using curl
16+
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
17+
curl -OL https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
18+
19+
# Or download using wget
20+
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar
21+
wget https://squizlabs.github.io/PHP_CodeSniffer/phpcbf.phar
22+
23+
# Then test the downloaded PHARs
24+
php phpcs.phar -h
25+
php phpcbf.phar -h
26+
```
27+
28+
### Composer
29+
If you use Composer, you can install PHP_CodeSniffer system-wide with the following command:
30+
31+
composer global require "squizlabs/php_codesniffer=*"
32+
33+
Make sure you have the composer bin dir in your PATH. The default value is `~/.composer/vendor/bin/`, but you can check the value that you need to use by running `composer global config bin-dir --absolute`.
34+
35+
Or alternatively, include a dependency for `squizlabs/php_codesniffer` in your `composer.json` file. For example:
36+
37+
```json
38+
{
39+
"require-dev": {
40+
"squizlabs/php_codesniffer": "3.*"
41+
}
42+
}
43+
```
44+
45+
You will then be able to run PHP_CodeSniffer from the vendor bin directory:
46+
47+
./vendor/bin/phpcs -h
48+
./vendor/bin/phpcbf -h
49+
50+
### Phive
51+
If you use Phive, you can install PHP_CodeSniffer as a project tool using the following commands:
52+
53+
phive install phpcs
54+
phive install phpcbf
55+
56+
You will then be able to run PHP_CodeSniffer from the tools directory:
57+
58+
./tools/phpcs -h
59+
./tools/phpcbf -h
60+
61+
### PEAR
62+
If you use PEAR, you can install PHP\_CodeSniffer using the PEAR installer. This will make the `phpcs` and `phpcbf` commands immediately available for use. To install PHP\_CodeSniffer using the PEAR installer, first ensure you have [installed PEAR](http://pear.php.net/manual/en/installation.getting.php) and then run the following command:
63+
64+
pear install PHP_CodeSniffer
65+
66+
### Git Clone
67+
You can also download the PHP\_CodeSniffer source and run the `phpcs` and `phpcbf` commands directly from the Git clone:
68+
69+
git clone https://github.com/squizlabs/PHP_CodeSniffer.git
70+
cd PHP_CodeSniffer
71+
php bin/phpcs -h
72+
php bin/phpcbf -h
73+
74+
## Documentation
75+
76+
The documentation for PHP\_CodeSniffer is available on the [Github wiki](https://github.com/squizlabs/PHP_CodeSniffer/wiki).
77+
78+
## Issues
79+
80+
Bug reports and feature requests can be submitted on the [Github Issue Tracker](https://github.com/squizlabs/PHP_CodeSniffer/issues).
81+
82+
## Contributing
83+
84+
See [CONTRIBUTING.md](CONTRIBUTING.md) for information.
85+
86+
## Versioning
87+
88+
PHP_CodeSniffer uses a `MAJOR.MINOR.PATCH` version number format.
89+
90+
The `MAJOR` version is incremented when:
91+
- backwards-incompatible changes are made to how the `phpcs` or `phpcbf` commands are used, or
92+
- backwards-incompatible changes are made to the `ruleset.xml` format, or
93+
- backwards-incompatible changes are made to the API used by sniff developers, or
94+
- custom PHP_CodeSniffer token types are removed
95+
96+
The `MINOR` version is incremented when:
97+
- new backwards-compatible features are added to the `phpcs` and `phpcbf` commands, or
98+
- backwards-compatible changes are made to the `ruleset.xml` format, or
99+
- backwards-compatible changes are made to the API used by sniff developers, or
100+
- new sniffs are added to an included standard
101+
102+
> NOTE: Backwards-compatible changes to the API used by sniff develpers will allow an existing sniff to continue running without producing fatal errors but may not result in the sniff reporting the same errors as it did previously without changes being required.
103+
104+
The `PATCH` version is incremented when:
105+
- backwards-compatible bug fixes are made
106+
107+
> NOTE: As PHP_CodeSniffer exists to report and fix issues, most bugs are the result of coding standard errors being incorrectly reported or coding standard errors not being reported when they should be. This means that the messages produced by PHP_CodeSniffer, and the fixes it makes, are likely to be different between PATCH versions.

server/phpcs/licence.txt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
Copyright (c) 2012, Squiz Pty Ltd (ABN 77 084 670 600)
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are met:
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above copyright
9+
notice, this list of conditions and the following disclaimer in the
10+
documentation and/or other materials provided with the distribution.
11+
* Neither the name of Squiz Pty Ltd nor the
12+
names of its contributors may be used to endorse or promote products
13+
derived from this software without specific prior written permission.
14+
15+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
19+
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22+
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

server/phpcs/phpcbf.phar

605 KB
Binary file not shown.

server/phpcs/phpcs.phar

100755100644
605 KB
Binary file not shown.

server/phpcs/rules/PHPCompatibility/AbstractComplexVersionSniff.php

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
11
<?php
22
/**
3-
* PHPCompatibility_AbstractComplexVersionSniff.
3+
* \PHPCompatibility\AbstractComplexVersionSniff.
44
*
55
* @category PHP
66
* @package PHPCompatibility
77
* @author Juliette Reinders Folmer <phpcompatibility_nospam@adviesenzo.nl>
88
*/
99

10+
namespace PHPCompatibility;
11+
1012
/**
11-
* PHPCompatibility_AbstractComplexVersionSniff.
13+
* \PHPCompatibility\AbstractComplexVersionSniff.
1214
*
1315
* @category PHP
1416
* @package PHPCompatibility
1517
* @author Juliette Reinders Folmer <phpcompatibility_nospam@adviesenzo.nl>
1618
*/
17-
abstract class PHPCompatibility_AbstractComplexVersionSniff extends PHPCompatibility_Sniff implements PHPCompatibility_ComplexVersionInterface
19+
abstract class AbstractComplexVersionSniff extends Sniff implements ComplexVersionInterface
1820
{
1921

2022

2123
/**
2224
* Handle the retrieval of relevant information and - if necessary - throwing of an
2325
* error/warning for an item.
2426
*
25-
* @param PHP_CodeSniffer_File $phpcsFile The file being scanned.
26-
* @param int $stackPtr The position of the relevant token in
27-
* the stack.
28-
* @param array $itemInfo Base information about the item.
27+
* @param \PHP_CodeSniffer_File $phpcsFile The file being scanned.
28+
* @param int $stackPtr The position of the relevant token in
29+
* the stack.
30+
* @param array $itemInfo Base information about the item.
2931
*
3032
* @return void
3133
*/
32-
public function handleFeature(PHP_CodeSniffer_File $phpcsFile, $stackPtr, array $itemInfo)
34+
public function handleFeature(\PHP_CodeSniffer_File $phpcsFile, $stackPtr, array $itemInfo)
3335
{
3436
$itemArray = $this->getItemArray($itemInfo);
3537
$errorInfo = $this->getErrorInfo($itemArray, $itemInfo);
@@ -101,8 +103,8 @@ abstract protected function getErrorMsgTemplate();
101103
* Allow for concrete child classes to filter the error message before it's passed to PHPCS.
102104
*
103105
* @param string $error The error message which was created.
104-
* @param array $itemInfo Base information about the item this error message applied to.
105-
* @param array $errorInfo Detail information about an item this error message applied to.
106+
* @param array $itemInfo Base information about the item this error message applies to.
107+
* @param array $errorInfo Detail information about an item this error message applies to.
106108
*
107109
* @return string
108110
*/
@@ -116,8 +118,8 @@ protected function filterErrorMsg($error, array $itemInfo, array $errorInfo)
116118
* Allow for concrete child classes to filter the error data before it's passed to PHPCS.
117119
*
118120
* @param array $data The error data array which was created.
119-
* @param array $itemInfo Base information about the item this error message applied to.
120-
* @param array $errorInfo Detail information about an item this error message applied to.
121+
* @param array $itemInfo Base information about the item this error message applies to.
122+
* @param array $errorInfo Detail information about an item this error message applies to.
121123
*
122124
* @return array
123125
*/

0 commit comments

Comments
 (0)