Add AccessResultInterface return type to hook_entity_access (and friends) implementations

Created on 18 November 2024, 4 months ago

Problem/Motivation

See πŸ“Œ [META] Add return types to hook implementations Active

This includes all access hooks in entity.api.php, being:

  • hook_entity_access
  • hook_entity_create_access,
  • hook_ENTITY_TYPE_access
  • hook_ENTITY_TYPE_create_access
  • hook_entity_field_access

Steps to reproduce

Proposed resolution

find . -type f -path "*/src/Hook/*.php" -exec sed -i "/#\[Hook('entity_access')\]/ {N;s|\(public function \w*([^)]*)\) *{|\\1: \\\\\\Drupal\\\\Core\\\\Access\\\\AccessResultInterface {|}" {} +
find . -type f -path "*/src/Hook/*.php" -exec sed -i "/#\[Hook('entity_.*_access')\]/ {N;s|\(public function \w*([^)]*)\) *{|\\1: \\\\\\Drupal\\\\Core\\\\Access\\\\AccessResultInterface {|}" {} +
composer phpcbf
./vendor/bin/phpstan --memory-limit=1G --configuration=./core/phpstan.neon.dist --generate-baseline=./core/.phpstan-baseline.php

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

entity system

Created by

πŸ‡¦πŸ‡ΊAustralia mstrelan

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024