Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
floriankraemer committed Mar 27, 2024
0 parents commit 31feeb9
Show file tree
Hide file tree
Showing 21 changed files with 3,905 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true

[*.bat]
end_of_line = crlf

[*.yml]
indent_style = space
indent_size = 4
67 changes: 67 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: CI

on: [push, pull_request]

jobs:
testsuite:
name: Unittests
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
php-version: ['8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
tools: pecl
coverage: pcov

- name: Composer install
run: |
if [[ ${{ matrix.prefer-lowest == '8.1' }} ]]; then
composer update --prefer-lowest --prefer-stable
else
composer install
fi
- name: Run PHPUnit
run: |
if [[ ${{ matrix.php-version }} == '8.3' ]]; then
bin/phpunit --coverage-clover=coverage.xml
else
bin/phpunit
fi
- name: Code Coverage Report
if: success() && matrix.php-version == '8.3'
uses: codecov/codecov-action@v4

validation:
name: Coding Standard & Static Analysis
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
coverage: none
tools: pecl

- name: Composer install
run: composer update --prefer-stable

- name: Run phpcs
run: bin/phpcs --version && bin/phpcs --report=checkstyle --standard=phpcs.xml src/ tests/

- name: Run phpstan
run: bin/phpstan -V && bin/phpstan analyse -c phpstan.neon --error-format=github
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/vendor/
/tools/
/bin/
composer.lock
4 changes: 4 additions & 0 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="grumphp" version="^2.5.0" installed="2.5.0" location="./tools/grumphp" copy="false"/>
</phive>
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testGetSubscribedEvents":7,"Phauthentic\\CorrelationIdBundle\\TestsEventSubscriber\\CorrelationIdSubscriberTest::testGetSubscribedEvents":8,"Phauthentic\\CorrelationIdBundle\\TestsEventSubscriber\\CorrelationIdSubscriberTest::testOnKernelRequest":8,"Phauthentic\\CorrelationIdBundle\\TestsEventSubscriber\\CorrelationIdSubscriberTest::testOnKernelResponse":8},"times":{"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelRequest":0.013,"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelResponse":0.004,"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testGetSubscribedEvents":0.009,"Phauthentic\\CorrelationIdBundle\\TestsEventSubscriber\\CorrelationIdSubscriberTest::testOnKernelRequest":0.014,"Phauthentic\\CorrelationIdBundle\\TestsEventSubscriber\\CorrelationIdSubscriberTest::testOnKernelResponse":0.004,"Phauthentic\\CorrelationIdBundle\\TestsEventSubscriber\\CorrelationIdSubscriberTest::testGetSubscribedEvents":0.004}}
1 change: 1 addition & 0 deletions .phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":1,"defects":{"Tests\\Phauthentic\\CorrelationIdBundle\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelRequest":4,"Tests\\Phauthentic\\CorrelationIdBundle\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelResponse":4,"Tests\\Phauthentic\\CorrelationIdBundle\\EventSubscriber\\CorrelationIdSubscriberTest::testGetSubscribedEvents":4,"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelRequest":4,"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelResponse":4,"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testGetSubscribedEvents":4},"times":{"Tests\\Phauthentic\\CorrelationIdBundle\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelRequest":0.046,"Tests\\Phauthentic\\CorrelationIdBundle\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelResponse":0.009,"Tests\\Phauthentic\\CorrelationIdBundle\\EventSubscriber\\CorrelationIdSubscriberTest::testGetSubscribedEvents":0.002,"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelRequest":0.013,"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testOnKernelResponse":0.004,"Phauthentic\\CorrelationIdBundle\\Tests\\EventSubscriber\\CorrelationIdSubscriberTest::testGetSubscribedEvents":0.005}}
26 changes: 26 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
build:
image: default-bionic
nodes:
analysis:
environment:
php:
version: 8.3.3
project_setup:
override:
- 'true'
tests:
override:
- php-scrutinizer-run
php83:
environment:
php:
version: 8.3.3
filter:
excluded_paths:
- 'tests/*'
checks:
php: true
coding_style:
php: { }
tools:
php_code_coverage: true
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2024] [Florian Krämer]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Correlation ID Symfony Bundle

![PHP >= 8.1](https://img.shields.io/static/v1?label=PHP&message=^8.1&color=787CB5&style=for-the-badge&logo=php)
![phpstan Level 8](https://img.shields.io/static/v1?label=phpstan&message=Level%208&color=%3CCOLOR%3E&style=for-the-badge)
![License: MIT](https://img.shields.io/static/v1?label=License&message=MIT&color=%3CCOLOR%3E&style=for-the-badge)
[![Code Quality](https://img.shields.io/scrutinizer/g/Phauthentic/correlation-id-symfony-bundle/master.svg?style=for-the-badge)](https://scrutinizer-ci.com/g/Phauthentic/correlation-id-symfony-bundle/)
<!--[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/Phauthentic/correlation-id-symfony-bundle/master.svg?style=for-the-badge)](https://scrutinizer-ci.com/g/Phauthentic/correlation-id-symfony-bundle/)-->


This is a Symfony bridge for the framework agnostic [Correlation ID library](https://github.com/Phauthentic/correlation-id).

> A Correlation ID, also known as a Transit ID, is a unique identifier value that is attached to requests and messages that allow reference to a particular transaction or event chain. The Correlation Pattern, which depends on the use of Correlation ID is a well documented Enterprise Integration Pattern.
* [The value of a correlation ID](https://blog.rapid7.com/2016/12/23/the-value-of-correlation-ids/)
* [Identity Correlation on Wikipedia](https://en.wikipedia.org/wiki/Identity_correlation)

## Copyright & License

Licensed under the [MIT license](LICENSE).

Copyright (c) [Phauthentic](https://github.com/Phauthentic) / Florian Krämer
38 changes: 38 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "phauthentic/correlation-id-symfony-bundle",
"type": "library",
"require": {
"phauthentic/correlation-id": "^2.0",
"symfony/http-kernel": "^6.0||^7.0"
},
"require-dev": {
"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^10.5.15",
"squizlabs/php_codesniffer": "^3.9",
"symfony/config": "^6.0||^7.0",
"symfony/dependency-injection": "^6.0||^7.0",
"symfony/phpunit-bridge": "^6.0||^7.0"
},
"license": "MIT",
"autoload": {
"psr-4": {
"Phauthentic\\CorrelationIdBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Phauthentic\\CorrelationIdBundle\\Tests\\": "tests/"
}
},
"config": {
"sort-packages": true,
"optimize-autoloader": true,
"bin-dir": "bin"
},
"scripts": {
"cs": "phpcs",
"cs-fix": "phpcbf",
"test": "phpunit --coverage-tex",
"stan": "phpstan"
}
}
Loading

0 comments on commit 31feeb9

Please sign in to comment.