Answer the question
In order to leave comments, you need to log in
phpstorm. how to make explicit type casting in setter?
Hello.
A question from the category of laziness, but which of the programmers is not lazy? :)
Let's say there is such a class property:
/**
* @var int
*/
private $id;
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = (int)$id;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question