Skip to content

Commit aa15485

Browse files
committed
Initial code commit
1 parent ca1e1a8 commit aa15485

20 files changed

+6945
-0
lines changed

.dependabot/config.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 1
2+
update_configs:
3+
- package_manager: "php:composer"
4+
directory: "/"
5+
update_schedule: "live"
6+
default_labels:
7+
- "Dependencies 📦"
8+
- "PHP 🐘"
9+
version_requirement_updates: "widen_ranges"
10+
automerged_updates:
11+
- match:
12+
dependency_type: "all"
13+
update_type: "semver:minor"

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.travis.yml export-ignore
2+
.gitignore export-ignore
3+
.gitattributes export-ignore
4+
.scrutinizer.yml export-ignore
5+
phpunit.xml.dist export-ignore
6+
Makefile export-ignore

.github/FUNDING.yml

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

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Continuous Integration
2+
on:
3+
push:
4+
pull_request:
5+
jobs:
6+
composer-install:
7+
strategy:
8+
matrix:
9+
php: [7.4]
10+
composer: [lowest, current, highest]
11+
runs-on: ubuntu-latest
12+
container:
13+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.10-dev-root
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Cache composer packages
17+
uses: actions/cache@v1
18+
with:
19+
path: ./vendor/
20+
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
21+
- name: Install Dependencies
22+
run: composer update --prefer-lowest --no-progress --ansi --no-interaction --prefer-dist
23+
if: matrix.composer == 'lowest'
24+
- name: Install Dependencies
25+
run: composer install --ansi --no-progress --no-interaction --prefer-dist
26+
if: matrix.composer == 'current'
27+
- name: Install Dependencies
28+
run: composer update --ansi --no-progress --no-interaction --prefer-dist
29+
if: matrix.composer == 'highest'
30+
qa:
31+
strategy:
32+
matrix:
33+
php: [7.4]
34+
composer: [lowest, current, highest]
35+
qa: [lint, cs, stan, psalm, unit-ci, infection, composer-require-checker, composer-unused]
36+
needs: composer-install
37+
runs-on: ubuntu-latest
38+
container:
39+
image: wyrihaximusnet/php:${{ matrix.php }}-zts-alpine3.10-dev-root
40+
steps:
41+
- uses: actions/checkout@v1
42+
- name: Cache composer packages
43+
uses: actions/cache@v1
44+
with:
45+
path: ./vendor/
46+
key: ${{ matrix.composer }}-${{ matrix.php }}-${{ hashFiles('**/composer.lock') }}
47+
- run: make ${{ matrix.qa }}

.gitignore

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

.php_cs

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

.phpcs.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"config":{"phpVersion":70406,"tabWidth":4,"encoding":"utf-8","recordErrors":true,"annotations":true,"configData":{"installed_paths":"..\/..\/slevomat\/coding-standard,..\/..\/wyrihaximus\/coding-standard\/src,..\/..\/doctrine\/coding-standard\/lib"},"codeHash":"965e46655295cb0b6e4da9a0b6ae4b50","rulesetHash":"6437dc4eda23e7c26f5f667da4f4ba90"},"\/home\/wyrihaximus\/Projects\/ReactPHPParallel\/streams\/src\/SingleRecv.php":{"hash":"7ccd997df158bcc969d1e64f11b745d633204","errors":{"15":{"27":[{"message":"Private member variable \"loop\" must contain a leading underscore","source":"Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore","listener":"PHP_CodeSniffer\\Standards\\Squiz\\Sniffs\\NamingConventions\\ValidVariableNameSniff","severity":0,"fixable":false}]},"17":{"20":[{"message":"Private member variable \"events\" must contain a leading underscore","source":"Squiz.NamingConventions.ValidVariableName.PrivateNoUnderscore","listener":"PHP_CodeSniffer\\Standards\\Squiz\\Sniffs\\NamingConventions\\ValidVariableNameSniff","severity":0,"fixable":false}]},"19":{"12":[{"message":"Missing doc comment for function __construct()","source":"Squiz.Commenting.FunctionComment.Missing","listener":"PHP_CodeSniffer\\Standards\\Squiz\\Sniffs\\Commenting\\FunctionCommentSniff","severity":0,"fixable":false}]},"25":{"12":[{"message":"Missing doc comment for function recv()","source":"Squiz.Commenting.FunctionComment.Missing","listener":"PHP_CodeSniffer\\Standards\\Squiz\\Sniffs\\Commenting\\FunctionCommentSniff","severity":0,"fixable":false}]}},"warnings":[],"metrics":{"Number of newlines at EOF":{"values":{"1":1}},"PHP closing tag at end of PHP-only file":{"values":{"no":1}},"Declarations and side effects mixed":{"values":{"no":1}},"PHP short open tag used":{"values":{"no":1}},"EOL char":{"values":{"\\n":1}},"Line length":{"values":{"80 or less":43,"81-120":3}},"Line indent":{"values":{"spaces":34}},"PHP keyword case":{"values":{"lower":37}},"Multiple statements on same line":{"values":{"no":22}},"Class opening brace placement":{"values":{"new line":1}},"One class per file":{"values":{"yes":1}},"Class defined in namespace":{"values":{"yes":1}},"PascalCase class name":{"values":{"yes":1}},"Function opening brace placement":{"values":{"new line":2}},"Function has doc comment":{"values":{"no":2}},"Function spacing after":{"values":{"1":1}},"Function spacing before":{"values":{"1":1}},"Spacing before object operator":{"values":[14]},"Spacing after object operator":{"values":[14]},"Adjacent assignments aligned":{"values":{"yes":1}},"CamelCase method name":{"values":{"yes":1}},"Function spacing after last":{"values":[1]},"Closure opening brace placement":{"values":{"same line":2}},"PHP type case":{"values":{"lower":2}},"Inline comment style":{"values":{"\/\/ ...":1}},"Blank lines at start of control structure":{"values":[7]},"Blank lines at end of control structure":{"values":[7]},"Spaces after control structure open parenthesis":{"values":[6]},"Spaces before control structure close parenthesis":{"values":[6]},"Control structure defined inline":{"values":{"no":4}},"Short array syntax used":{"values":{"yes":1}},"Array end comma":{"values":{"no":1}},"PHP constant case":{"values":{"lower":1}}},"errorCount":4,"warningCount":0,"fixableCount":0,"numTokens":422}}

