Simplify "kEvent" class constructor

Components

Labels

Description

Simplify "kEvent" class constructor by extracting array-like event creation way into separate static method.

Context Information

None

Additional information (do not use)

None

Activity

Alex September 1, 2015 at 7:43 AM

alex closed D112: https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor by committing rINP16222: Fixes https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor.
alex updated the diff for D112: https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor.

http://qa.in-portal.org/D112

[API] Administrator September 1, 2015 at 7:43 AM

User committed a fix to 5.3.x. Commit Message:

Fixes https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor

Differential Revision: http://qa.in-portal.org/D112

Gleb Sinkovskiy August 26, 2015 at 6:59 AM

glebs accepted D112: https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor.
D112: https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor is now accepted and ready to land.

http://qa.in-portal.org/D112

Alex August 15, 2015 at 12:09 PM

alex created D112: https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor.
alex updated D112: https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor.
Herald added 1 reviewer(s) for D112: https://in-portal.atlassian.net/browse/INP-1462#icft=INP-1462 - Simplify "kEvent" class constructor: glebs.

http://qa.in-portal.org/D112

Fixed

Details

Priority

Assignee

Reporter

Developer

Reviewer

Change Log Group

Changed

Change Log Message

Patch Instructions

Patches must be submitted through Phabricator.

BC Break Details

Method Signature Changed:

  • kApplication::HandleEvent (removed optional "$params" and "$specific_params" parameters)

  • kEvent::__construct (replaced required "$params" parameter with required "$event_string" parameter)

  • kEvent::copyFrom (the "kEvent" type hint added to "$source_event" parameter)

  • kEvent::setRedirectParams (the "array" type hint added to "$params" parameter)

Solution

  1. in "kApplication::HandleEvent" method:

    • add "$params" and "$specific_params" parameters back, but add "array" type hint to them

    • when "$params" parameter is an array, then

      • use "kUtil::deprecateParameter" method to trigger notice about usage of $params/$specific_params parameters

      • use "kEvent::fromArray" method to create event, that will replace "$event" parameter value

  2. extract logic, that transforms "$params" array into string from public static "kEvent::fromArray" into protected static "kEvent::arrayToString" method

  3. in "kEvent::__construct" method, when "$event_string" argument turns out to be an array:

    • use "kUtil::deprecateParameter" method to trigger notice about usage of $params parameter

    • use "kEvent::arrayToString" to transform "$event_string" parameter value

Story Points

Fix versions

Created August 15, 2015 at 11:51 AM
Updated December 29, 2024 at 11:27 PM
Resolved September 1, 2015 at 7:43 AM