I studied PSR-2 and PSR-12 documentations completely but didn't find any explanation regarding whether to put any space after $this keyword.
My exact question is which one of following styles is more correct according to PSRs:
return $this->name;
or
return $this -> name;
sample codes to compare would be as below:
class Car
{
public $name;
public function getName()
{
return $this->name; // I've always seen this style (no spaces)
}
}
in comparison with:
class Car
{
public $name;
public function getName()
{
return $this -> name; // Includes spaces
}
}
Are both correct? If so, is there a reason to use one over the other?