Add void return type to all hook_install and hook_uninstall implementations

Created on 24 October 2024, 8 months ago

Problem/Motivation

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

Steps to reproduce

Find all occurrences in the baseline:

grep "Function .*_install\\\\.* has no return type specified" core/.phpstan-baseline.php
grep "Function .*_uninstall\\\\.* has no return type specified" core/.phpstan-baseline.php

Proposed resolution

Add : void to each of them.

These nifty commands will find and replace all occurrences that come shortly after "Implements hook_install()" and "Implements hook_uninstall()":

find . -type f -exec sed -i '/Implements hook_install()/,/\(function .*_install(.*)\) *{/!b;/\(function .*_install(.*)\) *{/s/\(function .*_install(.*)\) *{/\1: void {/' {} +

find . -type f -exec sed -i '/Implements hook_uninstall()/,/\(function .*_uninstall(.*)\) *{/!b;/\(function .*_uninstall(.*)\) *{/s/\(function .*_uninstall(.*)\) *{/\1: void {/' {} +

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

11.0 πŸ”₯

Component

install 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