Skip to content

Commit e66b068

Browse files
author
Sebastian Thulin
committed
fix: avoid fatal error when post id is unknown
1 parent 14eaf04 commit e66b068

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

source/php/BrokenLinkRegistry/Link/Link.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function classify(): Classify
6262
*
6363
* @return Link
6464
*/
65-
public static function createLink(string $url, ?int $httpCode, int $postId, WpService $wpService, Config $config): Link
65+
public static function createLink(string $url, ?int $httpCode, null|string|int $postId, WpService $wpService, Config $config): Link
6666
{
6767
self::$wpService = $wpService;
6868
self::$config = $config;

source/php/BrokenLinkRegistry/Link/LinkInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
interface LinkInterface
1212
{
13-
public static function createLink(string $url, int $httpCode, int $postId, WpService $wpService, Config $config): Link;
13+
public static function createLink(string $url, ?int $httpCode, null|string|int $postId, WpService $wpService, Config $config): Link;
1414

1515
public function classify(): Classify;
1616
}

0 commit comments

Comments
 (0)