1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-08 07:52:39 +01:00

PHPDoc: Replace "@return this" with "@return $this"

Summary:
Per https://github.com/php-fig/fig-standards/blob/master/proposed/phpdoc.md the valid keyword is `$this`.
Thus replace `this` to make output of static code analysis slightly less noisy.

Test Plan: Read the docs.

Reviewers: O1 Blessed Committers, valerio.bozzolan

Reviewed By: O1 Blessed Committers, valerio.bozzolan

Subscribers: tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Differential Revision: https://we.phorge.it/D25818
This commit is contained in:
Andre Klapper 2024-09-05 17:21:07 +02:00
parent a094105908
commit 4b7ee1985b
35 changed files with 89 additions and 89 deletions

View file

@ -66,7 +66,7 @@ abstract class PhutilChannel extends Phobject {
* The default implementation accepts bytes.
*
* @param wild $bytes Data to write to the channel, normally bytes.
* @return this
* @return $this
*
* @task io
*/
@ -247,7 +247,7 @@ abstract class PhutilChannel extends Phobject {
* channel code more easily, by naming channels something meaningful.
*
* @param string $name Channel name.
* @return this
* @return $this
*
* @task impl
*/
@ -364,7 +364,7 @@ abstract class PhutilChannel extends Phobject {
*
* @param int|null $size Maximum read buffer size, or `null` for a limitless
* buffer.
* @return this
* @return $this
* @task impl
*/
public function setReadBufferSize($size) {

View file

@ -163,7 +163,7 @@ final class PhutilExecChannel extends PhutilChannel {
* any output on stderr.
*
* @param callable $handler Handler to invoke when stderr data is received.
* @return this
* @return $this
*/
public function setStderrHandler($handler) {
$this->stderrHandler = $handler;

View file

@ -47,7 +47,7 @@ abstract class PhutilProtocolChannel extends PhutilChannelChannel {
* Write a message to the channel.
*
* @param wild $message Some message.
* @return this
* @return $this
*
* @task io
*/
@ -62,7 +62,7 @@ abstract class PhutilProtocolChannel extends PhutilChannelChannel {
* you can use it to inject out-of-band messages.
*
* @param wild $message Some message.
* @return this
* @return $this
*
* @task io
*/

View file

@ -22,7 +22,7 @@ abstract class PhutilConsoleView extends Phobject {
/**
* Draw a view to the console.
*
* @return this
* @return $this
* @task draw
*/
final public function draw() {

View file

@ -32,7 +32,7 @@ final class FileFinder extends Phobject {
* Create a new FileFinder.
*
* @param string $root Root directory to find files beneath.
* @return this
* @return $this
* @task create
*/
public function __construct($root) {

View file

@ -27,7 +27,7 @@ final class FileList extends Phobject {
* Build a new FileList from an array of paths, e.g. from $argv.
*
* @param list $paths List of relative or absolute file paths.
* @return this
* @return $this
* @task create
*/
public function __construct($paths) {

View file

@ -86,7 +86,7 @@ final class PhutilDeferredLog extends Phobject {
* the values you provide.
*
* @param dict $map Map of variables to values.
* @return this
* @return $this
* @task log
*/
public function setData(array $map) {
@ -117,7 +117,7 @@ final class PhutilDeferredLog extends Phobject {
*
* @param string|null $file File where the entry should be written to, or
* null to prevent writes.
* @return this
* @return $this
* @task log
*/
public function setFile($file) {
@ -166,7 +166,7 @@ final class PhutilDeferredLog extends Phobject {
* A log object will never write more than once, so it is safe to call this
* method even if the object's destructor later runs.
*
* @return this
* @return $this
* @task write
*/
public function write() {

View file

@ -146,7 +146,7 @@ abstract class PhutilLock extends Phobject {
*
* @param float $wait (optional) Seconds to block waiting for the lock. By
* default, do not block.
* @return this
* @return $this
*
* @task lock
*/
@ -186,7 +186,7 @@ abstract class PhutilLock extends Phobject {
* Release the lock. Throws an exception on failure, e.g. if the lock is not
* currently held.
*
* @return this
* @return $this
*
* @task lock
*/

View file

@ -63,7 +63,7 @@ final class TempFile extends Phobject {
* can set it to be preserved instead.
*
* @param bool $preserve True to preserve the file after object destruction.
* @return this
* @return $this
* @task config
*/
public function setPreserveFile($preserve) {

View file

@ -57,7 +57,7 @@ abstract class LinesOfALarge extends Phobject implements Iterator {
* the output of a command which returns a large amount of data.
*
* @param string|null $character A one-byte delimiter character.
* @return this
* @return $this
* @task config
*/
final public function setDelimiter($character) {

View file

@ -135,7 +135,7 @@ final class FutureIterator
*
* @param float $interval Maximum number of seconds to block waiting on
* futures before yielding null.
* @return this
* @return $this
*
* @task config
*/
@ -155,7 +155,7 @@ final class FutureIterator
* }
*
* @param int $max Maximum number of simultaneous jobs allowed.
* @return this
* @return $this
*
* @task config
*/

View file

@ -120,7 +120,7 @@ final class ExecFuture extends PhutilExecutableFuture {
* NOTE: Setting this to 0 means "no buffer", not "unlimited buffer".
*
* @param int $limit Maximum size of the stdout read buffer.
* @return this
* @return $this
* @task config
*/
public function setStdoutSizeLimit($limit) {
@ -134,7 +134,7 @@ final class ExecFuture extends PhutilExecutableFuture {
* See @{method:setStdoutSizeLimit} for discussion.
*
* @param int $limit Maximum size of the stderr read buffer.
* @return this
* @return $this
* @task config
*/
public function setStderrSizeLimit($limit) {
@ -155,7 +155,7 @@ final class ExecFuture extends PhutilExecutableFuture {
*
* @param int|null $read_buffer_size Maximum buffer size, or `null` for
* unlimited.
* @return this
* @return $this
*/
public function setReadBufferSize($read_buffer_size) {
$this->readBufferSize = $read_buffer_size;
@ -240,7 +240,7 @@ final class ExecFuture extends PhutilExecutableFuture {
* that commands which listen for EOF will execute. If you want
* to keep the pipe open past the start of command execution, do
* an empty write with `$keep_pipe = true` first.
* @return this
* @return $this
* @task interact
*/
public function write($data, $keep_pipe = false) {
@ -268,7 +268,7 @@ final class ExecFuture extends PhutilExecutableFuture {
* future resolves. This is almost certainly only useful if you need the
* buffer memory for some reason.
*
* @return this
* @return $this
* @task interact
*/
public function discardBuffers() {
@ -311,7 +311,7 @@ final class ExecFuture extends PhutilExecutableFuture {
*
* @param int $seconds Maximum number of seconds this command may execute for
* before it is signaled.
* @return this
* @return $this
* @task config
*/
public function setTimeout($seconds) {

View file

@ -63,7 +63,7 @@ abstract class PhutilExecutableFuture extends Future {
* @param map<string, string> $env Dictionary of environmental variables.
* @param bool $wipe_process_env (optional) Pass `true` to replace the
* existing environment.
* @return this
* @return $this
*
* @task config
*/
@ -89,7 +89,7 @@ abstract class PhutilExecutableFuture extends Future {
*
* @param string $key Environmental variable name.
* @param string|null $value New value, or null to remove this variable.
* @return this
* @return $this
* @task config
*/
final public function updateEnv($key, $value) {
@ -161,7 +161,7 @@ abstract class PhutilExecutableFuture extends Future {
* current working directory.
*
* @param string $cwd Directory to execute the subprocess in.
* @return this
* @return $this
* @task config
*/
final public function setCWD($cwd) {

View file

@ -59,7 +59,7 @@ abstract class BaseHTTPFuture extends Future {
* isTimeout() on the status object.
*
* @param float $timeout Maximum timeout, in seconds.
* @return this
* @return $this
* @task config
*/
public function setTimeout($timeout) {
@ -84,7 +84,7 @@ abstract class BaseHTTPFuture extends Future {
* By default, requests use "GET".
*
* @param string $method HTTP method name.
* @return this
* @return $this
* @task config
*/
final public function setMethod($method) {
@ -125,7 +125,7 @@ abstract class BaseHTTPFuture extends Future {
* parameter.
*
* @param string $uri URI to send the request to.
* @return this
* @return $this
* @task config
*/
public function setURI($uri) {
@ -152,7 +152,7 @@ abstract class BaseHTTPFuture extends Future {
* case it will be encoded and sent as 'application/x-www-form-urlencoded').
*
* @param mixed $data Data to send with the request.
* @return this
* @return $this
* @task config
*/
public function setData($data) {
@ -181,7 +181,7 @@ abstract class BaseHTTPFuture extends Future {
*
* @param string $name Header name, like "Accept-Language".
* @param string $value Header value, like "en-us".
* @return this
* @return $this
* @task config
*/
public function addHeader($name, $value) {
@ -230,7 +230,7 @@ abstract class BaseHTTPFuture extends Future {
*
* @param array|null $status_codes List of expected HTTP status codes.
*
* @return this
* @return $this
* @task config
*/
public function setExpectStatus($status_codes) {
@ -253,7 +253,7 @@ abstract class BaseHTTPFuture extends Future {
*
* @param string $username Username to authenticate with.
* @param PhutilOpaqueEnvelope $password Password to authenticate with.
* @return this
* @return $this
* @task config
*/
public function setHTTPBasicAuthCredentials(

View file

@ -41,7 +41,7 @@ final class HTTPSFuture extends BaseHTTPFuture {
*
* @param string $certificate The multi-line, possibly lengthy, SSL
* certificate to use.
* @return this
* @return $this
*/
public function setCABundleFromString($certificate) {
$temp = new TempFile();
@ -54,7 +54,7 @@ final class HTTPSFuture extends BaseHTTPFuture {
* Set the SSL certificate to use for this session, given a path.
*
* @param string $path The path to a valid SSL certificate for this session
* @return this
* @return $this
*/
public function setCABundleFromPath($path) {
$this->cabundle = $path;
@ -76,7 +76,7 @@ final class HTTPSFuture extends BaseHTTPFuture {
*
* @param boolean $follow true to follow any Location header present in the
* response, false to return the request directly
* @return this
* @return $this
*/
public function setFollowLocation($follow) {
$this->followLocation = $follow;
@ -191,7 +191,7 @@ final class HTTPSFuture extends BaseHTTPFuture {
* @param string $data File content.
* @param string $name File name.
* @param string $mime_type File mime type.
* @return this
* @return $this
*/
public function attachFileData($key, $data, $name, $mime_type) {
if (isset($this->files[$key])) {
@ -627,7 +627,7 @@ final class HTTPSFuture extends BaseHTTPFuture {
* Discard any buffered data. Normally, you call this after reading the
* data with @{method:read}.
*
* @return this
* @return $this
*/
public function discardBuffers() {
if ($this->isDownload()) {
@ -831,7 +831,7 @@ final class HTTPSFuture extends BaseHTTPFuture {
* You must write the entire body before starting the request.
*
* @param string $raw_body Raw body.
* @return this
* @return $this
*/
public function write($raw_body) {
$this->rawBody = $raw_body;

View file

@ -57,7 +57,7 @@ final class ArcanistHgProxyClient extends Phobject {
* When connecting, do not expect the "capabilities" message.
*
* @param bool $skip True to skip the "capabilities" message.
* @return this
* @return $this
*
* @task config
*/

View file

@ -68,7 +68,7 @@ final class ArcanistHgProxyServer extends Phobject {
* Disable status messages to stdout. Controlled with `--quiet`.
*
* @param bool $quiet True to disable status messages.
* @return this
* @return $this
*
* @task config
*/
@ -86,7 +86,7 @@ final class ArcanistHgProxyServer extends Phobject {
* to profile the server.
*
* @param int $limit Client limit, or 0 to disable limit.
* @return this
* @return $this
*
* @task config
*/
@ -101,7 +101,7 @@ final class ArcanistHgProxyServer extends Phobject {
* will exit. Controlled with `--idle-limit`.
*
* @param int $limit Idle limit, or 0 to disable limit.
* @return this
* @return $this
*
* @task config
*/
@ -118,7 +118,7 @@ final class ArcanistHgProxyServer extends Phobject {
* improves performance. Controlled with --skip-hello.
*
* @param bool $skip True to skip the "capabilities" message.
* @return this
* @return $this
*
* @task config
*/
@ -133,7 +133,7 @@ final class ArcanistHgProxyServer extends Phobject {
* Controlled by --do-not-daemonize. Primarily useful for debugging.
*
* @param bool $do_not_daemonize True to run in the foreground.
* @return this
* @return $this
*
* @task config
*/

View file

@ -292,7 +292,7 @@ abstract class ArcanistLintEngine extends Phobject {
/**
* @param dict<string path, dict<string version, list<dict message>>>
* $results
* @return this
* @return $this
*/
final public function setCachedResults(array $results) {
$this->cachedResults = $results;
@ -437,7 +437,7 @@ abstract class ArcanistLintEngine extends Phobject {
*
* @param string $key Resource identifier.
* @param wild $value Resource.
* @return this
* @return $this
*/
public function setLinterResource($key, $value) {
$this->linterResources[$key] = $value;

View file

@ -105,7 +105,7 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter {
* by @{method:getDefaultFlags} are used.
*
* @param list<string> $flags New flags.
* @return this
* @return $this
* @task bin
*/
final public function setFlags(array $flags) {
@ -117,7 +117,7 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter {
* Set the binary's version requirement.
*
* @param string $version Version requirement.
* @return this
* @return $this
* @task bin
*/
final public function setVersionRequirement($version) {
@ -152,7 +152,7 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter {
* Override the default binary with a new one.
*
* @param string $bin New binary.
* @return this
* @return $this
* @task bin
*/
final public function setBinary($bin) {
@ -201,7 +201,7 @@ abstract class ArcanistExternalLinter extends ArcanistFutureLinter {
* Set the interpreter, overriding any default.
*
* @param string $interpreter New interpreter.
* @return this
* @return $this
* @task bin
*/
final public function setInterpreter($interpreter) {

View file

@ -132,7 +132,7 @@ abstract class ArcanistLinter extends Phobject {
* This ID is assigned automatically by the @{class:ArcanistLintEngine}.
*
* @param string $id Unique linter ID.
* @return this
* @return $this
* @task state
*/
final public function setLinterID($id) {

View file

@ -30,7 +30,7 @@ final class ArcanistXHPASTLinter extends ArcanistBaseXHPASTLinter {
* linter rules in isolation. By default, all linter rules will be enabled.
*
* @param list<ArcanistXHPASTLinterRule> $rules
* @return this
* @return $this
*/
public function setRules(array $rules) {
assert_instances_of($rules, 'ArcanistXHPASTLinterRule');

View file

@ -17,7 +17,7 @@ abstract class ArcanistXHPASTLintNamingHook extends Phobject {
* The constructor is final because @{class:ArcanistXHPASTLinter} is
* responsible for hook instantiation.
*
* @return this
* @return $this
* @task internals
*/
final public function __construct() {

View file

@ -41,7 +41,7 @@ final class PhutilLibraryMapBuilder extends Phobject {
* Control subprocess parallelism limit. Use `--limit` to set this.
*
* @param int $limit Maximum number of subprocesses to run in parallel.
* @return this
* @return $this
*
* @task map
*/

View file

@ -163,7 +163,7 @@ final class PhutilSimpleOptions extends Phobject {
*
* @param bool $case_sensitive True to make the parser case sensitive, false
* to make it case-insensitive.
* @return this
* @return $this
* @task config
*/
public function setCaseSensitive($case_sensitive) {

View file

@ -115,7 +115,7 @@ final class PhutilArgumentParser extends Phobject {
* @{class:PhutilArgumentSpecification}.
* @param bool $initial_only (optional) Require flags appear before any
* non-flag arguments.
* @return this
* @return $this
* @task parse
*/
public function parsePartial(array $specs, $initial_only = false) {
@ -123,7 +123,7 @@ final class PhutilArgumentParser extends Phobject {
}
/**
* @return this
* @return $this
*/
private function parseInternal(
array $specs,
@ -313,7 +313,7 @@ final class PhutilArgumentParser extends Phobject {
*
* @param list $specs List of argument specs, see
* @{class:PhutilArgumentSpecification}.
* @return this
* @return $this
* @task parse
*/
public function parseFull(array $specs) {
@ -349,7 +349,7 @@ final class PhutilArgumentParser extends Phobject {
*
* @param list $specs List of argument specs, see
* @{class:PhutilArgumentSpecification}.
* @return this
* @return $this
* @task parse
*/
public function parse(array $specs) {
@ -370,7 +370,7 @@ final class PhutilArgumentParser extends Phobject {
*
* @param list $workflows List of argument specs, see
* @{class:PhutilArgumentSpecification}.
* @return this
* @return $this
* @task parse
*/
public function parseWorkflows(array $workflows) {
@ -506,7 +506,7 @@ final class PhutilArgumentParser extends Phobject {
* --xprofile <file> Write out an XHProf profile.
* --help Show help.
*
* @return this
* @return $this
*
* @phutil-external-symbol function xhprof_enable
*/

View file

@ -269,7 +269,7 @@ abstract class ArcanistRepositoryAPI extends Phobject {
* Drops caches after changes to the working copy. By default, some queries
* against the working copy are cached. They
*
* @return this
* @return $this
* @task status
*/
final public function reloadWorkingCopy() {

View file

@ -61,7 +61,7 @@ final class PhutilClassMapQuery extends Phobject {
* of.
*
* @param string $class Ancestor class or interface name.
* @return this
* @return $this
* @task config
*/
public function setAncestorClass($class) {
@ -82,7 +82,7 @@ final class PhutilClassMapQuery extends Phobject {
* @param string $unique_method Name of the unique key method.
* @param bool $filter_null (optional) If true, then classes which return
* `null` will be filtered from the results.
* @return this
* @return $this
* @task config
*/
public function setUniqueMethod($unique_method, $filter_null = false) {
@ -126,7 +126,7 @@ final class PhutilClassMapQuery extends Phobject {
* each instance with @{method:setUniqueMethod}.
*
* @param string $expand_method Name of the expansion method.
* @return this
* @return $this
* @task config
*/
public function setExpandMethod($expand_method) {
@ -142,7 +142,7 @@ final class PhutilClassMapQuery extends Phobject {
* name.
*
* @param string $sort_method Name of the sorting method.
* @return this
* @return $this
* @task config
*/
public function setSortMethod($sort_method) {
@ -155,7 +155,7 @@ final class PhutilClassMapQuery extends Phobject {
* Provide a method to filter the map.
*
* @param string $filter_method Name of the filtering method.
* @return this
* @return $this
* @task config
*/
public function setFilterMethod($filter_method) {

View file

@ -57,7 +57,7 @@ final class PhutilSymbolLoader {
* `interface`.
*
* @param string $type Type of symbol to load.
* @return this
* @return $this
*
* @task config
*/
@ -72,7 +72,7 @@ final class PhutilSymbolLoader {
* library will be loaded.
*
* @param string $library Library name.
* @return this
* @return $this
*
* @task config
*/
@ -91,7 +91,7 @@ final class PhutilSymbolLoader {
* in files below that path will be selected.
*
* @param string $path Path relative to library root, like "apps/cheese/".
* @return this
* @return $this
*
* @task config
*/
@ -106,7 +106,7 @@ final class PhutilSymbolLoader {
* or function name.
*
* @param string $name Symbol name.
* @return this
* @return $this
*
* @task config
*/
@ -122,7 +122,7 @@ final class PhutilSymbolLoader {
* implies loading only classes.
*
* @param string $base Base class name.
* @return this
* @return $this
*
* @task config
*/
@ -140,7 +140,7 @@ final class PhutilSymbolLoader {
* @{method:selectSymbolsWithoutLoading}.
*
* @param bool $concrete True if the query should load only concrete symbols.
* @return this
* @return $this
*
* @task config
*/

View file

@ -81,7 +81,7 @@ final class ArcanistUnitTestResult extends Phobject {
* 3 seconds, or `0.125` for 125 milliseconds.
*
* @param int|float $duration Duration, in seconds.
* @return this
* @return $this
*/
public function setDuration($duration) {
if (!is_int($duration) && !is_float($duration)) {

View file

@ -41,7 +41,7 @@ final class ArcanistFileDataRef extends Phobject {
* human consumption.
*
* @param string $name Filename.
* @return this
* @return $this
* @task config
*/
public function setName($name) {
@ -92,7 +92,7 @@ final class ArcanistFileDataRef extends Phobject {
* should also call @{method:setName}.
*
* @param string $path Path on disk to a file containing data to upload.
* @return this
* @return $this
* @task config
*/
public function setPath($path) {
@ -134,7 +134,7 @@ final class ArcanistFileDataRef extends Phobject {
* timestamp. The file will be deleted after this time.
*
* @param int $epoch Epoch timestamp to retain the file until.
* @return this
* @return $this
* @task config
*/
public function setDeleteAfterEpoch($epoch) {

View file

@ -48,7 +48,7 @@ final class ArcanistFileUploader extends Phobject {
*
* @param ArcanistFileDataRef $file File data to upload.
* @param null|string $key (optional) Key to use to identify this file.
* @return this
* @return $this
* @task add
*/
public function addFile(ArcanistFileDataRef $file, $key = null) {

View file

@ -70,7 +70,7 @@ abstract class AbstractDirectedGraph extends Phobject {
*
* @param dict $nodes A map of nodes to the nodes reachable along their
* edges
* @return this
* @return $this
* @task build
*/
final public function addNodes(array $nodes) {
@ -219,7 +219,7 @@ abstract class AbstractDirectedGraph extends Phobject {
* constructs the graph level-by-level, calling @{method:loadEdges} to
* expand the graph at each stage until it is complete.
*
* @return this
* @return $this
* @task build
*/
final public function loadGraph() {

View file

@ -62,7 +62,7 @@ abstract class PhutilBufferedIterator extends Phobject implements Iterator {
* Configure the page size. Note that implementations may ignore this.
*
* @param int $size Page size.
* @return this
* @return $this
* @task config
*/
final public function setPageSize($size) {

View file

@ -20,7 +20,7 @@ final class PhutilRope extends Phobject {
* Append a string to the rope.
*
* @param string $string String to append.
* @return this
* @return $this
*/
public function append($string) {
if (!strlen($string)) {
@ -109,7 +109,7 @@ final class PhutilRope extends Phobject {
* Remove a specified number of bytes from the head of the rope.
*
* @param int $remove Bytes to remove.
* @return this
* @return $this
*/
public function removeBytesFromHead($remove) {
if ($remove <= 0) {

View file

@ -317,7 +317,7 @@ abstract class ArcanistWorkflow extends Phobject {
*
* @param string $conduit_uri The URI to open a conduit to when
* @{method:establishConduit} is called.
* @return this
* @return $this
* @task conduit
*/
final public function setConduitURI($conduit_uri) {
@ -352,7 +352,7 @@ abstract class ArcanistWorkflow extends Phobject {
* NOTE: You must call @{method:setConduitURI} before you can call this
* method.
*
* @return this
* @return $this
* @task conduit
*/
final public function establishConduit() {
@ -409,7 +409,7 @@ abstract class ArcanistWorkflow extends Phobject {
*
* @param dict $credentials A credential dictionary, see
* @{method:authenticateConduit}.
* @return this
* @return $this
* @task conduit
*/
final public function setConduitCredentials(array $credentials) {
@ -458,7 +458,7 @@ abstract class ArcanistWorkflow extends Phobject {
* NOTE: You must call @{method:setConduitURI} and
* @{method:setConduitCredentials} before you invoke this method.
*
* @return this
* @return $this
* @task conduit
*/
final public function authenticateConduit() {