Problem/Motivation
The AccessResult::forbidden() method takes an optional $reason parameter, but the AccessResult::forbiddenIf() method only takes a $condition boolean.
Proposed resolution
I'm proposing to add an optional parameter to forbiddenIf() that is $reason, which can then be passed to forbidden() when the $condition is true.
public static function forbiddenIf($condition, $reason = NULL) {
return $condition ? static::forbidden($reason) : static::neutral();
}
User interface changes
N/A
API changes
N/A, optional parameter
Wanted to get feedback on this issue before working on it, but I think it's something I can post a patch for...