Skip to content

Commit

Permalink
Merge pull request #1288 from creative-commoners/pulls/7/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 be04ef4 + 1417d90 commit 6564981
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions code/Extension/UserFormFieldEditorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class UserFormFieldEditorExtension extends DataExtension
*
* @return FieldList
*/
public function updateCMSFields(FieldList $fields)
protected function updateCMSFields(FieldList $fields)
{
$fieldEditor = $this->getFieldEditorGrid();

Expand Down Expand Up @@ -178,15 +178,15 @@ public function createInitialFormStep($force = false)
/**
* Ensure that at least one page exists at the start
*/
public function onAfterWrite()
protected function onAfterWrite()
{
$this->createInitialFormStep();
}

/**
* Remove any orphaned child records on publish
*/
public function onAfterPublish()
protected function onAfterPublish()
{
// store IDs of fields we've published
$seenIDs = [];
Expand Down Expand Up @@ -220,7 +220,7 @@ public function onAfterPublish()
/**
* Remove all fields from the live stage when unpublishing the page
*/
public function onAfterUnpublish()
protected function onAfterUnpublish()
{
foreach ($this->owner->Fields() as $field) {
$field->deleteFromStage(Versioned::LIVE);
Expand All @@ -236,7 +236,7 @@ public function onAfterUnpublish()
* @param string $manyMany
* @return DataObject
*/
public function onAfterDuplicate($oldPage, $doWrite, $manyMany)
protected function onAfterDuplicate($oldPage, $doWrite, $manyMany)
{
// List of EditableFieldGroups, where the key of the array is the ID of the old end group
$fieldGroups = [];
Expand Down Expand Up @@ -289,7 +289,7 @@ public function isModifiedOnDraft()
/**
* @see Versioned::doRevertToLive
*/
public function onAfterRevertToLive()
protected function onAfterRevertToLive()
{
foreach ($this->owner->Fields() as $field) {
$field->copyVersionToStage(Versioned::LIVE, Versioned::DRAFT);
Expand Down
2 changes: 1 addition & 1 deletion code/Extension/UserFormFileExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class UserFormFileExtension extends DataExtension
* @param bool $value
* @see File::isTrackedFormUpload(), UserDefinedFormController::process()
*/
public function updateTrackedFormUpload(&$value): void
protected function updateTrackedFormUpload(&$value): void
{
$file = $this->owner;
if ($file->UserFormUpload != self::USER_FORM_UPLOAD_UNKNOWN) {
Expand Down
4 changes: 2 additions & 2 deletions code/Extensions/UsedOnTableExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class UsedOnTableExtension extends Extension
* @param array $ancestorDataObjects
* @param DataObject $dataObject|null
*/
public function updateUsageDataObject(?DataObject &$dataObject)
protected function updateUsageDataObject(?DataObject &$dataObject)
{
if (!($dataObject instanceof SubmittedFileField)) {
return;
Expand All @@ -41,7 +41,7 @@ public function updateUsageDataObject(?DataObject &$dataObject)
* @param array $ancestorDataObjects
* @param DataObject $dataObject
*/
public function updateUsageAncestorDataObjects(array &$ancestorDataObjects, DataObject $dataObject)
protected function updateUsageAncestorDataObjects(array &$ancestorDataObjects, DataObject $dataObject)
{
// SubmittedFileField was changed to a Submitted Form in updateUsageModifyOrExcludeDataObject()
if (!($dataObject instanceof SubmittedForm)) {
Expand Down
2 changes: 1 addition & 1 deletion code/Model/EditableFormField.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ protected function getDisplayRuleFields()
);
}

public function onBeforeWrite()
protected function onBeforeWrite()
{
parent::onBeforeWrite();

Expand Down
2 changes: 1 addition & 1 deletion code/Model/EditableFormField/EditableFieldGroupEnd.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function showInReports()
return false;
}

public function onAfterWrite()
protected function onAfterWrite()
{
parent::onAfterWrite();

Expand Down
2 changes: 1 addition & 1 deletion code/Model/EditableFormField/EditableFileField.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function getPHPMaxFileSizeMB()
return round(static::get_php_max_file_size() / 1024 / 1024, 1);
}

public function onBeforeWrite()
protected function onBeforeWrite()
{
parent::onBeforeWrite();

Expand Down
2 changes: 1 addition & 1 deletion code/Model/Recipient/EmailRecipient.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ public function requireDefaultRecords()
DB::query("UPDATE \"UserDefinedForm_EmailRecipient\" SET \"FormClass\" = 'Page' WHERE \"FormClass\" IS NULL");
}

public function onBeforeWrite()
protected function onBeforeWrite()
{
parent::onBeforeWrite();

Expand Down

0 comments on commit 6564981

Please sign in to comment.