/** * Get type cast object * * @return Jasny\TypeCast */ protected function typeCast($value) { $typecast = TypeCast::value($value); $typecast->alias('self', get_class($this)); $typecast->alias('static', get_class($this)); return $typecast; }
/** * Test type casting presenting multiple array types with no matching type * * @expectedException PHPUnit_Framework_Error_Notice * @expectedExceptionMessage Unable to cast string "rock" to integer|boolean */ public function testToMultipleTypedArrayNoMatch() { TypeCast::value([1, 'on', false, 'rock'])->toMultiple(['int[]', 'boolean[]']); }