interfaceCastRenderer
interface CastRenderer
Renders platform-specific CAST expressions.
Each platform provides an implementation that maps ColumnDeclaration to the appropriate CAST syntax for that SQL dialect.
Methods§
public function renderCast(string $expression, ColumnDeclaration $type): stringRender a CAST expression for a given expression string.
Parameters
$expression | string | The SQL expression to cast (e.g. "'Alice'", "1", "NULL"). |
$type | ColumnDeclaration | The target column type. |
Returns
string A SQL CAST expression (e.g. "CAST('Alice' AS CHAR)").public function renderNullCast(ColumnDeclaration $type): stringRender a CAST expression for NULL with the given type.
Used for empty CTE definitions to preserve column type information.
Parameters
$type | ColumnDeclaration | The target column type. |
Returns
string A SQL CAST(NULL AS ...) expression.Test cases 3§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.
Dedicated tests 1
CastRendererTestcalls
Other tests reaching this symbol 2
CastRendererContractTestcallsFakeCastRenderercalls