Skip to content

Commit e42cfcb

Browse files
committed
publish new component
0 parents  commit e42cfcb

20 files changed

+5829
-0
lines changed

.github/CONTRIBUTING.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
## Contributing
2+
Contributions are welcome. We accept pull requests on [GitHub](https://github.com/php-service-bus/service-bus/issues).
3+
4+
## Workflow
5+
If you have an idea for a new feature, it's a good idea to check out our [issues](https://github.com/php-service-bus/service-bus/issues) or active [pull requests](https://github.com/php-service-bus/service-bus/pulls) first to see if the feature is already being worked on. If not, feel free to submit an issue first, asking whether the feature is beneficial to the project. This will save you from doing a lot of development work only to have your feature rejected. We don't enjoy rejecting your hard work, but some features just don't fit with the goals of the project.
6+
7+
When you do begin working on your feature, here are some guidelines to consider:
8+
* Your pull request description should clearly detail the changes you have made.
9+
* Please write tests for any new features you add.
10+
* Please ensure that tests pass before submitting your pull request.
11+
* Use topic/feature branches. Please do not ask us to pull from your master branch.
12+
* Submit one feature per pull request. If you have multiple features you wish to submit, please break them up into separate pull requests.
13+
* Send coherent history. Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
14+
15+
## Coding Guidelines
16+
This project comes with a configuration file and an executable for php-cs-fixer (.php_cs.dist) that you can use to (re)format your source code for compliance with this project's coding guidelines:
17+
```bash
18+
composer cs-fix
19+
```
20+
For a simple check of the code standard, there is a command:
21+
```bash
22+
composer cs-check
23+
```
24+
## Static analysis
25+
To improve the quality of the code used static analysis (via `psalm` and `phpstan`). You can start it with the command:
26+
```bash
27+
composer psalm && composer phpstan
28+
```
29+
## Running the tests
30+
The following tests must pass before we will accept a pull request. If any of these do not pass, it will result in a complete build failure.
31+
```bash
32+
composer tests
33+
```
34+
### Communication Channels
35+
You can find help and discussion in the following places:
36+
* [Telegram chat (RU)](https://t.me/php_service_bus)
37+
* [Twitter](https://twitter.com/PhpBus)
38+
* Create issue [https://github.com/php-service-bus/service-bus/issues](https://github.com/php-service-bus/service-bus/issues)
39+
40+
## Security
41+
If you discover any security related issues, please email [`contacts@desperado.dev`](mailto:contacts@desperado.dev) instead of using the issue tracker.
42+
43+
## Reporting issues
44+
* [General problems](https://github.com/php-service-bus/service-bus/issues)
45+
* [Documentation](https://github.com/php-service-bus/service-bus/issues)
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: "Continuous Integration"
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
code-style:
7+
name: Code style
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@v2
12+
13+
- name: Install PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: 8.1
17+
coverage: none
18+
tools: composer:v2
19+
20+
- name: Install dependencies with composer
21+
run: composer update --no-ansi --no-interaction --no-progress
22+
23+
- name: Run php-cs-fixer
24+
run: PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run --using-cache=no --verbose
25+
26+
psalm:
27+
name: Psalm
28+
runs-on: ubuntu-latest
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v2
32+
33+
- name: Install PHP
34+
uses: shivammathur/setup-php@v2
35+
with:
36+
php-version: 8.1
37+
coverage: none
38+
tools: composer:v2
39+
40+
- name: Install dependencies with composer
41+
run: composer update --no-ansi --no-interaction --no-progress
42+
43+
- name: Run vimeo/psalm
44+
run: rm -rf ~/.cache/psalm/ && ./vendor/bin/psalm --config=psalm.xml --shepherd
45+
46+
phpstan:
47+
name: PHPStan
48+
runs-on: ubuntu-latest
49+
steps:
50+
- name: Checkout
51+
uses: actions/checkout@v2
52+
53+
- name: Install PHP
54+
uses: shivammathur/setup-php@v2
55+
with:
56+
php-version: 8.1
57+
coverage: none
58+
tools: composer:v2
59+
60+
- name: Install dependencies with composer
61+
run: composer update --no-ansi --no-interaction --no-progress
62+
63+
- name: Run phpstan/phpstan
64+
run: ./vendor/bin/phpstan analyse src --level 9
65+
66+
phpunit:
67+
name: PHPUnit
68+
69+
runs-on: ubuntu-latest
70+
71+
env:
72+
PHP_EXTENSIONS: dom, json, mbstring, curl, tokenizer
73+
PHP_INI_VALUES: assert.exception=1, zend.assertions=1
74+
75+
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v2
78+
79+
- name: Override PHP ini values for JIT compiler
80+
run: echo "PHP_INI_VALUES::assert.exception=1, zend.assertions=1, opcache.enable=1, opcache.enable_cli=1, opcache.optimization_level=-1, opcache.jit=1255, opcache.jit_buffer_size=32M" >> $GITHUB_ENV
81+
82+
- name: Install PHP with extensions
83+
uses: shivammathur/setup-php@v2
84+
with:
85+
php-version: 8.1
86+
extensions: ${{ env.PHP_EXTENSIONS }}
87+
ini-values: ${{ env.PHP_INI_VALUES }}
88+
tools: composer:v2
89+
90+
- name: Install dependencies
91+
run: composer update --no-ansi --no-interaction --no-progress
92+
93+
- name: Run tests with phpunit
94+
run: XDEBUG_MODE=coverage php ./vendor/bin/phpunit --configuration ./phpunit.xml --coverage-clover=coverage.xml
95+
96+
- name: Send code coverage report to Codecov.io
97+
uses: codecov/codecov-action@v1
98+
with:
99+
token: ${{ secrets.CODECOV_TOKEN }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/vendor
2+
/bin
3+
/coverage

.php-cs-fixer.dist.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?php
2+
3+
$config = new ServiceBus\CodeStyle\Config();
4+
$config->getFinder()
5+
->in(__DIR__ . '/src')
6+
->in(__DIR__ . '/tests');
7+
8+
$cacheDir = '' !== (string) \getenv('TRAVIS') ? (string) \getenv('HOME') . '/.php-cs-fixer' : __DIR__;
9+
$config->setCacheFile($cacheDir . '/.php_cs.cache');
10+
11+
return $config;

.php_cs.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"php":"8.1.0","version":"3.3.2:v3.3.2#06bdbdfcd619183dd7a1a6948360f8af73b9ecec","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_closure":true,"position_after_control_structures":"next","position_after_anonymous_constructs":"next","position_after_functions_and_oop_constructs":"next"},"class_definition":{"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"hashes":{"src\/MessageArgumentResolver.php":2093971006,"src\/ChainArgumentResolver.php":1148690007,"src\/ArgumentResolverModule.php":2882907424,"src\/ArgumentResolver.php":2743739041,"src\/ContainerArgumentResolver.php":2222636704,"src\/ContextArgumentResolver.php":2878217494,"tests\/ArgumentResolverModuleTest.php":428198566}}

.phpunit.result.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"defects":[],"times":{"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::datetimeInstantiator with data set #0":0.002,"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::datetimeInstantiator with data set #1":0,"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::datetimeInstantiator with data set #2":0,"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::datetimeInstantiator with data set #3":0,"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::datetimeToString with data set #0":0,"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::datetimeToString with data set #1":0,"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::datetimeToString with data set #2":0,"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::now":0,"ServiceBus\\Common\\Tests\\DateTimeFunctionsTest::withMicroseconds":0,"ServiceBus\\Common\\Tests\\FileFunctionsTest::searchFiles":0,"ServiceBus\\Common\\Tests\\FileFunctionsTest::extractNamespaceFromFile":0,"ServiceBus\\Common\\Tests\\FileFunctionsTest::extractFromNonexistentFile":0,"ServiceBus\\Common\\Tests\\JsonWrapperTest::decodeEmptyString":0,"ServiceBus\\Common\\Tests\\JsonWrapperTest::decodeWrongString":0,"ServiceBus\\Common\\Tests\\JsonWrapperTest::encodeEmptyArray":0,"ServiceBus\\Common\\Tests\\JsonWrapperTest::preserveZeroFractionWhenEncodeFloat":0,"ServiceBus\\Common\\Tests\\JsonWrapperTest::encodeWithWrongCharset":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::withoutReturnDeclaration":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::voidReturnDeclaration":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::noneReturnDeclaration":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::promiseReturnDeclaration":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::generatorReturnDeclaration":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::scalarReturnDeclaration":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::objectArgument":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::argumentWithoutTypeDeclaration":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::unionReturnTypeDeclaration":0,"ServiceBus\\Common\\Tests\\MessageHandler\\MessageHandlerTest::argumentWitUnionTypeDeclaration":0,"ServiceBus\\Common\\Tests\\OtherFunctionsTest::uuid":0.001,"ServiceBus\\Common\\Tests\\OtherFunctionsTest::isUUID":0,"ServiceBus\\Common\\Tests\\OtherFunctionsTest::formatBytes with data set #0":0,"ServiceBus\\Common\\Tests\\OtherFunctionsTest::formatBytes with data set #1":0,"ServiceBus\\Common\\Tests\\OtherFunctionsTest::formatBytes with data set #2":0,"ServiceBus\\Common\\Tests\\OtherFunctionsTest::collectThrowableDetails":0,"ServiceBus\\Common\\Tests\\OtherFunctionsTest::collectThrowableDetailsWithPrevious":0,"ServiceBus\\Common\\Tests\\OtherFunctionsTest::throwableMessage":0,"ServiceBus\\Common\\Tests\\ReflectionFunctionsTest::readPublicProperty":0,"ServiceBus\\Common\\Tests\\ReflectionFunctionsTest::readUnknownProperty":0,"ServiceBus\\Common\\Tests\\ReflectionFunctionsTest::readAllProperties":0,"ServiceBus\\Common\\Tests\\ReflectionFunctionsTest::invokeReflectionMethod":0,"ServiceBus\\Common\\Tests\\ReflectionFunctionsTest::invokeUnknownReflectionMethod":0,"ServiceBus\\Common\\Tests\\ReflectionFunctionsTest::createWithoutConstructor":0,"ServiceBus\\Common\\Tests\\ReflectionFunctionsTest::createWithUnknownClass":0,"ServiceBus\\Common\\Tests\\ReflectionFunctionsTest::writeReflectionPropertyValue":0}}

LICENSE.md

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

README.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
## What is it?
2+
3+
[![Packagist](https://img.shields.io/packagist/v/php-service-bus/argument-resolver.svg)](https://packagist.org/packages/php-service-bus/argument-resolver)
4+
[![Packagist](https://img.shields.io/packagist/dt/php-service-bus/argument-resolver.svg)](https://packagist.org/packages/php-service-bus/argument-resolver)
5+
![Continuous Integration](https://github.com/php-service-bus/argument-resolver/workflows/Continuous%20Integration/badge.svg)
6+
[![codecov](https://codecov.io/gh/php-service-bus/argument-resolver/branch/v5.1/graph/badge.svg?token=0bKwdiuo0S)](https://codecov.io/gh/php-service-bus/argument-resolver)
7+
[![Shepherd](https://shepherd.dev/github/php-service-bus/argument-resolver/coverage.svg)](https://shepherd.dev/github/php-service-bus/argument-resolver)
8+
9+
This component is part of the [PHP Service Bus](https://github.com/php-service-bus/service-bus): contains argument resolvers for Service Bus.
10+
11+
## Contributing
12+
Contributions are welcome! Please read [CONTRIBUTING](.github/CONTRIBUTING.md) for details.
13+
14+
### Communication Channels
15+
You can find help and discussion in the following places:
16+
* [Telegram chat (RU)](https://t.me/php_service_bus)
17+
* [Twitter](https://twitter.com/PhpBus)
18+
* Create issue [https://github.com/php-service-bus/service-bus/issues](https://github.com/php-service-bus/service-bus/issues)
19+
20+
## License
21+
22+
The MIT License (MIT). Please see [LICENSE](LICENSE.md) for more information.

composer.json

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "php-service-bus/argument-resolver",
3+
"description": "PHP Service Bus Argument resolver component",
4+
"type": "library",
5+
"keywords": [
6+
"async-php",
7+
"command-bus",
8+
"messaging"
9+
],
10+
"authors": [
11+
{
12+
"name": "Masiukevich Maksim",
13+
"email": "contacts@desperado.dev",
14+
"homepage": "https://github.com/mmasiukevich",
15+
"role": "Maintainer"
16+
}
17+
],
18+
"license": "MIT",
19+
"autoload": {
20+
"psr-4": {
21+
"ServiceBus\\ArgumentResolver\\": "src/"
22+
}
23+
},
24+
"autoload-dev": {
25+
"psr-4": {
26+
"ServiceBus\\ArgumentResolver\\Tests\\": "tests/"
27+
}
28+
},
29+
"require": {
30+
"php": ">=8.1",
31+
"php-service-bus/common": "v5.1.*"
32+
},
33+
"require-dev": {
34+
"ext-iconv": "*",
35+
"php-service-bus/code-style-config": "v5.1.*",
36+
"symfony/dependency-injection": "v5.4.*",
37+
"phpunit/phpunit": "v9.5.*",
38+
"vimeo/psalm": "v4.13.*",
39+
"phpstan/phpstan": "v1.2.*",
40+
"boesing/psalm-plugin-stringf": "v1.1.*"
41+
},
42+
"prefer-stable": true,
43+
"minimum-stability": "stable",
44+
"scripts": {
45+
"psalm": "rm -rf ~/.cache/psalm/ && ./vendor/bin/psalm --config=psalm.xml",
46+
"phpstan": "./vendor/bin/phpstan analyse src --level 9",
47+
"tests": "./vendor/bin/phpunit --configuration phpunit.xml --verbose --debug",
48+
"coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --configuration phpunit.xml --coverage-html ./coverage --verbose --debug",
49+
"cs-check": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes --dry-run",
50+
"cs-fix": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes",
51+
"pre-commit": "PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --allow-risky=yes && ./vendor/bin/psalm --config=psalm.xml && ./vendor/bin/phpstan analyse src --level 9 && ./vendor/bin/phpunit --configuration phpunit.xml --verbose"
52+
},
53+
"config": {
54+
"optimize-autoloader": true
55+
}
56+
}

0 commit comments

Comments
 (0)