phanalist

E0005: Capitalized Class Name

In plain English: Class names (and by extension interfaces, traits, and enums) should start with an uppercase letter (PascalCase / StudlyCase).

Why it matters: PSR-4 autoloading and PHP standards convention rely on class names starting with an uppercase letter to distinguish class references from functions or variables. It keeps the codebase consistent and predictable.

❌ The Bad Example

class paymentProcessor {
    // ...
}

✅ The Good Example

class PaymentProcessor {
    // ...
}

What the rule checks

When it does not report

How to fix

Configuration

E0005 has no configuration options and is enabled by default.

Junior Engineer’s Rule of Thumb:

Functions and variables are camelCase (getUser). Classes are PascalCase (UserProcessor). Always capitalize your class names!