Skip to content

Commit e2f073f

Browse files
committed
Method visibility according to coding conventions
1 parent d3112f7 commit e2f073f

File tree

376 files changed

+3378
-3378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

376 files changed

+3378
-3378
lines changed

admin/code/AdminRootController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ protected static function add_rule_for_controller($controllerClass) {
6666
}
6767
}
6868

69-
function handleRequest(SS_HTTPRequest $request, DataModel $model) {
69+
public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
7070
// If this is the final portion of the request (i.e. the URL is just /admin), direct to the default panel
7171
if ($request->allParsed()) {
7272
$base = $this->config()->url_base;

admin/code/CMSBatchAction.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ abstract class CMSBatchAction extends Object {
2020
/**
2121
* The the text to show in the dropdown for this action
2222
*/
23-
abstract function getActionTitle();
23+
abstract public function getActionTitle();
2424

2525
/**
2626
* Run this action for the given set of pages.
2727
* Return a set of status-updated JavaScript to return to the CMS.
2828
*/
29-
abstract function run(SS_List $objs);
29+
abstract public function run(SS_List $objs);
3030

3131
/**
3232
* Helper method for responding to a back action request
@@ -111,7 +111,7 @@ public function batchaction(SS_List $objs, $helperMethod, $successMessage, $argu
111111
* @param $checkStagePages Set to true if you want to check stage pages
112112
* @param $checkLivePages Set to true if you want to check live pages (e.g, for deleted-from-draft)
113113
*/
114-
function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $checkLivePages = true) {
114+
public function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $checkLivePages = true) {
115115
if(!is_array($ids)) user_error("Bad \$ids passed to applicablePagesHelper()", E_USER_WARNING);
116116
if(!is_string($methodName)) user_error("Bad \$methodName passed to applicablePagesHelper()", E_USER_WARNING);
117117

@@ -159,14 +159,14 @@ function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $chec
159159

160160

161161
// if your batchaction has parameters, return a FieldList here
162-
function getParameterFields() {
162+
public function getParameterFields() {
163163
return false;
164164
}
165165

166166
/**
167167
* If you wish to restrict the batch action to some users, overload this function.
168168
*/
169-
function canView() {
169+
public function canView() {
170170
return true;
171171
}
172172
}

admin/code/CMSBatchActionHandler.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class CMSBatchActionHandler extends RequestHandler {
3838
* action will be admin/batchactions/(urlSegment)
3939
* @param $batchActionClass The name of the CMSBatchAction subclass to register
4040
*/
41-
static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTree') {
41+
public static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTree') {
4242
if(is_subclass_of($batchActionClass, 'CMSBatchAction')) {
4343
self::$batch_actions[$urlSegment] = array(
4444
'class' => $batchActionClass,
@@ -54,19 +54,19 @@ static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTre
5454
* @param string $urlSegment
5555
* @param string $recordClass
5656
*/
57-
function __construct($parentController, $urlSegment, $recordClass = null) {
57+
public function __construct($parentController, $urlSegment, $recordClass = null) {
5858
$this->parentController = $parentController;
5959
$this->urlSegment = $urlSegment;
6060
if($recordClass) $this->recordClass = $recordClass;
6161

6262
parent::__construct();
6363
}
6464

65-
function Link() {
65+
public function Link() {
6666
return Controller::join_links($this->parentController->Link(), $this->urlSegment);
6767
}
6868

69-
function handleAction($request) {
69+
public function handleAction($request) {
7070
// This method can't be called without ajax.
7171
if(!$request->isAjax()) {
7272
$this->parentController->redirectBack();
@@ -128,7 +128,7 @@ function handleAction($request) {
128128
return $actionHandler->run($pages);
129129
}
130130

131-
function handleApplicablePages($request) {
131+
public function handleApplicablePages($request) {
132132
// Find the action handler
133133
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
134134
$actionClass = $actions[$request->param('BatchAction')];
@@ -150,7 +150,7 @@ function handleApplicablePages($request) {
150150
return $response;
151151
}
152152

153-
function handleConfirmation($request) {
153+
public function handleConfirmation($request) {
154154
// Find the action handler
155155
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
156156
$actionClass = $actions[$request->param('BatchAction')];
@@ -177,7 +177,7 @@ function handleConfirmation($request) {
177177
* - Link
178178
* - Title
179179
*/
180-
function batchActionList() {
180+
public function batchActionList() {
181181
$actions = $this->batchActions();
182182
$actionList = new ArrayList();
183183

@@ -202,7 +202,7 @@ function batchActionList() {
202202
*
203203
* @return array See {@link register()} for the returned format.
204204
*/
205-
function batchActions() {
205+
public function batchActions() {
206206
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
207207
if($actions) foreach($actions as $action) {
208208
if($action['recordClass'] != $this->recordClass) unset($action);

admin/code/CMSMenu.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -278,14 +278,14 @@ public static function get_cms_classes($root = 'LeftAndMain', $recursive = true)
278278
/**
279279
* IteratorAggregate Interface Method. Iterates over the menu items.
280280
*/
281-
function getIterator() {
281+
public function getIterator() {
282282
return new ArrayIterator(self::get_menu_items());
283283
}
284284

285285
/**
286286
* Provide menu titles to the i18n entity provider
287287
*/
288-
function provideI18nEntities() {
288+
public function provideI18nEntities() {
289289
$cmsClasses = self::get_cms_classes();
290290
$entities = array();
291291
foreach($cmsClasses as $cmsClass) {

admin/code/CMSPreviewable.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ interface CMSPreviewable {
1414
* @return String Absolute URL to the end-user view for this record.
1515
* Example: http://mysite.com/my-record
1616
*/
17-
function Link();
17+
public function Link();
1818

1919
/**
2020
* @return String Absolute URL to the CMS-author view. Should point to a controller subclassing {@link LeftAndMain}.
2121
* Example: http://mysite.com/admin/edit/6
2222
*/
23-
function CMSEditLink();
23+
public function CMSEditLink();
2424

2525
}

admin/code/CMSProfileController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public function Member_ProfileForm() {
1616
return new Member_ProfileForm($this, 'Member_ProfileForm', Member::currentUser());
1717
}
1818

19-
function canView($member = null) {
19+
public function canView($member = null) {
2020
if(!$member && $member !== FALSE) $member = Member::currentUser();
2121

2222
// cms menus only for logged-in members

admin/code/GroupImportForm.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class GroupImportForm extends Form {
1313
*/
1414
protected $group;
1515

16-
function __construct($controller, $name, $fields = null, $actions = null, $validator = null) {
16+
public function __construct($controller, $name, $fields = null, $actions = null, $validator = null) {
1717
if(!$fields) {
1818
$helpHtml = _t(
1919
'GroupImportForm.Help1',
@@ -62,7 +62,7 @@ function __construct($controller, $name, $fields = null, $actions = null, $valid
6262
$this->addExtraClass('import-form');
6363
}
6464

65-
function doImport($data, $form) {
65+
public function doImport($data, $form) {
6666
$loader = new GroupCsvBulkLoader();
6767

6868
// load file

0 commit comments

Comments
 (0)