Every event has an $action, $eventURL and a $message.
All these things end up being passed as strings to GithubEvent.
I think it would be nice to have a EventFactory which can build several events. So that each event in the above switch can have his own class. Including it's own parsing rules.
That way the entire switch and the filling of the events can be reduced to simply:
https://github.com/ekinhbayar/gitamp/blob/master/src/Response/Results.php#L52-L54
Every event has an
$action
,$eventURL
and a$message
.All these things end up being passed as strings to
GithubEvent
.I think it would be nice to have a
EventFactory
which can build several events. So that each event in the aboveswitch
can have his own class. Including it's own parsing rules.That way the entire switch and the filling of the events can be reduced to simply: