Replace magic numbers with constants (#754)
* Replace magic numbers with constants
This commit is contained in:
parent
6043114f38
commit
f94e4c15b0
3 changed files with 10 additions and 3 deletions
|
@ -18,6 +18,9 @@ class NodeRepository extends EloquentRepository implements NodeRepositoryInterfa
|
|||
{
|
||||
use Searchable;
|
||||
|
||||
const THRESHOLD_PERCENTAGE_LOW = 75;
|
||||
const THRESHOLD_PERCENTAGE_MEDIUM = 90;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
@ -56,7 +59,7 @@ class NodeRepository extends EloquentRepository implements NodeRepositoryInterfa
|
|||
'value' => number_format($value),
|
||||
'max' => number_format($maxUsage),
|
||||
'percent' => $percent,
|
||||
'css' => ($percent <= 75) ? 'green' : (($percent > 90) ? 'red' : 'yellow'),
|
||||
'css' => ($percent <= self::THRESHOLD_PERCENTAGE_LOW) ? 'green' : (($percent > self::THRESHOLD_PERCENTAGE_MEDIUM) ? 'red' : 'yellow'),
|
||||
],
|
||||
];
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue