Skip to content

Commit 1fa5236

Browse files
committed
Initial code commit
1 parent bf98413 commit 1fa5236

20 files changed

+1914
-3
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 4
7+
insert_final_newline = true
8+
trim_trailing_whitespace = true
9+
10+
[*.json]
11+
indent_size = 2
12+
13+
[Makefile]
14+
indent_style = tab

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Ignoring files for distribution archieves
2+
examples/ export-ignore
3+
tests/ export-ignore
4+
.dunitconfig export-ignore
5+
.travis.yml export-ignore
6+
.gitignore export-ignore
7+
.gitattributes export-ignore
8+
.scrutinizer.yml export-ignore
9+
.styleci.yml export-ignore
10+
appveyor.yml export-ignore
11+
phpunit.xml.dist export-ignore

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor/

.scrutinizer.yml

Lines changed: 68 additions & 0 deletions
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

.styleci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
preset: psr2
2+
3+
risky: false
4+
5+
linting: true

.travis.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
language: php
2+
sudo: false
3+
4+
## Cache composer bits
5+
cache:
6+
directories:
7+
- $HOME/.composer/cache
8+
9+
## PHP versions we test against
10+
php:
11+
- 7.0
12+
- hhvm
13+
- nightly
14+
15+
## Build matrix for lowest and highest possible targets
16+
matrix:
17+
include:
18+
- php: 7.0
19+
env: dependencies=lowest
20+
- php: hhvm
21+
env: dependencies=lowest
22+
- php: nightly
23+
env: dependencies=lowest
24+
- php: 7.0
25+
env: dependencies=highest
26+
- php: hhvm
27+
env: dependencies=highest
28+
- php: nightly
29+
env: dependencies=highest
30+
allow_failures:
31+
- php: hhvm
32+
33+
## Install or update dependencies
34+
install:
35+
- export COMPOSER_ROOT_VERSION='dev-'$TRAVIS_BRANCH
36+
- if [ -z "$dependencies" ]; then composer install; fi;
37+
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest -n; fi;
38+
- if [ "$dependencies" = "highest" ]; then composer update -n; fi;
39+
- composer show
40+
41+
## Run the actual test
42+
script: make travis
43+
44+
## Gather coverage and set it to coverage servers
45+
after_script: make travis-coverage

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
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/value-objects.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/

LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) 2016 php-api-clients
3+
Copyright (c) 2016 Cees-Jan Kiewiet
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
all: cs unit
2+
travis: cs travis-unit
3+
contrib: cs 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 --coverage-text --coverage-html covHtml
13+
14+
travis-unit: init
15+
./vendor/bin/phpunit --coverage-text --coverage-clover ./build/logs/clover.xml
16+
17+
travis-coverage: init
18+
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

README.md

Lines changed: 37 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,37 @@
1-
# value-objects
1+
# API Client Value Objects for PHP 7.x
2+
3+
[![Build Status](https://travis-ci.org/php-api-client/value-objects.svg?branch=master)](https://travis-ci.org/php-api-client/value-objects)
4+
[![Latest Stable Version](https://poser.pugx.org/api-client/value-objects/v/stable.png)](https://packagist.org/packages/api-client/value-objects)
5+
[![Total Downloads](https://poser.pugx.org/api-client/value-objects/downloads.png)](https://packagist.org/packages/api-client/value-objects/stats)
6+
[![Code Coverage](https://scrutinizer-ci.com/g/php-api-client/value-objects/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/php-api-client/value-objects/?branch=master)
7+
[![License](https://poser.pugx.org/api-client/value-objects/license.png)](https://packagist.org/packages/api-client/value-objects)
8+
[![PHP 7 ready](http://php7ready.timesplinter.ch/php-api-client/value-objects/badge.svg)](https://appveyor-ci.org/php-api-client/value-objects)
9+
10+
11+
# Goals
12+
13+
* Foundation for creating synchronous and asynchronous API clients
14+
15+
# License
16+
17+
The MIT License (MIT)
18+
19+
Copyright (c) 2016 Cees-Jan Kiewiet
20+
21+
Permission is hereby granted, free of charge, to any person obtaining a copy
22+
of this software and associated documentation files (the "Software"), to deal
23+
in the Software without restriction, including without limitation the rights
24+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
25+
copies of the Software, and to permit persons to whom the Software is
26+
furnished to do so, subject to the following conditions:
27+
28+
The above copyright notice and this permission notice shall be included in all
29+
copies or substantial portions of the Software.
30+
31+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
32+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
33+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
34+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
35+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
36+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
37+
SOFTWARE.

0 commit comments

Comments
 (0)