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