prestashop / github-webhook-parser
Converts Github API v3 events to PHP objects
Package info
github.com/PrestaShop/github-webhook-parser
pkg:composer/prestashop/github-webhook-parser
0.1.0
2020-09-09 15:24 UTC
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- phpunit/phpunit: ^9.3
This package is auto-updated.
Last update: 2026-03-06 21:18:18 UTC
README
This lib aims to convert Github API v3 events to PHP objects
Install
Via Composer
composer require prestashop/github-webhook-parser
Usage
Use the WebhookHandler class to retrieve the event:
$payload = json_decode($request->getContent(), true); $webhookHandler = new \PrestaShop\Github\WebhookHandler(); try { $event = $webhookHandler->handle($payload); } catch (\PrestaShop\Github\Exception\EventNotHandledException $e) { ... } if ($event instanceof \PrestaShop\Github\Event\PullRequestEvent) { $action = $event->getAction(); $pullRequest = $event->getPullRequest(); }
Testing
$ composer install $ vendor/bin/phpunit
Credits
License
The MIT License (MIT). Please see License File for more information.