for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace PhpGitHooks\Module\Git\Service;
class PreCommitOutputWriter
{
/**
* @var string
*/
private $message;
* PreCommitOutputWriter constructor.
*
* @param string $message
public function __construct($message)
$this->message = $message;
}
* @return string
public function getMessage()
$maxLength = 50;
$message = $this->message;
$restLength = $maxLength - strlen($message);
for ($i = 0; $restLength > $i; ++$i) {
$message .= '.';
return sprintf('<info>%s</info>', $message);
public function getSuccessfulMessage()
return '<comment>0K</comment>';
* @param string $error
public function setError($error)
return sprintf("\n<error>%s</error>", trim($error));
public function getFailMessage()
return $this->setError('Fail');