for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Graze\CiffRenderer\DateFormatter;
use Graze\CiffRenderer\DateFormatter\DateFormatterInterface;
use Urbanplum\DotnetDateTime\DotnetDateTime;
class DateFormatterBasic implements DateFormatterInterface
{
/**
* @var DotnetDateTime
*/
private $dotnetDateTime;
* @param DotnetDateTime $dotnetDateTime
public function __construct(DotnetDateTime $dotnetDateTime)
$this->dotnetDateTime = $dotnetDateTime;
}
* @param \DateTimeInterface $date
* @param string $format
* @return string
public function format(\DateTimeInterface $date, $format)
$phpFormat = $this->dotnetDateTime->formatToPhp($format);
return (string) $date->format($phpFormat);
* @return DateFormatterInterface
public static function factory()
return new static(
new DotnetDateTime()
);