Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit df084fa

Browse files
author
Jamie Snape
committed
Consistently order abstract, visibility, access modifiers
1 parent 136754f commit df084fa

26 files changed

+72
-72
lines changed

core/controllers/components/DateComponent.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
class DateComponent extends AppComponent
2323
{
2424
/** format date (ex: 01/14/2011 or 14/01/2011 (fr or en) */
25-
static public function formatDate($timestamp)
25+
public static function formatDate($timestamp)
2626
{
2727
if(!is_numeric($timestamp))
2828
{
@@ -43,7 +43,7 @@ static public function formatDate($timestamp)
4343
}
4444

4545
/** format the date (ex: 5 days ago) */
46-
static public function ago($timestamp, $only_time = false)
46+
public static function ago($timestamp, $only_time = false)
4747
{
4848
if(!is_numeric($timestamp))
4949
{
@@ -94,7 +94,7 @@ static public function ago($timestamp, $only_time = false)
9494
}
9595

9696
/** format the date (ex: 5 days ago) */
97-
static public function duration($timestamp)
97+
public static function duration($timestamp)
9898
{
9999
if(!is_numeric($timestamp))
100100
{

core/controllers/components/InternationalizationComponent.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
/** Internationalization tools */
2222
class InternationalizationComponent extends AppComponent
2323
{
24-
static private $_instance = null;
24+
private static $_instance = null;
2525

2626
/** Constructor */
2727
function __construct()
2828
{
2929
}
3030

3131
/** Instance */
32-
static public function getInstance()
32+
public static function getInstance()
3333
{
3434
if(!self::$_instance instanceof self)
3535
{
@@ -39,7 +39,7 @@ static public function getInstance()
3939
}
4040

4141
/** translate*/
42-
static public function translate($text)
42+
public static function translate($text)
4343
{
4444
if(Zend_Registry::get('configGlobal')->application->lang == 'fr')
4545
{
@@ -67,7 +67,7 @@ static public function translate($text)
6767
* Is Debug mode ON
6868
* @return boolean
6969
*/
70-
static public function isDebug()
70+
public static function isDebug()
7171
{
7272
$config = Zend_Registry::get('config');
7373
if($config->mode->debug == 1)

core/controllers/components/JsonComponent.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121
/** Json Component */
2222
class JsonComponent extends AppComponent
2323
{
24-
static private $_instance = null;
24+
private static $_instance = null;
2525

2626
/** Constructor */
2727
function __construct()
2828
{
2929
}
3030

3131
/** Instance */
32-
static public function getInstance()
32+
public static function getInstance()
3333
{
3434
if(!self::$_instance instanceof self)
3535
{
@@ -46,7 +46,7 @@ static public function getInstance()
4646
* @param boolean
4747
* @return mixed
4848
*/
49-
static public function decode($encodedValue, $objectDecodeType = true)
49+
public static function decode($encodedValue, $objectDecodeType = true)
5050
{
5151
$char = substr($encodedValue, 0, 1);
5252
$isValue = false;
@@ -78,7 +78,7 @@ static public function decode($encodedValue, $objectDecodeType = true)
7878
* @param mixed $valueToEncode
7979
* @return string JSON encoded object
8080
*/
81-
static public function encode($valueToEncode)
81+
public static function encode($valueToEncode)
8282
{
8383
if(!is_array($valueToEncode))
8484
{

core/controllers/components/UtilityComponent.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ private function _initModulesConfig($dir)
192192
}
193193

194194
/** format long names*/
195-
static public function sliceName($name, $nchar)
195+
public static function sliceName($name, $nchar)
196196
{
197197
if(strlen($name) > $nchar)
198198
{
@@ -208,7 +208,7 @@ static public function sliceName($name, $nchar)
208208
}
209209

210210
/** create init file*/
211-
static public function createInitFile($path, $data)
211+
public static function createInitFile($path, $data)
212212
{
213213
if(!is_writable(dirname($path)))
214214
{
@@ -247,7 +247,7 @@ static public function createInitFile($path, $data)
247247
return $text;
248248
}
249249
/** PHP md5_file is very slow on large file. If md5 sum is on the system we use it. */
250-
static public function md5file($filename)
250+
public static function md5file($filename)
251251
{
252252
// If we have md5 sum
253253
if(Zend_Registry::get('configGlobal')->md5sum->path)
@@ -296,7 +296,7 @@ static function checkPhpExtensions($phpextensions)
296296
* which is not supported by PHP's filesize()
297297
* @param path Path of the file to check
298298
*/
299-
static public function fileSize($path)
299+
public static function fileSize($path)
300300
{
301301
if(strpos(strtolower(PHP_OS), 'win') === 0)
302302
{
@@ -314,7 +314,7 @@ static public function fileSize($path)
314314
* Format file size. Rounds to 1 decimal place and makes sure
315315
* to use 3 or less digits before the decimal place.
316316
*/
317-
static public function formatSize($sizeInBytes, $separator = ',')
317+
public static function formatSize($sizeInBytes, $separator = ',')
318318
{
319319
$suffix = 'B';
320320
if(Zend_Registry::get('configGlobal')->application->lang == 'fr')
@@ -344,7 +344,7 @@ static public function formatSize($sizeInBytes, $separator = ',')
344344
}
345345

346346
/** Safe delete function. Checks ifthe file can be deleted. */
347-
static public function safedelete($filename)
347+
public static function safedelete($filename)
348348
{
349349
if(!file_exists($filename))
350350
{

core/models/base/ActivedownloadModelBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct()
3838
}
3939

4040
/** Check for an active download by ip address */
41-
public abstract function getByIp($ip);
41+
abstract public function getByIp($ip);
4242

4343
/**
4444
* Call this function to acquire the download lock.

core/models/base/FeedModelBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ public function __construct()
4343
} // end __construct()
4444

4545
/** get Feeds*/
46-
protected abstract function getFeeds($loggedUserDao, $userDao = null, $communityDao = null, $policy = 0, $limit = 20);
46+
abstract protected function getFeeds($loggedUserDao, $userDao = null, $communityDao = null, $policy = 0, $limit = 20);
4747
/** add a community*/
48-
protected abstract function addCommunity($feed, $community);
48+
abstract protected function addCommunity($feed, $community);
4949
abstract function policyCheck($feedDao, $userDao = null, $policy = 0);
5050

5151
/** get feeds (filtered by policies)

core/models/base/MetadataModelBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ abstract function getMetadataQualifiers($type, $element);
4545

4646
abstract function getMetadata($type, $element, $qualifier);
4747
abstract function getAllMetadata();
48-
protected abstract function saveMetadataValue($metadataDao);
48+
abstract protected function saveMetadataValue($metadataDao);
4949
abstract function getMetadataValueExists($metadataDao);
5050

5151
/** Add a metadata

core/models/base/NewUserInvitationModelBase.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ public function __construct()
4848
} // end __construct()
4949

5050
/** abstract functions */
51-
public abstract function getByParams($params);
52-
public abstract function getAllByParams($params);
53-
public abstract function deleteByGroup($group);
54-
public abstract function deleteByCommunity($community);
51+
abstract public function getByParams($params);
52+
abstract public function getAllByParams($params);
53+
abstract public function deleteByGroup($group);
54+
abstract public function deleteByCommunity($community);
5555

5656
/**
5757
* Create the database record for inviting a user via email that is not registered yet

core/models/base/PendingUserModelBase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public function __construct()
4545
} // end __construct()
4646

4747
/** abstract functions */
48-
public abstract function getByParams($params);
49-
public abstract function getAllByParams($params);
48+
abstract public function getByParams($params);
49+
abstract public function getAllByParams($params);
5050

5151
/**
5252
* Create the database record for a user who has registered but not had their email verified yet

modules/batchmake/models/base/ItemmetricModelBase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,5 @@ public function createItemmetric($metricName, $bmsName)
6262
/**
6363
* getAll returns all rows
6464
*/
65-
public abstract function getAll();
65+
abstract public function getAll();
6666
} // end class

0 commit comments

Comments
 (0)