Skip to content

Commit 30a33ee

Browse files
committed
Initial code commit
1 parent cffa933 commit 30a33ee

18 files changed

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

.php_cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php declare(strict_types=1);
2+
3+
use ApiClients\Tools\TestUtilities\PhpCsFixerConfig;
4+
use PhpCsFixer\Config;
5+
6+
return (function (): Config
7+
{
8+
$paths = [
9+
__DIR__ . DIRECTORY_SEPARATOR . 'src',
10+
__DIR__ . DIRECTORY_SEPARATOR . 'tests',
11+
__DIR__ . DIRECTORY_SEPARATOR . 'examples',
12+
];
13+
14+
return PhpCsFixerConfig::create()
15+
->setFinder(
16+
PhpCsFixer\Finder::create()
17+
->in($paths)
18+
->append($paths)
19+
)
20+
->setUsingCache(false)
21+
;
22+
})();

.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

.travis.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
language: php
2+
sudo: false
3+
4+
## Cache composer bits
5+
cache:
6+
directories:
7+
- $HOME/.composer/cache/files
8+
9+
## PHP versions we test against
10+
php:
11+
- 7.0
12+
- 7.1
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: 7.1
21+
env: dependencies=lowest
22+
- php: nightly
23+
env: dependencies=lowest
24+
- php: 7.0
25+
env: dependencies=highest
26+
- php: 7.1
27+
env: dependencies=highest
28+
- php: nightly
29+
env: dependencies=highest
30+
31+
## Install or update dependencies
32+
install:
33+
- if [ -z "$dependencies" ]; then composer install --prefer-dist; fi;
34+
- if [ "$dependencies" = "lowest" ]; then composer update --prefer-lowest --prefer-dist -n; fi;
35+
- if [ "$dependencies" = "highest" ]; then composer update --prefer-dist -n; fi;
36+
- composer show
37+
38+
## Run the actual test
39+
script: make ci
40+
41+
## Gather coverage and set it to coverage servers
42+
after_script: make ci-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/reactphp-child-process-promise-closure.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/

