Skip to content

Commit 760f533

Browse files
committed
change package name from notamedia/sentry to silinternational/sentry
1 parent 24c1be7 commit 760f533

File tree

5 files changed

+33
-33
lines changed

5 files changed

+33
-33
lines changed

README.md

+10-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
# [Sentry](https://sentry.io) logger for Yii2
22

3-
[![Build Status](https://travis-ci.org/notamedia/yii2-sentry.svg)](https://travis-ci.org/notamedia/yii2-sentry)
4-
[![Latest Stable Version](https://poser.pugx.org/notamedia/yii2-sentry/v/stable)](https://packagist.org/packages/notamedia/yii2-sentry)
5-
[![Total Downloads](https://poser.pugx.org/notamedia/yii2-sentry/downloads)](https://packagist.org/packages/notamedia/yii2-sentry)
6-
[![License](https://poser.pugx.org/notamedia/yii2-sentry/license)](https://packagist.org/packages/notamedia/yii2-sentry)
7-
83
## Installation
94

105
```bash
11-
composer require notamedia/yii2-sentry
6+
composer require silinternational/yii2-sentry
127
```
138

149
Add target class in the application config:
@@ -20,7 +15,7 @@ return [
2015
'traceLevel' => YII_DEBUG ? 3 : 0,
2116
'targets' => [
2217
[
23-
'class' => 'notamedia\sentry\SentryTarget',
18+
'class' => 'silinternational\sentry\SentryTarget',
2419
'dsn' => 'http://2682ybvhbs347:[email protected]/1',
2520
'levels' => ['error', 'warning'],
2621
// Write the context information (the default is true):
@@ -54,11 +49,11 @@ Writing messages with extra data:
5449
### Extra callback
5550

5651
`extraCallback` property can modify extra's data as callable function:
57-
52+
5853
```php
5954
'targets' => [
6055
[
61-
'class' => 'notamedia\sentry\SentryTarget',
56+
'class' => 'silinternational\sentry\SentryTarget',
6257
'dsn' => 'http://2682ybvhbs347:[email protected]/1',
6358
'levels' => ['error', 'warning'],
6459
'context' => true, // Write the context information. The default is true.
@@ -73,7 +68,9 @@ Writing messages with extra data:
7368

7469
### Tags
7570

76-
Writing messages with additional tags. If need to add additional tags for event, add `tags` key in message. Tags are various key/value pairs that get assigned to an event, and can later be used as a breakdown or quick access to finding related events.
71+
Writing messages with additional tags. If need to add additional tags for event, add `tags` key in message. Tags are
72+
various key/value pairs that get assigned to an event, and can later be used as a breakdown or quick access to finding
73+
related events.
7774

7875
Example:
7976

@@ -91,8 +88,10 @@ More about tags see https://docs.sentry.io/learn/context/#tagging-events
9188

9289
### Additional context
9390

94-
You can add additional context (such as user information, fingerprint, etc) by calling `\Sentry\configureScope()` before logging.
91+
You can add additional context (such as user information, fingerprint, etc) by calling `\Sentry\configureScope()` before
92+
logging.
9593
For example in main configuration on `beforeAction` event (real place will dependant on your project):
94+
9695
```php
9796
return [
9897
// ...

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "notamedia/yii2-sentry",
2+
"name": "silinternational/yii2-sentry",
33
"description": "Yii2 logger for Sentry",
44
"keywords": [
55
"sentry",
@@ -19,7 +19,7 @@
1919
},
2020
"autoload": {
2121
"psr-4": {
22-
"notamedia\\sentry\\": "src"
22+
"silinternational\\sentry\\": "src"
2323
}
2424
},
2525
"extra": {

src/SentryTarget.php

+7-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* file that was distributed with this source code.
55
*/
66

7-
namespace notamedia\sentry;
7+
namespace silinternational\sentry;
88

99
use Sentry\ClientBuilder;
1010
use Sentry\Event;
@@ -113,7 +113,8 @@ public function export()
113113
if ($user && ($identity = $user->getIdentity(false))) {
114114
$data['userData']['id'] = $identity->getId();
115115
}
116-
} catch (Throwable $e) {}
116+
} catch (Throwable $e) {
117+
}
117118

118119
\Sentry\withScope(function (Scope $scope) use ($text, $level, $data) {
119120
if (is_array($text)) {
@@ -138,7 +139,7 @@ public function export()
138139

139140
$data['extra'] = $text;
140141
} else {
141-
$data['message'] = (string) $text;
142+
$data['message'] = (string)$text;
142143
}
143144

144145
if ($this->context) {
@@ -149,7 +150,7 @@ public function export()
149150

150151
$scope->setUser($data['userData']);
151152
foreach ($data['extra'] as $key => $value) {
152-
$scope->setExtra((string) $key, $value);
153+
$scope->setExtra((string)$key, $value);
153154
}
154155
foreach ($data['tags'] as $key => $value) {
155156
if ($value) {
@@ -192,11 +193,11 @@ public function runExtraCallback($text, $data)
192193
/**
193194
* Returns the text display of the specified level for the Sentry.
194195
*
195-
* @deprecated Deprecated from 1.5, will remove in 2.0
196-
*
197196
* @param int $level The message level, e.g. [[LEVEL_ERROR]], [[LEVEL_WARNING]].
198197
*
199198
* @return string
199+
* @deprecated Deprecated from 1.5, will remove in 2.0
200+
*
200201
*/
201202
public static function getLevelName($level)
202203
{

tests/sentry-fill

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ $application = new \yii\web\Application([
3535
'class' => \yii\log\FileTarget::class,
3636
],
3737
[
38-
'class' => \notamedia\sentry\SentryTarget::class,
38+
'class' => \silinternational\sentry\SentryTarget::class,
3939
'dsn' => $params['sentryDsn'],
4040
],
4141
],

tests/unit/SentryTargetTest.php

+13-13
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
<?php
22

3-
namespace notamedia\sentry\tests\unit;
3+
namespace silinternational\sentry\tests\unit;
44

5+
use Codeception\Test\Unit;
6+
use ReflectionClass;
7+
use RuntimeException;
8+
use Sentry\ClientInterface;
59
use Sentry\Event;
610
use Sentry\EventHint;
711
use Sentry\EventId;
8-
use yii\log\Logger;
9-
use ReflectionClass;
10-
use RuntimeException;
1112
use Sentry\SentrySdk;
1213
use Sentry\State\Scope;
13-
use Codeception\Test\Unit;
14-
use Sentry\ClientInterface;
15-
use notamedia\sentry\SentryTarget;
14+
use silinternational\sentry\SentryTarget;
15+
use yii\log\Logger;
1616

1717
/**
1818
* Unit-tests for SentryTarget
@@ -94,13 +94,13 @@ public function testMessageConverting($expectedMessageText, $loggedMessage)
9494

9595
$client = $this->createMock(ClientInterface::class);
9696
$client->expects($this->once())
97-
->method('captureEvent')
98-
->willReturnCallback(function (Event $event, ?EventHint $hint = null, ?Scope $scope = null) use ($expectedMessageText, &$messageWasSent): ?EventId {
99-
$messageWasSent = true;
100-
$this->assertSame($expectedMessageText, $event->getMessage());
97+
->method('captureEvent')
98+
->willReturnCallback(function (Event $event, ?EventHint $hint = null, ?Scope $scope = null) use ($expectedMessageText, &$messageWasSent): ?EventId {
99+
$messageWasSent = true;
100+
$this->assertSame($expectedMessageText, $event->getMessage());
101101

102-
return EventId::generate();
103-
});
102+
return EventId::generate();
103+
});
104104

105105
SentrySdk::getCurrentHub()->bindClient($client);
106106

0 commit comments

Comments
 (0)