Skip to content

Commit 90fd313

Browse files
cleptricstayallive
andauthored
Bump PHP SDK to 4.0 (#793)
Co-authored-by: Alex Bouma <[email protected]>
1 parent 9624a88 commit 90fd313

6 files changed

+10
-20
lines changed

composer.json

+2-9
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"require": {
2424
"php": "^7.2 | ^8.0",
2525
"illuminate/support": "^6.0 | ^7.0 | ^8.0 | ^9.0 | ^10.0",
26-
"sentry/sentry": "^3.20.1",
27-
"sentry/sdk": "^3.4",
26+
"sentry/sentry": "^4.0",
2827
"symfony/psr-http-message-bridge": "^1.0 | ^2.0",
2928
"nyholm/psr7": "^1.0"
3029
},
@@ -74,11 +73,5 @@
7473
}
7574
},
7675
"prefer-stable": true,
77-
"minimum-stability": "dev",
78-
"config": {
79-
"allow-plugins": {
80-
"kylekatarnls/update-helper": false,
81-
"php-http/discovery": false
82-
}
83-
}
76+
"minimum-stability": "dev"
8477
}

src/Sentry/Laravel/ServiceProvider.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Laravel\Lumen\Application as Lumen;
1313
use RuntimeException;
1414
use Sentry\ClientBuilder;
15-
use Sentry\ClientBuilderInterface;
1615
use Sentry\Event;
1716
use Sentry\EventHint;
1817
use Sentry\Integration as SdkIntegration;
@@ -216,7 +215,7 @@ protected function registerAboutCommandIntegration(): void
216215
*/
217216
protected function configureAndRegisterClient(): void
218217
{
219-
$this->app->bind(ClientBuilderInterface::class, function () {
218+
$this->app->bind(ClientBuilder::class, function () {
220219
$basePath = base_path();
221220
$userConfig = $this->getUserConfig();
222221

@@ -280,8 +279,8 @@ protected function configureAndRegisterClient(): void
280279
});
281280

282281
$this->app->singleton(HubInterface::class, function () {
283-
/** @var \Sentry\ClientBuilderInterface $clientBuilder */
284-
$clientBuilder = $this->app->make(ClientBuilderInterface::class);
282+
/** @var \Sentry\ClientBuilder $clientBuilder */
283+
$clientBuilder = $this->app->make(ClientBuilder::class);
285284

286285
$options = $clientBuilder->getOptions();
287286

test/Sentry/ClientBuilderDecoratorTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
namespace Sentry\Laravel\Tests;
44

5-
use Sentry\ClientBuilderInterface;
5+
use Sentry\ClientBuilder;
66

77
class ClientBuilderDecoratorTest extends TestCase
88
{
99
protected function defineEnvironment($app): void
1010
{
1111
parent::defineEnvironment($app);
1212

13-
$app->extend(ClientBuilderInterface::class, function (ClientBuilderInterface $clientBuilder) {
13+
$app->extend(ClientBuilder::class, function (ClientBuilder $clientBuilder) {
1414
$clientBuilder->getOptions()->setEnvironment('from_service_container');
1515

1616
return $clientBuilder;

test/Sentry/ServiceProviderTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ServiceProviderTest extends TestCase
1212
{
1313
protected function defineEnvironment($app): void
1414
{
15-
$app['config']->set('sentry.dsn', 'https://publickey:secretkey@sentry.dev/123');
15+
$app['config']->set('sentry.dsn', 'https://[email protected]/123');
1616
$app['config']->set('sentry.error_types', E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED);
1717
}
1818

@@ -56,7 +56,6 @@ public function testDsnWasSetFromConfig(): void
5656
$this->assertEquals('https://sentry.dev', $options->getDsn()->getScheme() . '://' . $options->getDsn()->getHost());
5757
$this->assertEquals(123, $options->getDsn()->getProjectId());
5858
$this->assertEquals('publickey', $options->getDsn()->getPublicKey());
59-
$this->assertEquals('secretkey', $options->getDsn()->getSecretKey());
6059
}
6160

6261
/**

test/Sentry/ServiceProviderWithCustomAliasTest.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class ServiceProviderWithCustomAliasTest extends TestCase
1111
{
1212
protected function defineEnvironment($app): void
1313
{
14-
$app['config']->set('custom-sentry.dsn', 'http://publickey:secretkey@sentry.dev/123');
14+
$app['config']->set('custom-sentry.dsn', 'http://[email protected]/123');
1515
$app['config']->set('custom-sentry.error_types', E_ALL ^ E_DEPRECATED ^ E_USER_DEPRECATED);
1616
}
1717

@@ -55,7 +55,6 @@ public function testDsnWasSetFromConfig(): void
5555
$this->assertEquals('http://sentry.dev', $options->getDsn()->getScheme() . '://' . $options->getDsn()->getHost());
5656
$this->assertEquals(123, $options->getDsn()->getProjectId());
5757
$this->assertEquals('publickey', $options->getDsn()->getPublicKey());
58-
$this->assertEquals('secretkey', $options->getDsn()->getSecretKey());
5958
}
6059

6160
/**

test/Sentry/TestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ protected function defineEnvironment($app): void
5858
});
5959

6060
if ($config->get('sentry_test.override_dsn') !== true) {
61-
$config->set('sentry.dsn', 'https://publickey:secretkey@sentry.dev/123');
61+
$config->set('sentry.dsn', 'https://[email protected]/123');
6262
}
6363

6464
foreach ($this->setupConfig as $key => $value) {

0 commit comments

Comments
 (0)