In your first example, the assumption I would make based on what I see is that
This object is probably the handler object for the specified client for this interface.
That the results of the parsing are not returned immediately suggests that the latter is more likely, and subsequent calls to the handler would be needed to verify and/or retrive thos results.
That no attempt is made to check any return code from the parse call would worry me slightly.
In the second example, the code looks remenicient of much of the Java Library API's, where accessor methods for 'set' operations return their own handle allowing calls to the 'set' methods to be chained.
So that $Person is the handle to an object that has (at least 4) private attributes (name,job,wife,favorite_food), and accessor methods that return (at least when a parameter os passed) their object handle, thus leading to the notational 'short-hand' of
$Person->name('Homer')->job('safety inspector')->wife('Marge')->fav_fo +od('Duff');
instead of
$Person->name('Homer'); $Person->job('safety inspector'); $Person->wife('Marge'); $Person->fav_food('Duff');
Of course the real answer is that you shouldn't need to make these assumptions, as you should be able to consult the documentation, even if, in the worse-case scenario, the only documentation is the source code.
One of the joys of an interpreted language (interpreter/compiler debate aside) is that you always have the source to fall back on. None of the agony of trying to maintain and/or modify code that uses binary libararies for which the source and or documentation has long since disappeared or never existed in the first place.
In reply to Re: Getting Confused with the '->' operator
by BrowserUk
in thread Getting Confused with the '->' operator
by the_Don
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |