-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d582d5c
commit 2d46d78
Showing
1 changed file
with
0 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,3 @@ | ||
<<<<<<< HEAD | ||
<?php | ||
/** | ||
* Fonctions utiles pour les méthodes d'évaluations. | ||
* | ||
* @author Evarisk <[email protected]> | ||
* @since 6.2.9 | ||
* @version 7.0.0 | ||
* @copyright 2015-2018 Evarisk | ||
* @package DigiRisk | ||
*/ | ||
|
||
namespace digi; | ||
|
||
if ( ! defined( 'ABSPATH' ) ) { | ||
exit; | ||
} | ||
|
||
/** | ||
* Fonctions utiles pour les méthodes d'évaluations. | ||
*/ | ||
class Scale_Util { | ||
|
||
/** | ||
* Récupères le niveau d'évaluation par rapport à son level | ||
* | ||
* @since 6.2.9 | ||
* @version 7.0.0 | ||
* | ||
* @param int $level Le level de l'évaluation. | ||
* | ||
* @return $int value | ||
*/ | ||
public static function get_scale( $level ) { | ||
if ( true !== is_int( $level ) ) { | ||
return false; | ||
} | ||
|
||
$method_evaluation_simplified = Evaluation_Method_Class::g()->get( array( 'slug' => 'evarisk-simplified' ), true ); | ||
$list_scale = array( 1 => 0, 2 => 48, 3 => 51, 4 => 80 ); | ||
if ( empty( $list_scale ) ) { | ||
return false; | ||
} | ||
|
||
$list_ecart = array(); | ||
$list_key = array(); | ||
|
||
foreach ( $list_scale as $key => $value ) { | ||
if ( $level - $value >= 0 ) { | ||
$list_ecart[ $value ] = $level - $value; | ||
$list_key[ $value ] = $key; | ||
} | ||
} | ||
|
||
$key = 0; | ||
$value = min( $list_ecart ); | ||
$value = array_search( $value, $list_ecart ); | ||
return $list_key[ $value ]; | ||
} | ||
} | ||
======= | ||
<?php | ||
/** | ||
* Fonctions utiles pour les méthodes d'évaluations. | ||
|
@@ -118,4 +57,3 @@ public static function get_scale( $level ) { | |
return $list_key[ $value ]; | ||
} | ||
} | ||
>>>>>>> 7.1.0 |