Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: Update CS #678

Merged
merged 3 commits into from Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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