Commit 24e197de authored by catch's avatar catch
Browse files

Issue #3427999 by andypost, Ayesh, bbrala: [PHP 8.4] Fix implicitly nullable type declarations

(cherry picked from commit c71e641e)
parent 48d52ff3
Loading
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ class AccessArgumentsResolverFactory implements AccessArgumentsResolverFactoryIn
  /**
   * {@inheritdoc}
   */
  public function getArgumentsResolver(RouteMatchInterface $route_match, AccountInterface $account, Request $request = NULL) {
  public function getArgumentsResolver(RouteMatchInterface $route_match, AccountInterface $account, ?Request $request = NULL) {
    $route = $route_match->getRouteObject();

    // Defaults for the parameters defined on the route object need to be added
+1 −1
Original line number Diff line number Diff line
@@ -24,6 +24,6 @@ interface AccessArgumentsResolverFactoryInterface {
   * @return \Drupal\Component\Utility\ArgumentsResolverInterface
   *   The parametrized arguments resolver instance.
   */
  public function getArgumentsResolver(RouteMatchInterface $route_match, AccountInterface $account, Request $request = NULL);
  public function getArgumentsResolver(RouteMatchInterface $route_match, AccountInterface $account, ?Request $request = NULL);

}
+3 −3
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public function __construct(RouteProviderInterface $route_provider, ParamConvert
  /**
   * {@inheritdoc}
   */
  public function checkNamedRoute($route_name, array $parameters = [], AccountInterface $account = NULL, $return_as_object = FALSE) {
  public function checkNamedRoute($route_name, array $parameters = [], ?AccountInterface $account = NULL, $return_as_object = FALSE) {
    try {
      $route = $this->routeProvider->getRouteByName($route_name);

@@ -108,7 +108,7 @@ public function checkNamedRoute($route_name, array $parameters = [], AccountInte
  /**
   * {@inheritdoc}
   */
  public function checkRequest(Request $request, AccountInterface $account = NULL, $return_as_object = FALSE) {
  public function checkRequest(Request $request, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
    $route_match = RouteMatch::createFromRequest($request);
    return $this->check($route_match, $account, $request, $return_as_object);
  }
@@ -116,7 +116,7 @@ public function checkRequest(Request $request, AccountInterface $account = NULL,
  /**
   * {@inheritdoc}
   */
  public function check(RouteMatchInterface $route_match, AccountInterface $account = NULL, Request $request = NULL, $return_as_object = FALSE) {
  public function check(RouteMatchInterface $route_match, ?AccountInterface $account = NULL, ?Request $request = NULL, $return_as_object = FALSE) {
    if (!isset($account)) {
      $account = $this->currentUser;
    }
+3 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ interface AccessManagerInterface {
   *   returned, i.e. TRUE means access is explicitly allowed, FALSE means
   *   access is either explicitly forbidden or "no opinion".
   */
  public function checkNamedRoute($route_name, array $parameters = [], AccountInterface $account = NULL, $return_as_object = FALSE);
  public function checkNamedRoute($route_name, array $parameters = [], ?AccountInterface $account = NULL, $return_as_object = FALSE);

  /**
   * Execute access checks against the incoming request.
@@ -53,7 +53,7 @@ public function checkNamedRoute($route_name, array $parameters = [], AccountInte
   *   returned, i.e. TRUE means access is explicitly allowed, FALSE means
   *   access is either explicitly forbidden or "no opinion".
   */
  public function checkRequest(Request $request, AccountInterface $account = NULL, $return_as_object = FALSE);
  public function checkRequest(Request $request, ?AccountInterface $account = NULL, $return_as_object = FALSE);

  /**
   * Checks a route against applicable access check services.
@@ -78,6 +78,6 @@ public function checkRequest(Request $request, AccountInterface $account = NULL,
   *   returned, i.e. TRUE means access is explicitly allowed, FALSE means
   *   access is either explicitly forbidden or "no opinion".
   */
  public function check(RouteMatchInterface $route_match, AccountInterface $account = NULL, Request $request = NULL, $return_as_object = FALSE);
  public function check(RouteMatchInterface $route_match, ?AccountInterface $account = NULL, ?Request $request = NULL, $return_as_object = FALSE);

}
+1 −1
Original line number Diff line number Diff line
@@ -29,6 +29,6 @@ interface AccessibleInterface {
   *   returned, i.e. TRUE means access is explicitly allowed, FALSE means
   *   access is either explicitly forbidden or "no opinion".
   */
  public function access($operation, AccountInterface $account = NULL, $return_as_object = FALSE);
  public function access($operation, ?AccountInterface $account = NULL, $return_as_object = FALSE);

}
Loading