implement cast static method.

4 messages Options
Embed this post
Permalink
Carlos Villaronga () implement cast static method.
Reply Threaded More More options
Print post
Permalink
Hi everyone,

Recently I've been implementing a public static cast method in FirePHP class for IDE autocomplete and support, maybe someone could use this idea too.

  /**
   * return a instance of FirePHP for IDE support
   *
   * @param object
   * @return FirePHP
   */
  public static function cast(FirePHP $object) {
        return $object;
  }  
Christoph Dorn () Re: implement cast static method.
Reply Threaded More More options
Print post
Permalink
What does this do?
DrSlump () Re: implement cast static method.
Reply Threaded More More options
Print post
Permalink
I assume it just helps to force the IDE into knowing that calling the static method will always return a FirePHP object, so that autocompletion for its methods works.
cvillaronga () Re: implement cast static method.
Reply Threaded More More options
Print post
Permalink
Yes  DrSlump,

It's only for IDE helps, and It's very useful.
Carlos Villaronga