<commit_before><?php

namespace Koalamon\WebhookBundle\Formats;

use Bauer\IncidentDashboard\CoreBundle\Entity\Event;
use Bauer\IncidentDashboard\CoreBundle\Entity\RawEvent;
use Symfony\Component\HttpFoundation\Request;

class MonitisFormat implements Format
{
    const STATUS_PROBLEM = "PROBLEM";

    public function createEvent(Request $request, $payload)
    {
        $newEvent = json_decode(urldecode($payload));

        if ($request->get('confirmationURL')) {
            file_get_contents($request->get('confirmationURL'));
            return false;
        }

        if (!property_exists($newEvent, 'alert')) {
            return false;
        }

        $alert = $newEvent->alert;

        $event = new RawEvent();<commit_msg>added contact confirmation to monitis integration<commit_after><?php

namespace Koalamon\WebhookBundle\Formats;

use Bauer\IncidentDashboard\CoreBundle\Entity\Event;
use Bauer\IncidentDashboard\CoreBundle\Entity\RawEvent;
use Symfony\Component\HttpFoundation\Request;

class MonitisFormat implements Format
{
    const STATUS_PROBLEM = "PROBLEM";

    public function createEvent(Request $request, $payload)
    {
        $newEvent = json_decode(urldecode($payload));

        if ($request->get('confirmationURL')) {
            $url = trim(preg_replace('/\s\s+/', ' ', $request->get('confirmationURL')));
            $content = file_get_contents($url);
            return false;
        }

        if (!property_exists($newEvent, 'alert')) {
            return false;
        }

        $alert = $newEvent->alert;

        $event = new RawEvent();
{'fraction_non_alphanumeric': 0.12153652392947104, 'fraction_numerical': 0.0, 'mean_word_length': 3.181578947368421, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1785888', 'n_tokens_mistral': 473, 'n_tokens_neox': 463, 'n_words': 84}