Access type for interface constant %s::%s must be public¶
Description¶
An method or a constant, that are defined in an interface, must appear as public
in all the implementing classes. They cannot be made protected
or private
, as they would be no accessible.
Example¶
<?php
interface I {
private const C = 1;
}
?>
Literal Examples¶
Access type for interface constant I::C must be public
Solutions¶
Set the visibility to public in the interface.
Remove the visibility in the interface.
Remove the constant in the interface.