Permalink
Browse files

Method visibility according to coding conventions

  • Loading branch information...
1 parent d3112f7 commit e2f073f38ab3e3168f2d824d972f880e96842b46 @chillu chillu committed Sep 19, 2012
Showing 376 changed files with 3,378 additions and 3,378 deletions.
@@ -66,7 +66,7 @@ protected static function add_rule_for_controller($controllerClass) {
}
}
- function handleRequest(SS_HTTPRequest $request, DataModel $model) {
+ public function handleRequest(SS_HTTPRequest $request, DataModel $model) {
// If this is the final portion of the request (i.e. the URL is just /admin), direct to the default panel
if ($request->allParsed()) {
$base = $this->config()->url_base;
@@ -20,13 +20,13 @@
/**
* The the text to show in the dropdown for this action
*/
- abstract function getActionTitle();
+ abstract public function getActionTitle();
/**
* Run this action for the given set of pages.
* Return a set of status-updated JavaScript to return to the CMS.
*/
- abstract function run(SS_List $objs);
+ abstract public function run(SS_List $objs);
/**
* Helper method for responding to a back action request
@@ -111,7 +111,7 @@ public function batchaction(SS_List $objs, $helperMethod, $successMessage, $argu
* @param $checkStagePages Set to true if you want to check stage pages
* @param $checkLivePages Set to true if you want to check live pages (e.g, for deleted-from-draft)
*/
- function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $checkLivePages = true) {
+ public function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $checkLivePages = true) {
if(!is_array($ids)) user_error("Bad \$ids passed to applicablePagesHelper()", E_USER_WARNING);
if(!is_string($methodName)) user_error("Bad \$methodName passed to applicablePagesHelper()", E_USER_WARNING);
@@ -159,14 +159,14 @@ function applicablePagesHelper($ids, $methodName, $checkStagePages = true, $chec
// if your batchaction has parameters, return a FieldList here
- function getParameterFields() {
+ public function getParameterFields() {
return false;
}
/**
* If you wish to restrict the batch action to some users, overload this function.
*/
- function canView() {
+ public function canView() {
return true;
}
}
@@ -38,7 +38,7 @@ class CMSBatchActionHandler extends RequestHandler {
* action will be admin/batchactions/(urlSegment)
* @param $batchActionClass The name of the CMSBatchAction subclass to register
*/
- static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTree') {
+ public static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTree') {
if(is_subclass_of($batchActionClass, 'CMSBatchAction')) {
self::$batch_actions[$urlSegment] = array(
'class' => $batchActionClass,
@@ -54,19 +54,19 @@ static function register($urlSegment, $batchActionClass, $recordClass = 'SiteTre
* @param string $urlSegment
* @param string $recordClass
*/
- function __construct($parentController, $urlSegment, $recordClass = null) {
+ public function __construct($parentController, $urlSegment, $recordClass = null) {
$this->parentController = $parentController;
$this->urlSegment = $urlSegment;
if($recordClass) $this->recordClass = $recordClass;
parent::__construct();
}
- function Link() {
+ public function Link() {
return Controller::join_links($this->parentController->Link(), $this->urlSegment);
}
- function handleAction($request) {
+ public function handleAction($request) {
// This method can't be called without ajax.
if(!$request->isAjax()) {
$this->parentController->redirectBack();
@@ -128,7 +128,7 @@ function handleAction($request) {
return $actionHandler->run($pages);
}
- function handleApplicablePages($request) {
+ public function handleApplicablePages($request) {
// Find the action handler
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
$actionClass = $actions[$request->param('BatchAction')];
@@ -150,7 +150,7 @@ function handleApplicablePages($request) {
return $response;
}
- function handleConfirmation($request) {
+ public function handleConfirmation($request) {
// Find the action handler
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
$actionClass = $actions[$request->param('BatchAction')];
@@ -177,7 +177,7 @@ function handleConfirmation($request) {
* - Link
* - Title
*/
- function batchActionList() {
+ public function batchActionList() {
$actions = $this->batchActions();
$actionList = new ArrayList();
@@ -202,7 +202,7 @@ function batchActionList() {
*
* @return array See {@link register()} for the returned format.
*/
- function batchActions() {
+ public function batchActions() {
$actions = Config::inst()->get($this->class, 'batch_actions', Config::FIRST_SET);
if($actions) foreach($actions as $action) {
if($action['recordClass'] != $this->recordClass) unset($action);
View
@@ -278,14 +278,14 @@ public static function get_cms_classes($root = 'LeftAndMain', $recursive = true)
/**
* IteratorAggregate Interface Method. Iterates over the menu items.
*/
- function getIterator() {
+ public function getIterator() {
return new ArrayIterator(self::get_menu_items());
}
/**
* Provide menu titles to the i18n entity provider
*/
- function provideI18nEntities() {
+ public function provideI18nEntities() {
$cmsClasses = self::get_cms_classes();
$entities = array();
foreach($cmsClasses as $cmsClass) {
@@ -14,12 +14,12 @@
* @return String Absolute URL to the end-user view for this record.
* Example: http://mysite.com/my-record
*/
- function Link();
+ public function Link();
/**
* @return String Absolute URL to the CMS-author view. Should point to a controller subclassing {@link LeftAndMain}.
* Example: http://mysite.com/admin/edit/6
*/
- function CMSEditLink();
+ public function CMSEditLink();
}
@@ -16,7 +16,7 @@ public function Member_ProfileForm() {
return new Member_ProfileForm($this, 'Member_ProfileForm', Member::currentUser());
}
- function canView($member = null) {
+ public function canView($member = null) {
if(!$member && $member !== FALSE) $member = Member::currentUser();
// cms menus only for logged-in members
@@ -13,7 +13,7 @@ class GroupImportForm extends Form {
*/
protected $group;
- function __construct($controller, $name, $fields = null, $actions = null, $validator = null) {
+ public function __construct($controller, $name, $fields = null, $actions = null, $validator = null) {
if(!$fields) {
$helpHtml = _t(
'GroupImportForm.Help1',
@@ -62,7 +62,7 @@ function __construct($controller, $name, $fields = null, $actions = null, $valid
$this->addExtraClass('import-form');
}
- function doImport($data, $form) {
+ public function doImport($data, $form) {
$loader = new GroupCsvBulkLoader();
// load file
Oops, something went wrong.

4 comments on commit e2f073f

Owner

halkyon replied Sep 21, 2012

whoa... nice! Trying to rack up those additions/deletions contributions eh?

Contributor

stojg replied Sep 21, 2012

Sweet, currently working on getting some PHPCodesniffer standards for SS. Would it be interesting getting an official version out?

Owner

sminnee replied Sep 21, 2012

Yes please! AUTOMATE ALL THE THINGS. Provided we got our core codebase to a point where it passed, I wouldn't be opposed to adding that to our CI build.

Please sign in to comment.