* @param string|string[] ...$args
* @return $this
*/
- public function params( ...$args ) {
+ public function params( ...$args ): Command {
if ( count( $args ) === 1 && is_array( reset( $args ) ) ) {
// If only one argument has been passed, and that argument is an array,
// treat it as a list of arguments
* @param string|string[] ...$args
* @return $this
*/
- public function unsafeParams( ...$args ) {
+ public function unsafeParams( ...$args ): Command {
if ( count( $args ) === 1 && is_array( reset( $args ) ) ) {
// If only one argument has been passed, and that argument is an array,
// treat it as a list of arguments
* filesize (for ulimit -f), memory, time, walltime.
* @return $this
*/
- public function limits( array $limits ) {
+ public function limits( array $limits ): Command {
if ( !isset( $limits['walltime'] ) && isset( $limits['time'] ) ) {
// Emulate the behavior of old wfShellExec() where walltime fell back on time
// if the latter was overridden and the former wasn't
* @param string[] $env array of variable name => value
* @return $this
*/
- public function environment( array $env ) {
+ public function environment( array $env ): Command {
$this->env = $env;
return $this;
* @param string $method
* @return $this
*/
- public function profileMethod( $method ) {
+ public function profileMethod( $method ): Command {
$this->method = $method;
return $this;
* @param string|null $inputString
* @return $this
*/
- public function input( $inputString ) {
+ public function input( $inputString ): Command {
$this->inputString = is_null( $inputString ) ? null : (string)$inputString;
return $this;
* @param bool $yesno
* @return $this
*/
- public function includeStderr( $yesno = true ) {
+ public function includeStderr( $yesno = true ): Command {
$this->doIncludeStderr = $yesno;
return $this;
* @param bool $yesno
* @return $this
*/
- public function logStderr( $yesno = true ) {
+ public function logStderr( $yesno = true ): Command {
$this->doLogStderr = $yesno;
return $this;
* @param string|false $cgroup Absolute file path to the cgroup, or false to not use a cgroup
* @return $this
*/
- public function cgroup( $cgroup ) {
+ public function cgroup( $cgroup ): Command {
$this->cgroup = $cgroup;
return $this;
* @param int $restrictions
* @return $this
*/
- public function restrict( $restrictions ) {
+ public function restrict( $restrictions ): Command {
$this->restrictions |= $restrictions;
return $this;
*
* @return $this
*/
- public function whitelistPaths( array $paths ) {
+ public function whitelistPaths( array $paths ): Command {
// Default implementation is a no-op
return $this;
}
* Example: [ 'convert', '-font', 'font name' ] would produce "'convert' '-font' 'font name'"
* @return Command
*/
- public static function command( ...$commands ) {
+ public static function command( ...$commands ): Command {
if ( count( $commands ) === 1 && is_array( reset( $commands ) ) ) {
// If only one argument has been passed, and that argument is an array,
// treat it as a list of arguments
* 'wrapper': Path to a PHP wrapper to handle the maintenance script
* @return Command
*/
- public static function makeScriptCommand( $script, $parameters, $options = [] ) {
+ public static function makeScriptCommand( $script, $parameters, $options = [] ): Command {
global $wgPhpCli;
// Give site config file a chance to run the script in a wrapper.
// The caller may likely want to call wfBasename() on $script.