Skip to content

Commit

Permalink
feat: support Symfony 6 (#27)
Browse files Browse the repository at this point in the history
contributors: @MollocH
  • Loading branch information
cawolf authored Mar 26, 2022
1 parent e67287d commit 0d4cd31
Show file tree
Hide file tree
Showing 12 changed files with 434 additions and 373 deletions.
56 changes: 37 additions & 19 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
symfony:
- '3.4.*'
- '4.4.*'
- '5.3.*'
php:
- '7.4'
- '8.0'
- '8.1'
include:
- symfony: '4.4.*'
php: '7.4'
- symfony: '4.4.*'
php: '8.0'
- symfony: '4.4.*'
php: '8.1'
- symfony: '5.4.*'
php: '7.4'
- symfony: '5.4.*'
php: '8.0'
- symfony: '5.4.*'
php: '8.1'
- symfony: '6.0.*'
php: '8.0'
- symfony: '6.0.*'
php: '8.1'
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
Expand All @@ -55,7 +64,7 @@ jobs:
- name: upload coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: php vendor/bin/php-coveralls --coverage_clover=build/logs/clover.xml -v
run: php vendor/bin/php-coveralls --exclude-no-stmt --coverage_clover=build/logs/clover.xml -v

test_functional:
name: Functional Tests
Expand All @@ -64,17 +73,26 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
symfony:
- '3.4.*'
- '4.4.*'
- '5.3.*'
php:
- '7.4'
- '8.0'
- '8.1'
include:
- symfony: '4.4.*'
php: '7.4'
- symfony: '4.4.*'
php: '8.0'
- symfony: '4.4.*'
php: '8.1'
- symfony: '5.4.*'
php: '7.4'
- symfony: '5.4.*'
php: '8.0'
- symfony: '5.4.*'
php: '8.1'
- symfony: '6.0.*'
php: '8.0'
- symfony: '6.0.*'
php: '8.1'
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Setup PHP Action
uses: shivammathur/setup-php@v2
with:
Expand Down
6 changes: 3 additions & 3 deletions Factory/JaegerTracerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@

final class JaegerTracerFactory implements TracerFactory
{
private $jaegerConfigFactory;
private $agentHostResolver;
private $logger;
private JaegerConfigFactory $jaegerConfigFactory;
private AgentHostResolver $agentHostResolver;
private LoggerInterface $logger;

public function __construct(
JaegerConfigFactory $jaegerConfigFactory,
Expand Down
2 changes: 1 addition & 1 deletion Internal/JaegerTracingId.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class JaegerTracingId implements TracingId
{
private $tracing;
private Tracing $tracing;

public function __construct(Tracing $tracing)
{
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# auxmoney OpentracingBundle - Jaeger

[![test](https://github.com/auxmoney/OpentracingBundle-Jaeger/workflows/test/badge.svg)](https://github.com/auxmoney/OpentracingBundle-Jaeger/actions?query=workflow%3Atest)
![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/auxmoney/OpentracingBundle-Jaeger)
[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/auxmoney/OpentracingBundle-Jaeger)](https://github.com/auxmoney/OpentracingBundle-Jaeger/releases/latest)
![Coveralls github](https://img.shields.io/coveralls/github/auxmoney/OpentracingBundle-Jaeger)
![Codacy Badge](https://api.codacy.com/project/badge/Grade/dd11fb9bdbe54affb1946a03af5f432a)
![Code Climate maintainability](https://img.shields.io/codeclimate/maintainability/auxmoney/OpentracingBundle-Jaeger)
Expand Down
2 changes: 1 addition & 1 deletion Tests/DependencyInjection/OpentracingExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

class OpentracingExtensionTest extends TestCase
{
private $subject;
private OpentracingExtension $subject;

public function setUp(): void
{
Expand Down
2 changes: 1 addition & 1 deletion Tests/Factory/JaegerStaticConfigFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class JaegerStaticConfigFactoryTest extends TestCase
{
private $subject;
private JaegerStaticConfigFactory $subject;

public function setUp(): void
{
Expand Down
12 changes: 6 additions & 6 deletions Tests/Factory/JaegerTracerFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ class JaegerTracerFactoryTest extends TestCase
private $agentHostResolver;
private $jaegerConfigFactory;
private $logger;
private $projectName;
private $agentHost;
private $agentPort;
private $subject;
private $samplerClass;
private $samplerValue;
private string $projectName;
private string $agentHost;
private string $agentPort;
private JaegerTracerFactory $subject;
private string $samplerClass;
private string $samplerValue;

public function setUp(): void
{
Expand Down
10 changes: 8 additions & 2 deletions Tests/Functional/Scripts/requireAdditionalVendors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
shopt -s extglob

cd build/testproject/
rm -fr vendor/auxmoney/opentracing-bundle-jaeger/*
cp -r ../../!(build|vendor) vendor/auxmoney/opentracing-bundle-jaeger
VENDOR_VERSION=""
CURRENT_REF=${GITHUB_HEAD_REF:-$GITHUB_REF}
CURRENT_BRANCH=${CURRENT_REF#refs/heads/}
if [[ $CURRENT_BRANCH -ne "master" ]]; then
composer config minimum-stability dev
VENDOR_VERSION=":dev-${CURRENT_BRANCH}"
fi
composer require auxmoney/opentracing-bundle-jaeger${VENDOR_VERSION}
composer dump-autoload
cd ../../
3 changes: 1 addition & 2 deletions Tests/Internal/JaegerTracingIdTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ class JaegerTracingIdTest extends TestCase

/** @var Tracing|ObjectProphecy */
private $tracing;
/** @var JaegerTracingId */
private $subject;
private JaegerTracingId $subject;

public function setUp(): void
{
Expand Down
5 changes: 2 additions & 3 deletions Tests/OpentracingBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ class OpentracingBundleTest extends TestCase
{
use ProphecyTrait;

/** @var OpentracingBundle */
private $subject;
private OpentracingBundle $subject;

public function setUp(): void
{
Expand All @@ -28,7 +27,7 @@ public function setUp(): void
public function testBuild(): void
{
$containerBuilder = $this->prophesize(ContainerBuilder::class);
$containerBuilder->addCompilerPass(Argument::type(PSR18CompilerPass::class))->shouldBeCalled();
$containerBuilder->addCompilerPass(Argument::type(PSR18CompilerPass::class))->shouldBeCalled()->willReturn($containerBuilder->reveal());

$this->subject->build($containerBuilder->reveal());
}
Expand Down
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
"roave/security-advisories": "dev-latest",
"phpunit/phpunit": "^9.5",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^1.1",
"phpstan/phpstan": "^1.4",
"squizlabs/php_codesniffer": "^3.6",
"phpmd/phpmd": "^2.10",
"phpmd/phpmd": "^2.11",
"php-coveralls/php-coveralls": "^2.5",
"symfony/filesystem": "*",
"symfony/process": "*",
Expand Down Expand Up @@ -65,5 +65,10 @@
"vendor/auxmoney/opentracing-bundle-core/Tests/Functional/Scripts/teardown.sh"
],
"phpstan": "vendor/bin/phpstan analyse --no-progress"
},
"config": {
"allow-plugins": {
"composer/package-versions-deprecated": true
}
}
}
Loading

0 comments on commit 0d4cd31

Please sign in to comment.