Skip to content

Commit 83477dd

Browse files
committed
fix implicit null with rector
1 parent d51ebad commit 83477dd

28 files changed

+62
-62
lines changed

.github/workflows/phpstan-baseline.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ jobs:
3030
fi
3131
3232
- name: Run PHPStan with baseline
33-
run: vendor/bin/phpstan analyse --error-format=github
33+
run: vendor/bin/phpstan analyse --error-format=github

src/FeedIo/Adapter/ClientInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ interface ClientInterface
2121
* @throws \FeedIo\Adapter\ServerErrorException
2222
* @return \FeedIo\Adapter\ResponseInterface
2323
*/
24-
public function getResponse(string $url, DateTime $modifiedSince = null): ResponseInterface;
24+
public function getResponse(string $url, ?DateTime $modifiedSince = null): ResponseInterface;
2525
}

src/FeedIo/Adapter/FileSystem/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class Client implements ClientInterface
2020
* @return \FeedIo\Adapter\ResponseInterface
2121
*@throws \FeedIo\Adapter\NotFoundException
2222
*/
23-
public function getResponse(string $path, DateTime $modifiedSince = null): ResponseInterface
23+
public function getResponse(string $path, ?DateTime $modifiedSince = null): ResponseInterface
2424
{
2525
if (file_exists($path)) {
2626
return new Response(

src/FeedIo/Adapter/Http/Client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct(private readonly PsrClientInterface $client)
2525
* @return ResponseInterface
2626
* @throws ClientExceptionInterface
2727
*/
28-
public function getResponse(string $url, DateTime $modifiedSince = null): ResponseInterface
28+
public function getResponse(string $url, ?DateTime $modifiedSince = null): ResponseInterface
2929
{
3030
if ($modifiedSince) {
3131
$headResponse = $this->request('HEAD', $url, $modifiedSince);
@@ -44,7 +44,7 @@ public function getResponse(string $url, DateTime $modifiedSince = null): Respon
4444
* @return ResponseInterface
4545
* @throws ClientExceptionInterface
4646
*/
47-
protected function request(string $method, string $url, DateTime $modifiedSince = null): ResponseInterface
47+
protected function request(string $method, string $url, ?DateTime $modifiedSince = null): ResponseInterface
4848
{
4949
$headers = [];
5050

src/FeedIo/Adapter/NullClient.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class NullClient implements ClientInterface
1616
* @param DateTime|null $modifiedSince
1717
* @return \FeedIo\Adapter\ResponseInterface
1818
*/
19-
public function getResponse(string $url, DateTime $modifiedSince = null): ResponseInterface
19+
public function getResponse(string $url, ?DateTime $modifiedSince = null): ResponseInterface
2020
{
2121
return new NullResponse();
2222
}

src/FeedIo/Explorer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function discover(string $url): array
3636
return $feeds;
3737
}
3838

39-
protected function extractFeeds(string $html, string $url = null): array
39+
protected function extractFeeds(string $html, ?string $url = null): array
4040
{
4141
$dom = new DOMDocument();
4242
$dom->loadHTML($html);

src/FeedIo/Feed.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function getUrl(): ?string
4949
* @param string|null $url
5050
* @return FeedInterface
5151
*/
52-
public function setUrl(string $url = null): FeedInterface
52+
public function setUrl(?string $url = null): FeedInterface
5353
{
5454
$this->url = $url;
5555

@@ -64,7 +64,7 @@ public function getDescription(): ?string
6464
return $this->description;
6565
}
6666

67-
public function setDescription(string $description = null): FeedInterface
67+
public function setDescription(?string $description = null): FeedInterface
6868
{
6969
$this->description = $description;
7070

@@ -76,7 +76,7 @@ public function getLanguage(): ?string
7676
return $this->language;
7777
}
7878

79-
public function setLanguage(string $language = null): FeedInterface
79+
public function setLanguage(?string $language = null): FeedInterface
8080
{
8181
$this->language = $language;
8282

@@ -88,7 +88,7 @@ public function getLogo(): ?string
8888
return $this->logo;
8989
}
9090

91-
public function setLogo(string $logo = null): FeedInterface
91+
public function setLogo(?string $logo = null): FeedInterface
9292
{
9393
$this->logo = $logo;
9494

src/FeedIo/Feed/Item.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function getSummary(): ?string
7070
* @param string|null $summary
7171
* @return ItemInterface
7272
*/
73-
public function setSummary(string $summary = null): ItemInterface
73+
public function setSummary(?string $summary = null): ItemInterface
7474
{
7575
$this->summary = $summary;
7676

@@ -90,7 +90,7 @@ public function getContent(): ?string
9090
* @param string|null $content
9191
* @return ItemInterface
9292
*/
93-
public function setContent(string $content = null): ItemInterface
93+
public function setContent(?string $content = null): ItemInterface
9494
{
9595
$this->content = $content;
9696

src/FeedIo/Feed/Item/Author.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function getName(): ?string
2626
* @param string|null $name
2727
* @return AuthorInterface
2828
*/
29-
public function setName(string $name = null): AuthorInterface
29+
public function setName(?string $name = null): AuthorInterface
3030
{
3131
$this->name = $name;
3232

@@ -45,7 +45,7 @@ public function getUri(): ?string
4545
* @param string|null $uri
4646
* @return AuthorInterface
4747
*/
48-
public function setUri(string $uri = null): AuthorInterface
48+
public function setUri(?string $uri = null): AuthorInterface
4949
{
5050
$this->uri = $uri;
5151

@@ -64,7 +64,7 @@ public function getEmail(): ?string
6464
* @param string|null $email
6565
* @return AuthorInterface
6666
*/
67-
public function setEmail(string $email = null): AuthorInterface
67+
public function setEmail(?string $email = null): AuthorInterface
6868
{
6969
$this->email = $email;
7070

src/FeedIo/Feed/Item/AuthorInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function getName(): ?string;
1919
* @param string $name
2020
* @return AuthorInterface
2121
*/
22-
public function setName(string $name = null): AuthorInterface;
22+
public function setName(?string $name = null): AuthorInterface;
2323

2424
/**
2525
* @return string
@@ -30,7 +30,7 @@ public function getUri(): ?string;
3030
* @param string $uri
3131
* @return AuthorInterface
3232
*/
33-
public function setUri(string $uri = null): AuthorInterface;
33+
public function setUri(?string $uri = null): AuthorInterface;
3434

3535
/**
3636
* @return string
@@ -41,5 +41,5 @@ public function getEmail(): ?string;
4141
* @param string $email
4242
* @return AuthorInterface
4343
*/
44-
public function setEmail(string $email = null): AuthorInterface;
44+
public function setEmail(?string $email = null): AuthorInterface;
4545
}

0 commit comments

Comments
 (0)