Skip to content
This repository has been archived by the owner on Feb 15, 2020. It is now read-only.

Commit

Permalink
fixes #8
Browse files Browse the repository at this point in the history
  • Loading branch information
Tustin committed May 9, 2018
1 parent b633e6e commit e1a6faf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
language: php
php:
- '5.5'
- '5.6'
- '7.0'
- '7.1'
script: phpunit --configuration phpunit.xml
9 changes: 4 additions & 5 deletions src/Model/FortniteStats.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,10 @@ public function __construct($stats) {
}
}

// Calculate Kill/Death ratio and round to 2 decimal places
$this->kill_death_ratio = round($this->kills / $this->matches_played,2);
$this->kill_death_per_game = round($this->kills / $this->minutes_played, 2);
$this->score_per_match = round($this->score / $this->matches_played , 2);
$this->win_loss_ratio = round($this->wins / $this->matches_played);
// TODO: Cleanup
$this->kill_death_per_game = ($this->matches_played === 0) ? 0 : round($this->kills / $this->matches_played, 2);
$this->score_per_match = ($this->matches_played === 0) ? 0 : round($this->score / $this->matches_played , 2);
$this->win_loss_ratio = ($this->matches_played === 0) ? 0 : round($this->wins / $this->matches_played, 2);
}

}

0 comments on commit e1a6faf

Please sign in to comment.