Skip to content

Commit

Permalink
API Update method signature for CMSEditLink
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Aug 19, 2024
1 parent 860df12 commit e8b061b
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/en/05_examples/00_elementalarea_with_dataobject.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class BlogPost extends DataObject
{
// ...

public function CMSEditLink()
public function CMSEditLink(): ?string
{
// In this example we use BlogPostsAdmin class as Controller
$admin = BlogPostsAdmin::singleton();
Expand Down
2 changes: 1 addition & 1 deletion src/Models/BaseElement.php
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ public function isCMSPreview()
* @return null|string
* @throws \SilverStripe\ORM\ValidationException
*/
public function CMSEditLink($directLink = false)
public function CMSEditLink($directLink = false): ?string
{
// Allow for repeated calls to be returned from cache
if (isset($this->cacheData['cms_edit_link'])) {
Expand Down
2 changes: 1 addition & 1 deletion tests/Src/TestDataObjectWithCMSEditLink.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class TestDataObjectWithCMSEditLink extends DataObject implements TestOnly
'ElementalArea',
];

public function CMSEditLink()
public function CMSEditLink(): ?string
{
$link = Controller::join_links(
'admin/',
Expand Down
2 changes: 1 addition & 1 deletion tests/Src/TestPreviewableDataObject.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function getMimeType()
return null;
}

public function CMSEditLink()
public function CMSEditLink(): ?string
{
return null;
}
Expand Down

0 comments on commit e8b061b

Please sign in to comment.