Skip to content

Commit

Permalink
Merge pull request #177 from creative-commoners/pulls/2/protect-hooks
Browse files Browse the repository at this point in the history
API Set extension hook implementation visibility to protected
  • Loading branch information
GuySartorelli authored May 21, 2024
2 parents 2488992 + 62d9fbc commit f87f2c2
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion code/FrameworkTestRole.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class FrameworkTestRole extends DataExtension
'FavouritePage' => 'SilverStripe\\CMS\\Model\\SiteTree',
);

public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fields->addFieldToTab(
'Root.Main',
Expand Down
4 changes: 2 additions & 2 deletions code/elemental/ElementContentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public function validate(ValidationResult $result)
}
}

public function updateCMSCompositeValidator(CompositeValidator $compositeValidator)
protected function updateCMSCompositeValidator(CompositeValidator $compositeValidator)
{
$compositeValidator->addValidator(new RequiredFields(['Title', 'MyPageID', 'MyFile']));
}

public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fields->removeByName('HTML');
$fields->addFieldToTab('Root.Main', TextField::create('MyField', 'My Field'));
Expand Down
2 changes: 1 addition & 1 deletion code/elemental/NumericFieldExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*/
class NumericFieldExtension extends Extension
{
public function updateValidationResult($result, $validator)
protected function updateValidationResult($result, $validator)
{
if ($this->owner->Value() == 1) {
$validator->validationError($this->owner->getName(), 'This field cannot be 1');
Expand Down
2 changes: 1 addition & 1 deletion code/linkfield/Extensions/CompanyExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class CompanyExtension extends Extension
'ManyCompanyWebSiteLink',
];

public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fields->removeByName(['CompanyWebSiteLinkID', 'ManyCompanyWebSiteLinkID']);

Expand Down
2 changes: 1 addition & 1 deletion code/linkfield/Extensions/ElementContentExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class ElementContentExtension extends Extension
'ManyLinks',
];

public function updateCMSFields($fields)
protected function updateCMSFields($fields)
{
$fields->removeByName(['OneLinkID', 'ManyLinks']);
$fields->addFieldsToTab(
Expand Down
2 changes: 1 addition & 1 deletion code/linkfield/Extensions/LinkPageExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class LinkPageExtension extends Extension
'HasManyLinks',
];

public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fields->removeByName(['Content', 'HasOneLinkID', 'HasManyLinksID']);

Expand Down

0 comments on commit f87f2c2

Please sign in to comment.