Skip to content

Commit 48ed85d

Browse files
committed
Docblock updates and better test command output
1 parent fcc0de1 commit 48ed85d

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

src/Sentry/Laravel/SentryHandler.php

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ class SentryHandler extends AbstractProcessingHandler
3636
protected $batchFormatter;
3737

3838
/**
39-
* @param Hub $hub
40-
* @param int $level The minimum logging level at which this handler will be triggered
39+
* @param Hub $hub
40+
* @param int $level The minimum logging level at which this handler will be triggered
4141
* @param bool $bubble Whether the messages that are handled can bubble up the stack or not
4242
*/
4343
public function __construct(Hub $hub, $level = Logger::DEBUG, bool $bubble = true)
@@ -95,6 +95,8 @@ function ($highest, $record) {
9595
* Sets the formatter for the logs generated by handleBatch().
9696
*
9797
* @param FormatterInterface $formatter
98+
*
99+
* @return \Sentry\Laravel\SentryHandler
98100
*/
99101
public function setBatchFormatter(FormatterInterface $formatter): self
100102
{
@@ -117,6 +119,10 @@ public function getBatchFormatter(): FormatterInterface
117119

118120
/**
119121
* Translates Monolog log levels to Sentry Severity.
122+
*
123+
* @param int $logLevel
124+
*
125+
* @return \Sentry\Severity
120126
*/
121127
protected function getLogLevel($logLevel)
122128
{
@@ -228,7 +234,10 @@ protected function getDefaultBatchFormatter(): FormatterInterface
228234
}
229235

230236
/**
231-
* @param string $value
237+
* Set the release.
238+
*
239+
* @param string $value
240+
*
232241
* @return self
233242
*/
234243
public function setRelease($value): self
@@ -238,6 +247,13 @@ public function setRelease($value): self
238247
return $this;
239248
}
240249

250+
/**
251+
* Set the current application environment.
252+
*
253+
* @param string $value
254+
*
255+
* @return self
256+
*/
241257
public function setEnvironment($value): self
242258
{
243259
$this->environment = $value;
@@ -246,7 +262,13 @@ public function setEnvironment($value): self
246262
}
247263

248264
/**
265+
* Add a breadcrumb.
266+
*
249267
* @link https://docs.sentry.io/learn/breadcrumbs/
268+
*
269+
* @param \Sentry\Breadcrumb $crumb
270+
*
271+
* @return \Sentry\Laravel\SentryHandler
250272
*/
251273
public function addBreadcrumb(Breadcrumb $crumb): self
252274
{

src/Sentry/Laravel/TestCommand.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ public function handle()
4545
if ($hub->getClient()->getOptions()->getDsn()) {
4646
$this->info('[sentry] Client DSN discovered!');
4747
} else {
48-
$this->warn('[sentry] Could not discover DSN! Check your config or .env file');
48+
$this->error('[sentry] Could not discover DSN!');
49+
$this->error('[sentry] Please check if you DSN is set properly in your config or `.env` as `SENTRY_LARAVEL_DSN`.');
4950

5051
return;
5152
}
@@ -62,7 +63,7 @@ public function handle()
6263

6364
if (!$lastEventId) {
6465
$this->error('[sentry] There was an error sending the test event.');
65-
$this->error('[sentry] Please check if you DSN is set properly in your config or .env as `SENTRY_LARAVEL_DSN`.');
66+
$this->error('[sentry] Please check if you DSN is set properly in your config or `.env` as `SENTRY_LARAVEL_DSN`.');
6667
} else {
6768
$this->info("[sentry] Event sent with ID: {$lastEventId}");
6869
}

0 commit comments

Comments
 (0)