Hallo,
ich wollte mal wissen wie ihr die Dokumentation von "indirekten" Exceptions in Methoden handhabt.
Beispiel:
class FooBar
{
public function __construct()
{
$this->foo();
}
public function baz()
{
$this->bar();
}
/**
* @throws Exception BAR anyway
*/
public function bar()
{
throw new Exception(Exception::BAR);
}
/**
* @throws Exception FOO anyway
*/
protected function foo()
{
throw new Exception(Exception::FOO);
}
}
Dokumentiert ihr das mögliche "indirekte" werfen einer Exception im Konstruktor bzw. in der Methode baz()?
Ich mache das i.d.R mit einer @internal Anmerkung, so richtig überzeugend finde ich das allerdings nicht.
Beispiel:
/**
* @internal Exceptions thrown by internally used {@see self::bar} are passed
*/
public function baz()
{
$this->bar();
}