Skip to content

Commit bc15057

Browse files
committed
First commit
0 parents  commit bc15057

14 files changed

+2588
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
composer.phar
2+
/vendor/
3+
/composer.lock

.travis.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# Travis CI (MIT License) configuration file
2+
# @link https://travis-ci.org/
3+
4+
# Use new container based environment
5+
sudo: false
6+
7+
# Declare project language.
8+
# @link http://about.travis-ci.org/docs/user/languages/php/
9+
language: php
10+
11+
env:
12+
global:
13+
# Name and folder of the the standard to test.
14+
- STANDARD="GreynoiseLaravel"
15+
# 0 For unit test without coverage 1 for unit test with coverage.
16+
- COVERAGE="1"
17+
# Upload covarage to clover.
18+
- CLOVER="0"
19+
20+
matrix:
21+
fast_finish: true
22+
23+
# Declare versions of PHP to use. Use one decimal max.
24+
include:
25+
# aliased to a recent 5.4.x version
26+
# - php: '5.4'
27+
# aliased to a recent 5.5.x version
28+
# - php: '5.5'
29+
# aliased to a recent 5.6.x version
30+
# - php: '5.6'
31+
# aliased to a recent 7.x version
32+
# - php: '7.0'
33+
# aliased to a recent 7.x version
34+
- php: '7.1'
35+
# aliased to a recent hhvm version
36+
# - php: 'hhvm'
37+
# php nightly
38+
# - php: 'nightly'
39+
40+
# allow_failures:
41+
# - php: 'hhvm'
42+
# - php: 'nightly'
43+
44+
before_install:
45+
# Remove xdebug.
46+
# - phpenv config-rm xdebug.ini
47+
# Update composer to latest version
48+
# - composer self-update
49+
# Install project composer deps in composer.json
50+
- composer install
51+
# Install composer deps in composer.json.
52+
# - composer require squizlabs/php_codesniffer:dev-master
53+
# - composer require satooshi/php-coveralls:dev-master
54+
- phpenv rehash
55+
56+
script:
57+
# Check for PHP syntax errors.
58+
- find -L . -path ./vendor -prune -o -name '*.php' -print0 | xargs -0 -n 1 -P 4 php -l
59+
# - Check files match the PHPCS standard.
60+
# - $TRAVIS_BUILD_DIR/vendor/squizlabs/php_codesniffer/bin/phpcs --ignore=*/Tests/* $TRAVIS_BUILD_DIR/$STANDARD/ --standard=$TRAVIS_BUILD_DIR/vendor/squizlabs/php_codesniffer/phpcs.xml.dist
61+
- ./vendor/bin/phpcs --ignore=*/Tests/* ./$STANDARD/ --standard=./vendor/squizlabs/php_codesniffer/phpcs.xml.dist
62+
# Change the default standard.
63+
- ./vendor/bin/phpcs --config-set installed_paths $TRAVIS_BUILD_DIR/$STANDARD
64+
# Verify it's installed.
65+
- ./vendor/bin/phpcs -i
66+
# Run unit tests for the standard with coverage.
67+
- if [[ "$COVERAGE" == "0" ]]; then ./vendor/bin/phpunit --bootstrap=./vendor/squizlabs/php_codesniffer/tests/bootstrap.php --debug --filter $STANDARD ./vendor/squizlabs/php_codesniffer/tests/AllTests.php; fi
68+
# Or Run unit tests for the standard with coverage.
69+
- if [[ "$COVERAGE" == "1" ]]; then ./vendor/bin/phpunit --bootstrap=./vendor/squizlabs/php_codesniffer/tests/bootstrap.php --debug --coverage-clover=$TRAVIS_BUILD_DIR/build/logs/clover.xml --filter $STANDARD ./vendor/squizlabs/php_codesniffer/tests/AllTests.php; fi
70+
71+
after_success:
72+
- if [[ "$CLOVER" == "1" ]]; then ./vendor/bin/coveralls -v -x $TRAVIS_BUILD_DIR/build/logs/clover.xml; fi

CONTRIBUTING.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Greynoise Design - Laravel 5 Standard
2+
3+
## Contributing
4+
5+
### PHPUnit Testing
6+
7+
`cd /Path/To/laravel-coding-standard`
8+
9+
Install dependencies (PHP_Codesniffer).
10+
11+
`composer install`
12+
13+
Verify PHP_Codesniffer works.
14+
15+
`./vendor/squizlabs/php_codesniffer/bin/phpcs -i`
16+
17+
Set installed standard to GreynoiseLaravel.
18+
19+
`./vendor/squizlabs/php_codesniffer/bin/phpcs --config-set installed_paths /Path/To/laravel-coding-standard/GreynoiseLaravel`
20+
21+
Verify the GreynoiseLaravel standard is installed.
22+
23+
`./vendor/squizlabs/php_codesniffer/bin/phpcs -i`
24+
25+
Change directory to 'php_codesniffer'.
26+
27+
`cd ./vendor/squizlabs/php_codesniffer/`
28+
29+
Install PHP_Codesniffer dependencies (PHPUnit).
30+
31+
`composer install`
32+
33+
Run unit tests.
34+
35+
`./vendor/bin/phpunit --debug --filter GreynoiseLaravel ./tests/AllTests.php`
36+
37+
phpcs -p -s ~/Documents/Projects/laravel-coding-standard/GreynoiseLaravel/Tests/Arrays/ArrayDeclarationUnitTest.inc --standard=GreynoiseLaravel --sniffs=GreynoiseLaravel.Arrays.ArrayDeclaration
38+
39+
-
40+
41+
### Creating Unit tests
42+
43+
Assuming the standard is in `~/Documents/Projects/`.
44+
45+
#### Get the errors
46+
`phpcs -p -s ~/Documents/Projects/laravel-coding-standard/GreynoiseLaravel/Tests/Arrays/ArrayDeclarationUnitTest.inc --standard=GreynoiseLaravel --sniffs=GreynoiseLaravel.Arrays.ArrayDeclaration`
47+
48+
Look at the error line numbers and add them to the ArrayDeclarationUnitTest.php file. (Ensure cli tabWith is set if needed eg. in ArrayDeclarationUnitTest->setCliValues).
49+
50+
#### Generate the fixed version
51+
52+
`phpcbf -v -p -s ~/Documents/Projects/laravel-coding-standard/GreynoiseLaravel/Tests/Arrays/ArrayDeclarationUnitTest.inc --standard=GreynoiseLaravel --sniffs=GreynoiseLaravel.Arrays.ArrayDeclaration --suffix=.fixed`
53+
54+
(This may contain spaces and tabs which get fixed elsewhere).
55+
56+
#### Run unit tests
57+
`./vendor/bin/phpunit --debug --filter GreynoiseLaravel ./tests/AllTests.php`

0 commit comments

Comments
 (0)