Skip to content

Commit 999bf76

Browse files
RotzbuaMinishlink
andauthored
chore: add override (#439)
Use new attribute: https://www.php.net/manual/class.override.php Co-authored-by: Louis Lagrange <[email protected]>
1 parent 19fc88e commit 999bf76

File tree

6 files changed

+11
-21
lines changed

6 files changed

+11
-21
lines changed

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
"ext-openssl": "*",
3636
"guzzlehttp/guzzle": "^7.9.2",
3737
"spomky-labs/base64url": "^2.0.4",
38+
"symfony/polyfill-php83": "^1.33",
3839
"web-token/jwt-library": "^3.4.9|^4.0.6"
3940
},
4041
"suggest": {

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ parameters:
33
paths:
44
- src
55
reportUnmatchedIgnoredErrors: false
6+
checkMissingOverrideMethodAttribute: true
7+
tipsOfTheDay: false
68
treatPhpDocTypesAsCertain: false
79
ignoreErrors:
810
- identifier: missingType.iterableValue

src/MessageSentReport.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ public function getResponseContent(): ?string
9393
return $this->response?->getBody()->getContents();
9494
}
9595

96+
#[\Override]
9697
public function jsonSerialize(): array
9798
{
9899
return [

src/Subscription.php

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -72,33 +72,25 @@ public static function create(array $associativeArray): self
7272
);
7373
}
7474

75-
/**
76-
* {@inheritDoc}
77-
*/
75+
#[\Override]
7876
public function getEndpoint(): string
7977
{
8078
return $this->endpoint;
8179
}
8280

83-
/**
84-
* {@inheritDoc}
85-
*/
81+
#[\Override]
8682
public function getPublicKey(): ?string
8783
{
8884
return $this->publicKey;
8985
}
9086

91-
/**
92-
* {@inheritDoc}
93-
*/
87+
#[\Override]
9488
public function getAuthToken(): ?string
9589
{
9690
return $this->authToken;
9791
}
9892

99-
/**
100-
* {@inheritDoc}
101-
*/
93+
#[\Override]
10294
public function getContentEncoding(): ?string
10395
{
10496
return $this->contentEncoding?->value;

tests/PushServiceTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,7 @@ final class PushServiceTest extends PHPUnit\Framework\TestCase
3434
/** @var WebPush WebPush with correct api keys */
3535
private WebPush $webPush;
3636

37-
/**
38-
* {@inheritdoc}
39-
*/
37+
#[\Override]
4038
public static function setUpBeforeClass(): void
4139
{
4240
self::$testServiceUrl = 'http://localhost:'.self::$portNumber;

tests/WebPushTest.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ final class WebPushTest extends PHPUnit\Framework\TestCase
2525
/** @var WebPush WebPush with correct api keys */
2626
private WebPush $webPush;
2727

28-
/**
29-
* {@inheritdoc}
30-
*/
28+
#[\Override]
3129
public static function setUpBeforeClass(): void
3230
{
3331
self::$endpoints = [
@@ -52,9 +50,7 @@ public static function setUpBeforeClass(): void
5250
}
5351
}
5452

55-
/**
56-
* {@inheritdoc}
57-
*/
53+
#[\Override]
5854
public function setUp(): void
5955
{
6056
if (!getenv('CI')) {

0 commit comments

Comments
 (0)