Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(REF) CRM_Utils_Hook - Remove deprecated formulations of invoke(int,…) #17124

Merged
merged 1 commit into from
May 5, 2020

Conversation

totten
Copy link
Member

@totten totten commented Apr 21, 2020

Overview

The signature of CRM_Utils_Hook::invoke() originally took an argument int $count (number of hook args), but circa 4.7 it changed to prefer string[] $names (symbolic names for each hook arg). The int notation doesn't provide enough information to fire via Symfony EventDispatcher and was mostly replaced/deprecated, but int notation is still supported for backward compatibility.

This cleans a couple oddballs using the int notation.

Before

Some stub functions in CRM_Utils_Hook still use int formulation.

  • hook_themes fell through a crack because it had a long PR (years?) that overlapped with the change in invoke().
  • hook_install (etc) looks like int, but it's not actually used.

After

None of the stub functions in CRM_Utils_Hook use int formulation.

…...)`

Overview
--------

The signature of `CRM_Utils_Hook::invoke()` originally took an argument `int
$count` (number of hook args), but circa 4.7 it changed to prefer `string[]
$names` (symbolic names for each hook arg).  The `int` notation doesn't
provide enough information to fire via Symfony EventDispatcher and was
mostly replaced/deprecated, but `int` notation is still supported for
backward compatibility.

This cleans a couple oddballs using the `int` notation.

Before
------

Some stub functions in `CRM_Utils_Hook` still use the `invoke(int,...)` formulation:

* `hook_themes` fell through a crack because it had a long PR (years?) that
   overlapped with the change in `invoke()`.
* `hook_install` (etc) looks like `int`, but it's not actually used.

After
-----

None of the stub functions in `CRM_Utils_Hook::invoke(string[], ...)` use
`int` formulation.
@civibot
Copy link

civibot bot commented Apr 21, 2020

(Standard links)

@civibot civibot bot added the master label Apr 21, 2020
@eileenmcnaughton eileenmcnaughton merged commit dea87e1 into civicrm:master May 5, 2020
@totten totten deleted the master-hook-cleanup branch May 29, 2020 00:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants