Details
Priority
MinorAssignee
AlexAlexReporter
AlexAlexDeveloper
AlexAlexReviewer
Gleb SinkovskiyGleb SinkovskiyChange Log Group
ChangedChange Log Message
The "kApplication::HandleEvent" method no longer supports event given in string form.Patch Instructions
Patches must be submitted through Phabricator.
To submit patch via Command Line use Patches Workflow (via Arcanist) tutorial.
To submit patch via Web Interface use Patches Workflow (via Web Interface) tutorial.
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
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
extract logic, that transforms "$params" array into string from public static "kEvent::fromArray" into protected static "kEvent::arrayToString" method
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
1Fix versions
Details
Details
Priority
Assignee
Reporter
Developer
Reviewer
Change Log Group
Change Log Message
Patch Instructions
Patches must be submitted through Phabricator.
To submit patch via Command Line use Patches Workflow (via Arcanist) tutorial.
To submit patch via Web Interface use Patches Workflow (via Web Interface) tutorial.
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
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
extract logic, that transforms "$params" array into string from public static "kEvent::fromArray" into protected static "kEvent::arrayToString" method
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
Simplify "kEvent" class constructor by extracting array-like event creation way into separate static method.