public function isThreat(DataInterface $data)
    {
        $response = $this->client->post(
            self::API_ENDPOINT,
            [
                'secret' => $this->secret,
                'response' => $data->getValue(),
            ]
        );

        if (!$response->isSuccess()) {
            return true;
        }

        $validation = json_decode($response->getBody());

        if (is_null($validation) || !$validation->success) {
            return true;
        }

        return false;
    }
public function isThreat(DataInterface $data)
    {
        $response = $this->client->post(
            self::API_ENDPOINT,
            [
                'secret' => $this->secret,
                'response' => $data->getValue(),
            ]
        );

        if (!$response->isSuccess()) {
            return true;
        }

        $validation = json_decode($response->getBody());

        if (is_null($validation) || !$validation->success) {
            return true;
        }

        return false;
    }
public function isThreat ( DataInterface $ data ) { $ response = $ this -> client -> post ( self :: API_ENDPOINT , [ 'secret' => $ this -> secret , 'response' => $ data -> getValue ( ) , ] ) ; if ( ! $ response -> isSuccess ( ) ) { return true ; } $ validation = json_decode ( $ response -> getBody ( ) ) ; if ( is_null ( $ validation ) || ! $ validation -> success ) { return true ; } return false ; }
Flags if the used Control impl detected a threat

@param DataInterface $data The incoming data to investigate

@return bool
Flags if the used Control impl detected a threat