transform() public method

Transforms a normalized date into a localized date string/array.
public transform ( DateTime $dateTime ) : string | array
$dateTime DateTime Normalized date.
return string | array Localized date string/array.
コード例 #1
0
 public function testTransformRequiresValidDateTime()
 {
     $transformer = new DateTimeToLocalizedStringTransformer();
     $this->setExpectedException('\\InvalidArgumentException');
     $transformer->transform('2010-01-01');
 }
コード例 #2
0
 public function testTransformRequiresValidDateTime()
 {
     $transformer = new DateTimeToLocalizedStringTransformer();
     $this->setExpectedException('Symfony\\Component\\Form\\Exception\\UnexpectedTypeException');
     $transformer->transform('2010-01-01');
 }