Skip to content

Commit

Permalink
⬆️ Upgrade to PHP CS Fixer 3
Browse files Browse the repository at this point in the history
  • Loading branch information
B-Galati committed Jul 17, 2022
1 parent 24cb5b3 commit 3ac9dd9
Show file tree
Hide file tree
Showing 5 changed files with 198 additions and 236 deletions.
30 changes: 30 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);
$finder = PhpCsFixer\Finder::create()
->in(__DIR__.'/src')
->in(__DIR__.'/tests')
->append([__FILE__])
;

return (new PhpCsFixer\Config())
->setFinder($finder)
->setRiskyAllowed(true)
->setRules([
'@Symfony' => true,
'yoda_style' => false,
'array_syntax' => [
'syntax' => 'short',
],
'general_phpdoc_annotation_remove' => [
'annotations' => ['author'],
],
'no_useless_return' => true,
'phpdoc_to_comment' => false,
'multiline_whitespace_before_semicolons' => [
'strategy' => 'new_line_for_chained_calls',
],
'phpdoc_var_annotation_correct_order' => true,
'void_return' => true,
])
;
70 changes: 0 additions & 70 deletions .php_cs.dist

This file was deleted.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"require-dev": {
"coduo/php-matcher": "^6.0.8",
"friendsofphp/php-cs-fixer": "^2.15",
"friendsofphp/php-cs-fixer": "^3.9",
"jangregor/phpstan-prophecy": "^1.0.0",
"phpstan/phpstan": "^1.8.0",
"phpstan/phpstan-phpunit": "^1.1.1",
Expand Down
6 changes: 4 additions & 2 deletions src/SentryHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
use Sentry\State\Scope;

/**
* Compatibility layer copied and completed from Sentry SDK
* Compatibility layer copied and completed from Sentry SDK.
*
* @see \Sentry\Monolog\CompatibilityProcessingHandlerTrait
*/
if (Logger::API >= 3) { // @phpstan-ignore-line - Comparison operation ">=" between 3 and 3 is always true.
/**
* Logic which is used if monolog >= 3 is installed.
*
* @internal
*/
trait CompatibilityProcessingHandlerTrait
Expand Down Expand Up @@ -93,6 +94,7 @@ private function getBreadcrumbLevelFromLevel(int $level): string
} else { // @phpstan-ignore-line - Else branch is unreachable because previous condition is always true.
/**
* Logic which is used if monolog < 3 is installed.
*
* @internal
*/
trait CompatibilityProcessingHandlerTrait
Expand Down Expand Up @@ -213,7 +215,7 @@ static function ($highest, $record) {

// the other ones are added as a context items
foreach ($records as $record) {
$record = $this->processRecord($record);
$record = $this->processRecord($record);
$record['formatted'] = $this->getFormatter()->format($record);

$this->breadcrumbsBuffer[] = $record;
Expand Down

0 comments on commit 3ac9dd9

Please sign in to comment.