Skip to content

Commit

Permalink
add sf5 compatibility (#30)
Browse files Browse the repository at this point in the history
Co-authored-by: Perriguey Thomas <[email protected]>
  • Loading branch information
thomasp1992 and Perriguey Thomas authored Jun 12, 2020
1 parent abfa552 commit ac8a259
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 25 deletions.
3 changes: 3 additions & 0 deletions .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ build:
coverage:
file: 'clover-coverage.xml'
format: 'clover'
environment:
php:
version: 7.2 # or any other released version
15 changes: 8 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: php
sudo: false

cache:
directories:
- $HOME/.composer/cache/files
Expand All @@ -10,22 +10,23 @@ env:
- PHPUNIT_FLAGS="-v"
- SYMFONY_PHPUNIT_DIR="$HOME/symfony-bridge/.phpunit"

matrix:
jobs:
fast_finish: true
include:
# Minimum supported dependencies with the latest and oldest PHP version
- php: 7.4
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[self]=0"
- php: 7.2
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
- php: 7.1
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="weak_vendors"
env: COMPOSER_FLAGS="--prefer-stable --prefer-lowest" SYMFONY_DEPRECATIONS_HELPER="max[self]=0"

# Test the latest stable release
- php: 7.1
- php: 7.2
- php: 7.3
- php: 7.4
env: COVERAGE=true PHPUNIT_FLAGS="-v --coverage-text"

# Latest commit to master
- php: 7.2
- php: 7.4
env: STABILITY="dev"

allow_failures:
Expand Down
18 changes: 13 additions & 5 deletions Processors/Monolog/DeamonLoggerExtraWebProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,26 @@ class DeamonLoggerExtraWebProcessor extends BaseWebProcessor
public function __construct(?array $config = null)
{
parent::__construct([]);
$this->channelPrefix = $config['channel_prefix'];
$this->displayConfig = $config['display'];
$this->userClass = $config['user_class'];
$this->userMethods = $config['user_methods'];
if(!empty($config) && array_key_exists('channel_prefix', $config)) {
$this->channelPrefix = $config['channel_prefix'];
}
if(!empty($config) && array_key_exists('display', $config)) {
$this->displayConfig = $config['display'];
}
if(!empty($config) && array_key_exists('user_class', $config)) {
$this->userClass = $config['user_class'];
}
if(!empty($config) && array_key_exists('user_methods', $config)) {
$this->userMethods = $config['user_methods'];
}
}

/**
* @param array $record
*
* @return array
*/
public function __invoke(array $record)
public function __invoke(array $record): array
{
$this->record = parent::__invoke($record);

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ DeamonLoggerExtra Bundle
[![Build Status](https://travis-ci.org/FrDeamon/logger-extra-bundle.svg?branch=master&style=flat)](https://travis-ci.org/FrDeamon/logger-extra-bundle)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/FrDeamon/logger-extra-bundle/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/FrDeamon/logger-extra-bundle/?branch=master)
[![Code Coverage](https://scrutinizer-ci.com/g/FrDeamon/logger-extra-bundle/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/FrDeamon/logger-extra-bundle/?branch=master)
![symfony version](https://img.shields.io/badge/symfony->=4.0-blue.svg)
![php version](https://img.shields.io/badge/php->=7.1-blue.svg)
![symfony version](https://img.shields.io/badge/symfony->=5.0-blue.svg)
![php version](https://img.shields.io/badge/php->=7.2-blue.svg)


[![SensioLabsInsight](https://insight.sensiolabs.com/projects/5a913c84-a190-40f7-9e46-3c2052692fcd/big.png)](https://insight.sensiolabs.com/projects/5a913c84-a190-40f7-9e46-3c2052692fcd)
Expand All @@ -17,7 +17,7 @@ If you need compatibility with previous Symfony versions, have a look at previou

Requirements
----------------
php >=7.1
php >=7.2

symfony/security-core
symfony/dependency-injection
Expand All @@ -26,15 +26,15 @@ symfony/http-kernel
symfony/http-foundation
symfony/config

Compatible with Symfony starting from 4.0
Compatible with Symfony starting from 5.0

Installation
----------------

You need to add a package to your dependency list :
```
// composer.json
"deamon/logger-extra-bundle": "^4.0"
"deamon/logger-extra-bundle": "^5.0"
```

Then enable the bundle into your kernel
Expand Down
16 changes: 8 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@
],
"require": {
"php": ">=7.1",
"symfony/security-core": "^4.0",
"symfony/dependency-injection": "^4.0",
"symfony/monolog-bridge": "^4.0",
"symfony/http-kernel": "^4.0",
"symfony/http-foundation": "^4.0",
"symfony/config": "^4.0"
"symfony/security-core": "^5.0",
"symfony/dependency-injection": "^5.0",
"symfony/monolog-bridge": "^5.0",
"symfony/http-kernel": "^5.0",
"symfony/http-foundation": "^5.0",
"symfony/config": "^5.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^4.0"
"symfony/phpunit-bridge": "^5.0"
},
"autoload": {
"psr-4": {
Expand All @@ -35,7 +35,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "4.1-dev"
"dev-master": "5.0.x-dev"
}
},
"suggest": {
Expand Down

0 comments on commit ac8a259

Please sign in to comment.