Page MenuHomePhabricator

D12804.diff
No OneTemporary

D12804.diff

diff --git a/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php b/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php
--- a/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php
+++ b/src/aphront/storage/connection/mysql/AphrontMySQLDatabaseConnection.php
@@ -145,7 +145,7 @@
public function executeParallelQueries(
array $queries,
array $conns = array()) {
- assert_instances_of($conns, 'AphrontMySQLDatabaseConnection');
+ assert_instances_of($conns, __CLASS__);
$map = array();
$is_write = false;
diff --git a/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php b/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php
--- a/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php
+++ b/src/aphront/storage/connection/mysql/AphrontMySQLiDatabaseConnection.php
@@ -151,7 +151,7 @@
}
public static function resolveAsyncQueries(array $conns, array $asyncs) {
- assert_instances_of($conns, 'AphrontMySQLiDatabaseConnection');
+ assert_instances_of($conns, __CLASS__);
assert_instances_of($asyncs, 'mysqli');
$read = $error = $reject = array();
diff --git a/src/auth/PhutilGitHubAuthAdapter.php b/src/auth/PhutilGitHubAuthAdapter.php
--- a/src/auth/PhutilGitHubAuthAdapter.php
+++ b/src/auth/PhutilGitHubAuthAdapter.php
@@ -56,7 +56,7 @@
$future = new HTTPSFuture($uri);
// NOTE: GitHub requires a User-Agent string.
- $future->addHeader('User-Agent', 'PhutilGitHubAuthAdapter');
+ $future->addHeader('User-Agent', __CLASS__);
list($body) = $future->resolvex();
diff --git a/src/channel/PhutilChannel.php b/src/channel/PhutilChannel.php
--- a/src/channel/PhutilChannel.php
+++ b/src/channel/PhutilChannel.php
@@ -130,8 +130,8 @@
array $writes,
array $options = array()) {
- assert_instances_of($reads, 'PhutilChannel');
- assert_instances_of($writes, 'PhutilChannel');
+ assert_instances_of($reads, __CLASS__);
+ assert_instances_of($writes, __CLASS__);
$read = idx($options, 'read', array());
$write = idx($options, 'write', array());
diff --git a/src/console/PhutilConsoleFormatter.php b/src/console/PhutilConsoleFormatter.php
--- a/src/console/PhutilConsoleFormatter.php
+++ b/src/console/PhutilConsoleFormatter.php
@@ -69,7 +69,7 @@
$format = preg_replace($invert_re, $invert, $format);
$format = preg_replace_callback(
'@<(fg|bg):('.$colors.')>(.*)</\1>@sU',
- array('PhutilConsoleFormatter', 'replaceColorCode'),
+ array(__CLASS__, 'replaceColorCode'),
$format);
}
diff --git a/src/error/PhutilErrorHandler.php b/src/error/PhutilErrorHandler.php
--- a/src/error/PhutilErrorHandler.php
+++ b/src/error/PhutilErrorHandler.php
@@ -53,8 +53,8 @@
*/
public static function initialize() {
self::$initialized = true;
- set_error_handler(array('PhutilErrorHandler', 'handleError'));
- set_exception_handler(array('PhutilErrorHandler', 'handleException'));
+ set_error_handler(array(__CLASS__, 'handleError'));
+ set_exception_handler(array(__CLASS__, 'handleException'));
}
/**
diff --git a/src/filesystem/Filesystem.php b/src/filesystem/Filesystem.php
--- a/src/filesystem/Filesystem.php
+++ b/src/filesystem/Filesystem.php
@@ -983,7 +983,7 @@
if (!self::pathExists($path)) {
throw new FilesystemException(
$path,
- pht("Filesystem entity `%s' does not exist.", $path));
+ pht("File system entity `%s' does not exist.", $path));
}
}
diff --git a/src/filesystem/PhutilLock.php b/src/filesystem/PhutilLock.php
--- a/src/filesystem/PhutilLock.php
+++ b/src/filesystem/PhutilLock.php
@@ -104,7 +104,7 @@
*/
protected static function registerLock(PhutilLock $lock) {
if (!self::$registeredShutdownFunction) {
- register_shutdown_function(array('PhutilLock', 'unlockAll'));
+ register_shutdown_function(array(__CLASS__, 'unlockAll'));
self::$registeredShutdownFunction = true;
}
diff --git a/src/future/Future.php b/src/future/Future.php
--- a/src/future/Future.php
+++ b/src/future/Future.php
@@ -127,7 +127,7 @@
// anything because the SIGCHLD will interrupt the stream_select(), as
// long as we have a handler registered.
if (function_exists('pcntl_signal')) {
- if (!pcntl_signal(SIGCHLD, array('Future', 'handleSIGCHLD'))) {
+ if (!pcntl_signal(SIGCHLD, array(__CLASS__, 'handleSIGCHLD'))) {
throw new Exception(pht('Failed to install signal handler!'));
}
}
diff --git a/src/future/http/HTTPFuture.php b/src/future/http/HTTPFuture.php
--- a/src/future/http/HTTPFuture.php
+++ b/src/future/http/HTTPFuture.php
@@ -109,7 +109,7 @@
}
private function getDefaultUserAgent() {
- return 'HTTPFuture/1.0';
+ return __CLASS__.'/1.0';
}
public function isReady() {
diff --git a/src/future/http/status/HTTPFutureCURLResponseStatus.php b/src/future/http/status/HTTPFutureCURLResponseStatus.php
--- a/src/future/http/status/HTTPFutureCURLResponseStatus.php
+++ b/src/future/http/status/HTTPFutureCURLResponseStatus.php
@@ -71,7 +71,7 @@
);
$default_message = pht(
- "The cURL library raised an error while making a request. You may be ".
+ 'The cURL library raised an error while making a request. You may be '.
'able to find more information about this error (error code: %d) '.
'on the cURL site: %s',
$code,
diff --git a/src/parser/PhutilParserGenerator.php b/src/parser/PhutilParserGenerator.php
--- a/src/parser/PhutilParserGenerator.php
+++ b/src/parser/PhutilParserGenerator.php
@@ -807,7 +807,7 @@
public function generateParserFunction($name) {
$out = array();
$out[] = 'function '.$name.'(array $tokens, $callback) {';
- $out[] = ' return PhutilParserGenerator::parseTokensWithTables(';
+ $out[] = ' return '.__CLASS__.'::parseTokensWithTables(';
$out[] = ' '.$this->formatAndIndent($this->actionTable, 4).',';
$out[] = ' '.$this->formatAndIndent($this->gotoTable, 4).',';
$out[] = ' '.$this->formatAndIndent($this->getEOFSymbol(), 4).',';
diff --git a/src/serviceprofiler/PhutilServiceProfiler.php b/src/serviceprofiler/PhutilServiceProfiler.php
--- a/src/serviceprofiler/PhutilServiceProfiler.php
+++ b/src/serviceprofiler/PhutilServiceProfiler.php
@@ -58,7 +58,7 @@
public static function installEchoListener() {
$instance = self::getInstance();
- $instance->addListener(array('PhutilServiceProfiler', 'echoListener'));
+ $instance->addListener(array(__CLASS__, 'echoListener'));
}
public static function echoListener($type, $id, $data) {
diff --git a/src/utils/__tests__/PhutilUtilsTestCase.php b/src/utils/__tests__/PhutilUtilsTestCase.php
--- a/src/utils/__tests__/PhutilUtilsTestCase.php
+++ b/src/utils/__tests__/PhutilUtilsTestCase.php
@@ -213,7 +213,7 @@
$inputs = array(
'empty' => array(),
'stdClass' => array($object, $object),
- 'PhutilUtilsTestCase' => array($object, $this),
+ __CLASS__ => array($object, $this),
'array' => array(array(), array()),
'integer' => array($object, 1),
);

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 8, 2:39 PM (3 d, 17 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7382801
Default Alt Text
D12804.diff (7 KB)

Event Timeline