1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-30 01:10:58 +01:00

Fix some linter violations

Summary: Self-explanatory.

Test Plan: `arc lint`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: Korvin, epriestley

Differential Revision: https://secure.phabricator.com/D11142
This commit is contained in:
Joshua Spence 2015-01-03 09:11:41 +11:00
parent 87f11a091d
commit 8dee37a132
9 changed files with 34 additions and 33 deletions

View file

@ -4,7 +4,7 @@ final class PhabricatorFileTestDataGenerator
extends PhabricatorTestDataGenerator {
public function generate() {
$authorPHID = $this->loadPhabrictorUserPHID();
$author_phid = $this->loadPhabrictorUserPHID();
$dimension = 1 << rand(5, 12);
$image = id(new PhabricatorLipsumMondrianArtist())
->generate($dimension, $dimension);
@ -13,7 +13,7 @@ final class PhabricatorFileTestDataGenerator
array(
'name' => 'rand-'.rand(1000, 9999),
));
$file->setAuthorPHID($authorPHID);
$file->setAuthorPHID($author_phid);
$file->setMimeType('image/jpeg');
return $file->save();
}

View file

@ -238,18 +238,18 @@ final class PhabricatorFile extends PhabricatorFileDAO
$copy_of_storage_engine = $file->getStorageEngine();
$copy_of_storage_handle = $file->getStorageHandle();
$copy_of_storage_format = $file->getStorageFormat();
$copy_of_byteSize = $file->getByteSize();
$copy_of_mimeType = $file->getMimeType();
$copy_of_byte_size = $file->getByteSize();
$copy_of_mime_type = $file->getMimeType();
$new_file = PhabricatorFile::initializeNewFile();
$new_file->setByteSize($copy_of_byteSize);
$new_file->setByteSize($copy_of_byte_size);
$new_file->setContentHash($hash);
$new_file->setStorageEngine($copy_of_storage_engine);
$new_file->setStorageHandle($copy_of_storage_handle);
$new_file->setStorageFormat($copy_of_storage_format);
$new_file->setMimeType($copy_of_mimeType);
$new_file->setMimeType($copy_of_mime_type);
$new_file->copyDimensions($file);
$new_file->readPropertiesFromParameters($params);

View file

