Skip to content

PHPStan - Add Rule to ensure get_subscribed_events use one of the three possible syntax #7123

@Miraeld

Description

@Miraeld

We need to add a new custom rules to make sure that get_subscribed_events function is following one of the three possible syntax.

As a reminder, here is the docblock provided:

	/**
	 * Returns an array of events that this subscriber wants to listen to.
	 *
	 * The array key is the event name. The value can be:
	 *
	 *  * The method name
	 *  * An array with the method name and priority
	 *  * An array with the method name, priority and number of accepted arguments
	 *
	 * For instance:
	 *
	 *  * array('hook_name' => 'method_name')
	 *  * array('hook_name' => array('method_name', $priority))
	 *  * array('hook_name' => array('method_name', $priority, $accepted_args))
	 *  * array('hook_name' => array(array('method_name_1', $priority_1, $accepted_args_1)), array('method_name_2', $priority_2, $accepted_args_2)))
	 *
	 * @return array
	 */

Metadata

Metadata

Labels

noQAtype: enhancementImprovements that slightly enhance existing functionality and are fast to implement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions