Example #1
0
 public function castToExchange($value, $type)
 {
     if (Caster::castExists($type, 'ExchangeFormat')) {
         $value = Caster::cast($value, 'ExchangeFormat');
     }
     return $value;
 }
Example #2
0
 /**
  * @param $from
  * @param $to
  * @param $expected
  *
  * @dataProvider castExistsProvider
  */
 public function testCastExists($from, $to, $expected)
 {
     $this->assertEquals($expected, Caster::castExists($from, $to));
 }