/** * Override to infer command to composerCommand * * @param string $name The name * @param mixed $value The value * * @return $this */ public function offsetSet($name, $value) { if ($name === 'command') { parent::offsetSet('composerCommand', $value); $value = 'composer ' . $value; } parent::offsetSet($name, $value); }
/** * Infere command to gitCommand * * @param string $name Name * @param mixed $value Value * * @return void */ public function offsetSet($name, $value) { if ($name === 'command') { if (is_array($value)) { foreach ($value as &$item) { $item = 'git ' . $item; } } else { $value = 'git ' . $value; } } parent::offsetSet($name, $value); }