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

Add void return type to all preprocess 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 "Function .*_preprocess_.*\\\\.* has no return type specified" core/.phpstan-baseline.php

Proposed resolution

Add : void to each of them using these commands, and update a few stragglers after:

find core -type f -exec sed -i '/Implements hook_preprocess_/,/\(function .*_preprocess_.*(.*)\) *{/!b;/\(function .*_preprocess_.*(.*)\) *{/s/\(function .*_preprocess_.*(.*)\) *{/\1: void {/' {} +
find core -type f -exec sed -i 's/\(function template_preprocess_[^(]*(.*)\) {/\1: void {/' {} +
find core -type f -exec sed -i '/Implements template_preprocess_/,/\(function .*_preprocess_.*(.*)\) *{/!b;/\(function .*_preprocess_.*(.*)\) *{/s/\(function .*_preprocess_.*(.*)\) *{/\1: void {/' {} +

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet


Viewing all articles
Browse latest Browse all 294468

Trending Articles



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