<commit_before><?php
namespace ColissimoApi;

use stdClass;
use DOMDocument;

/**
 * Class Colissimo
 */
class ColissimoApi {
    /**
     * @var $id
     */
    private $id;

    /**
     * class constructor
     */
    public function __construct()
    {
        // if there is something wrong in the url, stop everything
        if (!isset($_GET['id']) || $_GET['id'] == null) {
            echo 'Please fill a Colissimo id in your url.';
            die();
        }

        // get the colissimo id from the url
        $this->id = $_GET['id'];
    }

    /**
     * run the colissimo api
     */
    public function run()
    {<commit_msg>accept only alphanumeric characters as id<commit_after><?php
namespace ColissimoApi;

use stdClass;
use DOMDocument;

/**
 * Class Colissimo
 */
class ColissimoApi {
    /**
     * @var $id
     */
    private $id;

    /**
     * class constructor
     */
    public function __construct()
    {
        // if there is something wrong in the url, stop everything
        if (!isset($_GET['id']) || $_GET['id'] == null) {
            echo 'Please fill a Colissimo id in your url.';
            die();
        }

        // we want only alphanumeric characters for $_GET['id']
        if (ctype_alnum($_GET['id']) !== true) {
            echo 'Please fill a valid Colissimo id in your url.';
            die();
        }

        // get the colissimo id from the url
        $this->id = $_GET['id'];
    }

    /**
     * run the colissimo api
     */
    public function run()
    {
{'fraction_non_alphanumeric': 0.13228552717747216, 'fraction_numerical': 0.0, 'mean_word_length': 1.7832422586520946, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '2734973', 'n_tokens_mistral': 459, 'n_tokens_neox': 454, 'n_words': 146}