yii\sphinx\ColumnSchema::phpTypecast PHP Method

phpTypecast() public method

If the value is null or an [[Expression]], it will not be converted.
public phpTypecast ( mixed $value ) : mixed
$value mixed input value
return mixed converted value
    public function phpTypecast($value)
    {
        return $this->typecast($value);
    }

Usage Example

 /**
  * @dataProvider dataProviderTypeCast
  *
  * @param $type
  * @param $phpType
  * @param $value
  * @param $expectedResult
  */
 public function testTypeCast($type, $phpType, $value, $expectedResult)
 {
     $columnSchema = new ColumnSchema();
     $columnSchema->type = $type;
     $columnSchema->phpType = $phpType;
     $this->assertEquals($expectedResult, $columnSchema->phpTypecast($value));
 }