Take in consideration the following PHP 5 class:
class SomeClass { //I want to document this property... private $foo; function __construct() { } public function SetFoo($value) { $this->foo = $value; } public function GetFoo() { return $this->foo; } }
How in phpDocumentor will I document the $foo property? I'm not even sure it need to be documented but I would like to know how if if needs to...
I know how to document SetFoo() and GetFoo(), I'm just not sure about the private property (variable?).
Thanks!
Here, we declare a static property: $value. Then, we echo the value of the static property by using the class name, double colon (::), and the property name (without creating a class first).
Within class methods non-static properties may be accessed by using -> (Object Operator): $this->property (where property is the name of the property). Static properties are accessed by using the :: (Double Colon): self::$property .
Introduction. Data members declared inside class are called properties. Property is sometimes referred to as attribute or field. In PHP, a property is qualified by one of the access specifier keywords, public, private or protected.
/** * This is what the variable does. The var line contains the type stored in this variable. * @var string */ private $foo;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With