---
title: "format/casts"
pagination: false
---

{/* Generated by scripts/gen-rule-docs.py. Edit mapping.toml, not this file. */}

Type casts. Also in [analyse](/docs/rules/analyse/casts) (1).

**[lowercase](/docs/rules/format/casts/lowercase)**

Cast should be written in lower case.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[no-short-bool](/docs/rules/format/casts/no-short-bool)**

Short cast `bool` using double exclamation mark should not be used.

In the `format-laravel` preset. Safe fix.

**[no-unset](/docs/rules/format/casts/no-unset)**

Variables must be set `null` instead of using `(unset)` casting.

In the `format-laravel` preset. Safe fix.

**[short-scalar](/docs/rules/format/casts/short-scalar)**

Cast `(boolean)` and `(integer)` should be written as `(bool)` and `(int)`, `(double)` and `(real)` as `(float)`, `(binary)` as `(string)`.

In the `format-laravel` and `format-psr12` presets. Safe fix.

**[spacing](/docs/rules/format/casts/spacing)**

A single space or none should be between cast and variable.

In the `format-laravel` preset. Safe fix.
