Skip to content

Commit 00b2e74

Browse files
authored
Merge pull request #1246 from hydephp/make-hydepage-title-property-readonly
Make HydePage::$title property readonly
2 parents 828e692 + 897b635 commit 00b2e74

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

RELEASE_NOTES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This serves two purposes:
1313
- for new features.
1414

1515
### Changed
16-
- for changes in existing functionality.
16+
- Made the `HydePage::$title` property readonly
1717

1818
### Deprecated
1919
- HydePage::$canonicalUrl

packages/framework/src/Pages/Concerns/HydePage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ abstract class HydePage implements PageSchema, SerializableContract
6666
public PageMetadataBag $metadata;
6767
public NavigationData $navigation;
6868

69-
public string $title;
69+
public readonly string $title;
7070

7171
/** @deprecated v1.0.0-RC.3 - This property requires information that is setup-dependent, and will work better through a runtime accessor. Since it is mainly related to blog posts, it will be moved there. */
7272
public ?string $canonicalUrl;

packages/framework/tests/Feature/HydePageTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,7 @@ public function test_all_returns_collection_of_all_parsed_source_files_from_page
370370
MarkdownPage::all()
371371
);
372372
$this->assertEquals(
373-
['_pages/foo.md' => tap(new MarkdownPage('foo'), function ($page) {
374-
$page->title = 'Foo';
375-
})],
373+
['_pages/foo.md' => (new MarkdownPage('foo'))],
376374
MarkdownPage::all()->all()
377375
);
378376
Filesystem::unlink('_pages/foo.md');

0 commit comments

Comments
 (0)