for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Moodle component manager.
*
* @author Luke Carrier <[email protected]>
* @copyright 2016 Luke Carrier
* @license GPL-3.0+
*/
namespace ComponentManager\VersionControl\Git\Command;
* Initialise a new repository.
class CheckoutIndexCommand implements Command {
* Prefix.
* @var string
protected $prefix;
* Initialiser.
* @param string $prefix
public function __construct($prefix) {
$this->prefix = $prefix;
}
* @override Command
public function getCommandLine() {
return ['checkout-index', '--all', "--prefix={$this->prefix}"];
sprintf
$this
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.
// Instead of $x = "foo $bar $baz"; // Better use either $x = "foo " . $bar . " " . $baz; $x = sprintf("foo %s %s", $bar, $baz);
* Get the prefix.
* @return string
* @codeCoverageIgnore
public function getPrefix() {
return $this->prefix;
* Set the prefix.
public function setPrefix($prefix) {
It is generally a best practice as it is often more readable to use concatenation instead of interpolation for variables inside strings.