Skip to content
Browse files

Coding Conventions : change Static function's name.

  • Loading branch information...
1 parent 8688b60 commit 6cb44121569efb5d862726644d4f53d5df6b5c36 @vikas-srivastava committed Dec 27, 2012
View
6 code/control/ExtensionAuthor.php
@@ -33,7 +33,7 @@ class ExtensionAuthorController extends Controller {
*
* @param array $authorsRawData, int $extensionId
*/
- public static function storeAuthorsInfo($authorsRawData,$extensionId) {
+ public static function store_authors_info($authorsRawData,$extensionId) {
$totalAuthors = count($authorsRawData);
$extensionAuthorsId = array();
@@ -84,7 +84,7 @@ public static function storeAuthorsInfo($authorsRawData,$extensionId) {
* @param int $extensionId
* @return array
*/
- public static function getAuthorsInformation($extensionId) {
+ public static function get_authors_information($extensionId) {
$extensionId = ExtensionData::get()->byID($extensionId);
return $extensionId->ExtensionAuthors();
}
@@ -95,7 +95,7 @@ public static function getAuthorsInformation($extensionId) {
* @param int $extensionId
* @return string
*/
- public static function getAuthorsEmail($extensionId) {
+ public static function get_authors_email($extensionId) {
$authors = ExtensionData::get()->byID($extensionId)->ExtensionAuthors();
$emails = array();
View
2 code/control/ExtensionCategory.php
@@ -40,7 +40,7 @@ class ExtensionCategory extends DataObject {
* @param extensionData
* @return string
*/
- public static function getExtensionCategory($categoryID) {
+ public static function get_extension_category($categoryID) {
$category = ExtensionCategory::get()->byID($categoryID);
if($category) {
return $category->CategoryName;
View
10 code/control/ExtensionData.php
@@ -132,7 +132,7 @@ public function onAfterWrite() {
$mailData = array(
'Subject' => $this->Type." '".$this->Name."' has been Approved",
- 'To' => ExtensionAuthorController::getAuthorsEmail($this->ID),
+ 'To' => ExtensionAuthorController::get_authors_email($this->ID),
'From' => Config::inst()->get($this->Type, 'ReviewerEmail'),
'ExtensionType' => $this->Type,
'ExtensionName' => $this->Name,
@@ -204,10 +204,10 @@ function show() {
'ExtensionData' => $ExtensionData,
'SubmittedBy' => $ExtensionData->SubmittedBy()->Name,
'Keywords' => $ExtensionData->Keywords(),
- 'AuthorsDetail'=> ExtensionAuthorController::getAuthorsInformation($ExtensionData->ID),
- 'VersionData' => ExtensionVersion::getExtensionVersion($ExtensionData->ID),
- 'DownloadLink' => ExtensionVersion::getLatestVersionDistUrl($ExtensionData->ID),
- 'Category' => ExtensionCategory::getExtensionCategory($ExtensionData->CategoryID),
+ 'AuthorsDetail'=> ExtensionAuthorController::get_authors_information($ExtensionData->ID),
+ 'VersionData' => ExtensionVersion::get_extension_version($ExtensionData->ID),
+ 'DownloadLink' => ExtensionVersion::get_latest_version_dist_url($ExtensionData->ID),
+ 'Category' => ExtensionCategory::get_extension_category($ExtensionData->CategoryID),
'SnapShot' => $ExtensionData->Thumbnail(),
'Disqus' => $this->disqus,
);
View
2 code/control/ExtensionKeywords.php
@@ -39,7 +39,7 @@ class ExtensionKeywords extends DataObject {
*
* @param array $authorsRawData, int $extensionId
*/
- public static function saveKeywords($rawKeywordData, $extensionId) {
+ public static function save_keywords($rawKeywordData, $extensionId) {
$totalKeywords = count($rawKeywordData);
for ($i = 0; $i < $totalKeywords; $i++) {
View
2 code/control/ExtensionSnapshot.php
@@ -14,7 +14,7 @@ class ExtensionSnapshot extends Controller {
* @param string $thumbnailUrl, $extensionName
* @return int
*/
- public static function saveSnapshot($thumbnailUrl, $extensionName) {
+ public static function save_snapshot($thumbnailUrl, $extensionName) {
$folderToSave = 'assets/Uploads/Snapshots/';
View
4 code/control/ExtensionVersion.php
@@ -66,7 +66,7 @@ class ExtensionVersion extends DataObject {
* @param int $extensionId
* @return dataobjectset
*/
- public static function getExtensionVersion($extensionId) {
+ public static function get_extension_version($extensionId) {
return ExtensionVersion::get()->filter(array(
'ExtensionDataID' => $extensionId
));
@@ -79,7 +79,7 @@ public static function getExtensionVersion($extensionId) {
* @param int $extensionId
* @return dataobject
*/
- public static function getLatestVersionDistUrl($extensionId) {
+ public static function get_latest_version_dist_url($extensionId) {
return ExtensionVersion::get()->filter(array(
'ExtensionDataID' => $extensionId,
'Version' => '9999999-dev'
View
6 code/control/JsonHandler.php
@@ -253,7 +253,7 @@ function dataFields($ExtensionData) {
$ExtensionData->Extra = serialize($this->latestReleasePackage->getExtra());
$extra = $this->latestReleasePackage->getExtra();
if(array_key_exists('snapshot',$extra)) {
- $ExtensionData->ThumbnailID = ExtensionSnapshot::saveSnapshot($extra['snapshot'],$this->latestReleasePackage->getPrettyName());
+ $ExtensionData->ThumbnailID = ExtensionSnapshot::save_snapshot($extra['snapshot'],$this->latestReleasePackage->getPrettyName());
}
}
@@ -266,14 +266,14 @@ function dataFields($ExtensionData) {
}
if($this->latestReleasePackage->getAuthors()) {
- ExtensionAuthorController::storeAuthorsInfo($this->latestReleasePackage->getAuthors(),$ExtensionData->ID);
+ ExtensionAuthorController::store_authors_info($this->latestReleasePackage->getAuthors(),$ExtensionData->ID);
} else {
throw new InvalidArgumentException("We could not find Author Info field in composer.json at'"
.$this->url."' ");
}
if($this->latestReleasePackage->getKeywords()) {
- ExtensionKeywords::saveKeywords($this->latestReleasePackage->getKeywords(),$ExtensionData->ID);
+ ExtensionKeywords::save_keywords($this->latestReleasePackage->getKeywords(),$ExtensionData->ID);
} else {
throw new InvalidArgumentException("We could not find Keywords field in composer.json at'"
.$this->url."' ");
View
4 tests/control/ExtensionAuthorTest.php
@@ -21,7 +21,7 @@ function testStoreAuthorsInfo(){
$obj = $this->objFromFixture('ExtensionData', 'testmodule');
$extensionId = $obj->ID;
$ExtensionAuthorController = new ExtensionAuthorController();
- $extensionAuthorsId = $ExtensionAuthorController->storeAuthorsInfo($authorsRawData,$extensionId);
+ $extensionAuthorsId = $ExtensionAuthorController->store_authors_info($authorsRawData,$extensionId);
$extensionAuthor = ExtensionAuthor::get()->byID($extensionAuthorsId['0']);
$this->assertEquals($extensionAuthor->Email , 'testuser@test.com');
@@ -45,6 +45,6 @@ function testStoreAuthorsInfoException() {
$obj = $this->objFromFixture('ExtensionData', 'testmodule');
$extensionId = $obj->ID;
$ExtensionAuthorController = new ExtensionAuthorController();
- $memberId = $ExtensionAuthorController->storeAuthorsInfo($authorsRawData,$extensionId);
+ $memberId = $ExtensionAuthorController->store_authors_info($authorsRawData,$extensionId);
}
}
View
4 tests/control/ExtensionSnapshotTest.php
@@ -12,7 +12,7 @@ function testSaveSnapshot() {
$obj = $this->objFromFixture('ExtensionData', 'testmodule');
$realUrl = 'http://openbees.org/images/Demo.jpg';
- $imageId = ExtensionSnapshot::saveSnapshot($realUrl, $obj->Name);
+ $imageId = ExtensionSnapshot::save_snapshot($realUrl, $obj->Name);
$image = Image::get()->byID($imageId);
$this->assertFileExists(BASE_PATH.DIRECTORY_SEPARATOR.$image->Filename);
@@ -26,6 +26,6 @@ function testSaveSnapshotException() {
$obj = $this->objFromFixture('ExtensionData', 'testmodule');
$fakeUrl = 'http://openbees.org/images/FakeImage.jpg';
- ExtensionSnapshot::saveSnapshot($fakeUrl, $obj->Name);
+ ExtensionSnapshot::save_snapshot($fakeUrl, $obj->Name);
}
}

0 comments on commit 6cb4412

Please sign in to comment.
Something went wrong with that request. Please try again.