mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-10 00:42:41 +01:00
Change fileName to filename
Summary: There are lots of callsites to $changeset->getFilename() so it seemed easier to rename getFileName() to getFilename() even if it includes database change. Plus I think that getFilename() is better. Test Plan: Alter database. Open revision. Reviewers: epriestley Reviewed By: epriestley CC: aran Differential Revision: https://secure.phabricator.com/D1437
This commit is contained in:
parent
ae0d9770a5
commit
6472dbe168
10 changed files with 19 additions and 17 deletions
2
resources/sql/patches/096.filename.sql
Normal file
2
resources/sql/patches/096.filename.sql
Normal file
|
@ -0,0 +1,2 @@
|
|||
ALTER TABLE phabricator_differential.differential_changeset
|
||||
CHANGE fileName filename varchar(255) NOT NULL;
|
|
@ -244,7 +244,7 @@ class DifferentialChangesetViewController extends DifferentialController {
|
|||
|
||||
$inlines = array();
|
||||
foreach ($lint as $msg) {
|
||||
if ($msg['path'] != $changeset->getFileName()) {
|
||||
if ($msg['path'] != $changeset->getFilename()) {
|
||||
continue;
|
||||
}
|
||||
$inline = new DifferentialInlineComment();
|
||||
|
|
|
@ -654,7 +654,7 @@ class DifferentialRevisionViewController extends DifferentialController {
|
|||
|
||||
$indexed_langs = array_fill_keys($langs, true);
|
||||
foreach ($visible_changesets as $key => $changeset) {
|
||||
$lang = $engine->getLanguageFromFilename($changeset->getFileName());
|
||||
$lang = $engine->getLanguageFromFilename($changeset->getFilename());
|
||||
if (isset($indexed_langs[$lang])) {
|
||||
$symbol_indexes[$key] = array(
|
||||
'lang' => $lang,
|
||||
|
|
|
@ -779,7 +779,7 @@ class DifferentialRevisionEditor {
|
|||
|
||||
$paths = array();
|
||||
foreach ($changesets as $changeset) {
|
||||
$paths[] = $path_prefix.'/'.$changeset->getFileName();
|
||||
$paths[] = $path_prefix.'/'.$changeset->getFilename();
|
||||
}
|
||||
|
||||
// Mark this as also touching all parent paths, so you can see all pending
|
||||
|
|
|
@ -33,7 +33,7 @@ final class DifferentialLintFieldSpecification
|
|||
|
||||
public function renderValueForRevisionView() {
|
||||
$diff = $this->getDiff();
|
||||
$path_changesets = mpull($diff->loadChangesets(), 'getId', 'getFileName');
|
||||
$path_changesets = mpull($diff->loadChangesets(), 'getId', 'getFilename');
|
||||
|
||||
$lstar = DifferentialRevisionUpdateHistoryView::renderDiffLintStar($diff);
|
||||
$lmsg = DifferentialRevisionUpdateHistoryView::getDiffLintMessage($diff);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -20,7 +20,7 @@ class DifferentialChangeset extends DifferentialDAO {
|
|||
|
||||
protected $diffID;
|
||||
protected $oldFile;
|
||||
protected $fileName;
|
||||
protected $filename;
|
||||
protected $awayPaths;
|
||||
protected $changeType;
|
||||
protected $fileType;
|
||||
|
@ -155,7 +155,7 @@ class DifferentialChangeset extends DifferentialDAO {
|
|||
$base = id(new PhutilURI($diff->getSourceControlPath()))->getPath();
|
||||
}
|
||||
|
||||
$path = $this->getFileName();
|
||||
$path = $this->getFilename();
|
||||
$path = rtrim($base, '/').'/'.ltrim($path, '/');
|
||||
|
||||
$vcs = $repository->getVersionControlSystem();
|
||||
|
@ -177,7 +177,7 @@ class DifferentialChangeset extends DifferentialDAO {
|
|||
public function getWordWrapWidth() {
|
||||
$config = PhabricatorEnv::getEnvConfig('differential.wordwrap');
|
||||
foreach ($config as $regexp => $width) {
|
||||
if (preg_match($regexp, $this->getFileName())) {
|
||||
if (preg_match($regexp, $this->getFilename())) {
|
||||
return $width;
|
||||
}
|
||||
}
|
||||
|
@ -187,7 +187,7 @@ class DifferentialChangeset extends DifferentialDAO {
|
|||
public function getWhitespaceMatters() {
|
||||
$config = PhabricatorEnv::getEnvConfig('differential.whitespace-matters');
|
||||
foreach ($config as $regexp) {
|
||||
if (preg_match($regexp, $this->getFileName())) {
|
||||
if (preg_match($regexp, $this->getFilename())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ class DifferentialDiff extends DifferentialDAO {
|
|||
$change = array(
|
||||
'metadata' => $changeset->getMetadata(),
|
||||
'oldPath' => $changeset->getOldFile(),
|
||||
'currentPath' => $changeset->getFileName(),
|
||||
'currentPath' => $changeset->getFilename(),
|
||||
'awayPaths' => $changeset->getAwayPaths(),
|
||||
'oldProperties' => $changeset->getOldProperties(),
|
||||
'newProperties' => $changeset->getNewProperties(),
|
||||
|
|
|
@ -177,7 +177,7 @@ final class DifferentialRevisionCommentView extends AphrontView {
|
|||
$inline_render[] =
|
||||
'<tr>'.
|
||||
'<th colspan="3">'.
|
||||
phutil_escape_html($changeset->getFileName()).
|
||||
phutil_escape_html($changeset->getFilename()).
|
||||
'</th>'.
|
||||
'</tr>';
|
||||
foreach ($inlines as $inline) {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -23,7 +23,7 @@ class PhabricatorMetaMTAAttachment {
|
|||
|
||||
public function __construct($data, $filename, $mimetype) {
|
||||
$this->setData($data);
|
||||
$this->setFileName($filename);
|
||||
$this->setFilename($filename);
|
||||
$this->setMimeType($mimetype);
|
||||
}
|
||||
|
||||
|
@ -36,11 +36,11 @@ class PhabricatorMetaMTAAttachment {
|
|||
return $this;
|
||||
}
|
||||
|
||||
public function getFileName() {
|
||||
public function getFilename() {
|
||||
return $this->filename;
|
||||
}
|
||||
|
||||
public function setFileName($filename) {
|
||||
public function setFilename($filename) {
|
||||
$this->filename = $filename;
|
||||
return $this;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
|
||||
/*
|
||||
* Copyright 2011 Facebook, Inc.
|
||||
* Copyright 2012 Facebook, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -326,7 +326,7 @@ class PhabricatorMetaMTAMail extends PhabricatorMetaMTADAO {
|
|||
foreach ($value as $attachment) {
|
||||
$mailer->addAttachment(
|
||||
$attachment->getData(),
|
||||
$attachment->getFileName(),
|
||||
$attachment->getFilename(),
|
||||
$attachment->getMimeType()
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue