Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API Set extension hook implementation visibility to protected #1749

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/AdminErrorExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class AdminErrorExtension extends Extension
/**
* Used by {@see RequestHandler::httpError}
*/
public function onBeforeHTTPError($statusCode, HTTPRequest $request, $errorMessage = null)
protected function onBeforeHTTPError($statusCode, HTTPRequest $request, $errorMessage = null)
{
$controller = $this->getAdminController();
if (!$controller || Director::is_ajax($request) || $errorMessage === null) {
Expand Down
2 changes: 1 addition & 1 deletion code/Forms/GridFieldDetailFormPreviewExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
class GridFieldDetailFormPreviewExtension extends Extension
{
public function updateItemEditForm(Form $form): void
protected function updateItemEditForm(Form $form): void
{
$record = $this->owner->getRecord();
// See LeftAndMain::getEditForm()
Expand Down
2 changes: 1 addition & 1 deletion code/Forms/GridFieldPrintButtonExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class GridFieldPrintButtonExtension extends Extension
{
public function updatePrintData($data)
protected function updatePrintData($data)
{
Requirements::css('silverstripe/admin:client/dist/styles/GridField_print.css');
}
Expand Down
2 changes: 1 addition & 1 deletion code/Forms/UsedOnTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function usage(HTTPRequest $request)
// Legacy extension hook kept for backwards compatibility
// Use 'updateUsageExcludedClasses' extension hook instead which prevents database from being queried
//
// Example: public function updateUsage(ArrayList &$usage, DataObject &$record)
// Example: protected function updateUsage(ArrayList &$usage, DataObject &$record)
// $dataObjects = $usage->exclude('ClassName', MyDataObject::class);
$this->extend('updateUsage', $usage, $record);
}
Expand Down
4 changes: 2 additions & 2 deletions code/LeftAndMainExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ public function init()
{
}

public function accessedCMS()
protected function accessedCMS()
{
}

public function augmentNewSiteTreeItem(&$item)
protected function augmentNewSiteTreeItem(&$item)
{
}
}
2 changes: 1 addition & 1 deletion code/ModelAdmin.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ public function getExportFields()
* Archived flag is set to false. That would be best done as an extension, for example:
*
* <code>
* public function updateList(\SilverStripe\ORM\DataList $list)
* protected function updateList(\SilverStripe\ORM\DataList $list)
* {
* return $list->filter('Archived', false);
* }
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/src/Extension/MemberEmailLinkExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
class MemberEmailLinkExtension extends Extension implements TestOnly
{
public function updateGridField(GridField $gridField)
protected function updateGridField(GridField $gridField)
{
if (is_a($this->getOwner()->getModelClass(), Member::class, true)) {
$columns = $gridField->getConfig()->getComponentByType(GridFieldDataColumns::class);
Expand Down
4 changes: 2 additions & 2 deletions tests/php/ModelAdminTest/ModelAdminExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
class ModelAdminExtension extends Extension implements TestOnly
{

public function updateGridField(GridField &$field)
protected function updateGridField(GridField &$field)
{
$this->getOwner()->calls[__FUNCTION__]++;
$field->setAttribute('ModelAdminExtension', 'called');
}

public function updateGridFieldConfig(GridFieldConfig &$config)
protected function updateGridFieldConfig(GridFieldConfig &$config)
{
$this->getOwner()->calls[__FUNCTION__]++;
$config->removeComponentsByType(GridFieldExportButton::class);
Expand Down
4 changes: 2 additions & 2 deletions tests/php/UsedOnTableTest/ExtTest_Extension.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
class ExtTest_Extension extends Extension implements TestOnly
{

public function updateUsageExcludedClasses(array &$excludedClasses)
protected function updateUsageExcludedClasses(array &$excludedClasses)
{
$excludedClasses[] = ExtTest_Middle::class;
}

public function updateUsageAncestorDataObjects(array &$ancestorDataObjects, DataObject $dataObject)
protected function updateUsageAncestorDataObjects(array &$ancestorDataObjects, DataObject $dataObject)
{
if (!($dataObject instanceof ExtTest_Outer)) {
return;
Expand Down
Loading