Skip to content

Commit 2565e6c

Browse files
committed
Added #[\Override] attribute to methods that override parent methods.
1 parent 9004787 commit 2565e6c

31 files changed

+57
-3
lines changed

src/DataBuilder.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ protected function setServerExtras($config)
303303
*
304304
* @return void
305305
*/
306+
#[\Override]
306307
public function setCustom(array $config): void
307308
{
308309
$this->custom = $config['custom'] ?? \Rollbar\Defaults::get()->custom();
@@ -373,6 +374,7 @@ protected function setHost($config)
373374
*
374375
* @return Data
375376
*/
377+
#[\Override]
376378
public function makeData(string $level, Throwable|string|Stringable $toLog, array $context): Data
377379
{
378380
$env = $this->getEnvironment();
@@ -1013,6 +1015,7 @@ protected function getServerExtras()
10131015
*
10141016
* @return array|null
10151017
*/
1018+
#[\Override]
10161019
public function getCustom(): ?array
10171020
{
10181021
return $this->custom;
@@ -1103,6 +1106,7 @@ protected function resolveCustomContent(mixed $custom): array
11031106
*
11041107
* @return void
11051108
*/
1109+
#[\Override]
11061110
public function addCustom(string $key, mixed $data): void
11071111
{
11081112
if (!is_array($this->custom)) {
@@ -1119,6 +1123,7 @@ public function addCustom(string $key, mixed $data): void
11191123
*
11201124
* @return void
11211125
*/
1126+
#[\Override]
11221127
public function removeCustom(string $key): void
11231128
{
11241129
unset($this->custom[$key]);
@@ -1186,6 +1191,7 @@ private function getSourceLines($filename)
11861191
*
11871192
* @return ErrorWrapper
11881193
*/
1194+
#[\Override]
11891195
public function generateErrorWrapper(int $errno, string $errstr, ?string $errfile, ?int $errline): ErrorWrapper
11901196
{
11911197
return new ErrorWrapper(

src/Handlers/ErrorHandler.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88

99
class ErrorHandler extends AbstractHandler
1010
{
11+
#[\Override]
1112
public function register()
1213
{
1314
$this->previousHandler = set_error_handler(array($this, 'handle'));
1415

1516
parent::register();
1617
}
1718

19+
#[\Override]
1820
public function handle(...$args)
1921
{
2022
parent::handle(...$args);

src/Handlers/ExceptionHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@
88

99
class ExceptionHandler extends AbstractHandler
1010
{
11+
#[\Override]
1112
public function register()
1213
{
1314
$this->previousHandler = set_exception_handler(array($this, 'handle'));
1415

1516
parent::register();
1617
}
17-
18+
19+
#[\Override]
1820
public function handle(...$args)
1921
{
2022
parent::handle(...$args);

src/Handlers/FatalHandler.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,16 @@ class FatalHandler extends AbstractHandler
1515
{
1616

1717
private static $fatalErrors = array(E_ERROR, E_PARSE, E_CORE_ERROR, E_COMPILE_ERROR, E_USER_ERROR);
18-
18+
19+
#[\Override]
1920
public function register()
2021
{
2122
\register_shutdown_function(array($this, 'handle'));
2223

2324
parent::register();
2425
}
25-
26+
27+
#[\Override]
2628
public function handle(...$args)
2729
{
2830
parent::handle(...$args);

src/Payload/Body.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public function setTelemetry(?array $telemetry): void
110110
*
111111
* @since 4.1.0 Includes the 'telemetry' key, if it is not empty.
112112
*/
113+
#[\Override]
113114
public function serialize()
114115
{
115116
$result = array();

src/Payload/Context.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function setPost(array $post): self
3535
return $this;
3636
}
3737

38+
#[\Override]
3839
public function serialize()
3940
{
4041
$result = array(

src/Payload/Data.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ public function setNotifier(Notifier $notifier): self
217217
return $this;
218218
}
219219

220+
#[\Override]
220221
public function serialize()
221222
{
222223
$result = array(

src/Payload/ExceptionInfo.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function setDescription(?string $description): self
4949
return $this;
5050
}
5151

52+
#[\Override]
5253
public function serialize()
5354
{
5455
$result = array(

src/Payload/Frame.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ public function setArgs(array $args): self
102102
return $this;
103103
}
104104

105+
#[\Override]
105106
public function serialize()
106107
{
107108
$result = array(

src/Payload/Level.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function toInt(): int
5757
*
5858
* @return string
5959
*/
60+
#[\Override]
6061
public function serialize()
6162
{
6263
return $this->level;

0 commit comments

Comments
 (0)