Skip to content

Commit

Permalink
style: Update CS (#678)
Browse files Browse the repository at this point in the history
  • Loading branch information
cleptric committed Nov 22, 2022
1 parent ea1a1f5 commit b1b8b17
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
10 changes: 5 additions & 5 deletions phpstan-baseline.neon
Expand Up @@ -230,6 +230,11 @@ parameters:
count: 1
path: src/Tracing/Doctrine/DBAL/TracingStatementForV3.php

-
message: "#^Parameter \\#4 \\$length of method Doctrine\\\\DBAL\\\\Driver\\\\Statement\\:\\:bindParam\\(\\) expects int\\|null, mixed given\\.$#"
count: 1
path: src/Tracing/Doctrine/DBAL/TracingStatementForV3.php

-
message: "#^Method Sentry\\\\SentryBundle\\\\Tracing\\\\HttpClient\\\\AbstractTraceableHttpClient\\:\\:request\\(\\) has parameter \\$options with no value type specified in iterable type array\\.$#"
count: 1
Expand All @@ -245,11 +250,6 @@ parameters:
count: 1
path: src/Tracing/HttpClient/TraceableHttpClientForV6.php

-
message: "#^Call to an undefined method Symfony\\\\Contracts\\\\HttpClient\\\\ResponseInterface\\:\\:toStream\\(\\)\\.$#"
count: 1
path: src/Tracing/HttpClient/TraceableResponseForV5.php

-
message: "#^Call to an undefined method Symfony\\\\Contracts\\\\HttpClient\\\\ResponseInterface\\:\\:toStream\\(\\)\\.$#"
count: 1
Expand Down
9 changes: 4 additions & 5 deletions src/DependencyInjection/SentryExtension.php
Expand Up @@ -5,7 +5,6 @@
namespace Sentry\SentryBundle\DependencyInjection;

use Doctrine\Bundle\DoctrineBundle\DoctrineBundle;
use LogicException;
use Psr\Log\NullLogger;
use Sentry\Client;
use Sentry\ClientBuilder;
Expand Down Expand Up @@ -204,7 +203,7 @@ private function registerDbalTracingConfiguration(ContainerBuilder $container, a
&& $this->isConfigEnabled($container, $config['dbal']);

if ($isConfigEnabled && !class_exists(DoctrineBundle::class)) {
throw new LogicException('DBAL tracing support cannot be enabled because the doctrine/doctrine-bundle Composer package is not installed.');
throw new \LogicException('DBAL tracing support cannot be enabled because the doctrine/doctrine-bundle Composer package is not installed.');
}

$container->setParameter('sentry.tracing.dbal.enabled', $isConfigEnabled);
Expand All @@ -225,7 +224,7 @@ private function registerTwigTracingConfiguration(ContainerBuilder $container, a
&& $this->isConfigEnabled($container, $config['twig']);

if ($isConfigEnabled && !class_exists(TwigBundle::class)) {
throw new LogicException('Twig tracing support cannot be enabled because the symfony/twig-bundle Composer package is not installed.');
throw new \LogicException('Twig tracing support cannot be enabled because the symfony/twig-bundle Composer package is not installed.');
}

if (!$isConfigEnabled) {
Expand All @@ -242,7 +241,7 @@ private function registerCacheTracingConfiguration(ContainerBuilder $container,
&& $this->isConfigEnabled($container, $config['cache']);

if ($isConfigEnabled && !class_exists(CacheItem::class)) {
throw new LogicException('Cache tracing support cannot be enabled because the symfony/cache Composer package is not installed.');
throw new \LogicException('Cache tracing support cannot be enabled because the symfony/cache Composer package is not installed.');
}

$container->setParameter('sentry.tracing.cache.enabled', $isConfigEnabled);
Expand All @@ -257,7 +256,7 @@ private function registerHttpClientTracingConfiguration(ContainerBuilder $contai
&& $this->isConfigEnabled($container, $config['http_client']);

if ($isConfigEnabled && !class_exists(HttpClient::class)) {
throw new LogicException('Http client tracing support cannot be enabled because the symfony/http-client Composer package is not installed.');
throw new \LogicException('Http client tracing support cannot be enabled because the symfony/http-client Composer package is not installed.');
}

$container->setParameter('sentry.tracing.http_client.enabled', $isConfigEnabled);
Expand Down
5 changes: 2 additions & 3 deletions src/Tracing/Twig/TwigTracingExtension.php
Expand Up @@ -7,7 +7,6 @@
use Sentry\State\HubInterface;
use Sentry\Tracing\Span;
use Sentry\Tracing\SpanContext;
use SplObjectStorage;
use Twig\Extension\AbstractExtension;
use Twig\Profiler\NodeVisitor\ProfilerNodeVisitor;
use Twig\Profiler\Profile;
Expand All @@ -20,7 +19,7 @@ final class TwigTracingExtension extends AbstractExtension
private $hub;

/**
* @var SplObjectStorage<object, Span> The currently active spans
* @var \SplObjectStorage<object, Span> The currently active spans
*/
private $spans;

Expand All @@ -30,7 +29,7 @@ final class TwigTracingExtension extends AbstractExtension
public function __construct(HubInterface $hub)
{
$this->hub = $hub;
$this->spans = new SplObjectStorage();
$this->spans = new \SplObjectStorage();
}

/**
Expand Down
9 changes: 4 additions & 5 deletions tests/EventListener/TracingConsoleListenerTest.php
Expand Up @@ -4,7 +4,6 @@

namespace Sentry\SentryBundle\Tests\EventListener;

use Generator;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;
use Sentry\SentryBundle\EventListener\TracingConsoleListener;
Expand Down Expand Up @@ -65,9 +64,9 @@ public function testHandleConsoleCommandEventStartsTransactionIfNoSpanIsSetOnHub
}

/**
* @return Generator<mixed>
* @return \Generator<mixed>
*/
public function handleConsoleCommandEventStartsTransactionIfNoSpanIsSetOnHubDataProvider(): Generator
public function handleConsoleCommandEventStartsTransactionIfNoSpanIsSetOnHubDataProvider(): \Generator
{
$transactionContext = new TransactionContext();
$transactionContext->setOp('console.command');
Expand Down Expand Up @@ -121,9 +120,9 @@ public function testHandleConsoleCommandEventStartsChildSpanIfSpanIsSetOnHub(Com
}

/**
* @return Generator<mixed>
* @return \Generator<mixed>
*/
public function handleConsoleCommandEventStartsChildSpanIfSpanIsSetOnHubDataProvider(): Generator
public function handleConsoleCommandEventStartsChildSpanIfSpanIsSetOnHubDataProvider(): \Generator
{
yield [
new Command(),
Expand Down

0 comments on commit b1b8b17

Please sign in to comment.