---
title: "lint/style/require-create-from-format-bang"
pagination: false
---

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

<RuleId id="lint/style/require-create-from-format-bang" />

Not in any set. Unsafe fix: it can change behaviour.

## What it does

The first argument of `DateTime::createFromFormat` method must start with `!`.

## Configuration

```toml title="pun.toml"
[lint.rules]
"style/require-create-from-format-bang" = "error"
```

To skip it in some files, add an [override](/docs/configuration/pun-toml#lint) or a [`@pun-ignore-file`](/docs/configuration/ignore-comments) comment.

## Replaces

- [`date_time_create_from_format_call`](https://cs.symfony.com/doc/rules/function_notation/date_time_create_from_format_call.html) (php-cs-fixer, risky)

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