Skip to content
Esc
↑↓navigate↵open⌘Jpreview
On this page

lint/style/prefer-dir-constant

In the lint-strict preset. In Rector’s rector/php53 set. Unsafe fix: it can change behavior.

What it does

Replaces dirname(__FILE__) expression with equivalent __DIR__ constant.

Configuration

[lint.rules]
"style/prefer-dir-constant" = "error"

To skip it in some files, add an override or a @pun-ignore-file comment.

Replaces

More lint/style rules · Edit this page

Last updated on

Was this page helpful?