original_string: public static function save(array $data, array $extra = null)
      {
          $data = self::saveConfigParams($data, $extra);
          $final_data = self::saveExtraParams($data);
          $saved = false;
          try {
              $final_data = array_filter($final_data, function($key, $value) {
                  return in_array($key, self::$required, true) || !empty($value);
              }, ARRAY_FILTER_USE_BOTH);
              $saved = (false !== file_put_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE, json_encode($final_data, JSON_PRETTY_PRINT)));
              self::getInstance()->loadConfigData();
              $saved = true;
          } catch (ConfigException $e) {
              Logger::log($e->getMessage(), LOG_ERR);
          }
          return $saved;
      }
code: public static function save(array $data, array $extra = null)
      {
          $data = self::saveConfigParams($data, $extra);
          $final_data = self::saveExtraParams($data);
          $saved = false;
          try {
              $final_data = array_filter($final_data, function($key, $value) {
                  return in_array($key, self::$required, true) || !empty($value);
              }, ARRAY_FILTER_USE_BOTH);
              $saved = (false !== file_put_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE, json_encode($final_data, JSON_PRETTY_PRINT)));
              self::getInstance()->loadConfigData();
              $saved = true;
          } catch (ConfigException $e) {
              Logger::log($e->getMessage(), LOG_ERR);
          }
          return $saved;
      }
code_tokens: public static function save ( array $ data , array $ extra = null ) { $ data = self :: saveConfigParams ( $ data , $ extra ) ; $ final_data = self :: saveExtraParams ( $ data ) ; $ saved = false ; try { $ final_data = array_filter ( $ final_data , function ( $ key , $ value ) { return in_array ( $ key , self :: $ required , true ) || ! empty ( $ value ) ; } , ARRAY_FILTER_USE_BOTH ) ; $ saved = ( false !== file_put_contents ( CONFIG_DIR . DIRECTORY_SEPARATOR . self :: CONFIG_FILE , json_encode ( $ final_data , JSON_PRETTY_PRINT ) ) ) ; self :: getInstance ( ) -> loadConfigData ( ) ; $ saved = true ; } catch ( ConfigException $ e ) { Logger :: log ( $ e -> getMessage ( ) , LOG_ERR ) ; } return $ saved ; }
docstring: Method that saves all the configuration in the system
  
  @param array $data
  @param array|null $extra
  @return boolean
docstring_tokens: Method that saves all the configuration in the system