---
title: "analyse/operators/non-boolean-and-operand"
pagination: false
---

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

<RuleId id="analyse/operators/non-boolean-and-operand" />

In the [`analyse-strict`](/docs/rules/presets/analyse-strict) preset and every stricter one. Report only. Upstream gates: `strictRules.booleansInConditions`.

## Configuration

```toml title="pun.toml"
[analyse.rules]
"operators/non-boolean-and-operand" = "on"
```

To skip it in some files or lines, add an [ignore comment](/docs/configuration/ignore-comments).

## Replaces

- [`BooleanInBooleanAndRule`](https://github.com/phpstan/phpstan-strict-rules#readme) (phpstan-classes)
- [`booleanAnd.leftNotBoolean`](https://phpstan.org/error-identifiers/booleanAnd.leftNotBoolean) (phpstan-strict-rules)
- [`booleanAnd.rightNotBoolean`](https://phpstan.org/error-identifiers/booleanAnd.rightNotBoolean) (phpstan-strict-rules)
- [`booleanOr.leftNotBoolean`](https://phpstan.org/error-identifiers/booleanOr.leftNotBoolean) (phpstan-strict-rules)
- [`booleanOr.rightNotBoolean`](https://phpstan.org/error-identifiers/booleanOr.rightNotBoolean) (phpstan-strict-rules)
- [`logicalAnd.leftNotBoolean`](https://phpstan.org/error-identifiers/logicalAnd.leftNotBoolean) (phpstan-strict-rules)
- [`logicalAnd.rightNotBoolean`](https://phpstan.org/error-identifiers/logicalAnd.rightNotBoolean) (phpstan-strict-rules)
- [`logicalOr.leftNotBoolean`](https://phpstan.org/error-identifiers/logicalOr.leftNotBoolean) (phpstan-strict-rules)
- [`logicalOr.rightNotBoolean`](https://phpstan.org/error-identifiers/logicalOr.rightNotBoolean) (phpstan-strict-rules)

[More analyse/operators rules](/docs/rules/analyse/operators) · [Edit this page](https://github.com/shipfastlabs/pun/edit/main/crates/pun-config/rules/mapping.toml)
