Interface no I prefix (ARCH7003)
Ce contenu n’est pas encore disponible dans votre langue.
Key php.naming.interface-no-i-prefix · Severity info · Category naming
The PHP convention discourages prefixing interface names with I. This Hungarian-style prefix is redundant; the abstraction is clear from context and the implements clause.
Incorrect
Section titled “Incorrect”<?php
interface IRepository{ public function find(int $id): ?object;}Correct
Section titled “Correct”<?php
interface Repository{ public function find(int $id): ?object;}Drop the I prefix; if a role marker is needed, use a meaningful suffix instead.