Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 291607

Add void return type to all *_alter hook implementations

$
0
0

Problem/Motivation

See #3483037: [META] Add return types to hook implementations

Steps to reproduce

Find all occurrences in the baseline:

grep "Method .*\\:.*Alter\\\\.* has no return type specified" core/.phpstan-baseline.php

Proposed resolution

Add : void to each of them.

Updated command for use in Hooks classes.
find . -type f -path "*/src/Hook/*.php" -exec sed -i "/#\[Hook('.*_alter')\]/ {N;s/\(public function \w*([^)]*)\) *{/\\1: void {/}" {} +

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 291607

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>