Skip to content
This repository was archived by the owner on Jan 31, 2020. It is now read-only.

Commit 744d346

Browse files
committed
Merge pull request #3 from Koopzington/new-coding-standard
New coding standard
2 parents 69fc1af + 557777d commit 744d346

File tree

4 files changed

+17
-31
lines changed

4 files changed

+17
-31
lines changed

.travis.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ matrix:
2626
include:
2727
- php: 5.5
2828
env:
29-
- EXECUTE_CS_CHECK=true
29+
- CS_CHECK=true
3030
- php: 5.6
3131
env:
32-
- EXECUTE_TEST_COVERALLS=true
32+
- TEST_COVERAGE=true
3333
- DEPLOY_DOCS="$(if [[ $TRAVIS_BRANCH == 'master' && $TRAVIS_PULL_REQUEST == 'false' ]]; then echo -n 'true' ; else echo -n 'false' ; fi)"
3434
- PATH="$HOME/.local/bin:$PATH"
3535
- php: 7
@@ -42,21 +42,20 @@ notifications:
4242
email: false
4343

4444
before_install:
45-
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
45+
- if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi
4646
- travis_retry composer self-update
47-
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
47+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer require --dev --no-update satooshi/php-coveralls ; fi
4848

4949
install:
5050
- travis_retry composer install --no-interaction --ignore-platform-reqs
5151

5252
script:
53-
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer test-coverage ; fi
54-
- if [[ $EXECUTE_TEST_COVERALLS != 'true' ]]; then composer test ; fi
55-
- if [[ $EXECUTE_CS_CHECK == 'true' ]]; then composer cs-check ; fi
53+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer test-coverage ; else composer test ; fi
54+
- if [[ $CS_CHECK == 'true' ]]; then composer cs-check ; fi
5655
- if [[ $DEPLOY_DOCS == "true" && "$TRAVIS_TEST_RESULT" == "0" ]]; then wget -O theme-installer.sh "https://raw.githubusercontent.com/zendframework/zf-mkdoc-theme/master/theme-installer.sh" ; chmod 755 theme-installer.sh ; ./theme-installer.sh ; fi
5756

5857
after_success:
5958
- if [[ $DEPLOY_DOCS == "true" ]]; then echo "Preparing to build and deploy documentation" ; ./zf-mkdoc-theme/deploy.sh ; echo "Completed deploying documentation" ; fi
6059

6160
after_script:
62-
- if [[ $EXECUTE_TEST_COVERALLS == 'true' ]]; then composer upload-coverage ; fi
61+
- if [[ $TEST_COVERAGE == 'true' ]]; then composer upload-coverage ; fi

CONTRIBUTING.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,24 @@ To do so:
7777

7878
## Running Coding Standards Checks
7979

80-
This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding
80+
This component uses [phpcs](https://github.com/squizlabs/PHP_CodeSniffer) for coding
8181
standards checks, and provides configuration for our selected checks.
82-
`php-cs-fixer` is installed by default via Composer.
82+
`phpcs` is installed by default via Composer.
8383

8484
To run checks only:
8585

8686
```console
87-
$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs
87+
$ composer cs-check
8888
```
8989

90-
To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run`
91-
flag:
90+
`phpcs` also includes a tool for fixing most CS violations, `phpcbf`:
91+
9292

9393
```console
94-
$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs
94+
$ composer cs-fix
9595
```
9696

97-
If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure
97+
If you allow `phpcbf` to fix CS issues, please re-run the tests to ensure
9898
they pass, and make sure you add and commit the changes after verification.
9999

100100
## Recommended Workflow for Contributions

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"zendframework/zendxml": "^1.0.2"
2121
},
2222
"require-dev": {
23-
"squizlabs/php_codesniffer": "^2.3",
24-
"phpunit/PHPUnit": "~4.0"
23+
"phpunit/PHPUnit": "~4.0",
24+
"zendframework/zend-coding-standard": "~1.0.0"
2525
},
2626
"autoload": {
2727
"psr-4": {

phpcs.xml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
<?xml version="1.0"?>
22
<ruleset name="Zend Framework coding standard">
3-
<description>Zend Framework coding standard</description>
4-
5-
<!-- display progress -->
6-
<arg value="p"/>
7-
<arg name="colors"/>
8-
9-
<!-- inherit rules from: -->
10-
<rule ref="PSR2"/>
11-
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
12-
<rule ref="Squiz.WhiteSpace.SuperfluousWhitespace">
13-
<properties>
14-
<property name="ignoreBlankLines" value="false"/>
15-
</properties>
16-
</rule>
3+
<rule ref="./vendor/zendframework/zend-coding-standard/ruleset.xml"/>
174

185
<!-- Paths to check -->
196
<file>src</file>

0 commit comments

Comments
 (0)