Skip to content

Commit

Permalink
fix some style, clean deprecated code and upgrade scrutinizer and (#31)
Browse files Browse the repository at this point in the history
delete insight because no free tier anymore.
  • Loading branch information
Deamon authored Jun 15, 2020
1 parent ac8a259 commit 849420e
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 27 deletions.
22 changes: 14 additions & 8 deletions .scrutinizer.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,19 @@ filter:
excluded_paths:
- Tests/*
build:
tests:
override:
-
command: 'vendor/bin/simple-phpunit --coverage-clover=clover-coverage.xml'
coverage:
file: 'clover-coverage.xml'
format: 'clover'
environment:
php:
version: 7.2 # or any other released version
version: 7.2
nodes:
analysis:
tests:
override:
- php-scrutinizer-run

tests-and-coverage:
tests:
override:
- command: 'vendor/bin/simple-phpunit --coverage-clover=clover-coverage.xml'
coverage:
file: 'clover-coverage.xml'
format: 'php-clover'
10 changes: 2 additions & 8 deletions DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,8 @@ class Configuration implements ConfigurationInterface
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('deamon_logger_extra');
// Keep compatibility with symfony/config < 4.2
if (!method_exists($treeBuilder, 'getRootNode')) {
$rootNode = $treeBuilder->root('deamon_logger_extra');
} else {
$rootNode = $treeBuilder->getRootNode();
}

$rootNode->children()
$treeBuilder->getRootNode()->children()
->arrayNode('application')->isRequired()
->children()
->scalarNode('name')->defaultNull()->cannotBeEmpty()->end()
Expand All @@ -35,7 +29,7 @@ public function getConfigTreeBuilder(): TreeBuilder
->arrayNode('handlers')->isRequired()
->beforeNormalization()
->ifString()
->then(function ($v) {
->then(function($v) {
return array($v);
})
->end()
Expand Down
10 changes: 5 additions & 5 deletions Processors/Monolog/DeamonLoggerExtraWebProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ class DeamonLoggerExtraWebProcessor extends BaseWebProcessor
public function __construct(?array $config = null)
{
parent::__construct([]);
if(!empty($config) && array_key_exists('channel_prefix', $config)) {
if (!empty($config) && array_key_exists('channel_prefix', $config)) {
$this->channelPrefix = $config['channel_prefix'];
}
if(!empty($config) && array_key_exists('display', $config)) {
if (!empty($config) && array_key_exists('display', $config)) {
$this->displayConfig = $config['display'];
}
if(!empty($config) && array_key_exists('user_class', $config)) {
if (!empty($config) && array_key_exists('user_class', $config)) {
$this->userClass = $config['user_class'];
}
if(!empty($config) && array_key_exists('user_methods', $config)) {
if (!empty($config) && array_key_exists('user_methods', $config)) {
$this->userMethods = $config['user_methods'];
}
}
Expand Down Expand Up @@ -178,7 +178,7 @@ private function isUserInstanceValid(?TokenInterface $token): bool
*/
private function addChannelInfo(): void
{
if(!array_key_exists('global_channel', $this->record['extra'])){
if (!array_key_exists('global_channel', $this->record['extra'])) {
$this->addInfo('global_channel', $this->record['channel']);
}

Expand Down
7 changes: 2 additions & 5 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ DeamonLoggerExtra Bundle
![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)


This project is used to add extra context information in your logs.

If you need compatibility with previous Symfony versions, have a look at previous releases.
Expand All @@ -26,7 +22,8 @@ symfony/http-kernel
symfony/http-foundation
symfony/config

Compatible with Symfony starting from 5.0
Compatible with Symfony starting from 5.0.
Tags follow Symfony versions.

Installation
----------------
Expand Down
2 changes: 1 addition & 1 deletion composer.json
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Log"
],
"require": {
"php": ">=7.1",
"php": ">=7.2",
"symfony/security-core": "^5.0",
"symfony/dependency-injection": "^5.0",
"symfony/monolog-bridge": "^5.0",
Expand Down

0 comments on commit 849420e

Please sign in to comment.