.phpunit.result.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:37:"PHPUnit\Runner\DefaultTestResultCache":334:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:4:{s:55:"ReactParallel\Tests\Runtime\RuntimeTest::convertSuccess";d:3.039;s:55:"ReactParallel\Tests\Runtime\RuntimeTest::convertFailure";d:3.029;s:58:"ReactParallel\Tests\Runtime\RuntimeTest::weClosedTheThread";d:1.004;s:58:"ReactParallel\Tests\Runtime\RuntimeTest::weKilledTheThread";d:1.005;}}}

.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: [tests/* examples/*]
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

Makefile

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# set all to phony
2+
SHELL=bash
3+
4+
.PHONY: *
5+
6+
ifneq ("$(wildcard /.dockerenv)","")
7+
DOCKER_RUN=
8+
else
9+
DOCKER_RUN=docker run --rm -it \
10+
-v `pwd`:`pwd` \
11+
-w `pwd` \
12+
"wyrihaximusnet/php:7.4-zts-alpine3.11-dev"
13+
endif
14+
15+
all: lint cs-fix cs stan psalm unit infection composer-require-checker composer-unused
16+
17+
lint:
18+
$(DOCKER_RUN) vendor/bin/parallel-lint --exclude vendor .
19+
20+
cs:
21+
$(DOCKER_RUN) vendor/bin/phpcs --parallel=$(nproc)
22+
23+
cs-fix:
24+
$(DOCKER_RUN) vendor/bin/phpcbf --parallel=$(nproc)
25+
26+
stan:
27+
$(DOCKER_RUN) vendor/bin/phpstan analyse src tests --level max --ansi -c phpstan.neon
28+
29+
psalm:
30+
$(DOCKER_RUN) vendor/bin/psalm --threads=$(nproc) --shepherd --stats
31+
32+
unit:
33+
$(DOCKER_RUN) vendor/bin/phpunit --colors=always -c phpunit.xml.dist --coverage-text --coverage-html covHtml --coverage-clover ./build/logs/clover.xml
34+
35+
unit-ci: unit
36+
if [ -f ./build/logs/clover.xml ]; then wget https://scrutinizer-ci.com/ocular.phar && sleep 3 && php ocular.phar code-coverage:upload --format=php-clover ./build/logs/clover.xml; fi
37+
38+
infection:
39+
$(DOCKER_RUN) vendor/bin/infection --ansi --min-msi=100 --min-covered-msi=100 --threads=$(nproc)
40+
41+
composer-require-checker:
42+
$(DOCKER_RUN) vendor/bin/composer-require-checker --ignore-parse-errors --ansi -vvv --config-file=composer-require-checker.json
43+
44+
composer-unused:
45+
$(DOCKER_RUN) composer unused --ansi

0 commit comments

Comments
 (0)