Fragen\GitHub_Updater\Rest_Update::parse_bitbucket_webhook PHP Метод

parse_bitbucket_webhook() приватный Метод

We assume here that changes contains one single entry and that first entry is the correct one.
private parse_bitbucket_webhook ( array $request_data ) : boolean | array
$request_data array
Результат boolean | array $response
    private function parse_bitbucket_webhook($request_data)
    {
        $new = $request_data['push']['changes'][0]['new'];
        // What else could this be? For now, just expect branch.
        if (empty($new) || 'branch' != $new['type']) {
            return false;
        }
        $response = array();
        $response['hash'] = $new['target']['hash'];
        $response['branch'] = $new['name'];
        return $response;
    }