Add CommandOutputFormatterTrait
This commit is contained in:
parent
92a0e575d4
commit
5b860d78b8
21
Command/Traits/CommandOutputFormatterTrait.php
Normal file
21
Command/Traits/CommandOutputFormatterTrait.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace RetailCrm\DeliveryModuleBundle\Command\Traits;
|
||||
|
||||
trait CommandOutputFormatterTrait
|
||||
{
|
||||
public function getMessage(string $level, string $message): string
|
||||
{
|
||||
return sprintf("%s %s %s", date('Y-m-d H:i:s'), strtoupper($level), $message);
|
||||
}
|
||||
|
||||
public function getInfoMessage(string $message): string
|
||||
{
|
||||
return $this->getMessage('INFO', $message);
|
||||
}
|
||||
|
||||
public function getErrorMessage(string $message): string
|
||||
{
|
||||
return $this->getMessage('ERROR', $message);
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user