2
I was looking at exceptions to the rule validation engine Respect Validation, and discovered something that caught my attention.
This is the interface ExceptionInterface, that apparently, there is no code in it, that is, there is no member to be implemented in the classes that implement this interface.
See the interface:
<?php
namespace Respect\Validation\Exceptions;
interface ExceptionInterface
{
}
And the class ValidationException implements this interface. And most exceptions of this engine extend from class ValidationException, such as the class CpfException which is Exception for invalid Cpfs.
Doubts
- I would like to know what is the purpose of an interface "empty"?
- A "blank" interface is unique to PHP or other languages have "empty" interfaces as well?