You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Question
Hi, I am unsure whether this is a bug or intended behavior, so I decided to post this as a question first.
I am planning to use PHPat for enforcing classes in certain namespaces in the application I am working on extend a common base class. (e.g. all controllers should extend BaseController, all requests should extend BaseRequest, etc)
The rule I am using is this, where $namespace is a namespace where we want to enforce a common base class for all classes, and $baseClass is the class which should be extended:
Question
Hi, I am unsure whether this is a bug or intended behavior, so I decided to post this as a question first.
I am planning to use PHPat for enforcing classes in certain namespaces in the application I am working on extend a common base class. (e.g. all controllers should extend
BaseController
, all requests should extendBaseRequest
, etc)The rule I am using is this, where
$namespace
is a namespace where we want to enforce a common base class for all classes, and$baseClass
is the class which should be extended:This works fine and PHPat correctly identifies an error for classes that extend an invalid base class, e.g. like the class below:
But no errors are reported if we run PHPAt for classes with no
extends
statement such as this one:Now I am left wondering, is this the intended behavior, a bug, or have I missed something when configuring the rule for enforcing this? 🤔
Thanks in advance for your time! 😄
The text was updated successfully, but these errors were encountered: