class MyViewHelper extends AbstractViewHelper
{
public function initializeArguments(): void
{
$this->registerArgument('uid', 'integer', 'UID of the newsletter to be rendered', true);
}
public function render()
{
$uid = $this->arguments['uid'];
if (null !== $uid && $uid > 10) {
return 10
}
return $uid;
}
}
The null check is not necessary because the argument must be an integer anyways.
Provide a rule for PHPStan to take this into account.
Imagine the following code
The null check is not necessary because the argument must be an integer anyways.
Provide a rule for PHPStan to take this into account.