Skip to content

Commit de03072

Browse files
committed
Bare basic setup
1 parent f44ad2a commit de03072

13 files changed

+1630
-0
lines changed

Diff for: .dunitconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// the list of docker images to run against
2+
images="vectorface/hhvm";
3+
4+
5+
// a flag indicating whether to run the syntax check
6+
checkSyntax="true";
7+
// the syntax command to execute
8+
syntaxCommand="find /opt/source -type f -name \"*.php\" ! -path \"*/vendor/*\" -print0 | xargs -0 -n 1 -P 8 php -l | grep -v 'No syntax errors'"
9+
10+
// a flag indicating whether to run the phpunit test suite
11+
runTests="true";
12+
// the phpunit command to execute
13+
unitTestsCommand="/opt/source/vendor/bin/phpunit"

Diff for: .gitattributes

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Ignoring files for distribution archieves
2+
examples/ export-ignore
3+
tests/ export-ignore
4+
.travis.yml export-ignore
5+
.gitignore export-ignore
6+
.gitattributes export-ignore
7+
.scrutinizer.yml export-ignore
8+
phpunit.xml.dist export-ignore

Diff for: .gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
composer.phar
2+
vendor/
3+
4+
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
5+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
6+
# composer.lock

Diff for: .scrutinizer.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
filter:
2+
paths: [src/*]
3+
excluded_paths: [examples/*, tests/*]
4+
tools:
5+
external_code_coverage: true
6+
php_analyzer: true
7+
php_hhvm: true
8+
php_sim: true
9+
php_pdepend: true
10+
sensiolabs_security_checker: true
11+
php_changetracking: true
12+
php_code_sniffer:
13+
enabled: true
14+
config:
15+
tab_width: 0
16+
encoding: utf8
17+
ruleset: ~
18+
standard: "PSR2"
19+
php_cs_fixer:
20+
enabled: true
21+
config:
22+
level: psr2
23+
php_mess_detector:
24+
enabled: true
25+
config:
26+
ruleset: ~
27+
code_size_rules:
28+
cyclomatic_complexity: true
29+
npath_complexity: true
30+
excessive_method_length: true
31+
excessive_class_length: true
32+
excessive_parameter_list: true
33+
excessive_public_count: true
34+
too_many_fields: true
35+
too_many_methods: true
36+
excessive_class_complexity: true
37+
design_rules:
38+
exit_expression: true
39+
eval_expression: true
40+
goto_statement: true
41+
number_of_class_children: true
42+
depth_of_inheritance: true
43+
coupling_between_objects: true
44+
unused_code_rules:
45+
unused_private_field: true
46+
unused_local_variable: true
47+
unused_private_method: true
48+
unused_formal_parameter: true
49+
naming_rules:
50+
short_variable:
51+
minimum: 3
52+
long_variable:
53+
maximum: 20
54+
short_method:
55+
minimum: 3
56+
constructor_conflict: true
57+
constant_naming: true
58+
boolean_method_name: true
59+
controversial_rules:
60+
superglobals: true
61+
camel_case_class_name: true
62+
camel_case_property_name: true
63+
camel_case_method_name: true
64+
camel_case_parameter_name: true
65+
camel_case_variable_name: true
66+
checks:
67+
php:
68+
code_rating: true

Diff for: .travis.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
language: php
2+
sudo: false
3+
4+
## Cache composer bits
5+
cache:
6+
directories:
7+
- vendor
8+
- $HOME/.composer/cache
9+
10+
## PHP versions we test against
11+
php:
12+
- 7
13+
- hhvm
14+
15+
## Build matrix for lowest and highest possible targets
16+
matrix:
17+
include:
18+
- php: 7
19+
env: dependencies=lowest
20+
- php: hhvm
21+
env: dependencies=lowest
22+
- php: 7
23+
env: dependencies=highest
24+
- php: hhvm
25+
env: dependencies=highest
26+
27+
## Update composer and run the appropriate composer command
28+
before_script:
29+
- composer self-update
30+
- if [ -n "$GH_TOKEN" ]; then composer config github-oauth.github.com ${GH_TOKEN}; fi;
31+
- if [ -z "$dependencies" ]; then composer install; fi;
32+
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest -n; fi;
33+
- if [ "$dependencies" = "highest" ]; then composer update -n; fi;
34+
- composer show -i
35+
36+
## Run the actual test
37+
script: make travis
38+
39+
## Gather coverage and set it to coverage servers
40+
after_script: make travis-coverage
41+
42+
notifications:
43+
webhooks:
44+
urls:
45+
- http://wyrihaximus.net/wyri_projects/wyri_projects/webhook/travisci.json
46+
on_success: always
47+
on_failure: always
48+
on_start: true

Diff for: CONTRIBUTING.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contributing
2+
3+
Pull requests are highly appreciated. Here's a quick guide.
4+
5+
Fork, then clone the repo:
6+
7+
git clone [email protected]:your-username/php-travis-client.git
8+
9+
Set up your machine:
10+
11+
composer install
12+
13+
Make sure the tests pass:
14+
15+
make unit
16+
17+
Make sure the tests pass on all supported PHP versions (requires docker):
18+
19+
make dunit
20+
21+
Make your change. Add tests for your change. Make the tests pass:
22+
23+
make dunit && make unit
24+
25+
Before committing and submitting your pull request make sure it passes PSR2 coding style, unit tests pass and pass on all supported PHP versions:
26+
27+
make contrib
28+
29+
Push to your fork and [submit a pull request][pr].
30+
31+
[pr]: https://help.github.com/articles/creating-a-pull-request/
32+
33+
At this point you're waiting on me. I like to at least comment on pull requests
34+
within a day or two. I may suggest some changes or improvements or alternatives.
35+
36+
Some things that will increase the chance that your pull request is accepted:
37+
38+
* Write tests.
39+
* Follow PSR2 (travis will also check for this).
40+
* Write a [good commit message][commit].
41+
42+
[commit]: http://chris.beams.io/posts/git-commit/

Diff for: Makefile

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
all: cs dunit unit
2+
travis: cs unit-travis
3+
contrib: cs dunit unit
4+
5+
init:
6+
if [ ! -d vendor ]; then composer install; fi;
7+
8+
cs: init
9+
./vendor/bin/phpcs --standard=PSR2 src/
10+
11+
unit: init
12+
./vendor/bin/phpunit
13+
14+
unit-travis: init
15+
./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
16+
17+
dunit: init
18+
./vendor/bin/dunit
19+
20+
travis-coverage: init
21+
if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi

Diff for: README.md

+24
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
11
# php-travis-client
22
TravisCI API Client
3+
4+
# License
5+
6+
The MIT License (MIT)
7+
8+
Copyright (c) 2016 Cees-Jan Kiewiet
9+
10+
Permission is hereby granted, free of charge, to any person obtaining a copy
11+
of this software and associated documentation files (the "Software"), to deal
12+
in the Software without restriction, including without limitation the rights
13+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14+
copies of the Software, and to permit persons to whom the Software is
15+
furnished to do so, subject to the following conditions:
16+
17+
The above copyright notice and this permission notice shall be included in all
18+
copies or substantial portions of the Software.
19+
20+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26+
SOFTWARE.

Diff for: composer.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "wyrihaximus/travis-client",
3+
"license": "MIT",
4+
"authors": [
5+
{
6+
"name": "Cees-Jan Kiewiet",
7+
"email": "[email protected]"
8+
}
9+
],
10+
"require": {
11+
"php": "^7.0",
12+
"guzzlehttp/guzzle": "^5.0|^6.0"
13+
},
14+
"require-dev": {
15+
"phpunit/phpunit": "^5.0",
16+
"vectorface/dunit": "~2.0"
17+
},
18+
"autoload": {
19+
"psr-4": {
20+
"WyriHaximus\\Travis\\": "src/"
21+
}
22+
},
23+
"autoload-dev": {
24+
"psr-4": {
25+
"WyriHaximus\\Tests\\Travis\\": "tests/"
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)