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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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