@ -4,9 +4,9 @@ final class PhabricatorManiphestTaskTestDataGenerator
extends PhabricatorTestDataGenerator {
public function generate() {
$authorPHID = $this->loadPhabrictorUserPHID();
$author_phid = $this->loadPhabrictorUserPHID();
$author = id(new PhabricatorUser())
->loadOneWhere('phid = %s', $authorPHID);
->loadOneWhere('phid = %s', $author_phid);
$task = ManiphestTask::initializeNewTask($author)
->setSubPriority($this->generateTaskSubPriority())
->setTitle($this->generateTitle());

View file

@ -37,8 +37,8 @@ abstract class PhameController extends PhabricatorController {
foreach ($posts as $post) {
$blogger = $this->getHandle($post->getBloggerPHID())->renderLink();
$bloggerURI = $this->getHandle($post->getBloggerPHID())->getURI();
$bloggerImage = $this->getHandle($post->getBloggerPHID())->getImageURI();
$blogger_uri = $this->getHandle($post->getBloggerPHID())->getURI();
$blogger_image = $this->getHandle($post->getBloggerPHID())->getImageURI();
$blog = null;
if ($post->getBlog()) {
@ -71,8 +71,8 @@ abstract class PhameController extends PhabricatorController {
$story = id(new PHUIFeedStoryView())
->setTitle($title)
->setImage($bloggerImage)
->setImageHref($bloggerURI)
->setImage($blogger_image)
->setImageHref($blogger_uri)
->setAppIcon('phame-dark')
->setUser($viewer)
->setPontification($phame_post, $phame_title);

View file

@ -4,11 +4,11 @@ final class PhabricatorPholioMockTestDataGenerator
extends PhabricatorTestDataGenerator {
public function generate() {
$authorPHID = $this->loadPhabrictorUserPHID();
$author_phid = $this->loadPhabrictorUserPHID();
$author = id(new PhabricatorUser())
->loadOneWhere('phid = %s', $authorPHID);
->loadOneWhere('phid = %s', $author_phid);
$mock = id(new PholioMock())
->setAuthorPHID($authorPHID);
->setAuthorPHID($author_phid);
$content_source = PhabricatorContentSource::newForSource(
PhabricatorContentSource::SOURCE_UNKNOWN,
array());
@ -27,10 +27,10 @@ final class PhabricatorPholioMockTestDataGenerator
array('=' => $this->getCCPHIDs());
// Get Files and make Images
$filePHIDS = $this->generateImages();
$file_phids = $this->generateImages();
$files = id(new PhabricatorFileQuery())
->setViewer($author)
->withPHIDs($filePHIDS)
->withPHIDs($file_phids)
->execute();
$mock->setCoverPHID(head($files)->getPHID());
$sequence = 0;

View file

@ -117,9 +117,9 @@ final class PhabricatorPolicyQuery
}
public static function isGlobalPolicy($policy) {
$globalPolicies = self::getGlobalPolicies();
$global_policies = self::getGlobalPolicies();
if (isset($globalPolicies[$policy])) {
if (isset($global_policies[$policy])) {
return true;
}

View file

@ -8,17 +8,17 @@ final class PhabricatorProjectTestDataGenerator
public function generate() {
$title = $this->generateTitle();
$author = $this->loadPhabrictorUser();
$authorPHID = $author->getPHID();
$author_phid = $author->getPHID();
$project = id(new PhabricatorProject())
->setName($title)
->setAuthorPHID($authorPHID);
->setAuthorPHID($author_phid);
$this->addTransaction(
PhabricatorProjectTransaction::TYPE_NAME,
$title);
$this->addTransaction(
PhabricatorProjectTransaction::TYPE_MEMBERS,
$this->loadMembersWithAuthor($authorPHID));
$this->loadMembersWithAuthor($author_phid));
$this->addTransaction(
PhabricatorProjectTransaction::TYPE_STATUS,
$this->generateProjectStatus());

View file

@ -46,31 +46,31 @@ final class ReleephQueryRequestsConduitAPIMethod
$query->withRequestedCommitPHIDs($requested_commit_phids);
}
$releephRequests = $query->execute();
$releeph_requests = $query->execute();
foreach ($releephRequests as $releephRequest) {
$branch = $releephRequest->getBranch();
foreach ($releeph_requests as $releeph_request) {
$branch = $releeph_request->getBranch();
$request_commit_phid = $releephRequest->getRequestCommitPHID();
$request_commit_phid = $releeph_request->getRequestCommitPHID();
$object = $releephRequest->getRequestedObject();
$object = $releeph_request->getRequestedObject();
if ($object instanceof DifferentialRevision) {
$object_phid = $object->getPHID();
} else {
$object_phid = null;
}
$status = $releephRequest->getStatus();
$statusName = ReleephRequestStatus::getStatusDescriptionFor($status);
$url = PhabricatorEnv::getProductionURI('/RQ'.$releephRequest->getID());
$status = $releeph_request->getStatus();
$status_name = ReleephRequestStatus::getStatusDescriptionFor($status);
$url = PhabricatorEnv::getProductionURI('/RQ'.$releeph_request->getID());
$result[] = array(
'branchBasename' => $branch->getBasename(),
'branchSymbolic' => $branch->getSymbolicName(),
'requestID' => $releephRequest->getID(),
'requestID' => $releeph_request->getID(),
'revisionPHID' => $object_phid,
'status' => $status,
'statusName' => $statusName,
'status_name' => $status_name,
'url' => $url,
);
}

View file

@ -66,9 +66,10 @@ final class PhabricatorRepositoryRepositoryPHIDType
if ($query->execute()) {
$objects = $query->getIdentifierMap();
foreach ($objects as $key => $object) {
foreach (idx($id_map, $key, array()) as $name)
foreach (idx($id_map, $key, array()) as $name) {
$results[$name] = $object;
}
}
return $results;
} else {
return array();