It is generally recommended to explicitly declare the visibility for methods.
Adding explicit visibility (private, protected, or public) is generally
recommend to communicate to other developers how, and from where this method
is intended to be used.
Loading history...
20
{
21
4
parent::__construct();
22
4
$this->_request_factory = new Driver_Kohana_RequestFactory_Kohana();
23
4
}
24
25
/**
26
* Return a Response object of the last request operation
The method response does only exist in Openbuildings\Spiderling\Driver_Kohana, but not in Openbuildings\Spiderling...r_Simple_RequestFactory.
It seems like the method you are trying to call exists only in some of the
possible types.
Let’s take a look at an example:
classA{publicfunctionfoo(){}}classBextendsA{publicfunctionbar(){}}/** * @param A|B $x */functionsomeFunction($x){$x->foo();// This call is fine as the method exists in A and B.$x->bar();// This method only exists in B and might cause an error.}
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.