Makefile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
all:
2+
composer run-script qa-all --timeout=0
3+
4+
all-coverage:
5+
composer run-script qa-all-coverage --timeout=0
6+
7+
ci:
8+
composer run-script qa-ci --timeout=0
9+
10+
ci-extended:
11+
composer run-script qa-ci-extended --timeout=0
12+
13+
contrib:
14+
composer run-script qa-contrib --timeout=0
15+
16+
init:
17+
composer ensure-installed
18+
19+
cs:
20+
composer cs
21+
22+
cs-fix:
23+
composer cs-fix
24+
25+
unit:
26+
composer run-script unit --timeout=0
27+
28+
unit-coverage:
29+
composer run-script unit-coverage --timeout=0
30+
31+
ci-coverage: init
32+
composer ci-coverage

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# ReactPHP Child Process Promise Closure child class
2+
3+
[![Linux Build Status](https://travis-ci.org/WyriHaximus/reactphp-child-process-promise-closure.png)](https://travis-ci.org/WyriHaximus/reactphp-child-process-promise-closure)
4+
[![Latest Stable Version](https://poser.pugx.org/WyriHaximus/react-child-process-promise-closure/v/stable.png)](https://packagist.org/packages/WyriHaximus/react-child-process-promise-closure)
5+
[![Total Downloads](https://poser.pugx.org/WyriHaximus/react-child-process-promise-closure/downloads.png)](https://packagist.org/packages/WyriHaximus/react-child-process-promise-closure)
6+
[![Code Coverage](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-child-process-promise-closure/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-child-process-promise-closure/?branch=master)
7+
[![License](https://poser.pugx.org/WyriHaximus/react-child-process-promise-closure/license.png)](https://packagist.org/packages/wyrihaximus/react-child-process-promise-closure)
8+
[![PHP 7 ready](http://php7ready.timesplinter.ch/WyriHaximus/reactphp-child-process-promise-closure/badge.svg)](https://travis-ci.org/WyriHaximus/reactphp-child-process-promise-closure)
9+
10+
Runs a closure in a child process and return the result over a promise
11+
12+
### Installation ###
13+
14+
To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `~`.
15+
16+
```
17+
composer require wyrihaximus/react-child-process-promise-closure
18+
```
19+
20+
## Examples ##
21+
22+
For examples see the [examples](https://github.com/WyriHaximus/reactphp-child-process-promise-closure/tree/master/examples) directory
23+
24+
## Contributing ##
25+
26+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
27+
28+
## License ##
29+
30+
Copyright 2017 [Cees-Jan Kiewiet](http://wyrihaximus.net/)
31+
32+
Permission is hereby granted, free of charge, to any person
33+
obtaining a copy of this software and associated documentation
34+
files (the "Software"), to deal in the Software without
35+
restriction, including without limitation the rights to use,
36+
copy, modify, merge, publish, distribute, sublicense, and/or sell
37+
copies of the Software, and to permit persons to whom the
38+
Software is furnished to do so, subject to the following
39+
conditions:
40+
41+
The above copyright notice and this permission notice shall be
42+
included in all copies or substantial portions of the Software.
43+
44+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
45+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
46+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
47+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
48+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
49+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
50+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
51+
OTHER DEALINGS IN THE SOFTWARE.

appveyor.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
build: false
2+
platform:
3+
- x64
4+
clone_folder: c:\projects\php-project-workspace
5+
6+
## Build matrix for lowest and highest possible targets
7+
environment:
8+
matrix:
9+
- dependencies: lowest
10+
php_ver_target: 7.0
11+
- dependencies: lowest
12+
php_ver_target: 7.1
13+
- dependencies: current
14+
php_ver_target: 7.0
15+
- dependencies: current
16+
php_ver_target: 7.1
17+
- dependencies: highest
18+
php_ver_target: 7.0
19+
- dependencies: highest
20+
php_ver_target: 7.1
21+
22+
## Cache composer, chocolatey and php bits
23+
cache:
24+
- '%LOCALAPPDATA%\Composer\files -> composer.lock'
25+
26+
## Set up environment varriables
27+
init:
28+
- SET PATH=C:\Program Files\OpenSSL;c:\tools\php;%PATH%
29+
- SET COMPOSER_NO_INTERACTION=1
30+
- SET PHP=1
31+
- SET ANSICON=121x90 (121x90)
32+
33+
## Install PHP and composer, and run the appropriate composer command
34+
install:
35+
- IF EXIST c:\tools\php (SET PHP=0)
36+
- ps: appveyor-retry cinst --params '""/InstallDir:C:\tools\php""' --ignore-checksums -y php --version ((choco search php --exact --all-versions -r | select-string -pattern $env:php_ver_target | sort { [version]($_ -split '\|' | select -last 1) } -Descending | Select-Object -first 1) -replace '[php|]','')
37+
- cd c:\tools\php
38+
- IF %PHP%==1 copy php.ini-production php.ini /Y
39+
- IF %PHP%==1 echo date.timezone="UTC" >> php.ini
40+
- IF %PHP%==1 echo extension_dir=ext >> php.ini
41+
- IF %PHP%==1 echo extension=php_openssl.dll >> php.ini
42+
- IF %PHP%==1 echo extension=php_mbstring.dll >> php.ini
43+
- IF %PHP%==1 echo extension=php_fileinfo.dll >> php.ini
44+
- IF %PHP%==1 echo @php %%~dp0composer.phar %%* > composer.bat
45+
- appveyor-retry appveyor DownloadFile https://getcomposer.org/composer.phar
46+
- cd c:\projects\php-project-workspace
47+
- composer config --unset platform.php
48+
- IF %dependencies%==lowest appveyor-retry composer update --prefer-lowest --no-progress --profile -n
49+
- IF %dependencies%==current appveyor-retry composer install --no-progress --profile
50+
- IF %dependencies%==highest appveyor-retry composer update --no-progress --profile -n
51+
- composer show
52+
53+
## Run the actual test
54+
test_script:
55+
- cd c:\projects\php-project-workspace
56+
- vendor/bin/phpunit -c phpunit.xml.dist

0 commit comments

Comments
 (0)