for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace AlexCool\Rcon\Utils;
final class CommandFormatter
{
/**
* @var array
*/
private $format;
private $arguments;
* @return string
public function getFormat(): string
return implode(' ', $this->format);
}
* @return array
public function getArguments(): array
return $this->arguments;
* @param string $format
* @param $argument
*
* @return $this
public function addElement(string $format, $argument)
$this->format[] .= $format;
$this->arguments[] .= $argument;
return $this;
* Return result string
public function compile()
return vsprintf(implode(' ', $this->format), $this->arguments);