Answer the question
In order to leave comments, you need to log in
Full or partial documentation?
Is it necessary, in a good way, to document the obvious things:
/**
* Order model.
*
* @property Car $car
*/
class Order {
/**
*
* Get the car record associated with the order.
*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function car()
{
return $this->hasOne('App\Models\Car');
}
/**
* @property Car $car
*/
class Order {
/*
* @return \Illuminate\Database\Eloquent\Relations\HasOne
*/
public function car()
{
return $this->hasOne('App\Models\Car');
}
Answer the question
In order to leave comments, you need to log in
it makes sense to fill in if documentation is generated for these blocks later.
if the dockblock is purely for yourself, then you can omit it.
I would instead
// * Get the car record associated with the order.
the name of the function would be renamed to get_car or get_car_record
The main problem with annotations in weakly typed languages is:
/**
* function which return dog
*/
getDog () {
return new Dog()
}
A year later:
/**
* function which return dog
*/
getDog () {
if ($this ->temperatureInZimbabve > 30 && $this->isHuman) {
$human = new Elepant()
$human->isLeopard = $this->getAnimalType(true, false)
return $human
}
return new Beer()
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question