Code Duplication    Length = 7-9 lines in 2 locations

classes/Options.php 2 locations

@@ 21-29 (lines=9) @@
18
	 * @param  string $filepath The path of the PHP config file
19
	 * @param  string $prefix_path You can insert/update the loaded array to a specific key path, if omitted it will be merged with the whole dictionary
20
	 */
21
  public static function loadPHP($filepath,$prefix_path=null){
22
    ob_start();
23
    $results = include($filepath);
24
    ob_end_clean();
25
    if($results) {
26
      $results = static::filterWith(["load.php", "load"], $results);
27
      static::loadArray($results,$prefix_path);
28
    }
29
  }
30
31
  /**
32
	 * Load an INI configuration file
@@ 36-42 (lines=7) @@
33
	 * @param  string $filepath The path of the INI config file
34
	 * @param  string $prefix_path You can insert/update the loaded array to a specific key path, if omitted it will be merged with the whole dictionary
35
	 */
36
  public static function loadINI($filepath,$prefix_path=null){
37
    $results = parse_ini_file($filepath,true);
38
    if($results) {
39
      $results = static::filterWith(["load.ini", "load"], $results);
40
      static::loadArray($results,$prefix_path);
41
    }
42
  }
43
44
  /**
45
   * Load a JSON configuration file