Skip to content

Commit 1fa5236

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

20 files changed

+1914
-3
lines changed

.editorconfig

+14
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

+11
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

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor/

.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

.styleci.yml

+5
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

+45
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

+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/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

+2-2
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

+18
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

+37-1
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.

appveyor.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
build: false
2+
platform:
3+
- x64
4+
clone_folder: c:\projects\php-api-client
5+
6+
7+
## Build matrix for lowest and highest possible targets
8+
environment:
9+
matrix:
10+
- dependencies: lowest
11+
php_ver: 7.0.9
12+
- dependencies: current
13+
php_ver: 7.0.9
14+
- dependencies: highest
15+
php_ver: 7.0.9
16+
17+
## Cache composer bits
18+
cache:
19+
- c:\tools\php -> appveyor.yml
20+
- c:\projects\php-api-client\vendor -> composer.lock
21+
- '%LOCALAPPDATA%\Composer\files -> composer.lock'
22+
23+
## Set up environment varriables
24+
init:
25+
- SET COMPOSER_ROOT_VERSION=dev-master ## Temporary until we tag first versions
26+
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
27+
- SET COMPOSER_NO_INTERACTION=1
28+
- SET PHP=1
29+
- SET ANSICON=121x90 (121x90)
30+
31+
## Install PHP and composer, and run the appropriate composer command
32+
install:
33+
- IF EXIST c:\tools\php (SET PHP=0)
34+
- IF %PHP%==1 appveyor-retry cinst -y OpenSSL.Light
35+
- IF %PHP%==1 appveyor-retry cinst -y php --version %php_ver%
36+
- cd c:\tools\php
37+
- IF %PHP%==1 copy php.ini-production php.ini /Y
38+
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
39+
- IF %PHP%==1 echo extension_dir=ext >> php.ini
40+
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
41+
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
42+
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
43+
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
44+
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
45+
- cd c:\projects\php-api-client
46+
- IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress -n
47+
- IF %dependencies%==current appveyor-retry composer install --no-progress
48+
- IF %dependencies%==highest appveyor-retry composer update --no-progress -n
49+
- composer show
50+
51+
## Run the actual test
52+
test_script:
53+
- cd c:\projects\php-api-client
54+
- vendor/bin/phpunit -c phpunit.xml.dist

composer.json

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "api-clients/value-objects",
3+
"license": "MIT",
4+
"authors": [
5+
{
6+
"name": "Cees-Jan Kiewiet",
7+
"email": "[email protected]"
8+
}
9+
],
10+
"require": {
11+
"php": "^7.0"
12+
},
13+
"require-dev": {
14+
"phpunit/phpunit": "^5.2.3",
15+
"squizlabs/php_codesniffer": "^2.6",
16+
"phake/phake": "^2.3"
17+
},
18+
"autoload": {
19+
"psr-4": {
20+
"ApiClients\\Foundation\\ValueObjects\\": "src/"
21+
},
22+
"files": [
23+
"src/functions_include.php"
24+
]
25+
},
26+
"autoload-dev": {
27+
"psr-4": {
28+
"ApiClients\\Tests\\Foundation\\ValueObjects\\": "tests/"
29+
}
30+
}
31+
}

0 commit comments

Comments
 (0)