<?php

function getStatus()
{
    $client = new GuzzleHttp\Client();
    $incidents = $client->get('https://status.exvps.ca/api/v1/incidents');

    $isBroken = false;

    $incidents_decode = json_decode($incidents->getBody(),true);
    
    foreach ($incidents_decode['data'] as $incident) {
        if (!$incident['is_resolved']) {
            $isBroken = true;
        }
    }

    return $isBroken;
}