atkrad/webhook-event-manager

WebHook Event Manager is a simple library to help parse webhook payloads from some services (GitHub, BitBucket)

v0.1.0 2014-02-28 10:23 UTC

README

WebHook Event Manager is a simple library to help parse webhook payloads from some services (GitHub, BitBucket):

Requirements

  • php >=5.4

Installation

Using composer:

Add the following to your composer.json file:

"require": {
    "atkrad/webhook-event-manager": "0.1.*",
},

Usage

<?php
use WebHookEventManager\WebHook;

$webHook = new WebHook();

//Get repository owner's avatar url
$avatarUrl = $webHook->getGitHubService()
    ->getIssuesEvent()
    ->getRepository()
    ->getOwner()
    ->getAvatarUrl();

//Get sender's followers url
$followersUrl = $webHook->getGitHubService()
    ->getIssuesEvent()
    ->getSender()
    ->getFollowersUrl();

//Get pusher's username
$pusherUsername = $webHook->getGitHubService()
    ->getPushEvent()
    ->getPusher()
    ->getUsername();

Contribute

Please do. Fork it and send pull requests.