<commit_before><?php
namespace ProjectRena\Model;

use ProjectRena\RenaApp;

/**
 * Fetches pricing data from EVE Central
 */
class EveCentral
{

    /**
     * The Slim Application
     */
    private $app;

    /**
     * The Cache
     */
    private $cache;

    /**
     * The baseConfig (config/config.php)
     */
    private $config;

    /**
     * cURL interface (getData / setData)
     */
    private $curl;

    /**
     * The Database
     */
    private $db;

    /**
     * The logger, outputs to logs/app.log
     */
    private $log;

    /**
     * StatsD for tracking stats
     */
    private $statsd;

    /**
     * @param RenaApp $app
     */
    public function __construct(RenaApp $app)
    {
        $this->app = $app;
        $this->db = $app->Db;
        $this->config = $app->baseConfig;
        $this->cache = $app->Cache;
        $this->curl = $app->cURL;
        $this->statsd = $app->StatsD;
        $this->log = $app->Logging;
    }

    /**
     * Fetches pricing data for one typeID
     *
     * @param $typeID
     * @param int $regionID
     *
     * @return array
     */
    public function getPrice($typeID, $regionID = 10000002)
    {
        $address = "http://api.eve-central.com/api/marketstat";
        $data = $this->app->cURL->getData($address . "?typeid={$typeID}&regionlimit={$regionID}");
        $data = json_decode(json_encode(simplexml_load_string($data)), true);

        return array("date" => date("Y-m-d"), "buy" => array("min" => $data["marketstat"]["type"]["buy"]["min"], "avg" => $data["marketstat"]["type"]["buy"]["avg"], "max" => $data["marketstat"]["type"]["buy"]["max"]), "sell" => array("min" => $data["marketstat"]["type"]["sell"]["min"], "avg" => $data["marketstat"]["type"]["sell"]["avg"], "max" => $data["marketstat"]["type"]["sell"]["max"]));
    }

    /**
     * Fetches pricing data for an array of typeIDs
     *
     * @param array $typeID
     * @param int $regionID
     *
     * @return array
     */
    public function getPrices($typeID = array(), $regionID = 10000002)
    {
        $address = "http://api.eve-central.com/api/marketstat?regionlimit={$regionID}";<commit_msg>Switch to https for eve-central<commit_after><?php
namespace ProjectRena\Model;

use ProjectRena\RenaApp;

/**
 * Fetches pricing data from EVE Central
 */
class EveCentral
{

    /**
     * The Slim Application
     */
    private $app;

    /**
     * The Cache
     */
    private $cache;

    /**
     * The baseConfig (config/config.php)
     */
    private $config;

    /**
     * cURL interface (getData / setData)
     */
    private $curl;

    /**
     * The Database
     */
    private $db;

    /**
     * The logger, outputs to logs/app.log
     */
    private $log;

    /**
     * StatsD for tracking stats
     */
    private $statsd;

    /**
     * @param RenaApp $app
     */
    public function __construct(RenaApp $app)
    {
        $this->app = $app;
        $this->db = $app->Db;
        $this->config = $app->baseConfig;
        $this->cache = $app->Cache;
        $this->curl = $app->cURL;
        $this->statsd = $app->StatsD;
        $this->log = $app->Logging;
    }

    /**
     * Fetches pricing data for one typeID
     *
     * @param $typeID
     * @param int $regionID
     *
     * @return array
     */
    public function getPrice($typeID, $regionID = 10000002)
    {
        $address = "https://api.eve-central.com/api/marketstat";
        $data = $this->app->cURL->getData($address . "?typeid={$typeID}&regionlimit={$regionID}");
        $data = json_decode(json_encode(simplexml_load_string($data)), true);

        return array("date" => date("Y-m-d"), "buy" => array("min" => $data["marketstat"]["type"]["buy"]["min"], "avg" => $data["marketstat"]["type"]["buy"]["avg"], "max" => $data["marketstat"]["type"]["buy"]["max"]), "sell" => array("min" => $data["marketstat"]["type"]["sell"]["min"], "avg" => $data["marketstat"]["type"]["sell"]["avg"], "max" => $data["marketstat"]["type"]["sell"]["max"]));
    }

    /**
     * Fetches pricing data for an array of typeIDs
     *
     * @param array $typeID
     * @param int $regionID
     *
     * @return array
     */
    public function getPrices($typeID = array(), $regionID = 10000002)
    {
        $address = "https://api.eve-central.com/api/marketstat?regionlimit={$regionID}";
{'fraction_non_alphanumeric': 0.19580258302583026, 'fraction_numerical': 0.007380073800738007, 'mean_word_length': 2.404238618524333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 53, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6478099', 'n_tokens_mistral': 1475, 'n_tokens_neox': 1472, 'n_words': 279}