Skip to content

Instantly share code, notes, and snippets.

@iRynoh
Last active September 6, 2018 16:28
Show Gist options
  • Save iRynoh/8a5df9e4e05538a5d65b89726b8eab67 to your computer and use it in GitHub Desktop.
Save iRynoh/8a5df9e4e05538a5d65b89726b8eab67 to your computer and use it in GitHub Desktop.
<?php
public function verify() {
$statistic = $this->getStatistic();
if ($statistic) {
if ($statistic->getTotalCount() === 0) {
$incident = IncidentFactory::CtIncident();
$incident->registerIncident();
} else {
$failurePercentage = $statistic->getFailCount() / $statistic->getTotalCount() * 100;
if ($failurePercentage > 40) {
$incident = IncidentFactory::CtIncident();
$incident->registerIncident();
}
}
}
}
@iRynoh
Copy link
Author

iRynoh commented Sep 6, 2018

Awesome! Thank you so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment