Skip to content
This repository was archived by the owner on May 18, 2025. It is now read-only.

Commit 7e567f4

Browse files
committed
Merge remote-tracking branch 'origin/main'
2 parents 69390d4 + bc40ecb commit 7e567f4

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

classes/Bolt.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ final class Bolt
3535
*/
3636
private static $idToPage;
3737

38-
public function __construct(Page $parent = null)
38+
public function __construct(?Page $parent = null)
3939
{
4040
$kirby = kirby();
4141
$this->root = $kirby->root('content');
@@ -232,7 +232,7 @@ public function findByID(string $id, bool $cache = true, bool $extend = true): ?
232232
return $page;
233233
}
234234

235-
public static function page(string $id, Page $parent = null, bool $cache = true, bool $extend = true): ?Page
235+
public static function page(string $id, ?Page $parent = null, bool $cache = true, bool $extend = true): ?Page
236236
{
237237
return (new self($parent))->findByID($id, $cache, $extend);
238238
}

classes/BoostIndex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function write(): bool
7070
return false;
7171
}
7272

73-
public function index(bool $force = false, Page $target = null): int
73+
public function index(bool $force = false, ?Page $target = null): int
7474
{
7575

7676
$count = $this->index ? count($this->index) : 0;

classes/ModelHasBoost.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ public function setBoostWillBeDeleted(bool $value): void
2424
$this->boostWillBeDeleted = $value;
2525
}
2626

27-
public function isContentBoosted(string $languageCode = null): bool
27+
public function isContentBoosted(?string $languageCode = null): bool
2828
{
2929
return $this->readContentCache($languageCode) !== null;
3030
}
3131

32-
public function contentBoostedKey(string $languageCode = null): string
32+
public function contentBoostedKey(?string $languageCode = null): string
3333
{
3434
$key = hash(BoostCache::hashalgo(), $this->id()); // can not use UUID since content not loaded yet
3535
if (! $languageCode) {
@@ -42,7 +42,7 @@ public function contentBoostedKey(string $languageCode = null): string
4242
return $key;
4343
}
4444

45-
public function isContentCacheExpiredByModified(string $languageCode = null): bool
45+
public function isContentCacheExpiredByModified(?string $languageCode = null): bool
4646
{
4747
$cache = BoostCache::singleton();
4848
if (! $cache) {
@@ -70,7 +70,7 @@ public function isContentCacheExpiredByModified(string $languageCode = null): bo
7070
return false;
7171
}
7272

73-
public function readContentCache(string $languageCode = null): ?array
73+
public function readContentCache(?string $languageCode = null): ?array
7474
{
7575
if ($this->checkModifiedTimestampForContentBoost()) {
7676
if ($this->isContentCacheExpiredByModified($languageCode)) {
@@ -84,7 +84,7 @@ public function readContentCache(string $languageCode = null): ?array
8484
);
8585
}
8686

87-
public function readContent(string $languageCode = null): array
87+
public function readContent(?string $languageCode = null): array
8888
{
8989
// read from boostedCache if exists
9090
$data = option('bnomei.boost.read') === false || option('debug') ? null : $this->readContentCache($languageCode);
@@ -100,7 +100,7 @@ public function readContent(string $languageCode = null): array
100100
return $data;
101101
}
102102

103-
public function writeContentCache(array $data = null, string $languageCode = null): bool
103+
public function writeContentCache(?array $data = null, ?string $languageCode = null): bool
104104
{
105105
$cache = BoostCache::singleton();
106106
if (! $cache || option('bnomei.boost.write') === false) {
@@ -129,7 +129,7 @@ public function writeContentCache(array $data = null, string $languageCode = nul
129129
);
130130
}
131131

132-
public function writeContent(array $data, string $languageCode = null): bool
132+
public function writeContent(array $data, ?string $languageCode = null): bool
133133
{
134134
// write to file and cache
135135
return parent::writeContent($data, $languageCode) &&

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
], __DIR__);
2626

2727
if (! function_exists('bolt')) {
28-
function bolt(string $id, Page $parent = null, bool $cache = true, bool $extend = true)
28+
function bolt(string $id, ?Page $parent = null, bool $cache = true, bool $extend = true)
2929
{
3030
$id = str_replace('page://', '', $id);
3131
$cacheKey = 'page/'.Str::substr($id, 0, 2).'/'.Str::substr($id, 2);

0 commit comments

Comments
 (0)