GitSynchronizer.php
public function handleSynchronizationRequest(Request $request, $token = null)
    {
        $data = json_decode($request->get('payload'), false);

        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new Exception(400, 'The JSON data cannot be parsed');
        } elseif (false === isset($data->repository->url)) {
            throw new Exception(400, 'The JSON data does not contain the required information');
        }

        if (false === $this->synchronize($data->repository->url, $token)) {
            throw new Exception(500, 'Internal error', $data->repository->url);
        }

        return new Response('', 204);
    }
public function handleSynchronizationRequest(Request $request, $token = null)
    {
        $data = json_decode($request->get('payload'), false);

        if (JSON_ERROR_NONE !== json_last_error()) {
            throw new Exception(400, 'The JSON data cannot be parsed');
        } elseif (false === isset($data->repository->url)) {
            throw new Exception(400, 'The JSON data does not contain the required information');
        }

        if (false === $this->synchronize($data->repository->url, $token)) {
            throw new Exception(500, 'Internal error', $data->repository->url);
        }

        return new Response('', 204);
    }
public function handleSynchronizationRequest ( Request $ request , $ token = null ) { $ data = json_decode ( $ request -> get ( 'payload' ) , false ) ; if ( JSON_ERROR_NONE !== json_last_error ( ) ) { throw new Exception ( 400 , 'The JSON data cannot be parsed' ) ; } elseif ( false === isset ( $ data -> repository -> url ) ) { throw new Exception ( 400 , 'The JSON data does not contain the required information' ) ; } if ( false === $ this -> synchronize ( $ data -> repository -> url , $ token ) ) { throw new Exception ( 500 , 'Internal error' , $ data -> repository -> url ) ; } return new Response ( '' , 204 ) ; }
Handles a synchronization request

@param Request         $request The request
@param string          $token   The token

@return Response The response
Handles a synchronization request