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

Commit a3afcda

Browse files
authored
Merge pull request #120 from webimpress/new-coding-standard
Rebased #100 - New coding standard
2 parents 9f6eb29 + 2e94434 commit a3afcda

Some content is hidden

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

58 files changed

+257
-261
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,5 @@ tmp/
1111
zf-mkdoc-theme/
1212
clover.xml
1313
coveralls-upload.json
14-
phpcs.xml
1514
phpunit.xml
1615
vendor

CONTRIBUTING.md

Lines changed: 17 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -36,39 +36,30 @@ For sensitive email communications, please use [our PGP key](http://framework.ze
3636

3737
## RUNNING TESTS
3838

39-
> ### Note: testing versions prior to 2.4
40-
>
41-
> This component originates with Zend Framework 2. During the lifetime of ZF2,
42-
> testing infrastructure migrated from PHPUnit 3 to PHPUnit 4. In most cases, no
43-
> changes were necessary. However, due to the migration, tests may not run on
44-
> versions < 2.4. As such, you may need to change the PHPUnit dependency if
45-
> attempting a fix on such a version.
46-
4739
To run tests:
4840

4941
- Clone the repository:
5042

5143
```console
52-
$ git clone git@github.com:zendframework/zend-code.git
53-
$ cd
44+
$ git clone git://github.com/zendframework/zend-code.git
45+
$ cd zend-code
5446
```
5547

5648
- Install dependencies via composer:
5749

5850
```console
59-
$ curl -sS https://getcomposer.org/installer | php --
60-
$ ./composer.phar install
51+
$ composer install
6152
```
6253

63-
If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/
54+
If you don't have `composer` installed, please download it from https://getcomposer.org/download/
6455

65-
- Run the tests via `phpunit` and the provided PHPUnit config, like in this example:
56+
- Run the tests using the "test" command shipped in the `composer.json`:
6657

6758
```console
68-
$ ./vendor/bin/phpunit
59+
$ composer test
6960
```
7061

71-
You can turn on conditional tests with the phpunit.xml file.
62+
You can turn on conditional tests with the `phpunit.xml` file.
7263
To do so:
7364

7465
- Copy `phpunit.xml.dist` file to `phpunit.xml`
@@ -77,24 +68,22 @@ To do so:
7768

7869
## Running Coding Standards Checks
7970

80-
This component uses [php-cs-fixer](http://cs.sensiolabs.org/) for coding
81-
standards checks, and provides configuration for our selected checks.
82-
`php-cs-fixer` is installed by default via Composer.
71+
First, ensure you've installed dependencies via composer, per the previous
72+
section on running tests.
8373

84-
To run checks only:
74+
To run CS checks only:
8575

8676
```console
87-
$ ./vendor/bin/php-cs-fixer fix . -v --diff --dry-run --config-file=.php_cs
77+
$ composer cs-check
8878
```
8979

90-
To have `php-cs-fixer` attempt to fix problems for you, omit the `--dry-run`
91-
flag:
80+
To attempt to automatically fix common CS issues:
9281

9382
```console
94-
$ ./vendor/bin/php-cs-fixer fix . -v --diff --config-file=.php_cs
83+
$ composer cs-fix
9584
```
9685

97-
If you allow php-cs-fixer to fix CS issues, please re-run the tests to ensure
86+
If the above fixes any CS issues, please re-run the tests to ensure
9887
they pass, and make sure you add and commit the changes after verification.
9988

10089
## Recommended Workflow for Contributions
@@ -103,12 +92,12 @@ Your first step is to establish a public repository from which we can
10392
pull your work into the master repository. We recommend using
10493
[GitHub](https://github.com), as that is where the component is already hosted.
10594

106-
1. Setup a [GitHub account](http://github.com/), if you haven't yet
107-
2. Fork the repository (http://github.com/zendframework/zend-code)
95+
1. Setup a [GitHub account](https://github.com/), if you haven't yet
96+
2. Fork the repository (https://github.com/zendframework/zend-code)
10897
3. Clone the canonical repository locally and enter it.
10998

11099
```console
111-
$ git clone git://github.com:zendframework/zend-code.git
100+
$ git clone git://github.com/zendframework/zend-code.git
112101
$ cd zend-code
113102
```
114103

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
"ext-phar": "*",
2121
"doctrine/annotations": "~1.0",
2222
"zendframework/zend-stdlib": "^2.7 || ^3.0",
23-
"squizlabs/php_codesniffer": "^2.5",
24-
"phpunit/phpunit": "^6.2.2"
23+
"phpunit/phpunit": "^6.2.3",
24+
"zendframework/zend-coding-standard": "~1.0.0"
2525
},
2626
"suggest": {
2727
"doctrine/annotations": "Doctrine\\Common\\Annotations >=1.0 for annotation features",

composer.lock

Lines changed: 70 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpcs.xml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0"?>
2+
<ruleset name="Zend Framework coding standard">
3+
<rule ref="./vendor/zendframework/zend-coding-standard/ruleset.xml"/>
4+
5+
<!-- Paths to check -->
6+
<file>src</file>
7+
<file>test</file>
8+
<exclude-pattern>*/TestAsset/*</exclude-pattern>
9+
</ruleset>

0 commit comments

Comments
 (0)